From 143cb534dcb5ceb05a04552e4e2a05f04df1c850 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sat, 14 Nov 2026 20:58:58 +0100 Subject: [PATCH] design: retag gm-key service user as owner-delegated (#13) Co-Authored-By: Claude Haiku 5.5 --- docs/DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 984fec6..6028abd 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -660,7 +660,7 @@ Principles carried from the prototype: the checker must be independent of the co ### 11.1 Deployment on NixOS [PROPOSED] - **Service** [FIXED, Q20; research: `docs/research/q20-nix-packaging.md`]: NixOS module `services.fffVtt` in `nix/module.nix`, defining: package from `nix/package.nix` (`buildNimPackage`; dependencies from committed `nix/lock.json` generated by `nim_lk`; mummy tag `0.4.8`; nixpkgs input pinned to match devbox Nim 2.2.12; fallback: vendored deps via `nimFlags --path:`), a systemd unit, state dir, options for `publicOrigin`, `port`. Imported from the owner's server NixOS config, like `foundryvtt.nix`. - Unit hardening: `DynamicUser` or dedicated user, `StateDirectory=fff-vtt`, `ProtectSystem=strict`, `ProtectHome`, `NoNewPrivileges`, `PrivateTmp`, `RestrictAddressFamilies=AF_INET AF_INET6`, `MemoryMax`. Add `AF_UNIX` only if the FFF sidecar (section 9, option b) is chosen; revisit at Q19. Listen on `127.0.0.1:` only [MEASURED prototype binds 127.0.0.1]. - - `fff-vtt gm-key` (3.2) must run as the service user (e.g. `sudo -u fff-vtt gm-key`, or a wrapper in the module), so the DB and its WAL files stay owned by that user; with `DynamicUser` the module needs a fixed user name or a wrapper. [FIXED, owner decision 2026-11-14, #13] + - `fff-vtt gm-key` (3.2) must run as the service user (e.g. `sudo -u fff-vtt gm-key`, or a wrapper in the module), so the DB and its WAL files stay owned by that user; with `DynamicUser` the module needs a fixed user name or a wrapper. [FIXED, owner-delegated, 2026-11-14, #13] - `Restart=on-failure`; `TimeoutStopSec` short; SIGTERM handler flushes (4.4). - **Client build**: Vite `dist/` produced by Nix (or CI), served by nginx from the store path. Hashed assets, long cache; `index.html` no-cache. - **nginx** (shape of the vhost, adapt to the existing server config; reference only, I did not read the owner's NixOS repo for this doc):