feat(home): add herdr user service + herdr.zeroq.su vhost
Per-UID design of herdr (Unix sockets, no HTTP) drove the home-manager
choice over a NixOS module — mirrors the existing opencode-web pattern.
- home/modules/herdr.nix: new systemd user service running
herdr 0.9.3 on sapphira, --session herdr-prod,
EnvironmentFile from sops opencode_server. 2G/4G cgroup caps,
Restart=always (mitigates herdr#4920).
- modules/server/nginx.nix: herdr.zeroq.su vhost with Authelia
forward-auth (wildcard *.zeroq.su policy already covers it).
Upstream 127.0.0.1:7317 is the Bun server from the
devswha/herdr-web-ui plugin (970star, MIT) — vhost 502s until
'herdr plugin install devswha/herdr-web-ui' runs.
- modules/server/coredns.nix: 192.168.1.20 herdr.zeroq.su A record.
- home/server.nix: import the new module.
This commit is contained in:
1 parent
13a86dfc9d
commit
5c6c28f380
4 files changed
+168
No files matched your search
@@ -16,6 +16,7 @@
|
||||
192.168.1.20 flux.zeroq.su
|
||||
192.168.1.20 git.zeroq.su
|
||||
192.168.1.20 glances.zeroq.su
|
||||
192.168.1.20 herdr.zeroq.su
|
||||
192.168.1.20 homebox.zeroq.su
|
||||
192.168.1.20 immich.zeroq.su
|
||||
192.168.1.20 kuma.zeroq.su
|
||||
|
||||
@@ -228,6 +228,58 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
# herdr.zeroq.su — web UI for the herdr orchestrator (devswha/herdr-web-ui,
|
||||
# MIT, 970★). herdr itself has no HTTP surface (only JSON-RPC over a
|
||||
# per-UID Unix socket; see home/modules/herdr.nix for the design
|
||||
# context). The webui is provided by the `devswha/herdr-web-ui` herdr
|
||||
# plugin, which spawns a Bun-based HTTP+WebSocket server on
|
||||
# 127.0.0.1:7317 as a herdr startup hook. Without the plugin installed
|
||||
# this vhost 502s; the plugin install is `herdr plugin install
|
||||
# devswha/herdr-web-ui` (one shot, then the plugin's update mechanism
|
||||
# takes over; the user is expected to handle it — see
|
||||
# https://herdrweb.dev/ for the install guide and Tailscale pairing).
|
||||
# Same auth_request / 401→302 wiring as vtimeline/tty below — the
|
||||
# wildcard rule `*.zeroq.su` in modules/server/authelia.nix already
|
||||
# covers this subdomain under `one_factor`, so no policy change is
|
||||
# needed.
|
||||
"herdr.zeroq.su" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:7317";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
auth_request /authelia;
|
||||
auth_request_set $authelia_user $upstream_http_remote_user;
|
||||
# Same 401→302 trick as vtimeline/tty: a bare 302 from
|
||||
# Authelia surfaces to the client as a 500 ("auth request
|
||||
# unexpected status"), so we rewrite the response status to
|
||||
# a 302 pointing at the authelia login UI with an absolute
|
||||
# `$scheme://$host$request_uri` so the post-login `rd`
|
||||
# lands the user back on herdr.zeroq.su, not on
|
||||
# authelia.zeroq.su/<path>.
|
||||
error_page 401 =302 https://authelia.zeroq.su/?rd=$scheme://$host$request_uri;
|
||||
'';
|
||||
};
|
||||
"= /authelia" = {
|
||||
extraConfig = ''
|
||||
internal;
|
||||
proxy_pass http://127.0.0.1:9091/api/authz/forward-auth;
|
||||
proxy_set_header X-Original-URL $request_uri;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Method $request_method;
|
||||
proxy_set_header X-Forwarded-Uri $request_uri;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
# Same Accept-forces-401 trick as vtimeline.zeroq.su — see
|
||||
# the comment there for why Authelia's default 302 is
|
||||
# harmful here.
|
||||
proxy_set_header Accept "application/json";
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# Authelia login UI — same podman container on 127.0.0.1:9091 as the
|
||||
# forward-auth endpoint above, just exposed on a separate vhost so
|
||||
# Authelia has a stable absolute URL to redirect users to. Authelia
|
||||
|
||||
Reference in new issue
Block a user