feat(compose): optional static/mirror via override files; build-stack up modes

Base compose is core only (dnsmasq, drasl, minecraft, mc-backup, caddy
auth+packwiz). docker-compose.static.yml and docker-compose.mirror.yml layer
on the landing site and the air-gap mirror independently. build-stack.sh --up
[core|static|mirror|full] selects the override files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-24 05:07:20 +02:00
parent 3bf714a224
commit d6e7504d6e
4 changed files with 53 additions and 12 deletions

View File

@@ -80,28 +80,46 @@ prep() {
}
# ---- offline bring-up ------------------------------------------------------
# Modes select which optional layers come up (override files):
# core base only (dnsmasq, drasl, minecraft, mc-backup, caddy auth+packwiz)
# static + apex landing page + launcher downloads
# mirror + full air-gap upstream mirror (tls internal on :443)
# full static + mirror (default)
up() {
log "PHASE up (offline-capable bring-up)"
local mode="${1:-full}"
local -a files=(-f docker-compose.yml)
case "$mode" in
core) ;;
static) files+=(-f docker-compose.static.yml) ;;
mirror) files+=(-f docker-compose.mirror.yml) ;;
full) files+=(-f docker-compose.static.yml -f docker-compose.mirror.yml) ;;
*) die "unknown up mode: '$mode' (use core|static|mirror|full)" ;;
esac
log "PHASE up (mode=$mode)"
have_script render-config.sh
tooling/render-config.sh # cheap; ensures configs match current .env
"${COMPOSE[@]}" up -d
log "stack up. apex: http://${BASE_DOMAIN} auth: http://auth.${BASE_DOMAIN}"
"${COMPOSE[@]}" "${files[@]}" up -d
log "stack up (mode=$mode). apex: http://${BASE_DOMAIN} auth: http://auth.${BASE_DOMAIN}"
}
# ---- dispatch --------------------------------------------------------------
preflight
case "${1:-}" in
--prep) prep ;;
--up) up ;;
--up) up "${2:-full}" ;;
"") cat <<EOF
Nothing run. Choose a phase:
$0 --prep # ONLINE: render, build landing, mirror everything, pre-bake server
$0 --up # OFFLINE: docker compose up -d the full stack
$0 --prep # ONLINE: render, build landing, mirror everything, pre-bake server
$0 --up [mode] # bring the stack up; mode = core|static|mirror|full (default full)
# core = no static site, no mirror
# static = + apex landing + launcher downloads
# mirror = + full air-gap upstream mirror (:443)
# full = static + mirror
Sub-scripts expected in tooling/: render-config.sh, mirror-mods.sh,
mirror-airgap.sh, fetch-launcher.sh (built in their own commits — see plan/12).
EOF
;;
*) die "unknown arg: $1 (use --prep or --up)" ;;
*) die "unknown arg: $1 (use --prep or --up [core|static|mirror|full])" ;;
esac