Harden secret recipes, document Serena/REA caveats, overwrite stale home-manager backups

The Telegram secret recipes no longer depend on openssl (the host does not
install it): they read 16 bytes from /dev/urandom with od and check the
length before anything is encrypted, so a failure cannot store an empty
secret. README, secrets/README.md and the proxy-suite header and warning
agree.

README: Serena's dashboard is started but not opened and listens on
127.0.0.1 only; the nix-ld note for REA now distinguishes standalone npm
executables from .node add-ons; the Serena pin notes mention the
stdenv.isLinux/isDarwin warnings.

home-manager.overwriteBackup = true so a rewritten gtk.css or qt6ct.conf
does not make a later switch fail on an existing .hm-backup.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
This commit is contained in:
Claude committed 2026-10-13 01:43:30 +00:00
1 parent ca224d5e66
commit 9407c0e453
4 files changed
+34 -17

No files matched your search

+7 -3
View File
@@ -23,7 +23,7 @@ switched off, and the build prints a warning that names the missing file.
| File | Content | Used by | Without the file |
| ------------------------ | --------------------------------------- | ------------------------------------------------ | ------------------------------------------ |
| `gitea-runner-token.age` | One line `TOKEN=<registration token>` | `modules/dev/gitea-runner.nix` (`tokenFile`) | The runner "performance" is not configured |
| `tg-ws-proxy-secret.age` | The hex secret (`openssl rand -hex 16`) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off |
| `tg-ws-proxy-secret.age` | The hex secret (32 hex digits) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off |
Both are decrypted to `/run/agenix/<name>` (root, mode `0400`) and read by the
service units. No `.nix` file contains a secret value.
@@ -39,7 +39,9 @@ printf 'TOKEN=%s\n' "$t" | nix run .#secret-from-file -- gitea-runner-token.age
unset t
# Telegram proxy secret: a fresh random value.
openssl rand -hex 16 | tee /dev/stderr | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519
s=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n') && [ "${#s}" -eq 32 ] && echo "$s" >&2 \
&& printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519
unset s
```
The second command also prints the secret once, because the Telegram clients
@@ -55,5 +57,7 @@ new Telegram secret, and store the new values with the commands above. To
replace an existing file later, add `--force`:
```sh
openssl rand -hex 16 | nix run .#secret-from-file -- tg-ws-proxy-secret.age - --force -i ~/.ssh/id_ed25519
s=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n') && [ "${#s}" -eq 32 ] \
&& printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - --force -i ~/.ssh/id_ed25519
unset s
```