14 Commits

Author SHA1 Message Date
Catherine
fc9e6fcf7b [breaking-change] Listen only on localhost by default.
It is expected that in most deployments, a reverse proxy server like
Caddy or Nginx will be connecting to Caddy; listening on any address
by default is a privacy and security concern.
2025-12-07 07:17:54 +00:00
Catherine
5b8cb4ba11 Clean up Caddyfile, removing Fly.io-isms.
The grebedoc.dev infrastructure is no longer directly tied to
the container built from this repository, so we don't have to
pollute the configuration with Fly.io-isms.
2025-10-09 14:43:41 +00:00
Catherine
dcabcac106 Rename feature h2c to serve-h2c. 2025-09-29 01:47:13 +00:00
Catherine
4c087278cb Fly.io: switch health check method to [[services.http_checks]].
More specifically, remove the dedicated HTTP datapath for health
checks and verify the entire stack, from TLS frontend to S3 backend.
Verifying too little has resulted in a small outage recently when
the pages listener got misconfigured but the health listener happily
accepted connections like normal. This would not happen now that
the health check uses port 443, too.
2025-09-23 02:34:55 +00:00
Catherine
80e3d7ff56 Turn off Caddy's admin interface and expose metrics on the same port. 2025-09-22 16:26:55 +00:00
Catherine
e78f70626e Fly.io: enable Caddy metrics collection. 2025-09-22 09:50:01 +00:00
Catherine
a159dba0b8 [breaking-change] Redesign environment var configuration overrides.
This is done using reflection to avoid boilerplate and potential desync
of the two configuration interfaces. The `[[wildcards]]` section did
not fit well into the "splat every config key" paradigm, so it is
unmarshalled as a whole from a JSON payload in an environment variable.

This commit also splits up the `Config` type into small per-section
struct types and removes most references to the global `config` in
favor of passing pointers to sections around.

A new option, `-print-config-env-vars`, shows the names and types of
all of the available configuration knobs.
2025-09-22 07:02:42 +00:00
Catherine
e59699ab1a Configure Caddy to use PROXY protocol for X-Forwarded-For. 2025-09-21 14:27:25 +00:00
Catherine
d4f5420875 Configure Caddy to use HTTP/3.
Also, add `Alt-Svc:` headers for both H2 and H3.
2025-09-21 14:27:25 +00:00
Catherine
5b471f6677 Add a feature flag for testing h2c:// performance. 2025-09-21 04:38:06 +00:00
Catherine
a10e28210a Enable h2c:// (cleartext HTTP/2) protocol on all http:// sockets.
This allows git-pages and Caddy to efficiently use the same connection
for many pipelined requests, which I hope will reduce contention when
some bot decides to send fifty requests in the same millisecond.

This commit also changes built-in Caddy configuration to use HTTP/2
cleartext only when talking to the backend.
2025-09-21 03:36:14 +00:00
Catherine
da604215c1 Adapt Caddyfile during the build.
Until https://github.com/ss098/certmagic-s3/pull/25 is merged, this
also uses a fork of certmagic-s3.
2025-09-19 22:12:48 +00:00
Catherine
3d23d58fbb Make supervisord and Caddy less chatty. 2025-09-19 21:08:21 +00:00
bin
da212dcb89 Aggressively optimise size of Nix built Docker images 2025-09-19 04:23:57 +00:00