feat(demo): deploy/demo and the wipe + baseline workflows (step 5)
The public demo's deployment (docs/website/DEMO_MODE.md §7, §10 step 5): - deploy/demo/docker-compose.yml: the app and its database only, DEMO_MODE on, a /status healthcheck, the fixture mounted for seed:demo, MODULES read from state/modules.env so the workflow never edits the .env with secrets. - deploy/demo/.env.example: every variable the host needs, including BOT_INTERNAL_KEY (the app refuses to start in production without it) and MODULE_SOURCE_HOSTS (a fresh database's install allowlist). - deploy/demo/seed.json: the four logins, settings, two posts, a wiki page, a published "Server greeting" event on a Rust console step, the rig's server link and demo-player's Steam link; secrets as "$env:NAME". - deploy/demo/rig.mjs: plan (latest Rust bundle + newest Module-Rust on the same protocol, keeping the previous set when none matches), restore (kill, write a changed bundle, delete + unpack demo-baseline.tar.gz, start), baseline (power stop saves the world, DM22; compress, rename, start) and smoke (the site, then the rig reporting in), on the Pterodactyl client API. - .gitea/workflows/demo-wipe.yml: every 2 h on the hour UTC, on a push to deploy/demo/, and by hand; rig first, then down -v / pull / up / seed. - .gitea/workflows/demo-baseline.yml: by hand only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
61
deploy/demo/.env.example
Normal file
61
deploy/demo/.env.example
Normal file
@@ -0,0 +1,61 @@
|
||||
# ─── The demo site's environment (docs/website/DEMO_MODE.md) ───
|
||||
# Copy to /opt/demo.runicgateway.com/.env on the `demo-site` host and fill in.
|
||||
# NEVER commit the real file. The wipe workflow never writes it; it only reads it.
|
||||
|
||||
IMAGE_TAG=latest
|
||||
NODE_ENV=production
|
||||
PORT=3000
|
||||
# The host port the external reverse proxy forwards demo.runicgateway.com to.
|
||||
DEMO_HOST_PORT=3000
|
||||
# How often the wipe runs, for the banner's "wiped at" time. Must match the cron
|
||||
# in .gitea/workflows/demo-wipe.yml (every 2 hours on the hour, UTC, DM7).
|
||||
DEMO_RESET_EVERY_HOURS=2
|
||||
|
||||
# Branding
|
||||
BRAND_NAME=Runic Gateway Demo
|
||||
BRAND_SHORT_NAME=RG Demo
|
||||
BRAND_URL=https://demo.runicgateway.com
|
||||
CLIENT_ORIGIN=https://demo.runicgateway.com
|
||||
|
||||
# Database. Recreated empty at every wipe; the passwords only need to be stable.
|
||||
DB_HOST=db
|
||||
DB_PORT=3306
|
||||
DB_NAME=runic_gateway
|
||||
DB_USER=runic
|
||||
DB_PASSWORD=
|
||||
DB_ROOT_PASSWORD=
|
||||
|
||||
# Long random strings, e.g. `openssl rand -hex 32`. SECRET_ENC_KEY is required in
|
||||
# production. Every stored secret is re-seeded at each wipe, so rotating either
|
||||
# one only signs people out.
|
||||
JWT_SECRET=
|
||||
SECRET_ENC_KEY=
|
||||
COOKIE_SECURE=auto
|
||||
# The guard on the app's unpublished internal port. The demo runs no bot, but the
|
||||
# app refuses to start in production without it. Another long random string.
|
||||
BOT_INTERNAL_KEY=
|
||||
# One proxy hop: the external reverse proxy.
|
||||
TRUST_PROXY=1
|
||||
|
||||
# Leave ADMIN_USERNAME unset: the boot seed must not create a fifth admin. The four
|
||||
# demo accounts come from seed.json (§4).
|
||||
ADMIN_USERNAME=
|
||||
|
||||
# Where modules may be installed from. A fresh database seeds the allowlist from
|
||||
# this, and the declared module (state/modules.env) installs under it.
|
||||
MODULE_SOURCE_HOSTS=gitea.whitlocktech.com
|
||||
|
||||
# ── seed.json reads these through "$env:NAME" ──
|
||||
# The published logins (§4) are not secrets, but they live here so the repo does
|
||||
# not pin them. play-review's is NOT published; it goes in the Play Console only.
|
||||
DEMO_ADMIN_PASSWORD=
|
||||
DEMO_MODERATOR_PASSWORD=
|
||||
DEMO_PLAYER_PASSWORD=
|
||||
PLAY_REVIEW_PASSWORD=
|
||||
# A stand-in Steam id that has played on the rig, so demo-player's Rust screens
|
||||
# have data (DM6).
|
||||
DEMO_PLAYER_STEAM_ID=
|
||||
# The rig's sidecar web API (rust-oxide's last allocation) and its web token: the
|
||||
# RUSTLINK_WEB_TOKEN in the rig's startup command, or rust-link/sidecar.toml.
|
||||
DEMO_RIG_SIDECAR_URL=http://192.168.0.12:21004
|
||||
DEMO_RIG_SIDECAR_TOKEN=
|
||||
Reference in New Issue
Block a user