# Deployment Instructions - ASF test host The pipeline definition already exists in `.gitea/workflows/continuous_integration.yaml` (jobs `config-asf`, `publish-asf-test`, `deploy-asf-test`, reusing `deploy-scp.yaml`); this runbook sequences the one-time Pi work, the first deploy and every later deploy. The exact one-time steps (1-18) are in `construction/andreaslop-client/infrastructure-design/manual-steps-for-bryan.md`; the Pi-Main session drafts the commands from that list. ## 0. Before anything is pushed 1. The vulnerability gate is clean (done: Xml 10.0.14, zod, react-router). Run `dotnet test SlpModularCms.sln` where MariaDB exists, or let CI do it. 2. Decide when to push or merge (done by Bryan; the assistant never pushes unasked). A merge to master with `ASF_TEST_DEPLOY_ENABLED` unset changes nothing for ASF, but does deploy the shared Core change (patched packages, per-client limiters, opt-in forwarded headers) to SlpSoftware test on that push. Watch that first SlpSoftware deploy. ## 1. One-time preparation (manual-steps phase A, nothing live yet) Verify prerequisites, create database/user, directories + symlink `shared/wwwroot-web`, `shared/env`, user unit (enabled, not started), ufw 5200 from 192.168.1.102, DB backup entry, Gitea variables (`DEPLOY_PATH_ASF_TEST`, `SERVICE_NAME_ASF_TEST`, `HEALTH_CHECK_URL_ASF_TEST`, `VITE_SENTRY_DSN_ASF`). Leave `ASF_TEST_DEPLOY_ENABLED` unset. ## 2. Cut over (phase B, accepted short test downtime) Save the current proxy block; verify the three forwarded headers are present; change only `proxy_pass` to `http://192.168.1.103:5200`; test config; reload. Set `ASF_TEST_DEPLOY_ENABLED=true`; push to master or run the workflow manually with "Deploy ASF test". ## 2b. Consequences of the switch being `true` (verified on Gitea, run 606/607) - `vars.ASF_TEST_DEPLOY_ENABLED == 'true'` in a job-level `if:` works on this Gitea (`config-asf` ran with the variable set). - With the variable `true`, **a push or merge to master now deploys ASF test** (besides SlpSoftware test). - The first ASF deploy does **not** need a merge: run "Continuous Integration" manually on the branch `feature/andreaslop-site-hosting` with only "Deploy ASF test" ticked (`deploy-asf-test` accepts any ref on dispatch). A dispatch with all boxes unticked builds and tests only (runs 606/607) and deploys nothing. ## 3. What a deploy does (every time) Build admin (`VITE_THEME=asf`, Dutch default) -> publish linux-arm64 -> upload to `releases/` -> link `wwwroot/web` to `shared/wwwroot-web` -> atomic switch of `current` -> `systemctl --user restart` -> `/health` on the public URL (10 tries) -> prune to current + previous. ## 4. Verify after the first deploy (phase C) `curl -I https://test.andreaslop.nl/` (CSP, HSTS, noindex), an inner page, `/Over-Mij` -> one 301, unknown path -> 404 page, `/robots.txt`, `/health`, `/api/v1/System/capabilities` (no Offerings), admin in Dutch with ASF theme, create the first administrator with the setup token, then remove `Identity__Setup__Token` from `shared/env` and restart the unit. Report forwarded-header observation and optional timing. ## 5. Later deploys Push to master (or manual run). The website itself is delivered by its own repository into `/mnt/storage1/www/html/andreaslop-test`; no host restart is needed.