GuidoD
(Guido Drehsen)
29. Januar 2023 um 11:24
1
Zur Information, ich habe gerade einen Pull-Request für web.ssl.template.yml erstellt, um die IPv6-NAT-Funktion von Docker in einer Discourse-Instanz nutzen zu können.
Mit meiner Änderung konnte ich die IPv6-NAT von Docker mit Discourse nutzen.
Ohne meine Änderung wurden Anfragen von IP6-Clients von Discourse abgelehnt, nur Anfragen von IP4-Clients wurden akzeptiert.
NAT IP6 wird jetzt von Docker ähnlich wie NAT IP4 behandelt.
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 „Gefällt mir“
GuidoD
(Guido Drehsen)
4. April 2023 um 10:35
2
Kann bitte jemand vom Discourse Core Developer Team meinen PR überprüfen.
Damit er entweder gemerged oder abgelehnt und geschlossen wird.
sam
(Sam Saffron)
4. April 2023 um 10:45
3
Das Problem hier ist, dass ich nicht sicher bin, ob wir diese Oberfläche standardmäßig erhöhen wollen.
Ich bin unschlüssig, ob ich dies für alle Installationen ändern soll, da die Offenlegung von v6 möglicherweise nicht die Absicht des Benutzers ist.
Ich werde intern nachfragen, ob wir die Änderung vornehmen möchten oder nicht.
3 „Gefällt mir“
Einverstanden. Das Folgende ist ein besserer Weg, dies zu tun, und bietet einen einfachen Weg, sich für dieses Verhalten zu entscheiden:
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 „Gefällt mir“
GuidoD
(Guido Drehsen)
5. April 2023 um 06:47
6
Danke für den PR. und dass er sofort in Discourse Docker gemerged wurde.
Ich habe gerade git pull ausgeführt, “templates/web.ipv6.template.yml” in app.yml aktiviert und die App neu erstellt, nachdem ich meine Änderungen in web.ssl.template.yml deaktiviert hatte.
Unsere Seite läuft weiterhin problemlos über IPv4 und IPv6.
2 „Gefällt mir“
system
(system)
Geschlossen,
5. Mai 2023 um 06:48
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.