syphon-org / syphon

⚗️ a privacy centric matrix client
https://syphon.org
GNU Affero General Public License v3.0
1.04k stars 72 forks source link

Check SRV record as alternative to .well-known #709

Closed feinedsquirrel closed 2 years ago

feinedsquirrel commented 2 years ago

I asked in the syphon matrix room first to verify. This was my original question:

I removed my .well-known configuration from my home server, and set up a SRV record, deleted my home server database to start with a clean slate, and Syphon (android) gave me an error with something along the lines of ".well-known misconfiguration, unable to connect to server" while element let me connect and create a user without any hiccups.

I've done a text search through the current code base, did not find "SRV", and the few instances of "record" seem to be for other things.

It would be great to allow a proper SRV record to be a valid replacement for ".well-known". Thanks!

notramo commented 2 years ago

As far as I know, SRV records are only for server-to-server federation. The .well-known solution was chosen because in-browser clients can't initiate DNS queries, so while the server-server API uses both SRV and .well-known, the client-server API uses only .well-known.

EdGeraghty commented 2 years ago

As far as I know, SRV records are only for server-to-server federation.

Having re-read the spec, you're correct.

@ereio - do we continue with this, or drop?

feinedsquirrel commented 2 years ago

Oh shoot, @notramo is right. The client-server spec doesn't mention anything about SRV records. :facepalm:

EdGeraghty commented 2 years ago

An MSC for clients to use SRV records has been rejected from the Spec upstream.

Given the code I wrote actually works I don't know whether we might want to include it anyway, or just drop it as not just out of spec but actively rejected.

ereio commented 2 years ago

I don't mind safeguarding Syphon in ways that are out of spec. I already do this with Server to Server well known checks in case people forget or ignore the client well-known (and it has helped).

In this case, it would require external calls I'd rather not add as dependencies, so we'll close it for now but know it's there for the future if we need it