浏览代码

sni-router: review fixes — compose style, subnet caveat, IPv6 note

- Use list form for `networks: [sni]` on services that need no
  per-network config; keep map form only on `web` where ipv4_address
  requires it.
- README: note that the 172.28.0.0/24 subnet can be changed if it
  collides with an existing host network (and remind to update both
  files in lockstep).
- README: caveat that IPv6 fronting may lose the real client IP in
  Caddy's logs because mtg constructs a mixed-family PROXY v2 header
  (IPv6 source, IPv4 destination); Telegram traffic unaffected.
pull/478/head
Alexey 1周前
父节点
当前提交
0f7c58e2ad
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 9
    1
      contrib/sni-router/README.md
  2. 2
    2
      contrib/sni-router/docker-compose.yml

+ 9
- 1
contrib/sni-router/README.md 查看文件

@@ -83,7 +83,15 @@ IP, not a hostname, hence the static `sni` network).  `proxy-protocol =
83 83
 true` matches Caddy's `:8443` listener wrapper so the real client IP
84 84
 still propagates to Caddy's logs.
85 85
 
86
-If you change Caddy's pinned IP, update both files together.
86
+If you change Caddy's pinned IP, update both files together.  If
87
+`172.28.0.0/24` collides with another network on this host, change the
88
+subnet in `docker-compose.yml` and the IP in `mtg-config.toml` to match.
89
+
90
+> Caveat for IPv6 clients: when an IPv6 probe is fronted, mtg's
91
+> outbound PROXY v2 header has an IPv6 source but an IPv4 destination
92
+> (Caddy's pinned address).  Caddy may refuse the mixed-family header
93
+> and log the docker-network address instead of the real client IP for
94
+> that connection.  Telegram traffic is unaffected.
87 95
 
88 96
 ## ACME (Let's Encrypt) notes
89 97
 

+ 2
- 2
contrib/sni-router/docker-compose.yml 查看文件

@@ -31,7 +31,7 @@ services:
31 31
     sysctls:
32 32
       - net.ipv4.ip_unprivileged_port_start=80
33 33
     networks:
34
-      sni:
34
+      - sni
35 35
 
36 36
   mtg:
37 37
     image: nineseconds/mtg:2
@@ -43,7 +43,7 @@ services:
43 43
     extra_hosts:
44 44
       - "host.containers.internal:host-gateway"
45 45
     networks:
46
-      sni:
46
+      - sni
47 47
 
48 48
   web:
49 49
     image: caddy:alpine

正在加载...
取消
保存