523 Commits

Author SHA1 Message Date
Will Hunt
cbc7718808
Move noisy log line to debug (#473)
* Move noisy log level to debug

I think I meant to actually set this to debug before :/

* Create 473.bugfix
2022-09-09 09:31:25 +01:00
Will Hunt
79f28f3ae0
Fix feed.success crashing the process due to a typing issue (#469)
* Fix feed.sucess

* changelog

* Stop being lazy and use an interface
2022-09-02 14:46:20 +00:00
Will Hunt
944bbe77ff
Logging fixes (#467)
* Log fatal to console if we haven't configured logging

* Move token store load up

* Fix logging typo

* Fix everything logging at debug

* changelog

* Make private
2022-09-02 13:17:36 +00:00
Will Hunt
33becc47ee
Update ioredis & block on startup if we couldn't connect (#462)
* Update ioredis & block on startup if we couldn't connect

* changelog
2022-09-01 11:15:27 +01:00
Will Hunt
6ae2ebe495
Fix GitHub/Jira/GitLab login not checking for permissions early enough (#461)
* Ensure login commands have appropirate permissions levels

* Also fix GitLab

* changelog
2022-09-01 11:08:21 +01:00
Will Hunt
a3046114d0
Useful JSON logger formatting (#463)
* Refactor log wrapper to support richer json errors

* Make webhook events less noisy

* Document new log format
2022-09-01 11:07:58 +01:00
Will Hunt
08727e43e2
Don't use onRoomJoin to detect non-AS joins (#464)
* Don't use onRoomJoin to detect non-AS joins

* changelog
2022-09-01 11:04:03 +01:00
Will Hunt
63ab457b45
Refactor feed errors and error presentation (#459)
* Add support for setting a global feed timeout

* Track failures, and don't show the first non-serious error

* Tidy up error reporting

* Make a prettier error pane

* Use the prettier event pane

* Show failed feed attempts in the widget

* Ensure we catch connection resets

* Add styling file

* Ensure we only track one result per fetch

* changelog

* Refactor to use better status codes

* Make feed results cheaper

* splice
2022-08-31 14:01:43 +01:00
Andrew Ferrazzutti
e9afe10a7d
Don't look for body in an ApiError (#457)
Instead, look for `jsonBody`
2022-08-26 10:02:16 -04:00
Kim Brose
bca1b0b0ec
Fix typo (#447) 2022-08-22 10:57:52 +01:00
Will Hunt
f8b0dc40b9
Fix GitLab setup command (#445)
* Properly log errors in the console for unknown faults

* Fix wrong this in bind

* bugfix
2022-08-22 10:02:22 +01:00
Will Hunt
00e5bfe332
Fix markdown paragraphs not rendering properly (#443)
* Fix markdown paragraphs not rendering properly

* changelog
2022-08-18 15:41:07 +01:00
Will Hunt
52b6033908
Validate figma access token + cleaner errors (#440)
* Validate figma access token + cleaner errors

* fix import

* changelog

* fix typo

* Apply suggestions from code review

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>
2022-08-12 15:38:22 +01:00
Will Hunt
00927175a2
Update matrix-bot-sdk to 0.6.0 (#417)
* Update matrix-bot-sdk to 0.6.0

* changelog

* More package updates

* Don't need to copy bindings anymore

* Expliclty require Node 16

* Drop node 14 test

* fix rust bindings fetch

* Update .github/workflows/main.yml

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>

* Update main.yml

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>
2022-08-12 10:59:24 +01:00
Will Hunt
e487b48b2a
Skip already handled GitHub events (#429)
* Skip already handled GitHub webhooks

* Create 429.bugfix

* tidy up
2022-08-12 10:59:03 +01:00
Andrew Ferrazzutti
e9613225be
Add GitHub widget (#420)
* Add GitHub widget

Also make assorted fixes to help push this along

* Remove unused import

* Resolve new linter warnings

* Undo testing-only change

Didn't mean to commit this

* Use "org/repo" as GitHub repo names in widget

* Update src/ConnectionManager.ts

Co-authored-by: Will Hunt <will@half-shot.uk>

* Don't use null assertions

* Use block scope in switch cases

* Fix some BridgeAPI imports

* Actually validate connection state

* Return only GitHub repos with admin permissions

Co-authored-by: Will Hunt <will@half-shot.uk>
2022-07-29 10:05:21 -04:00
Andrew Ferrazzutti
c719f1b926
Share code for tracking config via state events (#418)
* Share code for tracking config via state events

This should prevent forgetting to add state event handlers in new or
existing connection types.

* Address review feedback

* Mark GitLabRepoConnection as an IConnection

* Remove unused imports

* Tighten typing for JiraProjectConnectionState
2022-07-29 09:57:58 -04:00
Andrew Ferrazzutti
b118a8e606
Fix some docstrings (#428)
* Fix some docstrings

* changelog
2022-07-28 10:33:28 -04:00
Christian Paul
1018ca119f
Fix typo: propetyKey -> propertyKey (#424) 2022-07-27 12:23:49 +01:00
Andrew Ferrazzutti
eac6819a58
Don't say nothing to no GitHub connections (#416)
* Don't say nothing to no GitHub connections

Allow the message of "No GitHub bridges" to be sent.

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>

* Changelog

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>

* "Github" -> "GitHub" in `list-connections`

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
2022-07-14 09:55:46 -04:00
Will Hunt
7796f104cb
Add XML parser for generic webhook payloads (#410)
* Add support for decoding XML for webhooks

* Ensure all endpoints use the error middleware

* Dependencies

* changelog

* Describe form data in the documentation

* Reorder
2022-07-13 16:14:21 +01:00
Andrew Ferrazzutti
d4f701c871
Disallow some empty config URL settings (#412)
* Disallow some empty config URL settings

If these settings are meant to be unspecified, then their entire parent
sections (`widgets` & `generic`) should be unspecified.

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>

* Convert some config URL strings to URL objects

This allows both parsing and easier crafting of relative URLs.

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>

* Dump parsed URLs to default config

Also implement getters to return stringified URLs, instead of having to
store a URL's string representation directly.

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
2022-07-13 08:39:23 -04:00
Andrew Ferrazzutti
c46cc71de8
Use the admin widget in admin rooms (#411)
Fixes #308

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
2022-07-13 08:34:50 -04:00
Will Hunt
c68bcafeb6
Automatically reconfigure GitHub notifications when a token is updated. (#388)
* Refactor methods

* changelog

* Tweaks
2022-07-11 17:08:09 +00:00
Will Hunt
74a3611134
Allow the same GitLab repo to be bridged to multiple rooms (#406)
* Check matching roomId when checking for existing GitLab repos

* changelog

* Don't need to cast
2022-07-11 16:56:42 +01:00
Damien Gaignon
1d0b2adc8a
Fix link in AdminRoom (#384)
* Fix link in AdminRoom

Signed-off-by: Damien Gaignon <damien.gaignon@gmail.com>

* Add 384.bugfix file

* Add full stop to changelog entry

Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2022-07-11 09:48:06 -04:00
Andrew Ferrazzutti
18df8eb8b6
Stringify provision connection data object in logs (#404)
* Stringify provision connection data object in logs

Otherwise, it may get logged as [object Object]

* changelog
2022-07-11 09:41:11 -04:00
Andrew Ferrazzutti
3199f0c87b
Allow proper responses to widget-setup commands (#403)
* Allow proper responses to widget-setup commands

* changelog
2022-07-11 09:40:37 -04:00
Andrew Ferrazzutti
b491ad1e07
Fix typos in docs (#401)
* Fix typos in docs

* changelog
2022-07-11 09:37:06 -04:00
Will Hunt
b674fff486
Disable GET for webhooks (unless configured) (#397)
* Disable GET for webhooks (unless configured)

* Docs

* newsfile

* Update Config.ts
2022-07-07 21:52:59 +00:00
Will Hunt
42f02b1445
Add a warning when no action is given for GitLab (#398)
* Add a warning when no action is given for GitLab

* Add notice about webhooks being crap

* changelog
2022-07-07 17:47:27 +01:00
Will Hunt
ff1079aa3b
Fix floating values breaking generic webhooks (#396)
* Convert floats to strings for generic webhook payloads

* document the change

* Create 396.bugfix
2022-07-07 17:44:11 +01:00
Will Hunt
f7b652a0b5
Remove transformation function from webhook rooms when it's removed from the state (#383)
* Clear transformationFunction when state omits it.

* Create 383.bugfix
2022-06-28 09:10:37 +01:00
Will Hunt
c36a5e7d60
Fix oauth login urls for GitHub cloud having the wrong domain (#377)
* Ensure we use a single function for generating oauth urls

* Add tests

* changelog

* Fix test
2022-06-27 15:17:01 +01:00
Damien Gaignon
5e63508f49
Fix Webhook command (#379)
* Fix Webhook command

Signed-off-by: Damien Gaignon <damien.gaignon@gmail.com>

* Add 379.bugfix

* Words

Co-authored-by: Will Hunt <will@half-shot.uk>
2022-06-27 14:15:25 +00:00
Will Hunt
58b08c95d4
Reinstate login commands for GitHub (#372)
* Reinstate login commands for GitHub

* Create 372.bugfix

* Use proper enums
2022-06-09 15:00:14 +01:00
Tadeusz Sośnierz
86b9a83b97
Add Admin command from listing and disconnecting connections (#367)
* Add Admin command from listing and disconnecting connections

(Only lists Github for now).

* Require connectionManager permissions to manipulate connections

Gives connection management its own config section and switches
AdminRoom categories to be enums.

* Fail more descriptively if connectionManager is not up in time for adminRoom

* Fix Github API URLs (#366)

* Fix Github API URLs

* Add changelog entry

* Fixes

* Tidyup

Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>

* Fix URLs *again*

* Block private repos from being publically bridged

* Ensure check looks at service type

* Finish up deleting connections impl

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
2022-06-08 15:50:09 +00:00
Half-Shot
f8579d35a5 Fix URLs *again* 2022-06-07 10:33:50 +01:00
Tadeusz Sośnierz
5c899f045d
Fix Github API URLs (#366)
* Fix Github API URLs

* Add changelog entry

* Fixes

* Tidyup

Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
2022-06-07 09:58:45 +01:00
Will Hunt
21b6d79c3f
Support GitHub Enterprise (#364)
* Support GitHub Enterprise

* Add default config

* Fixes

* Hide enterprise key
2022-05-25 11:07:07 +01:00
Will Hunt
2a9326a499
Fix issue where GitLab support would break if GitHub wasn't also configured (#362)
* Drop !github

* changelog
2022-05-23 14:34:25 +00:00
Andrew Ferrazzutti
0241a90e9d
Get UserAgent from package.json (#360)
* Get UserAgent from package.json (#359)

* Add changelog entry

* Update changelog.d/359.bugfix

Be more precise about which UserAgent it is

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>

* Rename changelog file to refer to its PR number

* Update changelog with issue number and credit

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>
2022-05-20 10:37:13 -04:00
Tadeusz Sośnierz
d1494ff373
Add Feed configuration widget (#345)
* Refactor RoomConfigView slightly to reduce duplication

* Add Feed configuration widget

* Drop an unused parameter in FeedConnection

Co-authored-by: Will Hunt <will@half-shot.uk>

* Add a key to connection listing in RoomConfigView

Co-authored-by: Will Hunt <will@half-shot.uk>

* Be more explicit when checking for feeds enabledness

Co-authored-by: Will Hunt <will@half-shot.uk>

* Erase state when removing FeedConnection

* Tone down logging in FeedReader

* Strenghten validation of feed URLs

* Drop an unnecessary non-null assertion

* Allow adding labels to feeds

* Add changelog for #345

* Fix lint-found errors

* Improve feed setup widget changelog

Co-authored-by: Will Hunt <will@half-shot.uk>

* Validate feed URLs with HEAD if possible

* Don't log.error feed validation failures in SetupConnection

* Remove extra space

Co-authored-by: Will Hunt <will@half-shot.uk>

* Wrap errors from FeedConnection.provisionConnection in ApiErrors

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
2022-05-12 12:06:20 +01:00
Will Hunt
9b216afd2b
Fix GitHub/GitLab state config not being honoured (#346)
* 1.6.1

* Add new error type for validation errors

* Validate state for GitHubRepo properly

* Add tests to check labels

* Also check GitLab repo

* changelog

* add mock store

* remove nullable

* Be less strict for existing state

* Improve test coverage

* Improve expect error text

* ValidationApiError now takes falsey objects and errors on them

* Remove UserTokenMockStore

* Actually commit the new tests

* Whoops we need to include github
2022-05-12 11:28:55 +01:00
Kim Brose
e9303d0fb3
Multiple improvements to GitLab push event formatting (#309)
* Update GitlabRepo.ts

* Create 309.feature

* Only show list of pushed commits if it's complete

* fixup! Only show list of pushed commits if it's complete

* address feedback about constants

* print only a summary if there are too many commits

* update changelog

* wordy bits

* refactor for readability

Co-authored-by: Will Hunt <will@half-shot.uk>
2022-05-09 14:53:41 +01:00
Will Hunt
bc29b78442
Allow overriding the results of an openID lookup for widgets for local development. (#326)
* Revert "Withdraw openid overrides change for this PR"

This reverts commit 561fb20471107827a5304eb3d4c4254bb215ae8d.

* Drop setting from sample config

* changelog

* Clarify config
2022-05-09 12:16:27 +01:00
Will Hunt
b23e516aa5
Statically define connection creation and provisioing (#330)
* Statically define connection creation and provisioing

* Tidy up

* Drop JIRA

* Convert other connections to new system

* Small linting fixes

* Fixes

* changelog

* Fix bridge

* Fix JIRA instance naming

* Fix JIRA config

* Drop unnessacery check
2022-05-06 13:58:39 +00:00
Will Hunt
8808385b6d
Add support for GitLab connection configuration via widgets (#320)
* Refactors to support multiple services in the widget UI

* Add GitLabRepo web component view

* Support searching and adding a GitLab repository on the frontend

* Add final bits to supporting adding and removing connections from rooms

* lint

* changelog

* Lots of changes based upon review feedback

* linting

* Add warnings

* Withdraw openid overrides change for this PR

* Drop unused

* Remove async function syntax

* Tiny bug fixes
2022-04-30 06:08:13 +01:00
Will Hunt
f56545bf7c
Add setup command for GitLab (#321)
* Cleanup gitlab auth command

* Add support for the `!hookshot gitlab project` command

* Improve docs

* changelog

* add new page

* Wording

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>

* Remove useless comment

Co-authored-by: Tadeusz Sośnierz <tadzik@tadzik.net>
2022-04-26 16:04:24 +01:00
Tadeusz Sośnierz
c02951552d
Merge pull request #315 from matrix-org/tadzik/rss
Add RSS/Atom feed support
2022-04-25 15:26:37 +02:00