Add a static-site host layer #58
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!58
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/static-site-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds a reusable static-site host layer on the existing public-host base: consumers provide a hostname and store-backed built directory, while archetypes provides a Zola builder and shared content checks. The publicHost base still exclusively owns Caddy/ACME, SSH, fail2ban, and the firewall; no machine or service builder is added.
./check.shpasses all 31 steps ate6a3ee4, including a first-boot VM that compares served bytes to the build and logs in on port 22022 while 22 stays closed. Rollback is a straight revert; these commits create no persistent or deployed state.Shape
nixosModules.staticSite, which importspublicHostand contributes one directory-backed Caddy virtual host.siteRootuses the normalized in-store path type and separately requires string context, while a system build scans any caller-supplied root for escaping symlinks and fails closed if the root is absent or unenumerable.lib.buildZolaSite { pkgs, websiteSrc }, retaining the source-tree symlink refusal from the parts bin.Risk
R3 — this touches public web serving, administrative authentication composition, and the symlink boundary that prevents a public web root from exposing host files. It does not deploy a host or mutate persistent state.
Independent review
ea88281; both are repaired ine6a3ee4with explicit regression witnesses.origin/master...e6a3ee4, reproduced the former traversal bypass, verified both repairs against pinned nixpkgs and built checks, and reported no blocker remaining.Validation
./check.sh— all 31 enumerated steps passed ate6a3ee4.nix build -L .#checks.x86_64-linux.site-content— sabotage and control suite passed.nix build -L .#checks.x86_64-linux.static-site— first-boot serving and SSH VM passed.Refs allod/archetypes#55
Refs allod/archetypes#56
Refs allod/archetypes#57
Independent adversarial review requested after opening: Claude Opus 5 at xhigh effort reviewed
origin/master...ea88281read-only.It found two high-severity paths that need repair before merge: the finished-tree scanner accepts a nonexistent/un-enumerable root because the process-substitution
findstatus is lost, and thesiteRootprefix/context assertions accept both..traversal and context borrowed from an unrelated derivation. Together those can leave Caddy rooted outside the intended store tree while the build stays green.It also found that the static-site composition is not pinned against acquiring machine-wide firewall/SSH ownership, the module check is pinned only by derivation name rather than generated command, and the directory-without-index and writable-tree scanner rules have no sabotage fixtures. I am verifying these against the pinned nixpkgs and will amend the PR for every confirmed finding, then rerun
./check.sh.Follow-up on the independent review above: every confirmed finding is repaired in
e6a3ee4.siteRootnow uses nixpkgspathInStore, which normalizes and rejects store-prefixed..traversal; the separate string-context assertion remains.findfailures instead of losing them through process substitution.ssexists before checking port 22../check.shpassed all 31 steps ate6a3ee4. A second independent pass with Claude Fable 5 at xhigh reproduced the old traversal weakness against the former implementation, verified the repairs against the pinned nixpkgs and built checks, and concluded: No blocker remains. Its remaining notes were low residual test-depth observations, not defects.