909 Commits

Author SHA1 Message Date
Will Hunt
44eea7f7c3
Staggered RSS feed polling (#685)
* Ensure we poll feeds equally

* Ensure we poll at least once

* Create 685.misc

* Tidy up
2023-03-28 10:13:57 +00:00
Tadeusz Sośnierz
507b014bd5
Make sure we're not treating garbage data in feed item as guids (#689)
* Make sure we're not treating garbage data in feed item as guids

Some of these would parse as `{ '$': { isPermaLink: 'false' } }` or similar,
which would then surprise us very much when assuming that it's a string stored in accountData.

* Changelog

* Exclude empty strings when looking for viable guids

Co-authored-by: Christian Paul <christianp@matrix.org>

* Hash seen feed entry guids for storing and checking

This saves a little bit of space in the common case,
and prevents bloating the storage were someone to feed us obnoxiously long guids.

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Christian Paul <christianp@matrix.org>
2023-03-28 09:06:30 +00:00
Will Hunt
74a577a97f
Ensure joined to room when checking widget API permissions. (#691)
* Add an ensureJoined to assertUserPermissions

* Ensure web component retries connection fetches

* Ensure errors are caught and logged as JSON on the widget API

* changelog

* non-linear retry timer

* lint

* Use retry

* Make getBotUserInRoom try to join the room

* Make this fn safe to handle
2023-03-27 17:56:37 +01:00
Will Hunt
037674115a
Wrap createConnectionForState/ensureGrant in a try/catch (#680)
* Fix thrown exception when the state is not granted

* changelog

* make it an error

* Typing
2023-03-24 14:39:19 +00:00
Tadeusz Sośnierz
6c4bbc7150
When setting up a FeedConnection, check if the feed loads and parses rather than just checking the Content-Type (#684)
* When setting up a FeedConnection, check if the feed loads and parses rather than just checking the Content-Type

* Don't create a new Parser each time we fetch a feed

* Create 684.bugfix

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
2023-03-24 14:22:10 +00:00
Tadeusz Sośnierz
5ccd64acd8
Undo XML parser customizations (#683)
* Undo XML parser customizations

These did more harm then good, breaking many legit feeds in weird ways.

* Undo changelog

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
2023-03-24 14:16:54 +00:00
Will Hunt
f6475a5182
Do more to shut down quickly and start RSS feeds later (#671)
* Only load RSS feeds once all connections have loaded

* Clear various timeouts

* changelog
2023-03-24 14:13:51 +00:00
Will Hunt
5d27f173a6
Add a ready probe to each listener and start the listeners immediately (#676)
* Put a ready probe on all listeners

* Start the listener early, and add ready probes to each listener

* Apply to the other two listeners
2023-03-24 14:09:09 +00:00
Will Hunt
d12a05d0fa
Add feeds failing metric (#681)
* Track failing feeds in a metric

* Update docs

* changelog
2023-03-24 13:12:50 +00:00
Will Hunt
05b23127d8
Don't hide form elements in GitHub component if we're not checking auth (#675)
* Don't check authentication if we're not requesting you to login

* changelog
2023-03-24 12:06:37 +00:00
Will Hunt
b5b86d45da
Continue even if localstorage is inaccessible (#678)
* Ignore storage failures

* changelog
2023-03-23 13:56:46 +00:00
Will Hunt
61f25fae36
Make the feed parser less strict on HTML data. (#670)
* Less strict parser

* changelog

* Instantiate parser once
2023-03-22 20:17:28 +00:00
Will Hunt
735ae2d673
Add release script (#667)
* Add release script and workflow

* remove comments

* changelog
2023-03-22 14:03:36 +00:00
Justin Carlson
dd76b9dbcd 3.0.1 3.0.1 2023-03-21 08:51:32 -04:00
Will Hunt
c6f975b390
Refactor oauth response page and show a pending state for GitHub installations (#666)
* Show a sensible message for pending GitHub installations

* Clean up grammar

* changelog

* Update Webhooks.ts
2023-03-21 10:46:08 +00:00
Will Hunt
61ede0b97a
Fix GitHub grant checker not checking the correct ID (#665)
* Remove the need for a grant key

* changelog
2023-03-20 22:38:44 +00:00
Justin Carlson
8071243696
Fix add instance link grammar (#664)
* Fix add instance link grammar

* Add changelog
2023-03-20 14:48:18 -04:00
Will Hunt
7f34d69cfa
Don't remove the oauth state on polling the status of the auth request (#663)
* Fix unused ?.

* Don't remove the state from the tokenStore when polling

* changelog
2023-03-20 17:03:37 +00:00
Half-Shot
e6f51bf2de 3.0.0 3.0.0 2023-03-17 17:29:46 +00:00
Will Hunt
6233aa19c9
Refactor hookshot to include permission grant system (#655)
* Add support for checking connection grants

* Make this less noisy

* Remove import

* Trying to generic-ize the grant system

* Implement for Figma

* More grant reformatting

* Add tests

* changelog

* Fix todo

* Refactor grants

* Add logging to grant checkers

* Ensure we provide a sender
2023-03-17 16:38:39 +00:00
Michael Weimann
46e1008942
Fix widget config detection (#657)
Co-authored-by: Will Hunt <will@half-shot.uk>
2023-03-17 14:05:04 +00:00
Half-Shot
0d0cc6b3da fix push 2023-03-17 13:57:50 +00:00
Half-Shot
0dc2512e10 only log in if we're pushing 2023-03-17 13:55:15 +00:00
Will Hunt
7faa3f031e
Run docker CI for pull requests too (#662)
* Do a docker build for pull requests too

* drop branch limit for push

* changelog
2023-03-17 13:51:24 +00:00
Tadeusz Sośnierz
7cd59f3774
Add a go-neb migrator (#647)
* Add a go-neb migrator, capable of migrating RSS/Atom feeds to hookshot (so far)

* Add forgotten file

* Fix useCallback() usage

* Gracefully handle go-neb not being configured

* Make Feed URLs not editable when they're being migrated over from go-neb

https://github.com/matrix-org/matrix-hookshot/pull/647#discussion_r1131615944

* Changelog

* Linting

* Add the ability to migrate Github repo connections from go-neb (#651)

* Add the ability to migrate Github repo connections from go-neb

* Gracefully handle the lack of go-neb migrator

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>

* Handle Scalar-style go-neb service IDs (#656)

* Add the ability to migrate Github repo connections from go-neb

* Handle Scalar-style go-neb service IDs

* Make service type in service ID match the Scalar-generated one

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131647595

* Safeguard against undefined hardcoded service IDs

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131646578

* Rename a variable

https://github.com/matrix-org/matrix-hookshot/pull/656#discussion_r1131710225

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>

* Linting

---------

Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
2023-03-17 14:25:35 +01:00
Will Hunt
b8bb51fd1f
Fix service bots not rejecting invites on incoming DMs (#659)
* Manually send a reason on a leave for now

* changelog
2023-03-14 22:35:16 +00:00
Will Hunt
55529d7128
Add support for OAuth login to GitHub via widget (including adding new installations) (#661)
* WIP

* Update vite

* Add oauth landing page

* Add API support for GitHub oauthing

* Remove console.logs

* Add support for logging and and out of GitHub

* Add bridge API methods

* Add base link styling

* Sugar syntax main get

* Update vite

* changelog

* Review changes

* Use instance to match UI

* lint

---------

Co-authored-by: Justin Carlson <justinc@element.io>
2023-03-14 10:50:46 +00:00
Will Hunt
d602c895f3
Fix hookshot showing connections as editable when the user has no permission (#660)
* Fix getConnectionsForRequest reporting canEdit=true if the user has the
default or greater PL

* changelog
2023-03-14 10:48:53 +00:00
Justin Carlson
7575f93f67
Improve widget style (#652)
* Add widget card style and background

* Add padding and header based on embed type parameter

* Add changelog

* Add loading spinner component

* Add loading spinners
2023-03-08 09:20:13 -05:00
Kim Brose
1b80bd8f40
Register namespace for sample serviceBot in registration.sample.yml (#643)
* Update service_bots.md

* Update registration.sample.yml

* Create 643.doc
2023-02-13 12:29:19 +00:00
Will Hunt
80ccb0c877
Use replace uuid package with crypto.randomUUID (#640)
* Use randomUUID over uuid

* changelog

* Fix mess
2023-02-10 11:14:21 +00:00
Half-Shot
e846f3f19b 2.7.0 2.7.0 2023-01-20 13:27:25 +00:00
Will Hunt
88273a249b
New project picker component for room configs (#624)
* Implement new Dropdown component

* Apply field styling to search too

* General improvements to GitLabClient

* Add support for storing small base64 files in the storage provider

* Refactor GitLab repo to use new connection provider

* Start trying to deduplicate code

* Begin refactor to support ConnectionSearch

* Add support for GitHub searching

* Refactor GitLab/GitHub into components

* Port Jira to ConnectionSearch

* Drop unused functions

* Hide connection list if no connections are present.

* Cleanups

* Cleanup abort controller

* changelog

* Update JIRA for search powers
2023-01-20 13:16:11 +00:00
Half-Shot
b08ca20803 2.6.1 2.6.1 2023-01-16 16:08:28 +00:00
Half-Shot
66d5abb5d8 2.6.0 2023-01-16 16:07:43 +00:00
Michael Weimann
1b51189db1
Fix generic webhook 'user is already in the room error' (#627)
* Fix generic webhook 'user is already in the room error'

* Add changelog

* Cleanup to support usecases without slamming the homeserver.

* Fix fallthrough

* Add some tests

* Add tests for intentutils

* Refactor the rest of the app

Co-authored-by: Half-Shot <will@half-shot.uk>
2023-01-16 14:58:23 +00:00
Michael Weimann
469e88f9ba
Add webhook name and room to admin info (#620)
* Add webhook name and room to admin info

* Add changelog

* Escape room Id in webhook admin message

Co-authored-by: Will Hunt <will@half-shot.uk>
2023-01-16 10:51:36 +00:00
Michael Weimann
e7a6cfcef4
Fix state update validation (#628)
* Fix state update validation

* Add changelog
2023-01-16 10:48:24 +00:00
Christian Paul
67fc55af93
Change URL protocol in the ocumentation and sample configs to HTTPS (#623)
* Config: Use variables for similar values
* Configs and Documentation: http -> https, except for localhost
2023-01-13 16:39:34 +01:00
Justin Carlson
9a7839ce42
Implement separate bot users per service (#573)
* Add service bots config

* Add joined rooms manager and keep track of joined rooms

* Add bot users manager and ensure registration and profiles

* Improve joined rooms manager and set up already joined rooms

* Handle invites with service bots

* Handle messages with service bots

* Use service bots for connections

* Use service bots in widget and provisioning APIs

* Use service bots in setup connections

* Use service bots for feed connections

* Handle admin rooms for service bots

* Fix confused event type and service type in provisioning and widget APIs

* Fix generic webhooks service name

* Fix enabled services config

* Handle power level change

* Create widgets with service scope

* Use service bots for gitlab repo connections

* Use service bots for gitlab issue connections

* Use service bots for generic webhook connections

* Use service bots for figma file connections

* Use service bots when verifying state events

* Use service bots for github repo connections

* Use service bots for github discussion connections

* Use service bots for github discussion space connections

* Use service bots for github project connections

* Use service bots for github issue connections

* Use service bots for github user space connections

* Use service bots for jira connections

* Make sure ghost users are invited for gitlab issue comments

* Configure one service per service bot

* Add changelog

* Update tests

* Fix up following rebase

* Fix comment

* Use getter for enabled services

* Ensure homeserver can be reached before registering bots

* Add intent getter on bot user

* Update config comment

* Merge joined rooms manager with bot users manager

* Remove unused localpart from bot user class

* Refactor to pass in bot users manager

* Improve priority sort function

Co-authored-by: Christian Paul <christianp@matrix.org>

* Fix priority sort

Higher priority should come first

* Add debug log when invites are rejected

* Use different state key for scoped setup widgets

* Use different subtitles to differentiate service bots setup widgets

* Refactor bot user setup into bot users manager

* Refactor to reduce duplication in widget API

* Consistent room ID and intent args order

* Add docs and update changelog

* Add overrideUserId deprecation warning

* Add service bots link

Co-authored-by: Christian Paul <christianp@matrix.org>
Co-authored-by: Will Hunt <will@half-shot.uk>
2023-01-13 15:32:09 +00:00
Christian Paul
46467ac810
Correctly apply CSS for recent RSS feed changes (#604)
* Button: Extend HTMLButton prop types
* Use className prop instad of styles
* Move style prop into scss file
2023-01-13 14:44:07 +01:00
Will Hunt
1e8a112a28
Drop ignoreHooks configuration. (#592)
* Refactor HookFilter to only support enabledEvents (and add a function to convert)

* Convert connections to deprecate ignoreHooks

* Update documentation

* Split out EventHookCheckbox

* Refactor frontend to support enableHooks only mode

* drop old field name

* changelog

* Fix enabledHooks for widgets

* Fixes across the board

* Update test description

* Cleanup

* Fix HookFilter

* Fixup checkboxes

* Cleanup
2023-01-10 17:08:50 +00:00
Will Hunt
4048cc8b01
Check the GitLab instance name when looking for existing connections (#617)
* Check the GitLab instance name when looking for existing connections

* changelog
2023-01-10 10:42:05 +00:00
Will Hunt
a5ea88578c
Decrease connection creation concurrency when starting up (#614)
* Add a queue system for loading connections on startup

* Retry state requests

* Add ability to retry on some matrix failures

* Add the queue

* changelog

* Add docstring
2023-01-09 17:57:24 +00:00
Christian Paul
188eb4004e
A11y: Add alt tags to all images (#602)
* A11y: Add alt tags to all images

* Add newsfile
2023-01-08 12:04:40 +01:00
Will Hunt
707ce0de2d
Cache yarn dependencies (#615)
* Cache yarn dependencies

* changelog
2023-01-06 17:21:08 +00:00
Christian Paul
8eab1ff750
Improve webhook code editor performance (#601)
* Improve webhook code editor performance

* Add newsfile
2023-01-06 12:02:13 +00:00
dependabot[bot]
8e8a1a6958
Bump json5 from 2.2.0 to 2.2.3 (#611)
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 12:02:01 +00:00
Will Hunt
abe4fefda4
Mark encryption as experimental (#610)
* Update config to mark encryption support as experimental

* Mention encryption as experimental in docs

* changelog

* Hide empty values from config

* transmuate snakes into camels
2023-01-05 16:25:48 +00:00
Will Hunt
2eadc1c9d7
Increase maximum size of webhook payload. (#606)
* Increase maximum size of webhook payload.

* Create 606.misc
2023-01-04 12:04:58 +00:00