Files
akyldash/docs/operations/DEPLOYMENT.md
T

5.0 KiB

Deployment

Status and authorization

The implementation in PR #59 is not merged, installed, or exercised against the VPS. No release, backup, restore, or production service operation has been performed by this change. Production deployment remains blocked until the owner has verified host state, registry access, protected configuration, corpus/index readiness, RU/KY canaries, an external backup, and restore on a separate target. See current state and the owner evidence packet.

The existing codex account has no Docker socket access and receives no new privilege in this change. The external receiver requires an owner-controlled SSH entry that runs the fixed root command; no SSH key, authorized_keys entry, sudo rule, or root alias is created here. If akyldash_vps logs in as codex, it cannot run the root-only receiver and the client fails closed. Do not grant general sudo or Docker access to make the flow work.

Release verification and image publication

.gitea/workflows/ci.yaml remains the required test and image-build workflow. The release workflow runs after successful main CI, verifies the source run and commit, and publishes digest-pinned images plus a small release descriptor. The descriptor records both the release workflow run ID and the successful CI source run ID. PR builds do not publish images. Production runtime secrets are not supplied to CI.

On the host, the fixed root receiver uses the installed gitea-api helper to re-fetch and verify the exact successful CI and release runs, current main, artifact name, checksum, manifest schema, builder pin, image policy, and commit binding. Its binary DOWNLOAD extension accepts HTTPS and at most one allowlisted HTTPS redirect, does not forward the token across origins, bounds the response, and refuses to overwrite an existing file. The installer checks the exact audited helper fixture hash before applying its patch. The helper and source code are not installed on the VPS by this PR.

External backup and cutover

The fixed root release receiver accepts only a bounded protocol request over stdin. It does not accept a remote shell command, artifact path, or image reference from the caller. It rechecks the release and current main, takes a shared lock, captures running image IDs, and stops the stack. It streams the cold archive directly to the owner's Windows client at D:\Dev\akyldash\.backups; the VPS does not hold a full archive, including temporarily. The Windows client requires a real NTFS destination with private ACLs and a precise local Git exclude rule. It publishes only after hash, archive, and manifest verification, and acknowledges the exact live session nonce and backup identity.

Only after the acknowledgement does the host pull approved digest references, atomically replace both image refs, and start Compose with --no-build. It checks running image IDs, /review, and non-empty Russian and Kyrgyz search canaries. A stale main, source mismatch, invalid archive, image mismatch, or failed health/canary check stops cutover and attempts recovery using the pre-change references. A recovery journal blocks another operation if automatic recovery cannot be verified.

Rollback uses the root-pinned prior external archive and creates a fresh external backup of current state before switching refs. It restores images only, not data. Old local VPS backup paths and legacy release states without a pinned external backup identity are rejected. See backup and restore and rollback.

Owner bootstrap still required

After review and merge, the owner must decide whether to install the helper from a root-owned checkout and provision, without exposing values in logs:

  • a read-only Gitea API token in /etc/akyldash/gitea-api-token, root-owned mode 0600;
  • the exact artifact redirect origin allowlist in /etc/akyldash/gitea-download-origins, if the Gitea artifact endpoint redirects;
  • approved Russian and Kyrgyz search canaries in /etc/akyldash/release-canaries.json, root-owned mode 0600;
  • a root-only SSH path to /usr/local/sbin/akyldash-release-deploy and /usr/local/sbin/akyldash-release-rollback using the existing owner key and verified host key.

The installer intentionally does not create credentials, SSH entries, canary values, registry permissions, or a new privilege rule. Existing files with unexpected owner, mode, or content cause installation to stop for owner review. Do not run the installer or receiver from CI. The owner's first use must be a separate-target restore check and a reviewed dry run; this PR does not authorize a production cutover.

The Windows client uses the existing OpenSSH host-key checking. Its configured alias must reach a root-controlled endpoint capable of invoking the fixed receiver; no new key or sudo permission is requested. Windows ACL and NTFS checks, SSH host configuration, artifact redirect origin, registry pull access, and every production health gate remain unverified until the owner checks them.