GuidoD
(Guido Drehsen)
Janeiro 29, 2023, 11:24am
1
para sua informação, acabei de criar um pull request para o web.ssl.template.yml para poder usar a função NAT IPv6 do Docker em uma instância Discourse.
Com minha alteração, consegui usar o NAT IPv6 do Docker com o Discourse.
Sem minha alteração, as solicitações de clientes IP6 eram rejeitadas pelo Discourse, apenas as solicitações de clientes IP4 eram aceitas.
O NAT IP6 agora é tratado pelo Docker de forma semelhante ao NAT IP4.
main ← GuidoDr:patch-1
opened 11:14AM - 29 Jan 23 UTC
the "listen [::]:443 ssl http2;" is also required in the first rewrite section w… here it was only rewritten to "listen 443 ssl http2;" Otherwise Discourse will reject requests from pure IP6 webbrowser access.
it has to be:
- replace: filename: "/etc/nginx/conf.d/discourse.conf" from: /listen 80;\s+listen \[::\]:80;\s+gzip on;/m to: | listen 443 ssl http2; listen [::]:443 ssl http2; SSL_TEMPLATE_SSL_BLOCK
With this change the docker IPv6 NAT is handled correctly by Discourse.
In order to enable IP6 in docker without the userland-proxy do create the file /etc/docker/daemon.json and do restart the docker daemon. Then the original IP6 from the accessing client is visible in Discourse for the admins under last IP address and can be checked with the IP check. With the userland-proxy only the IP4 address of the docker daemon would be shown there.
Here the content of my daemon.json (I just anonymized my DNS servers a little bit with the xxx): {
"userland-proxy": false,
"ipv6": true,
"fixed-cidr-v6": "fd00::/80",
"experimental": true,
"ip6tables": true,
"dns": ["xxx.169.148.34","xxx.214.7.22","8.8.8.8","8.8.4.4"]
}
With this the docker container is not exposed directly to the internet with a global IPv6 but instead it is running with a ULA that is not accessible globally. So IP6 is handled in docker with NAT like IP4.
And Discourse is now reachable by IP4 and IP6 and always the original IP address is visible in Discourse.
1 curtida
GuidoD
(Guido Drehsen)
Abril 4, 2023, 10:35am
2
alguém da equipe de desenvolvedores principais do discourse pode verificar meu PR.
Para que ele seja mesclado ou rejeitado e fechado.
sam
(Sam Saffron)
Abril 4, 2023, 10:45am
3
O problema aqui é que não tenho certeza se queremos aumentar essa superfície por padrão.
Estou em dúvida sobre mudar isso para todas as instalações, expor o v6 pode ou não ser a intenção do usuário.
Vou perguntar internamente se gostaríamos de fazer a alteração ou não.
3 curtidas
Concordo. O seguinte é uma maneira melhor de fazer isso e oferece um caminho fácil para optar por esse comportamento:
main ← ipv6_template
opened 05:39PM - 04 Apr 23 UTC
By default nginx in the container only listens for IPv4 connections. Some users
… want to enable direct IPv6 connectivity to the container either via forwarding
or NAT. This provides an easy method to allow that.
6 curtidas
GuidoD
(Guido Drehsen)
Abril 5, 2023, 6:47am
6
obrigado pelo PR. e que ele foi mesclado imediatamente no discourse docker.
Eu apenas fiz o git pull, habilitei o "templates/web.ipv6.template.yml" em app.yml e fiz o rebuild do app depois que desabilitei minhas alterações em web.ssl.template.yml.
Nosso site ainda está funcionando bem em IPv4 e IPv6.
2 curtidas
system
(system)
Fechado
Maio 5, 2023, 6:48am
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.