From f3e0233e6bb8d1a3ed4ff418f1121d6364456125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Pe=CC=81rez?= Date: Fri, 17 Jul 2026 01:06:37 +0100 Subject: [PATCH] chore: run scripts --- site/run-secure.sh | 1 + site/run.sh | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/site/run-secure.sh b/site/run-secure.sh index 3941319..32cf988 100755 --- a/site/run-secure.sh +++ b/site/run-secure.sh @@ -11,6 +11,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" +export HTMX_ASSETS_PATH="${HTMX_ASSETS_PATH:-$SCRIPT_DIR/htmx-assets}" SECRETS="${SECRETS:-$SCRIPT_DIR/../../vault/ontoref-site.sops.env}" # Default to the ontoref vault identity; in infra, SOPS_AGE_KEY_FILE points at diff --git a/site/run.sh b/site/run.sh index e123d06..8d4c336 100755 --- a/site/run.sh +++ b/site/run.sh @@ -10,13 +10,23 @@ lsof -ti:3030 | xargs kill -9 2>/dev/null || true # 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. +# Only export what the server genuinely needs from here. SITE_CONFIG_PATH, NICKEL_IMPORT_PATH, +# HTMX_ASSETS_PATH and SITE_SERVER_CONTENT_ROOT are NOT set here on purpose: the `just local-install` +# wrapper at ~/.local/bin/rustelo-htmx-server resolves the site root from $PWD and sets all four +# (each with `: "${VAR:=…}"`, so anything exported here still wins). Setting them here too would +# duplicate that knowledge in a second place, and the two would drift. 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}" +# Routes THIS site owns, merged over the ones embedded in the shared image. The last piece of a +# page that was not yet the consumer's: templates, Fluent and content already were. A route +# declared in the image is served by every site built from it — and needs an image rebuild per +# addition, because routes are embedded at build time. Declared here, a route costs no build. +# +# Requires rustelo_core_lib with `merge_site_routes` (a site route's component must end in `Page`; +# anything else names a compiled component a consumer cannot add, and is refused at startup). +# Unset ⇒ nothing changes, so this is safe to carry before the binary has the capability. +export RUSTELO_SITE_ROUTES="${RUSTELO_SITE_ROUTES:-site/config/routes}" # 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}"