GuidoD
(Guido Drehsen)
1월 29, 2023, 11:24오전
1
참고로, Discourse 인스턴스에서 Docker의 IPv6 NAT 기능을 사용할 수 있도록 web.ssl.template.yml에 대한 pull request를 방금 생성했습니다.
제 변경 사항 덕분에 Discourse에서 Docker의 IPv6 NAT를 사용할 수 있었습니다.
변경 사항이 없을 경우, Discourse는 IPv6 클라이언트로부터의 요청을 거부하고 IPv4 클라이언트로부터의 요청만 허용했습니다.
이제 IPv6 NAT는 IPv4 NAT와 유사하게 Docker에서 처리됩니다.
main ← GuidoDr:patch-1
closed 05:40PM - 04 Apr 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.
GuidoD
(Guido Drehsen)
4월 4, 2023, 10:35오전
2
디스코어 코어 개발팀 중 한 분이 제 PR을 확인해 주실 수 있을까요?
병합되거나 거절되어 닫히도록 해주세요.
sam
(Sam Saffron)
4월 4, 2023, 10:45오전
3
여기서 문제는 기본적으로 이 범위를 늘리고 싶은지 확신이 서지 않는다는 점입니다.
모든 설치 환경에 대해 이 설정을 변경하는 것에 대해서는 의견이 갈립니다. v6를 노출하는 것이 사용자의 의도일 수도 있고, 아닐 수도 있기 때문입니다.
내부적으로 이 변경 사항을 적용할지 여부를 문의해 보겠습니다.
동의합니다. 아래 방법은 이를 수행하는 더 나은 방식이며, 이 동작을 선택적으로 활성화할 수 있는 쉬운 방법을 제공합니다:
main ← ipv6_template
merged 11:03PM - 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.
GuidoD
(Guido Drehsen)
4월 5, 2023, 6:47오전
6
PR 감사합니다. 그리고 바로 discourse docker에 병합되었습니다.
web.ssl.template.yml에서 제 변경 사항을 비활성화한 후, app.yml에서 "templates/web.ipv6.template.yml"을 활성화하고 git pull을 실행한 뒤 앱을 다시 빌드했습니다.
우리의 사이트는 여전히 IPv4와 IPv6에서 정상적으로 작동하고 있습니다.