First real commit of site/. Until now outreach/.git tracked exactly one file
(README.md) and every content pack stamped git_sha=5619a40 regardless of what it
shipped — a signature with no provenance behind it. The site had no witness, which
is why a deploy could erase two sessions of work with nothing to diff against and
nothing to restore from.
Tracked here (authored): site/content, site/config, site/i18n, site/public/images,
justfile, scripts/, .just/, run*.sh, rustelo.manifest.toml.
Ignored (reproducible, or secret):
.k, .env real keys — outreach mirrors to a PUBLIC remote
site/r, site/public/r content indexes, rebuilt by `just content`
provisioning/.content-packs 228 MB of deploy tarballs
cache, data, logs_*.out runtime droppings
Three trees are deliberately NOT ignored despite looking generated, because their
declared source cannot currently reproduce them — ignoring them would delete the
only copy:
site/public/images 196 of 209 images exist nowhere else (assets/site is empty)
site/content/{adr,catalog} projections whose generators are unwired (gen-adr-pages)
site/content/domains or failing (`just graph`)
They become ignorable when an audit proves regeneration is a no-op, not before.
Fixes carried in this import
---------------------------
content: the mirror ran one way and reverted its own work. content_processor writes
site/r, but the recipe ended with `rsync -a site/public/r/ -> site/r/`, so each fresh
index was clobbered by the stale deploy-tree copy: the tool reported "index.json with
69 posts" while the disk kept 58. Meanwhile public/r is the tree the deploy pack ships,
so no new content could ever reach production. The two trees own different files, so
the mirror now runs both ways: content indexes r -> public/r (with --delete, or a
renamed slug survives as a live URL), and the four nu artifacts (about, adr-map,
taglines, content_graph) back public/r -> r, excluded from the outbound leg so stale
copies cannot overwrite the fresh originals.
templates: the assembler has two layers (framework defaults, source-project templates)
but the level chain has three (rustelo -> website-htmx-rustelo -> outreach/site). The
site level had no overlay slot, so its template work had nowhere legitimate to live and
ended up in htmx-templates/ — the one tree `just templates` rm -rf's. That is how the
nav submenus were lost. site/templates-overlay/ is the missing third slot; 214 lines
(nav submenus, subscribe CTA, post engagement block) now live in a declared source and
survive regeneration byte-identical.
adr: projected ADR-059..069 into the content tree. They were written months ago and
never reached the site because gen-adr-pages.nu is wired into no recipe — a generator
outside the dependency chain is a generator that does not run.
Gates added
-----------
templates-check reassembles into a temp tree and asserts an empty diff against the
live one: any drift means htmx-templates/ holds work that exists
live one: any drift means htmx-templates/ holds work that exists
nowhere else and the next run deletes it.
Both gates run before the destructive operation, not after. A check you can only run
afterwards is not a gate, it is an autopsy.
Refs: ADR-062 (projection-not-own-repo: site is a Projection of outreach, not its own
repo — different deploy target is not a different visibility boundary), ADR-048
(materialization), ADR-066 (the check decides, never the reporter — which the content
pipeline, the surface that publishes ontoref, was the last place not to honour).
42 lines
2.4 KiB
Bash
Executable file
42 lines
2.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
lsof -ti:3030 | xargs kill -9 2>/dev/null || true
|
|
|
|
# Secrets (SMTP creds, CRYPTO_KEY, …) are provided as ENV by the deploy/provisioning
|
|
# layer (SOPS-decrypted at run time — e.g. `sops exec-env`), not from a plaintext
|
|
# file here. email.ncl reads ${SMTP_*}/${EMAIL_FROM} from that injected env.
|
|
|
|
# Only export what the server genuinely needs from here. NICKEL_IMPORT_PATH and
|
|
# SITE_CONFIG_PATH are intentionally LEFT to the binary's built-in defaults
|
|
# (which resolve site/contracts.ncl from ~/.local/share/rustelo/nickel) —
|
|
# exporting a relative path here broke NCL contract resolution.
|
|
export DATABASE_URL="${DATABASE_URL:-sqlite:data/dev.db}"
|
|
# Templates from the local runtime tree so .j2 edits need no cargo rebuild.
|
|
export HTMX_TEMPLATE_PATH="${HTMX_TEMPLATE_PATH:-htmx-templates}"
|
|
# Canonical public origin — feeds SEO canonical/OG URLs (seo::site_base_url).
|
|
# Without it the head falls back to http://127.0.0.1:3030.
|
|
export SITE_BASE_URL="${SITE_BASE_URL:-https://ontoref.dev}"
|
|
export SITE_NAME="${SITE_NAME:-ontoref}"
|
|
# Logo is config-driven: site/config/site.ncl [logo]. No env needed.
|
|
|
|
# ── Email delivery (post comments + contact form) ──────────────────────────
|
|
# Owner inbox for new post comments and contact-form submissions. Change to your
|
|
# real address. Delivery also needs email.enabled=true in site/config/email.ncl
|
|
# (provider=console logs to stdout in dev; set provider=smtp + creds for real send).
|
|
export POST_MESSAGE_RECIPIENT="${POST_MESSAGE_RECIPIENT:-jpl@jesusperez.pro}"
|
|
export CONTACT_RECIPIENT="${CONTACT_RECIPIENT:-$POST_MESSAGE_RECIPIENT}"
|
|
export EMAIL_FROM="${EMAIL_FROM:-noreply@ontoref.dev}"
|
|
export EMAIL_FROM_NAME="${EMAIL_FROM_NAME:-$SITE_NAME}"
|
|
|
|
# Quiet noisy framework tracing (these are informational logs the framework emits at
|
|
# WARN, not real problems): per-request routing conversions (🔄/🔍/✅), the category
|
|
# filter-index fallback ("using empty meta config"), NATS-not-configured, and the
|
|
# missing rustelo/migrations dir. Genuine warnings/errors (incl. RBAC audit) still show.
|
|
# Override by exporting RUST_LOG yourself before running.
|
|
export RUST_LOG="${RUST_LOG:-warn,rustelo_core_lib::routing=error,rustelo_core_lib::categories::cache=error,rustelo_server::nats=error,rustelo_server::migrations=error}"
|
|
|
|
exec rustelo-htmx-server
|