From b82a2ca1b3da9b02f24a8aa41c5fec423d407ce8 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 27 May 2026 12:56:34 +0200 Subject: [PATCH] config: hoist forge URL out of templates + add nginx deploy snippet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses two review notes on PR #1: **argus ๐Ÿ”ด**: hardcoded `http://localhost:3000/hyperhive/hyperhive` is meaningless to a public visitor at hyperhive.darkest.space. Moved to `[extra] forge_url` in config.toml so it's swappable without touching templates. Both consumer sites now reference `{{ config.extra.forge_url }}`: - `templates/base.html` โ€” footer "code on the forge" link - `templates/index.html` โ€” hero CTA button Default value points at the operator's current public mirror (`git.berlin.ccc.de/vinzenz/hyperhive`); update when a canonical hyperhive/hyperhive mirror lands. **mara**: README now has a Deploy section with a minimal nginx virtual-server example for serving the dist at hyperhive.darkest.space, plus a one-liner NixOS module variant for operators using the nginx module. Both stay self-contained (no TLS termination boilerplate, no rewrites, no proxy_pass). --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++ config.toml | 6 ++++++ templates/base.html | 2 +- templates/index.html | 2 +- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7150a3f..ca87fbb 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,55 @@ static/ flake.nix # `nix build` โ†’ site dist, `nix develop` โ†’ zola shell ``` +## Deploy + +The build output is a plain `public/` directory of static files โ€” +drop it under any HTTP server's docroot. nginx vhost example for +serving it at `hyperhive.darkest.space`: + +```nginx +server { + listen 80; + listen [::]:80; + server_name hyperhive.darkest.space; + + # If you've got TLS in front, the usual `return 301 + # https://$host$request_uri;` redirect goes here and the + # listen lines move to a sibling server { listen 443 ssl โ€ฆ; } + # block. Keeping this snippet minimal โ€” plain HTTP on a + # cert-managed host is the smallest working config. + + # Point at wherever `nix build .#website && cp -r result/. โ€ฆ` + # lands. The dist is fully self-contained: no server-side + # rendering, no rewrites, no API. + root /var/www/hyperhive-website; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + + # 7-day cache on the immutable assets (SVG, CSS, fonts). + # `nix build` produces a fresh path each rebuild, so caching + # is safe โ€” operator can just `mv -T result-new /var/www/โ€ฆ` + # to swap, no cache-busting hashes needed. + location ~* \.(svg|css|js|woff2|png|ico)$ { + expires 7d; + add_header Cache-Control "public, immutable"; + } +} +``` + +If you're running NixOS, the equivalent module config is: + +```nix +services.nginx.virtualHosts."hyperhive.darkest.space" = { + enableACME = true; + forceSSL = true; + root = "${pkgs.callPackage ./website {}}"; # or nix build path +}; +``` + ## Theme Catppuccin Mocha palette + the hyperhive amber from the swarm's diff --git a/config.toml b/config.toml index ec11b5a..ebf33a4 100644 --- a/config.toml +++ b/config.toml @@ -32,3 +32,9 @@ smart_punctuation = true # theme intent is reviewable in one place. palette = "catppuccin-mocha" accent = "amber" + +# Public-facing forge URL โ€” surfaced in templates via +# `{{ config.extra.forge_url }}`. Update this when the canonical +# public hyperhive mirror lands; the current value is the operator's +# berlin.ccc.de instance (per the project README at that mirror). +forge_url = "https://git.berlin.ccc.de/vinzenz/hyperhive" diff --git a/templates/base.html b/templates/base.html index e9bce4d..b86e4af 100644 --- a/templates/base.html +++ b/templates/base.html @@ -25,7 +25,7 @@