dns + keybinding consolidation

This commit is contained in:
ari committed 2026-09-21 10:52:32 -04:00
1 parent df46627173
commit f8444b1549
23 files changed
+612 -109

No files matched your search

+9 -3
View File
@@ -3,14 +3,19 @@
# - no SSH, no uci, no router changes. Run from the repo root. Router name is
# passed as $1 (defaults to glmain).
#
# Expects GENERATOR to be exported by the Nix wrapper before this file's
# content runs (store path of the openwrt-gen package, bin/openwrt-gen inside).
# Expects GENERATOR and NIX_DNS_RECORDS to be exported by the Nix wrapper before
# this file's content runs (store paths of the openwrt-gen package and of the
# Nix-generated generalMappings fragment).
set -euo pipefail
if [ $# -ge 1 ]; then ROUTER="$1"; else ROUTER=glmain; fi
OUTDIR=".tmp/openwrt-$ROUTER"
mkdir -p "$OUTDIR"
CONFIG=$(cat)
# Same merge as the real deploy: secret config + Nix-declared skyg.dns records.
CONFIG=$(cat | jq --slurpfile nix "$NIX_DNS_RECORDS" \
'.generalMappings = ((.generalMappings // []) + $nix[0].generalMappings)')
cp "$NIX_DNS_RECORDS" "$OUTDIR/dns-records.json"
echo "$CONFIG" | "$GENERATOR"/bin/openwrt-gen dnsmasq > "$OUTDIR/dnsmasq.conf"
echo "$CONFIG" | "$GENERATOR"/bin/openwrt-gen ethers > "$OUTDIR/ethers"
@@ -20,3 +25,4 @@ echo "Dry-run configs written to $OUTDIR (no router changes made):"
echo " $OUTDIR/dnsmasq.conf"
echo " $OUTDIR/ethers"
echo " $OUTDIR/firewall.batch"
echo " $OUTDIR/dns-records.json # Nix-declared skyg.dns records merged in"