proposal(deploy): Switch to Caddy from Traefik and enable localhost run support #889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the previous work of separating out the reverse proxy (Traefik) into a
docker-compose.override.ymlfile so that it still runs by default, but thedocker-compose.ymlin thedeploydirectory can be used without a reverse proxy without modifying the file such that it can be kept on a viable upgrade path.It further replaces Traefik with Caddy as the default reverse proxy.
The default
docker compose uprun, which always uses thedocker-compose.override.ymlif it exists, is currently in this branch set to run Caddy. Currently Traefik configuration and support is unchanged but requires to use it instead of Caddy requires:We could choose to simply deprecate Traefik, maintain optional support for it, or keep it as the default option with Caddy as the optional choice. We have options, but my recommendation is that we only maintain one reverse proxy option, and that we switch to Caddy.
Reasons for choosing Caddy:
New Feature: Local Certificate Generation (enables localhost support)
A new helper script,
create-local-certs.sh, has been added to the root of thedeploydirectory.Behavior:
WIKIBASE_PUBLIC_HOSTandWDQS_PUBLIC_HOSTfrom the local.envfile.mkcert. Ifmkcertis missing, the script will exit with instructions to the user with a link to installation instructions..envis missing or either variable is unset, prompting the user to complete the WBS Deploy configuration step first..testtld as this is the only reliable cross-platform localhost tld we support (see https://datatracker.ietf.org/doc/html/rfc2606)config/certs:config/certs/<domain>.crtconfig/certs/<domain>.key.env(only if not already present) so that Caddy switches to local certs mode.Benefits
How to Use
.testdomains from your.envto your/etc/hostsfile so they resolve locally.These can be any
.testdomains you choose, as long as they match what is set in.env.For example:
.envcontains:mkcertif not already installed.deploydirectory, run:Remaining TODOs: