1 parent
80ec3dfdd3
commit
079cceb554
57 files changed
+4092
-538
No files matched your search
+37
-10
@@ -17,20 +17,21 @@ Decryption on the machine uses `/etc/ssh/ssh_host_ed25519_key`.
|
||||
|
||||
## Service secrets
|
||||
|
||||
Two more optional secrets belong to services. Without them the service is
|
||||
Three more optional secrets belong to services. Without them the service is
|
||||
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 (32 hex digits) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off |
|
||||
| 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 (32 hex digits) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off |
|
||||
| `amneziawg-ai.age` | The whole AmneziaWG client .conf (AWG 1.x to 3.x) | `modules/network/proxy-suite.nix` (`amneziaWg.profiles.ai.configFile` and `profiles.vpn.configFile`) | No AmneziaWG tunnel, no TProxy, no perAppRouting: the proxy 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.
|
||||
All three are decrypted to `/run/agenix/<name>` (root, mode `0400`) and read by
|
||||
the service units. No `.nix` file contains a secret value.
|
||||
|
||||
Create them from the repository root (`-i` checks that your key can decrypt the
|
||||
result; `secret-from-file` also runs `git add` on the new file). The values go
|
||||
through a pipe, so they never touch the disk or a command line:
|
||||
result; `secret-from-file` also runs `git add` on the new file). The first two
|
||||
values go through a pipe, so they never touch the disk or a command line:
|
||||
|
||||
```sh
|
||||
# Registration token: Gitea -> Site Administration -> Actions -> Runners.
|
||||
@@ -45,7 +46,33 @@ unset s
|
||||
```
|
||||
|
||||
The second command also prints the secret once, because the Telegram clients
|
||||
need it. Then switch (`nix run .#switch`).
|
||||
need it.
|
||||
|
||||
The AmneziaWG config is a whole file, the client `.conf` that AmneziaVPN
|
||||
exports (it holds the private key, so treat it as one). Keep it outside the
|
||||
repository, encrypt it, and delete the plaintext:
|
||||
|
||||
```sh
|
||||
nix run .#secret-from-file -- amneziawg-ai.age /path/to/client.conf -i ~/.ssh/id_ed25519
|
||||
rm /path/to/client.conf
|
||||
```
|
||||
|
||||
The plaintext must not stay in the repository (a `/WG.conf` in the repository
|
||||
root is gitignored, but delete it all the same). `secret-from-file` already ran
|
||||
`git add` on `secrets/amneziawg-ai.age`, so there is nothing left to stage.
|
||||
|
||||
The same file also backs the full-tunnel profile `vpn` (all traffic, not
|
||||
autostarted): `proxy-ctl awg on vpn` brings it up and `proxy-ctl awg off`
|
||||
takes it down. Starting it stops the global TProxy, zapret and the `ai` split
|
||||
tunnel (same peer); stopping it starts TProxy (with `ai`) and zapret again by
|
||||
itself, and so does a switch, which ends the full tunnel (see the header of
|
||||
`modules/network/proxy-suite.nix`). A second peer for `vpn` (another secret and a
|
||||
`profiles.vpn.configFile` that points at it) would only keep `ai` up beside the
|
||||
full tunnel, and only once the unconditional conflicts and after of
|
||||
`proxy-suite-awg-vpn` on `awg-ai` in that file are dropped: TProxy and zapret
|
||||
stop either way.
|
||||
|
||||
Then switch (`nix run .#switch`).
|
||||
|
||||
### Rotation
|
||||
|
||||
|
||||
Reference in new issue
Block a user