crosscode: --json reports, --config, env templates, frpc tunnels, restart/export/uninstall/purge

- Every command takes --json (crosscode.script-report/1 on stdout, the
  log on stderr) and --config (the .env values by layer, from the agent).
- .env files come from the release's env.template.json (lib/envtpl.js):
  written whole on install; on deploy only new variables are appended,
  and a new required one with no value stops the deploy at the checks.
- install --frp: Hub-given ports, a marked frpc.ini block (backup,
  frpc verify, reload; [common] admin lines added once), no nginx.
  A database on another server via DB_ADMIN_URL. Refuses an existing
  database or role. Everything the run made is removed if it fails.
- restart, export (crosscode.church-export/1 ZIP), uninstall (final
  backup, uploads and .env kept 30 days) and purge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 12:50:19 +02:00
co-authored by Claude Opus 5.5
parent 350ab9f4e8
commit e9e9b5a97f
17 changed files with 1308 additions and 88 deletions
+4 -2
View File
@@ -14,10 +14,12 @@ CROSSCODE_NODE_MIN=20
CROSSCODE_NODE_WARN=22
# ── Logging ──────────────────────────────────────────────────────────────────────────────────
step() { printf '==> %s\n' "$*"; }
# shellcheck source=report.sh
source "$(dirname "${BASH_SOURCE[0]}")/report.sh"
step() { printf '==> %s\n' "$*"; report_line step "$(now_iso)" "$*"; }
info() { printf ' %s\n' "$*"; }
warn() { printf '!!> %s\n' "$*" >&2; }
die() { printf '!!> %s\n' "$*" >&2; exit 1; }
die() { printf '!!> %s\n' "$*" >&2; report_line message "$*"; exit 1; }
# ── Small checks ─────────────────────────────────────────────────────────────────────────────
require_root() {