aien-edge
aien-dev/aien-edge
Brought by drakestapleton
GitHub aien-dev/aien-edge#6 (code only)
Apply it
git checkout -b patch-e616af9255d97b88 a6b938f3539397d5874599ba986b692478a207f2 curl -fsSL https://interplane.io/drakestapleton/aien-edge/patches/e616af9255d97b88.patch | git am
Provenance
github-import 1
aien-dev/aien-edge
6
fbffb501cde2f5d3b814c8a578f3e32b299ec3c9
{"kind":"github-import","owner":"aien-dev","repo":"aien-edge","number":6,"url":"https://github.com/aien-dev/aien-edge/pull/6","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:35Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/README.md b/README.md index 647ec0c..b8d6305 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # aien-edge -## Copyright +A small native Rust web server for the AIEN static sites (`www.aienos.com`, `www.drakestapleton.com`). It was built to run on a Raspberry Pi at the network edge so the NVIDIA DGX Spark never faces the internet. -Copyright (c) 2026 Drake Stapleton <aien@aienos.com> and AIEN Contributors. Authored by Drake Stapleton in collaboration with AIEN. +Supports [Aienix](https://github.com/aien-dev/aienix), the core tree of AIEN. This is hosting infrastructure, not part of the core. -A small native Rust edge server for the AIEN static sites (`www.aienos.com`, `www.drakestapleton.com`). It runs on a Raspberry Pi at the network edge so the NVIDIA DGX Spark never faces the internet. +**Status (2026-10-18): not in use.** Both sites are served by GitHub Pages today (their DNS records point at `aien-dev.github.io`), so this server is not serving either of them. The code was written on 2026-09-23. Changes since then are a relicense (2026-10-04), a README correction (2026-10-13) and a security update of the TLS library (2026-10-17). The publish script still builds sites with `npm`, which no longer matches how either site is built (both use Rust generators now), so it would need updating before any redeploy. + +## What it does - **Everything in memory.** Each site is read once at startup (and again on reload). Text-like files of 1 KiB or more are precompressed with brotli (quality 11) and gzip, and every file is hashed for ETags. Requests never touch the disk. - **Automatic HTTPS.** Let's Encrypt certificates through `rustls-acme` (TLS-ALPN-01 on port 443; port 80 only redirects), HTTP/2 and HTTP/1.1. TLS is `rustls`; nothing is hand-rolled. Without a `[tls]` table in the config the server runs plain HTTP only and serves content on the HTTP port (local testing). @@ -28,7 +30,7 @@ VmRSS: 18316 kB (VmHWM 35924 kB) `ab` counts only dropped connections as failed. Check that the output has no `Non-2xx responses` line, or the run measured an error page. -A Pi will be slower than the Spark, and real visitors are bound by the home uplink long before either. +Not measured on a Pi. ## Build and test @@ -48,10 +50,14 @@ sudo mkdir -p /srv/sites/releases sudo systemctl daemon-reload && sudo systemctl enable --now aien-edge ``` -The server exits at startup if a site root is missing or has no `index.html`, and `Restart=always` retries every 2 seconds, so publish the sites soon after the first start. Publish each site from the Spark with `deploy/publish-site.sh <name> <checkout>`: it runs `npm ci` and `npm run build` in the checkout, uploads `dist/` to `/srv/sites/releases/` on the Pi (`EDGE_HOST`, default `edge@10.10.10.2`), repoints `/srv/sites/<name>` and reloads, keeping the last three releases. Keep `production = false` (Let's Encrypt staging) until the certificates issue, then switch to `true` and restart (a reload does not re-read the config). +The server exits at startup if a site root is missing or has no `index.html`, and `Restart=always` retries every 2 seconds, so publish the sites soon after the first start. Publish each site from the Spark with `deploy/publish-site.sh <name> <checkout>`: it runs `npm ci` and `npm run build` in the checkout (see the status note above: the sites no longer build with npm), uploads `dist/` to `/srv/sites/releases/` on the Pi (set `EDGE_HOST` to the Pi's ssh address), repoints `/srv/sites/<name>` and reloads, keeping the last three releases. Keep `production = false` (Let's Encrypt staging) until the certificates issue, then switch to `true` and restart (a reload does not re-read the config). Network: forward TCP 80 and 443 on the router to the Pi only, and point the DNS A records for both apex and `www` hosts at the public IP. The Spark reaches the Pi (over ssh and rsync, on the direct link) only to deploy; aien-edge itself never connects to the Spark. ## License Licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See [LICENSE](LICENSE). Values live in the nonbinding [COVENANT.md](COVENANT.md). + +## Copyright + +Copyright (c) 2026 Drake Stapleton <aien@aienos.com> and AIEN Contributors. Authored by Drake Stapleton in collaboration with AIEN.