3.2 KiB
3.2 KiB
Pi inventory notes (input for Infrastructure Design, U2)
Source: relayed by session "CMS & API" from session "Pi-Main - Server" (read-only inventory, no sudo, facts not verified by this session). Full write-up in the website repo: AndreaSlopFotografie-cms-api-foundation/aidlc-docs/features/cms-api-foundation/construction/cms-host/pi-inventory.md. Status: UNVERIFIED INPUT, to be checked against .gitea/workflows/deploy-scp.yaml and confirmed by Bryan.
Relayed decision (pending Bryan's confirmation in this session)
- The test instance takes over hostname
test.andreaslop.nl. Verify first on the Pi via the app port; Bryan then switches the route on the proxy Pi to the new port. nginx on the app Pi stays as fallback.
Pattern to copy (SlpSoftware test)
- User
gitea-workflow;~/apps/<name>/test/{releases,current,shared};shared/env(mode 600);shared/wwwroot-websymlink to/mnt/storage1/www/html/.... - systemd USER unit:
WorkingDirectory=current,ExecStart=dotnet ...dll,EnvironmentFile=shared/env,Restart=on-failure,KillSignal=SIGINT. - Deploy: appleboy/drone-scp over SSH port 2224 as
gitea-workflow; DB backup script before/after release.
Network and resources
- Free ports: 5200 (test), 5201 (production, later). ufw rule needed, allow only from proxy Pi 192.168.1.102. Taken: 5100/5101, 5150/5151, 5000, 3000, 3001, 3306, 80, 2224.
- Proxy Pi (TLS, certbot) forwards DIRECTLY to the app port over HTTP/1.0, bypassing nginx on the app Pi. The host must therefore provide gzip, security headers, canonical 301s and a real 404 itself, and
UseHttpsRedirection/ forwarded headers must be handled as SlpSoftware does (open point 2 in requirements). - Pi 4, about 5.4 GiB free RAM; one more .NET process (~250-300 MB) fits. Uploads/photos on
/mnt/storage1; releases on the SD card. - ARM64 builds must require runner label
arm64orlinux-arm64(the PC runner is x64).
Database
- MariaDB 10.11 on localhost. Convention: PascalCase DB named after the app, user = app name @localhost. Suggested by Pi-Main:
AndreaSlopTest/AndreaSlopCms@localhost. SUPERSEDED by relayed naming decision: databaseAndreaSlopFotografieTest, userAndreaSlopFotografie@localhost (reason: the CMS is part of the website; the company is AndreaSlopFotografie). Confirmed by Bryan with approval of requirements. Existing DBandreaslopis WordPress: do not confuse. Bryan creates DB and user with sudo; the Pi-Main session adds the new DB to the backup script.
Open design option (include both variants in Infrastructure Design)
- Variant 1: the website CI delivers files into
wwwroot/webdirectly. - Variant 2:
shared/wwwroot-websymlinks to/mnt/storage1/www/html/andreaslop-test, the folder the existing static web deploy already writes to, so the current web deploy keeps working and the CMS host serves those files. Implication for design: the known-page set must refresh when files change in place (requirements open point 1).
Manual steps for Bryan (to be finalised in the design)
User unit, env file, database and user, ufw rule, proxy-Pi server block/route switch, Gitea secrets in the CMS repo, backup script entry. The Pi-Main session can draft exact commands once the list is final (ask via "CMS & API").