Files
inbuxa-installer/internal/plan
jcoffey-dev 35172dd0f5 --proxy snippets writes what it promised: nginx and Caddy configuration
The plan, the usage text and the docs all said --proxy snippets writes
configuration for the web server already on the machine; nothing did. Now
it writes <dir>/proxy/nginx-inbuxa.conf and <dir>/proxy/Caddyfile.fragment:
the server's names, the console and the webmail passed to their loopback
ports, X-Forwarded-For set to the client's address, the webmail's and the
server's push streams unbuffered, port 80 passing the mail server's own
certificate challenges to it and redirecting the rest. The fragment has no
global block, so it imports beside other sites, and leaves HTTP-01 for the
server's names to the server, as the managed Caddy does.

That web server becomes the proxy, so it is treated as Caddy is: the
server trusts its X-Forwarded-For and exempts the address its requests
arrive from -- loopback for a server on the host, the project network's
gateway too for one in a container, where a published loopback port is
reached from there. Nothing is loaded or reloaded; the summary names the
directory, and the mail server's own certificates are turned on in the
console once the file is loaded. A re-run rewrites it for what is
installed then.

The interface's Reach screen offers it, beside Caddy and nothing in front.

Tests: the snippets render for each shape and leave out what isn't
installed; they pass `nginx -t` and `caddy validate`.
e2e/cases/proxy-snippets.sh installs nginx, installs behind it, loads the
written file and reaches the server, console and webmail through it on
443, with port 80 passing a challenge to the server and redirecting the
console: 13/13. interface, install-local, install-host, install-public,
status-export and topology pass unchanged.
2026-10-12 09:48:25 -07:00
..