element-hq / element-hq/synapse
URL Preview for private URLs with active integrations (GitHub, GitLab, Jira)
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
### Your use case
Posting this here, as this is where the proposal will become visible to a person that is using Element.
#### What would you like to do?
When pasting a link to an issue in a private GitLab repository, I would like to see an informative URL preview.
> This might also be valid for the prime integrations with GitHub and Jira.
#### Why would you like to do it?
When referencing people to items in private repositories, in rooms with link previews enabled, we are regularly presented with the login screen. Clicking it away is a little tedious and could potentially be avoided.
#### How would you like to achieve it?
Paste a URL into a private GitLab repository / group / instance.
URL preview knows how to fetch the sensitive metadata.
This could maybe be facilitated by an existing Hookshot integration. Possibly by providing an oEmbed endpoint with a hardly guessable URL that does the resolution against GitLab?
This appears to become more challenging, if multiple integrations to multiple GitLab (GitHub (Enterprise), Jira) instances are considered.
### Have you considered any alternatives?
1. Disabling URL previews for the whole room is a poor workaround.
2. Using `url_preview_url_blacklist` in Synapse and adding rules for private instances / groups / repositories there.
3. Allow Element to build the preview locally via CORS and post it to the channel. https://github.com/element-hq/synapse/issues/10676
### Additional context
### References
- https://github.com/element-hq/element-meta/issues/1295
- https://github.com/element-hq/roadmap/issues/26
- https://github.com/matrix-org/matrix-spec-proposals/pull/2370
* [matrix-org/matrix-hookshot](https://github.com/matrix-org/matrix-hookshot)
* [Setting up GitLab, Git... | Element Knowledge](https://ems-docs.element.io/books/element-server-suite-documentation-lts-2410/page/setting-up-gitlab-github-jira-and-webhooks-integrations-with-the-installer)
- https://github.com/matrix-org/synapse/issues/2752
- https://github.com/matrix-org/synapse/pull/10714
- https://github.com/element-hq/synapse/commit/e2481dbe9325321d460037a2efe9b9ea2ac78057
- https://github.com/element-hq/synapse/issues/3242
- https://github.com/element-hq/synapse/issues/3440
- https://github.com/element-hq/synapse/issues/6205
- https://github.com/matrix-org/synapse/issues/7643
- https://github.com/matrix-org/synapse/pull/7920
- https://github.com/element-hq/synapse/commit/3fc8fdd150e2471d6e96b842e364d9421066f4ba
- https://github.com/element-hq/synapse/issues/9877
- https://github.com/element-hq/synapse/issues/10676
- https://github.com/element-hq/synapse/issues/11540
- https://github.com/element-hq/synapse/issues/17873
- https://github.com/element-hq/synapse/pull/17968
Contributor guide
Research direction
Start by reviewing the linked Synapse issues and pull requests, especially 2752, 7643, 10676, and 17873, alongside matrix-hookshot and the Matrix proposal. Compare the referenced URL-preview and integration approaches, then define how private GitLab, GitHub Enterprise, and Jira metadata could be resolved securely across instances. Done means there is an agreed implementation path with clear security and integration boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, python
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100