Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix badge doesn't work if a server's name differs from its FQDN #2524

Closed
1 of 3 tasks
babolivier opened this issue Dec 13, 2018 · 0 comments
Closed
1 of 3 tasks

Matrix badge doesn't work if a server's name differs from its FQDN #2524

babolivier opened this issue Dec 13, 2018 · 0 comments
Labels
service-badge New or updated service badge

Comments

@babolivier
Copy link
Contributor

babolivier commented Dec 13, 2018

Are you experiencing an issue with...

🪲 Description

The server-related part of a Matrix room ID (e.g. abolivier.bzh in !XvGbFViZZIJPftczyH:abolivier.bzh), aka the "server name", can differ from the FQDN the server is actually accessible at. In this example (!XvGbFViZZIJPftczyH:abolivier.bzh), my server's name is abolivier.bzh even though the server itself actually lives at chat.abolivier.bzh. Assuming server name = FQDN can work in some cases (e.g. with the matrix.org server) but doesn't cover most cases.

Translating a server name into a FQDN can be done using either a DNS query on the SRV record _matrix._tcp.[serverName] or through matrix.org's federation tester.

The Matrix badge generation considers the second argument in the URL as both the server's name (in order to build the room's ID) and the FQDN it lives at.

🔗 Link to the badge

Here's an example of a badge for a valid room on my server:

https://img.shields.io/matrix/!XvGbFViZZIJPftczyH/abolivier.bzh.svg

💡 Possible Solution

Use either a DNS query or the federation tester to resolve a server's FQDN.

On top of that (though not really related to this specific issue) badges should use room aliases instead of room IDs as a room isn't bound to a specific server (and using room IDs could render the badge unusable if there's no longer any user on the server that created the room in it).

I also wanted to use this opportunity to thank you, and especially to thank @fr1kin, for contributing a Matrix badge to Shields 🙂

@paulmelnikow paulmelnikow added the service-badge New or updated service badge label Dec 13, 2018
paulmelnikow pushed a commit that referenced this issue Dec 20, 2018
Fixes #2524 

This PR addresses the issues expressed in #2524, in that it:

* checks if a server has advertised a FQDN it can be reached at and if that FQDN hosts Matrix's client APIs
* uses room aliases instead of room IDs, in order to avoid a badge being impossible to generate if the server that created the room leaves it

This includes a breaking change to the badge endpoint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

2 participants