PlotDirector.Website/Docs/Publishing.md

8.3 KiB

Independent website publishing

Development runs on Atlas as plotdirector-website-dev, identity plotdirector-website, port 5051. Actual LAN URL: http://192.168.10.10:5051/ (or http://atlas:5051/ where Atlas resolves). Atlas UFW permits port 5051 only from 192.168.10.0/24; reachability was verified from the existing reverse-proxy host as well as Atlas. Application Development remains https://dev.plotdirector.com/, port 5050, identity/service unchanged. An optional public HTTPS edge template is prepared at Tools/Deployment/production/nginx-development.conf; DNS, TLS and edge administrator installation are required before https://website-dev.plotdirector.com exists.

Start independent Codex sessions:

cd /srv/repos/PlotDirector.Website && codex
cd /srv/repos/PlotDirector && codex

Build: dotnet build PlotDirector.Website.slnx. HTTP qualification: python3 Tests/verify.py --origin http://127.0.0.1:5051. Browser qualification: npm ci && WEBSITE_ORIGIN=http://127.0.0.1:5051 npm run test:browser. Browser installation: npx playwright install chromium, only if missing. Deployment-security qualification: python3 Tests/test_deployment.py. Build and regression gates run serially. Website has no application project reference.

Atlas setup (one time)

sudo -n bash Tools/Deployment/provision-development.sh installs the fixed website profile. It refuses an existing target; maintenance requires explicit review and administrator installation, rather than trusting files from a submitted release. Independent signing material lives in ~/.local/share/plotdirector-website-development/signing/, private key 0600/parent 0700. Install approved help as described in Content.md before activation.

Development release

Use a clean committed checkout and unique release identifier/output directory:

python3 Tools/Deployment/website_release.py prepare \
 --source /srv/repos/PlotDirector.Website \
 --output /home/nick/.local/share/plotdirector-website-development/releases/RELEASE-ID \
 --release-id RELEASE-ID \
 --signing-key /home/nick/.local/share/plotdirector-website-development/signing/private.pem \
 --public-key /home/nick/.local/share/plotdirector-website-development/signing/public.pem
sg plotdirector-website-deploy -c 'cp -R /home/nick/.local/share/plotdirector-website-development/releases/RELEASE-ID /opt/plotdirector-website-dev/incoming/RELEASE-ID'
sudo -n /usr/local/sbin/deploy-plotdirector-website-development validate RELEASE-ID
sudo -n /usr/local/sbin/deploy-plotdirector-website-development activate RELEASE-ID

Use sg ... -c 'sudo ...' when group membership is not yet active. Keep incoming packages for explicit rollback. Preparation retains existing Zstandard level 6/four workers/frame checksum and Ed25519 authorization plus transport signatures. The vendored transport verifier checks signatures and compressed checksums before bounded decoding, then checks every extracted file and the exact manifest/product identity. Website manifests contain no SQL; this helper never invokes a database worker.

The root-owned helper locks its own target, snapshots/verifies untrusted input, installs immutable files, atomically switches current, restarts only its own service, and checks health/product/source identity plus the homepage, pricing, help, solver and sitemap through bounded, non-redirecting loopback smoke requests. Failures record receipts and, after a failed switch with a previous release, restore that previous website. No SQL rollback is involved. Receipts: /opt/plotdirector-website-dev/receipts/*.json; current marker active-deployment.json; releases under releases/RELEASE-ID/app. Signing is separate from activation, and neither runtime nor transfer group can replace the trusted helper.

Restart/logs: sudo systemctl restart plotdirector-website-dev and journalctl -u plotdirector-website-dev. Neither command touches the application.

Explicit independent website rollback:

sudo -n /usr/local/sbin/deploy-plotdirector-website-development rollback PREVIOUS-RELEASE-ID

This re-verifies the retained signed package and retained files before switching, and writes a new rollback receipt. It does not roll back shared help; select its prior approved content publication independently if necessary.

Production (live after owner-approved cutover)

Current application origin is https://app.plotdirector.com; website is https://plotdirector.com. Qualified website source 681edbd4c3d9dd53a59469b443848f8a71a870b6 is live as website-production-separation-20261127-v4, receipt f3771060-6105-40fc-94dc-6fc06ad801ee. Use v4 or later compatible releases as the website rollback floor.

Templates are in Tools/Deployment/production. Production preparation must use a separate signing key and deployment SSH identity. The website uses port 5004, service plotdirector-website, /srv/plotdirector-website, independent trust/configuration /etc/plotdirector-website-production. Ports 5002/5003 and unrelated sites are untouched. The fixed Production profile refuses non-web1 hosts and any other root/service/endpoint.

An administrator must install the helper/vendor modules and SSH dispatcher root-owned under /usr/local/lib/plotdirector-website-deployment, plus the fixed launcher under /usr/local/sbin/deploy-plotdirector-website-production. Install the target/public key, service/env, sshd Match and sudoers from the reviewed templates. Runtime and transfer identities are separate locked system users, with no sudo/adm/docker membership. See the application's Docs/Separation/Cutover.md for exact directory permissions, preflight, backups, Nginx/TLS and activation order. Do not change Production without owner approval. No administrative key is currently required for Development work.

Prepare with the same website_release.py prepare command using Production signing material. Transfer independently:

python3 Tools/Deployment/transfer.py /absolute/qualified-bundle \
 --identity /home/nick/.ssh/plotdirector-website-production

Restricted SSH commands on plotdirector-website-deploy@85.190.124.132: validate RELEASE-ID, activate RELEASE-ID, rollback PREVIOUS-ID, receipt UUID. Use the application's documented pinned SSH options and verified web1 host key. Preparation/transfer/validation do not authorize activation. Retain receipts/releases.

The application's independent Development/Production commands remain documented in /srv/repos/PlotDirector/Docs/Codex/Deployment.md and Docs/Deployment/Production.md. Website publication never invokes those commands and never deploys application SQL.

Actual independent Production signing key: /home/nick/.local/share/plotdirector-website-production/signing/private.pem (public key alongside it). SSH identity: /home/nick/.ssh/plotdirector-website-production. Private signing key remains on Atlas; only its public key is installed on web1. The forced account accepts upload/validate/activate/rollback/receipt, rejects shells, and cannot change its helper or application configuration. Routine code publishing requires no administrator access. Content-store publication remains separately protected.

The installed helper accepts only bounded receiver telemetry in addition to signed bundle members; that telemetry is untrusted and never authorizes payloads. Cold-page smokes allow 15 seconds, while health requests remain bounded to three seconds. Nginx forwards only PlotDirectorWebsiteAntiforgery and PlotDirectorWebsiteSolverResult cookies to this process. Keep this allowlist aligned with any deliberately added public cookie. Never forward application authentication cookies or share cookie domains.

Post-cutover validation through the legacy compatibility edge:

python3 Tests/verify.py --origin https://plotdirector.com --production --legacy-application-bridge
WEBSITE_ORIGIN=https://plotdirector.com APPLICATION_ORIGIN=https://app.plotdirector.com npm run test:browser

Standalone website validation omits --legacy-application-bridge; it then requires application hubs to be absent. The real edge intentionally proxies those protected legacy endpoints and must return an authentication denial instead of website content. See the application Docs/Deployment/ProductionSeparation-20261127.md for consolidated verification, exact Production pricing provenance, preserved help publication and recovery.