fix(workspace): LAN exposure via host firewall — the Supabase CLI forces 0.0.0.0, so PostgreSQL / Studio / raw Mailpit close by UFW rules on the LAN interface; gateway reduced to Mailpit behind basic auth on 54325
Owner run: the CLI prints 'All services bind to 0.0.0.0' and ignored the rootless daemon's default address; the gateway could not share 54321/54324 with 0.0.0.0 listeners. Now: Kong serves the API directly; the DEV gateway serves only Mailpit with basic auth on <DEV host>:54325; ENVIRONMENTS.md §3 gives the exact UFW rules (interface-scoped deny on 54322-54324, two cases by current UFW state), rollback and impact; dev:net-check proves the allowed surfaces from a distinct Docker network (5/5 OK) and prints the refusal checks to run from another device, since a rootless container's traffic to the host is delivered locally and cannot see the LAN firewall. LRN-053 corrects LRN-052.
This commit is contained in:
1 parent
a8edd59059
commit
e633169a00
11 files changed
+143
-111
No files matched your search
@@ -1,7 +1,9 @@
|
||||
# DEV gateway (docs/development/ENVIRONMENTS.md §3): the only two Supabase surfaces
|
||||
# re-published on the private network once the rootless Docker daemon binds published
|
||||
# ports on loopback by default. Upstreams are resolved through Docker's DNS on every
|
||||
# request (variables + resolver) so a restarted stack is followed without a restart here.
|
||||
# DEV gateway (docs/development/ENVIRONMENTS.md §3): Mailpit behind HTTP basic auth on
|
||||
# the LAN address, port 54325. The Supabase CLI publishes Mailpit itself on
|
||||
# 0.0.0.0:54324 with no authentication; that raw port is closed to the LAN by the host
|
||||
# firewall rule of §3.2, so this gateway is the only way to read DEV mails from another
|
||||
# device. The upstream is resolved through Docker's DNS on every request (variable +
|
||||
# resolver), so a restarted stack is followed without restarting the gateway.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
@@ -9,28 +11,8 @@ map $http_upgrade $connection_upgrade {
|
||||
'' close;
|
||||
}
|
||||
|
||||
# Supabase API (Kong: Auth, PostgREST, Storage) for the browsers of the LAN.
|
||||
server {
|
||||
listen 54321;
|
||||
server_name _;
|
||||
client_max_body_size 16m; # avatar uploads are capped at 5 MiB by the bucket
|
||||
location / {
|
||||
set $kong http://supabase_kong_faunosteo:8000;
|
||||
proxy_pass $kong;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_request_buffering off;
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
}
|
||||
|
||||
# Mailpit (DEV mails: confirmation and recovery links) behind HTTP basic auth.
|
||||
server {
|
||||
listen 54324;
|
||||
listen 54325;
|
||||
server_name _;
|
||||
auth_basic "Faunosteo DEV mail";
|
||||
auth_basic_user_file /etc/nginx/htpasswd;
|
||||
|
||||
Reference in new issue
Block a user