Close self-registration workplan with Case A proven and Create account entry implemented; park public registration enablement and identity negatives as CSOC-IN-0001/0002. Complete app-shell workplan with T06 operator runbook (seed, bind, webhook, smoke) and smoke doc updates.
2.3 KiB
2.3 KiB
Space content — Forgejo markdown (read + write path)
See ADR-0002. App DB holds metadata; page bodies are markdown in Forgejo.
Operator runbook (seed, bind, cluster smoke): docs/deploy.md
§ Operator runbook — spaces on app.coulomb.social.
Read (T04)
- Space row has
forgejo_owner,forgejo_repo,default_branch,content_root. - App fetches
{content_root}/index.md(or?page=<slug>→{slug}.md) via Forgejo raw URL. - HTML is sanitized and cached in-process (successes only).
Env (non-secret defaults in settings):
| Variable | Purpose |
|---|---|
FORGEJO_BASE_URL |
default https://forgejo.coulomb.social |
FORGEJO_TOKEN |
optional; needed for private repos |
FORGEJO_WEBHOOK_SECRET |
optional; enables push webhook cache bust |
Write / sync (T05)
Git remains the source of truth. There is no in-app markdown editor in v1.
Operator / author workflow
- Open the space on app.coulomb.social.
- Click Edit in Forgejo (file editor) or View source.
- Commit on the space’s
default_branch(usuallymain). - Click Refresh content on the space page (or rely on webhook below).
Demo seed (public raw, no token):
python manage.py seed_demo_space
# binds demo → coulomb/coulomb-social @ docs/space-fixtures/demo/pages
Webhook (optional, recommended)
So authors do not need to click Refresh after every push:
- Set
FORGEJO_WEBHOOK_SECRETin the app env Secret (not in git). - In Forgejo: repo → Settings → Webhooks → Add webhook → Gitea.
- Target URL:
https://app.coulomb.social/app/spaces/hooks/forgejo/ - HTTP Method: POST, content type JSON.
- Secret: same value as
FORGEJO_WEBHOOK_SECRET(Forgejo signs with HMAC-SHA256). - Trigger: Push events.
Auth accepted by the app:
X-Gitea-Signature: <hex hmac-sha256 of body>(Forgejo default when secret set), orX-Coulomb-Webhook-Secret: <shared secret>
Response JSON: { ok, owner, repo, cache_entries_cleared, spaces_matched }.
Fail closed
- Missing binding → clear UI error, no Bubble fallback.
- Fetch errors → error card; previous cache entry is not used after Refresh.
Related
docs/adr/ADR-0002-space-content-forgejo-markdown.mdpython manage.py seed_demo_space