Fix the tunnel's error 1000 and notes sync, move maintenance to 05:00
nginx's network aliases for the public names vanish while it is stopped, so cloudflared fell through to public DNS, got Cloudflare's own IPs and visitors saw error 1000 on every deploy. nginx now has a fixed address and cloudflared pins both names to it, so a stopped nginx is a plain 502. The same aliases sent silverbullet-git's pushes to ssh://DOMAIN:2222 to nginx, which has no 2222: nothing has pushed since 2026-10-15. It now maps DOMAIN to the host gateway, where gitea publishes that port. The weekly maintenance restarts dockerd and every container; at 01:00 it kept catching late-night SilverBullet saves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -146,6 +146,11 @@ services:
|
||||
aliases:
|
||||
- ${DOMAIN}
|
||||
- www.${DOMAIN}
|
||||
# Fixed for cloudflared's extra_hosts (see there): an alias only
|
||||
# exists while nginx is running, and this address is pinned to the
|
||||
# same names for when it is not. Top of the /16 beside cloudflared's,
|
||||
# away from docker's dynamic allocations.
|
||||
ipv4_address: 172.28.255.251
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
@@ -227,6 +232,15 @@ services:
|
||||
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN:-}
|
||||
depends_on:
|
||||
- nginx
|
||||
# Pins the tunnel origin's names to nginx's fixed address. nginx's aliases
|
||||
# vanish while it is stopped (every deploy and the weekly maintenance), and
|
||||
# docker's DNS then forwards the name to public DNS, which answers with
|
||||
# Cloudflare's own IPs: the tunnel sent requests back to the edge and
|
||||
# visitors got error 1000. /etc/hosts wins over DNS, so a stopped nginx is
|
||||
# now a refused connection, which cloudflared reports as a plain 502.
|
||||
extra_hosts:
|
||||
- "${DOMAIN}:172.28.255.251"
|
||||
- "www.${DOMAIN}:172.28.255.251"
|
||||
networks:
|
||||
app-network:
|
||||
ipv4_address: 172.28.255.250
|
||||
@@ -453,6 +467,13 @@ services:
|
||||
restart: always
|
||||
networks:
|
||||
- app-network
|
||||
# The vault's remotes are ssh://git@DOMAIN:2222/..., but nginx's network
|
||||
# aliases make DOMAIN resolve to nginx on app-network, which has no :2222,
|
||||
# so every pull and push was refused. /etc/hosts wins over Docker's DNS, so
|
||||
# this sends DOMAIN back to the host, where gitea publishes 2222. The name
|
||||
# is unchanged, so known_hosts still matches.
|
||||
extra_hosts:
|
||||
- "${DOMAIN}:host-gateway"
|
||||
# Same uid SilverBullet writes as, so commits don't leave root-owned objects
|
||||
# in .git that the host user can no longer clean up.
|
||||
user: "1000:1000"
|
||||
|
||||
Reference in New Issue
Block a user