Runbook — External Docs Portal (docs.opengov.systems)
Summary
The external docs portal publishes operator, administrator, integrator, and security documentation at https://docs.opengov.systems. It runs as a standalone static web application on Coolify, separate from the opengov runtime image. A merge to main that edits allowlisted documentation triggers a rebuild and polls /version.txt until the new content serves live.
How the Build Works
| File | Role |
|---|---|
docs/portal/manifest.yaml | Explicit allowlist of external pages, sections, and metadata. |
scripts/docs/generate_reference_docs.py | Generates four code-owned reference pages under docs/reference/_generated/. |
scripts/docs/stage_portal_content.py | Stages allowlisted Markdown, strips internal markers, and rewrites links. |
scripts/docs/check_docs_portal.py | Checks manifest rules, links, anchors, redaction denylist, and L-8 compliance. |
deploy/docs-site/Dockerfile | Builds Hugo and Pagefind assets and serves them via nginx-unprivileged. |
deploy/docs-site/nginx.conf | Serves static assets on port 8080 with strict security headers. |
deploy/docs-site/40-docs-password.sh | Enables optional HTTP basic auth when DOCS_SITE_PASSWORD is non-empty. |
deploy/docs-site/digest.sh | Computes deterministic SHA-256 digests for staged and site trees. |
scripts/docs_site_deploy.sh | Queues a Coolify deploy and polls /version.txt until digests match. |
.github/workflows/docs-site.yml | Runs scripts/docs_site_deploy.sh on main when portal sources change. |
version.txt holds two lines: staged <sha256> and site <sha256>. The deploy script stages the checkout into a temporary directory and computes the same two digests before polling Coolify. This workflow never writes the sandbox deploy-window marker.
Local Preview and Checks
- Run
make docs-generateto refresh generated reference pages. - Run
make docs-checkto test the manifest, links, and redaction rules. - Run
make docs-serveto stage content and starthugo serverlocally on port 1313.
One-Time Coolify Setup
The host administrator configures the Coolify application once:
- Open Coolify and create a new application from the OpenGov repository on branch
main. - Set the build pack to Dockerfile and the base directory to
/. - Set the Dockerfile location to
/deploy/docs-site/Dockerfile. - Set the container port to
8080and the domain tohttps://docs.opengov.systems. - Set the health check path to
/version.txt. - Leave automatic deploy on push disabled.
- Leave
DOCS_SITE_PASSWORDempty for public access, or set a password for preview gating. - Deploy the application once from the Coolify console.
- Save the application UUID in the GitHub repository variable
COOLIFY_DOCS_APP_UUID.
Verifying a Live Deploy
Run these three checks against the deployed host:
- Check
/version.txtreturns HTTP 200 withstagedandsiteSHA-256 digests. - Check the
Content-Security-Policyheader includesscript-src 'self' 'wasm-unsafe-eval'. - Open the homepage in a browser and search with the search box to test Pagefind WebAssembly loading.
Troubleshooting
- If
stage_portal_content.pyfails on markers, check `` pairs in the named source file. - If
check_docs_portal.pyfails on a denylist term, wrap internal notes in strip markers or replace placeholders. - If
docs_site_deploy.shtimes out waiting for/version.txt, inspect the Coolify build log for checksum or stage errors.