Adapt the default config to bind on IPv6.#2232
Conversation
|
Can one of the admins verify this patch? |
2 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Side note: on BSD-variants (including macOS) this may bind on IPv6 only, depending on the |
|
yup, the v6only thing is why we haven't dones this before. that said, i'm unsure why we can't just bind on 0.0.0.0 as well as :: (ie do two binds...) |
|
i suspect the right fix for this is to listen twice, but fix the bind code so that a failing bind isn't considered a terminal error |
|
I think it's safe to say that almost all Synapse installations are on Linux (where I have looked into forcing |
|
By the way, according to RFC 3493, |
|
A very common pattern (eg the one that half the matrix core team use) is to get up and running locally on OSX before then shifting to run on linux in production... |
eed4157 to
60079d5
Compare
|
@ara4n: This works the same on macOS as on Linux. The main exception in functionality is Windows, which does require a separate bind, but the |
|
I see I overlooked some IPv4 addresses, so changed them to IPv6 as well. |
|
I got an error with archlinux after commenting in both |
|
@saram-kon: on Linux |
|
I know 😄 I just wanted to point out that enabling both as the default, as suggested by @ara4n
might not work on all platforms |
There was a problem hiding this comment.
Apparently binding to ::1 does not bind to 127.0.0.1. I’ve tried above (I use nginx as a reverse proxy), and bind_addresses: ['::1'] did not bind 127.0.0.1, but ['::1', '127.0.0.1'] worked.
There was a problem hiding this comment.
You're correct. I'll fix that.
Most deployments are on Linux (or Mac OS), so this would actually bind on both IPv4 and IPv6. Resolves matrix-org#1886. Signed-off-by: Willem Mulder <willemmaster@hotmail.com>
60079d5 to
4029f5a
Compare
|
@kyrias, can you comment on this PR? I seem to remember you looking into something like this when you first did the IPv6 support. |
|
So yeah, twisted currently has no support for setting I do think it make sense to default to On the other hand, it might also make sense to have the generated config be conditional on the platform, so on Windows and the BSDs where it's enabled by default we could generate a config file with listeners for both IPv4 and IPv6 enabled. |
|
|
|
having just discussed this briefly with @kyrias again in #matrix-dev:matrix.org, I'm still unclear why my suggestion of:
doesn't work. It just feels clumsy to have to tell people to comment/uncomment chunks of config depending on platform (or special-casing '::' based on platform). Can we not just try to bind to all the given addresses, but not consider bind failures fatal? |
|
That seems like a good idea, and is what MPD does for instance: the default setting for |
Binding on 0.0.0.0 when :: is specified in the bind_addresses is now allowed. This causes a warning explaining the behaviour. Configuration changed to match. See matrix-org#2232 Signed-off-by: Silke Hofstra <silke@slxh.eu>
|
superceded by #2435 |
Most deployments are on Linux, so this would actually bind on both IPv4 and IPv6. Resolves #1886.
This change would additionally prevent timeouts for domain names with both A and AAAA records, and allows IPv6-only homeservers to connect to servers with an AAAA record.