dns + keybinding consolidation
This commit is contained in:
1 parent
df46627173
commit
f8444b1549
23 files changed
+612
-109
No files matched your search
@@ -24,6 +24,12 @@ exported env vars before inlining each file's content via `builtins.readFile`.
|
||||
## How it works
|
||||
|
||||
1. The router config lives as an **agenix secret** (e.g. `secrets/glmain.json.age`).
|
||||
1b. Before generating, the decrypted JSON's `generalMappings` are **merged** (via `jq`) with
|
||||
`$NIX_DNS_RECORDS` — the DNS records declared across all hosts through `skyg.dns`
|
||||
(see `modules/nixos/common/dns-records/`) and aggregated by `modules/dns-aggregate.nix`
|
||||
into `packages.<sys>.skyg-dns-records`. The secret stays the source of truth for
|
||||
devices/MACs; **Nix owns service names**, so a container's DNS name lives next to the
|
||||
host config that owns its IP. Inspect the aggregate with `nix eval .#dnsRecords --json`.
|
||||
2. `openwrt-deploy` reads the decrypted JSON from stdin, runs `openwrt-gen dnsmasq`,
|
||||
`openwrt-gen ethers`, and `openwrt-gen firewall` to render the three target files.
|
||||
3. It SSHes to the router, shows a **colorized unified diff** against the current files
|
||||
@@ -55,6 +61,7 @@ is passed as a command-line argument (default `glmain`).
|
||||
```bash
|
||||
skyg openwrt --dry-run
|
||||
# → .tmp/openwrt-glmain/dnsmasq.conf
|
||||
# → .tmp/openwrt-glmain/dns-records.json # the Nix-declared skyg.dns fragment merged in
|
||||
# → .tmp/openwrt-glmain/ethers
|
||||
# → .tmp/openwrt-glmain/firewall.batch # the exact `uci -m import firewall` input
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user