422 Commits

Author SHA1 Message Date
Half-Shot
52eeb0b541 6.0.0 2024-11-29 09:57:56 +00:00
Will Hunt
424c475e2a
Update matrix-bot-sdk 0.7.1 element.7 (#996)
* @vector-im/matrix-bot-sdk@0.7.1-element.7

* newsfile

* sneak in a fix for devenv workflow
2024-11-29 09:51:01 +00:00
Will Hunt
283375c6c1
Retry E2E tests on failure if running in CI. (#995)
* Retry E2E tests in CI

* newsfile
2024-11-29 09:32:18 +00:00
Will Hunt
d550077f3e
Rewrite docker workflow. (#994)
* Rewrite docker workflow.

* tidy

* Create 994.misc

Signed-off-by: Will Hunt <will@half-shot.uk>

---------

Signed-off-by: Will Hunt <will@half-shot.uk>
2024-11-29 09:15:53 +00:00
Will Hunt
819c089aa4
Update minimum Node version to 22 (#990)
* Update dependencies

* Node 22 is now the new minimum version.

* changelog.

* Begin porting eslint to new config format.

* Make linter happy.

* Update reqwest to fix SSL issue?

* Fix test types

* quick check on ubuntu LTS 24.04

* Change cache key

* update rust action

* revert mocha due to esminess

* Remove the only usage of pqueue

* Use babel for TS transformations to get around ESM import bug.

* Dependency bundle upgrade

* Drop babel, not actually used.

* lint

* lint

* update default config (mostly sections moving around)
2024-11-28 15:04:01 +00:00
Will Hunt
745699abd3
Add devenv development files (#993)
* Add devenv config

* Use Node 20 for now.

* changelog
2024-11-28 10:49:11 +00:00
Will Hunt
052d42fca8
Stabilize E2EE support (#989)
* Deprecate legacy sled store

* Add e2ee test

* Add support for e2ee testing in e2e environment

* Tidy up redis support

* Attempt to get test working

* cleanup test

* opportunistic lint

* tiny bit of cleanup

* remove ref

* tweak to homerunner

* switch to nightly images for Synapse (to test E2EE)

* use nightly

* newsfile.

* Update bot sdk to support authenticated media (now that Synapse requires it)

* fix typings

* MatrixError

* one more

* Graduate the encryption property to stable.

* update test config

* Update encryption docs.

* fix some old config bits
2024-11-26 16:04:56 +00:00
Will Hunt
46b0004581
Skip newsfile CI check for dependabot. (#987)
* skip newsfile for dependabot.

* changelog
2024-11-19 10:53:03 +00:00
Will Hunt
6da67db058
Rename 987.misc to 985.misc
Signed-off-by: Will Hunt <will@half-shot.uk>
2024-11-19 10:52:54 +00:00
Will Hunt
eecf61f090
Rename 985.feature to 984.feature
Signed-off-by: Will Hunt <will@half-shot.uk>
2024-11-19 10:52:36 +00:00
Will Hunt
f0651a6cff
Reduce bundle size for widget room configs (#985)
* Add dynamic imports for room configs.

* Try to move code editor to imports

* Load code editor on demand to save a bundle load.

* Load fonts from npm

* changelog

* lint
2024-11-19 09:13:42 +00:00
Will Hunt
80c7d35a18
Add an expiry time to inbound webhooks (#984)
* Add logic to enable generic hook expiry

* Add storage for hook expiry warnings.

* Migrate generic hooks / add expiry field

* Allow reporting a specific error and status code for generic webhooks

* Report the specific error when a message fails to send

* Refactor input class to better support datetime

* Remove single use of innerChild

* Add UI support for expiry configuration

* Add new packages

* Add warnings when the timer is about to expire.

* Add send expiry notice config option

* lint

* document new option s

* Fixup test

* Add tests for expiry

* Add textual command for setting a duration on a webhook.

* Add e2e test for inbound hooks.

* changelog

* Add a configuration option to force webhooks to expire.

* update config.sample.yml

* fix field not working
2024-11-18 17:08:52 +00:00
Will Hunt
6571b9f710
Fix challengehound duplication bug. (#982)
* Fix challengehound duplication bug.

* Missed a bit

* No-op if no hashes need to be pushed.

* changelog

* lint
2024-10-29 11:07:56 +00:00
Andrew Ferrazzutti
2763801d1b 5.4.1 2024-06-21 13:37:59 -04:00
Andrew Ferrazzutti
5c5e8ce767
Pin the Node minor version for Docker builds (#949)
* Pin the Node minor version for Docker builds

as 20.13 & 20.14 cause Hookshot to crash on startup (at least on arm64)

* Add changelog
2024-06-21 15:56:06 +00:00
Andrew Ferrazzutti
5dae23b2ad 5.4.0 2024-06-20 07:46:02 -04:00
Kévin Commaille
863065792e
Fix rendering of comments of GitLab merge requests (#937)
* Fix rendering of comments of GitLab merge requests

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Change variable name to appease linter

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-19 17:28:51 +00:00
Will Hunt
7573d37527
Outbound Webhooks (#945)
* Initial support for outbound webhooks.

* Refactor outbound into it's own connection type.

* Add support for media / encrypted media.

* Ensure we configure a sensible User Agent

* Add a test for outbound webhooks

* Checkpoint for feature completeness.

* Lint tidy

* Finish up media tests.

* changelog

* Add outbound documentation

* update default config

* fix tests
2024-06-19 18:28:00 +01:00
Kévin Commaille
60ccc041b3
Fix the symbol used to prefix GitLab merge requests (#938)
* Fix the symbol used to prefix GitLab merge requests

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-12 10:03:32 +01:00
Kévin Commaille
2bffd5c90e
Fix GitLab's ready for review hook (#936)
* Fix GitLab's ready for review hook

As far back as I could go in the docs (GitLab 14.10),
the keys for changes have been `previous` and `current`.

There is a `draft` change that
we can use directly
instead of guessing from the title.
The type of the value depends on
the key of the change.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Will Hunt <will@half-shot.uk>
2024-05-22 12:17:29 +00:00
Kévin Commaille
e5705e74c0
Add support for reopened GitLab MR (#935)
* Add support for reopened GitLab MR

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-22 11:05:14 +00:00
Half-Shot
ab918bd293 5.3.0
amend changelog
2024-04-17 11:19:12 +01:00
Will Hunt
cf689919a4
Fix tokens encrypted with Node crypto implementation being undecryptable in new Rust implementation. (#930)
* Encrypt with new padding algo when possible.

* formatting

* changelog
2024-04-17 10:00:00 +00:00
Will Hunt
79bfffc13a
Clarify permission system. (#925)
* Clarify permission system.

* Rename 925.docs to 925.doc

Signed-off-by: Will Hunt <will@half-shot.uk>

---------

Signed-off-by: Will Hunt <will@half-shot.uk>
2024-04-16 21:06:41 +00:00
Will Hunt
45060f2b58
Apply CSPs to generic hook responses. (#926)
* Add CSPs to generic hook response.

* changelog

* Apply suggestions from code review

Co-authored-by: davidegirardi <16451191+davidegirardi@users.noreply.github.com>
Signed-off-by: Will Hunt <github@half-shot.uk>

---------

Signed-off-by: Will Hunt <github@half-shot.uk>
Co-authored-by: davidegirardi <16451191+davidegirardi@users.noreply.github.com>
2024-04-16 21:06:33 +00:00
Will Hunt
ff200114a6
Fix PKCS1 handling (#929)
* Support pkcs1 format keys.

* Test pkcs1 support.

* changelog

* rust formatting
2024-04-16 21:05:36 +00:00
Will Hunt
4839340c86
Add support for edit tracking in challenge hound & fix a few bugs. (#927)
* Fix a namespace conflict.

* Add support for edits.

* Couple of bugfixes.

* changelog

* Support pkcs1 format keys.

* Add docs for official API.

* couple of cleanups

* Revert "Support pkcs1 format keys."

This reverts commit 157cc4ac1269ecdeb64529c51b79d11463cdbbfd.
2024-04-16 22:05:06 +01:00
Will Hunt
1b5e0a4c21
Add support for Challenge Hound (#924)
* Add challenge hound connection type

* Add config

* Add bridge bindings

* Add reader implementation.

* Obvious renames.

* bit more tidying

* refactor

* fix imports

* fix import

* Start feed reader and recognise service.

* Move to using IDs rather than URLs for better security.

* lint

* Validate that challenge exists.

* Drive-by refactors.

* Add add/remove commands for challenge hound.

* Add challenge hound docs.

* Refactor icons

* add some more activity definitions

* changelog

* cleanup feed work
2024-04-12 13:38:26 +01:00
Will Hunt
6482c7ed55
Handle RSA token handling in Rust (#915)
* Split out queue and cache config

* Update usages of cache config,

* Update default

* Cleanup

* Make queue optional.

* config updates.

* changelog

* update spec config

* Update tests

* tweak import

* Update default config.

* fixup test

* Update config.sample.yml

Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
Signed-off-by: Will Hunt <will@half-shot.uk>

* Update encryption.md

Signed-off-by: Will Hunt <will@half-shot.uk>

* Clear up worker config

Signed-off-by: Will Hunt <will@half-shot.uk>

* Update src/config/Config.ts

Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
Signed-off-by: Will Hunt <will@half-shot.uk>

* update helm config

* move UserTokenStore.ts

* Port all the imports to new path.

* Port RSA handling to rust.

* Add tests.

* linting

* lint rust

* Remove unwraps / panics

* fix build script

* Ensure we store and check with algorithm and key was used.

* quieten false deadcode warnings

* changelog

* fix test imports

* lazy mock out UTS

* Refactor so that UserTokenStore is initiated by the time Bridge is created.

* update defaults

* replace if with match

* Use the magic of ?

* fmt

---------

Signed-off-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-04-08 15:22:57 +01:00
Will Hunt
082a61f802
Split cache config from queue config. (#902)
* Split out queue and cache config

* Update usages of cache config,

* Update default

* Cleanup

* Make queue optional.

* config updates.

* changelog

* update spec config

* Update tests

* tweak import

* Update default config.

* fixup test

* Update config.sample.yml

Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
Signed-off-by: Will Hunt <will@half-shot.uk>

* Update encryption.md

Signed-off-by: Will Hunt <will@half-shot.uk>

* Clear up worker config

Signed-off-by: Will Hunt <will@half-shot.uk>

* Update src/config/Config.ts

Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
Signed-off-by: Will Hunt <will@half-shot.uk>

* update helm config

* lint

* fix meta

* tidy tidy

* revert logging change

* lint rust

---------

Signed-off-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-03-19 16:45:52 +00:00
Half-Shot
b8d33f42bb 5.2.1 2024-03-04 14:31:30 +00:00
davidegirardi
9a6d4317b2
Use production mode (#904)
* Set NODE_ENV to production

* Disable the X-Powered-By HTTP header

* Explain what the different values do

* Add changelog file
2024-02-27 14:35:03 +00:00
Minecraftchest1
6c6cd6ee92
Change example Openid Connect callback url's to be correct. (#899)
* Change oauth urls in config sample

Signed-off-by: Minecraftchest1 <minecraftchest1@outlook.com>

* Update github docs oauth url

Signed-off-by: Minecraftchest1 <minecraftchest1@outlook.com>

* Fix default oauth2 callback url.

Signed-off-by: Minecraftchest1 <minecraftchest1@outlook.com>

* Create changelog docs.

Signed-off-by: Minecraftchest1 <minecraftchest1@outlook.com>

---------

Signed-off-by: Minecraftchest1 <minecraftchest1@outlook.com>
2024-02-26 08:45:30 +00:00
Will Hunt
c09f00e2a3
Fix Atom feed hashing format. (#901)
* Ensure atom feeds hash and prefix

* Add some fixing code for this.

* Remove feed fixer

* Refactor RSS feed tests a bit

* Add tests to ensure hashes do not change

* changelog
2024-02-21 16:13:36 +00:00
Half-Shot
bbf953fff8 5.2.0 2024-02-21 13:24:02 +00:00
Will Hunt
387f7c1ce9
Backoff failing RSS feeds (#890)
* Backoff RSS requests if a url repeatedly fails.

* Increase max backoff time to a day

* Add backoff for failing feeds.

* Remove unused finally

* Add this.feedLastBackoff

* Rewrite in rust.

* linting

* pop

* Optimise backoff function further

* Drop only!

* fix test

* lint

* lint further

* Better comments

* Fix urls calculation

* Remove testing URL

* Add some variance to speed up while loop

* correct comment

* Follow the advice and use a VecDeque as it's slightly faster.

* Vastly better shuffle method

* Speed up checking for previous guids.

* fix hasher function

* lint

* Content doesn't need to be calculated twice.

* Slightly more efficient iteration

* Improve performance of backoff insertion

* Configure feed reader

* lint

* Ensure appending and removing from the queue works as expected.

* Ensure we do keep urls that have been removed.

* lint

* Inc/dec metrics as queue items are added/deleted.

* Add comment

* tidy up
2024-02-20 22:21:19 +00:00
Will Hunt
3ff87b7564
Retry failed RSS entries (#891)
* Retry event send for RSS.

* Fix large summary bridges.

* Remove unused import

* Add some comments
2024-02-06 16:15:13 +00:00
Will Hunt
90927a71f4
Add support for mentioning multiple assignees on GitHub issues (#889)
* Add support for multiple assignees on issues

* changelog
2024-02-06 10:09:21 +00:00
Will Hunt
1cbd73bb46
Add troubleshooting doc. (#882)
* Add troubleshooting doc.

* Create 882.doc

Signed-off-by: Will Hunt <will@half-shot.uk>

* Rename 882.doc to 882.doc

Signed-off-by: Will Hunt <will@half-shot.uk>

---------

Signed-off-by: Will Hunt <will@half-shot.uk>
2024-01-16 09:43:56 +00:00
Will Hunt
6d3800a018
Convert bridgeAPI usages to preact context. (#871)
* Fix widget client only talking to localhost

* Improve error text around widget communication.

* changelog

* Remove unused.

* Simplify code by using a context for bridge API.
2024-01-16 09:44:51 +00:00
Srilokh Karuturi
3bb6724fe9
Update setup.md (#879)
* Update setup.md

Add relevant information related to webhooks resource endpoint, allows for less confusion and going back and forth between docs

Signed-off-by: Srilokh Karuturi <75606167+srilokhkaruturi@users.noreply.github.com>

* Create 879.doc

Signed-off-by: Will Hunt <will@half-shot.uk>

---------

Signed-off-by: Srilokh Karuturi <75606167+srilokhkaruturi@users.noreply.github.com>
Signed-off-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
2024-01-12 10:37:49 +00:00
Twilight Sparkle
675c1c14d0
Add command to list feeds in JSON and YAML format (#876)
* Add command to list feeds in YAML format

* Add line breaks

* Add changelog

* Add a period in the help

* Add $URL to templates and add feed list format docs

* Use an optional arg on yaml list instead of a separate function

* Update changelog to include JSON format
2024-01-04 19:14:11 +00:00
Half-Shot
0175f9e2a5 5.1.2
Bugfixes
--------

- Fix widget pinning to light theme. ([\#873](https://github.com/matrix-org/matrix-hookshot/issues/873))
- Fix hookshot failing to format API errors.
  Only log a stacktrace of API errors on debug level logging, log limited error on info. ([\#874](https://github.com/matrix-org/matrix-hookshot/issues/874))
- Fix GitHub events not working due to verification failures. ([\#875](https://github.com/matrix-org/matrix-hookshot/issues/875))

Internal Changes
----------------

- Fix spelling of "successfully". ([\#869](https://github.com/matrix-org/matrix-hookshot/issues/869))
2024-01-02 16:09:04 +00:00
Will Hunt
41ee467e2d
Fix logged errors not being properly formatted (and tone down the error verbosity a bit) (#874)
* Ensure we add the error handlers last

* Refactor error middleware to be less noisy

* changelog

* Add finalise
2024-01-02 15:58:25 +00:00
Will Hunt
c0bb71d553
Fix GitHub events not verifying (#875)
* Ensure we verify the raw payload.

* changelog

* Tidy up types

* Add test for GitHib

* Mock out GitHub API to allow tests to pass.

* Lint
2024-01-02 15:52:43 +00:00
Will Hunt
3ab7553f41
Do not pin widget to light theme (#873)
* Don't pin widget theme to light

* changelog
2024-01-02 11:34:10 +00:00
Simon Quigley
3af2aa7032
sucessfully (#869)
* sucessfully

* Create 869.misc

---------

Co-authored-by: Will Hunt <will@half-shot.uk>
2023-12-29 16:24:49 +00:00
Half-Shot
6a23dc7854 5.1.1 2023-12-29 16:17:13 +00:00
Will Hunt
5c5bdd546d
Fix widgets not working when bound to the same listener as webhooks. (#872)
* Bind listener in bridge.

* Add a test to confirm behaviour

* Fix test name

* changelog
2023-12-29 16:11:08 +00:00
Half-Shot
445be6e78c 5.1.0 2023-12-29 12:19:15 +00:00