# Deployment Architecture - andreaslop-client (U2, test) ## Runtime topology ```mermaid flowchart LR V["Visitor / Andrea"] --> P["Proxy Pi 192.168.1.102 (TLS, certbot)"] P -- "HTTP/1.0 + X-Forwarded-For/-Proto :5200" --> A["App Pi: ufw 5200 only from proxy"] A --> H["andreaslopfotografie-test.service (.NET host)"] H --> D[("MariaDB AndreaSlopFotografieTest")] H --> W["shared/wwwroot-web -> /mnt/storage1/www/html/andreaslop-test"] WS["Website repo deploy"] --> W H -. "/sentry-tunnel" .-> S["Sentry (website project)"] N["nginx on app Pi (fallback, old route)"] classDef user fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; classDef net fill:#d6bcfa,stroke:#553c9a,stroke-width:1px,color:#000; classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; class V user; class P,A,N net; class H app; class D,W,WS,S data; ``` Text alternative: visitors reach the proxy Pi, which forwards to the host on port 5200 with the client address in headers; the host reads the database and the website files (a symlinked folder that the website repo's own deploy writes), and forwards browser error reports to Sentry. The old nginx route remains as a fallback. ## Deploy sequence (CI, automatic on push to master or via the manual box, only when `ASF_TEST_DEPLOY_ENABLED=true`) ```mermaid sequenceDiagram box rgba(214,188,250,0.4) CI participant G as Gitea runner end box rgba(99,179,237,0.4) App Pi participant R as releases/ts participant S as shared participant U as systemd user unit end G->>G: build admin (VITE_THEME=asf, nl), publish linux-arm64 G->>R: scp release to releases/ts G->>S: mkdir -p shared/wwwroot-web (symlink already exists) G->>R: wwwroot/web -> ../../../shared/wwwroot-web G->>U: ln -sfn current, restart unit G->>G: curl https://test.andreaslop.nl/health (10 tries) G->>R: prune to current + 1 previous ``` Text alternative: build, upload to a timestamped release, link the persistent website folder, switch `current` atomically, restart, check `/health` through the public URL, prune old releases. ## Rollback `ln -sfn releases/ current && systemctl --user restart andreaslopfotografie-test`; the previous release is always kept. Route rollback: restore the saved nginx block on the proxy Pi (see the manual steps).