-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Clarify recommended setup #2438
Comments
https://matrix.org/docs/guides/lets-encrypt.html also seems to suggest putting LE on the synapse server directly is a correct approach |
I do 3). Excerpt from my config:
|
I also use 3, with the difference being I reverse proxy 8448 to point to the federation_reader. It's reverse proxied to make it easier to switch targets more easily, if required. |
My recommendation for a "production" setup is option 3, as it means you can have a proper LetsEncrypt cert on port 443 without having to worry about updating the cert used by synapse when it expires (and how that interacts with other servers in the federation). Certainly the README isn't clear in this respect. That's partly an artefact of the fact it tries to deal with a number of different scenarios, notably somebody trying to set up a "test" instance on a local machine, where having to mess about with reverse-proxies is somewhat overkill. I'm not sure what the best way to address the confusion would be; possibly the README should be broken up into separate documents on topics such as "setting up a local synapse for development/test purposes" and "setting up a production synapse with optional federation". Either way it could do with the attention of a proper technical author rather than the occasional half-hour to from a software dev trying to patch it up. |
Yeeeees, but as you have also noted:
yes. Synapse is currently a bit lax in this respect (#1362), but you could easily find yourself with outages if you're not quite careful about how you replace your certificates for federation. |
I use the 3) option, and I agree, docs must be coherent.. |
Also,
|
As described here ( matrix-org/synapse#2438 (comment) ), using own SSL certificates for the federation port is more fragile, as renewing them could cause federation outages. The recommended setup is to use the self-signed certificates generated by Synapse. On the 443 port (matrix-nginx-proxy) side, we still use the Let's Encrypt certificates, which ensures API consumers work without having to trust "our own CA". Having done this, we also don't need to ever restart Synapse anymore, as no new SSL certificates need to be applied there. It's just matrix-nginx-proxy that needs to be restarted, and it doesn't even need a full restart as an "nginx reload" does the job of swithing to the new SSL certificates.
hopefully improved as of #2468 |
Could some one please clarify how to setup the reverse proxy using LetsEncrypt with apache? Between this issue and the readme I am quite confused what goes where. I have setup a domain and a have a letsencrypt certificate setup with --apache. Currently I have a file The content of the file is
configuration in
When trying to connect with No Such ResourceNo such child resource. |
@amanusk In your apache config, amend as such:
|
@maxidor, thanks! |
then it's fine. If you have more issue, you should open a dedicated issue or come in #matrix:matrix.org |
@richvdh FYI I keep seeing several people a week that still do it the wrong way, but I don't have good ideas on how to improve this further short of a full rewrite of the README. Any ideas on that front? |
I think one very concrete improvement would be:
|
@ptman This is specifically for those NOT using docker images, so from source or distro packages |
many elements remain: database, synapse, reverse proxy, with config that listens on different ports and proxies traffic to synapse appropriately |
maybe just add the nginx/caddy configs then? |
Adding an apache2 example config when using Lets Encrypt to the README will definitely help |
Note that in the upcloud tutorial i used to install matrix as homeserver, it also had an optional paragraph about certificate replacement for matrix to directly use LetsEncrypt from the homeserver.yaml. For this it mentioned to set sth like: of course, this won't work anyway if your default setup uses root user access only for that folder, which it does on debian and derivatives at least. so you would have to copy the certificate around, which yet again other tutorials suggest, or worse, start synapse as root. so yes, indeed a common doc, with clear statements of what is needed and best behaviour is a good idea. i am still - up to this point in time - unsure, whether my 8448 port for federation should have self signed certs, needs renewal, etc. or not. btw. I knew about this issue also because I found the reverse proxy apache config here.
|
please don't follow the upcloud tutorial, for this reason.
The need for this is tracked at matrix-org/matrix.org#206 |
EDIT as to provide guidance to new users - Synapse devs official answer #1 and #2
TL;DR
The self-signed certificate of synapse SHOULD NOT be replaced and port 8448 should only be used for federation (server traffic) and directly exposed publicly.
For clients connections, a reverse proxy should be reachable publicly with a regular certificate (e.g. Let's Encrypt) on port 443 that goes to the port 8008 of synapse.
This is the last option in the first list below.
The community is currently discussing what is the official recommended setup for synapse in terms of ports and reverse proxying. Here are the three visions:
My personal believe is to do go for 3) but it seems many users in the community for for 1) or 2), which I believe is due to misleading documentation for synapse.
Why I think 1) and 2) occurs due to misleading doc:
First mention of 8008 and 8448 is at Configuring synapse, last paragraph which gives the first misleading advise.
It says 8448 has a self-signed certificate which is fine to test with clients but should be replaced in production but also state that it's fine for Federation. So if you want to connect clients to 8448, you should put a proper certificate - yet doesn't instruct to connect clients to it outside of a testing scope.
The next bit comes with Connecting to Synapse from a client which says again that the easiest way to try a synapse install is to connect to 8448 but totally ignores the fact it's a self-signed and will be a problem. So you're made to believe you should have changed the certificate.
Then we come to Using a reverse proxy with Synapse which says it will work nicely with clients as you expose 443 and continues by saying clients and servers don't necessarily need to connect to the same port, says and shows a nginx config of 443->8008 for clients.
Finally, several generic points:
Could the Matrix devs please clearly state what is the recommended setup?
The text was updated successfully, but these errors were encountered: