Commit graph

26 commits

Author SHA1 Message Date
660a31c35e Add warm-nftset.sh — periodic nftset warmer
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 14m41s
Elements in bbrkn_v4/bbrkn_v6 carry a 1d timeout and are only refreshed
when a query reaches the host dnsmasq on :5350, where the nftset=
directives are applied. Idle domains — or ones answered from the pihole
FTL cache — age out of the sets and their traffic silently falls back to
the plain WAN route instead of the tunnel.

warm-nftset.sh re-resolves every domain from the deployed 90-nftset.conf
(base + related subdomains) directly against 127.0.0.1:5350, bypassing
the FTL cache. Sourcing the domain list from the deployed config means
there is no second list to keep in sync.

Ping is off by default: packets originating on the gateway itself go
through OUTPUT, never prerouting_mangle, so they leave unmarked and
almost all time out — a misleading signal, not a real failure.

Run on the gateway via `make warm` or hourly cron. Measured: 1059
domains in ~1m45s at PARALLEL=8, v4 526->2203, v6 305->1440 elements.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 20:58:33 +03:00
d81a4ab3b2 Migrate bbrkn from legacy ipset to nftables sets
The gateway (Archie) routes bbrkn domains via nft sets bbrkn_v4/bbrkn_v6
(inet filter), not the legacy ipset. bbrkn was still emitting dead
`ipset=/domain/bbrkn` directives (no such ipset exists) plus a 92-resolve
pointing at 8.8.8.8, both overridden by hand-maintained files on the host.
This makes bbrkn the generator of record for the real scheme.

generate-configs.sh:
- emit `nftset=/domain/$NFTSET_SPEC` (default 4#inet#filter#bbrkn_v4,
  6#inet#filter#bbrkn_v6) into 90-nftset.conf instead of ipset= into
  91-ipset-bbrkn.conf
- DNS_SERVER default 8.8.8.8 -> 127.0.0.1#5350 (host dnsmasq pihole
  delegates bbrkn domains to for VPN resolution + nftset capture)

deploy-to-gateway.sh: two targets, two instances
- 90-nftset.conf -> host /etc/dnsmasq.d (:5350), 92-resolve -> pihole
- full restart of both (dnsmasq SIGHUP does NOT re-read nftset=/server=)
- flush nft sets bbrkn_v4/bbrkn_v6 instead of `ipset flush bbrkn`
- add end-to-end nftset-capture health check via :5350
- rollback restores both files and restarts both instances

Makefile/workflow: rename IPSET_CONF->NFTSET_CONF, add NFTSET_TARGET_DIR
and HOST_DNSMASQ_SVC, DNS_SERVER=127.0.0.1#5350 (escaped `\#` in Make,
quoted in YAML), note runner is ephemeral (cold gekata crawl).

Docs: README + new CLAUDE.md describe the two-dnsmasq / nft-set model;
exit-node DPI failover (10.77.1.2/10.77.2.2) documented as external
(wg-ha.service), not owned by bbrkn.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 23:55:16 +03:00
c3a30da18f fix ordered domain 2026-03-22 22:59:49 +03:00
48a157b119 unbound variable 2026-03-21 22:12:58 +03:00
1990114627 dns healthcheck 2026-03-21 10:57:59 +03:00
537ae61f63 Рефакторинг 2026-03-21 09:46:15 +03:00
379124a3a8 Update scripts/deploy-to-gateway.sh
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 32m23s
2026-01-21 21:28:32 +03:00
c183c59b30 Add flushing of ipset after config generation
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 1m42s
2025-11-15 13:29:22 +03:00
Kirill Kodanev
594320b601 Add ignored domains via env statement
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 1m37s
2025-09-19 18:17:25 +03:00
Kirill Kodanev
ebb0a19a34 Split curl output to body and header
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 22m47s
2025-09-15 21:16:00 +03:00
Kirill Kodanev
edbc320e44 Fix JSON in curl output
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 21:00:34 +03:00
Kirill Kodanev
8b1cef6944 Fix race in tmpfile
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 20:54:04 +03:00
Kirill Kodanev
a206ec509d Use tmpfiles for JSON
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 20:51:34 +03:00
Kirill Kodanev
568701d1cb Fix jq for oneline JSON answer
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 20:44:13 +03:00
Kirill Kodanev
a92f188c91 Fix jq in query API
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 20:24:14 +03:00
Kirill Kodanev
71c393d91d ADD query API function
Some checks failed
Deploy DNS Configuration / deploy (push) Has been cancelled
2025-09-15 20:20:57 +03:00
Kirill Kodanev
4aa270dae9 Rewrite generate config. Add timeout and retries count
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 1m44s
2025-09-15 19:12:14 +03:00
Kirill Kodanev
fca3ae254a Enhance query API code
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 2m15s
ADD DOMAIN: cloud.hetzner.com
2025-09-13 16:06:46 +03:00
Kirill Kodanev
be6acf224e Rewrite config generator and skip non-exist domains 2025-09-12 18:39:52 +03:00
Kirill Kodanev
ecb6fa8df6 Rewrite API logic 2025-09-12 17:37:58 +03:00
Kirill Kodanev
af6651fdfa Add debugging information to the output
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 2m16s
2025-09-12 16:03:06 +03:00
Kirill Kodanev
5f0e287b98 Remove a lot of TG domainsm, rewrite scripts
All checks were successful
Deploy DNS Configuration / deploy (push) Successful in 2m15s
2025-09-12 15:30:31 +03:00
Kirill Kodanev
31d07d4484 Rewrite logic, use env variables, and add comments to the following code to make it more readable and maintainable. 2025-09-11 19:49:28 +03:00
ec0cfa2adf Add support to find all domains
Some checks failed
Deploy DNS Configuration / deploy (push) Failing after 34s
2025-09-11 14:09:16 +03:00
Kirill Kodanev
44179dac63 Rewrite logic of validation and generation config for dnsmasq 2025-09-09 21:35:32 +03:00
Kirill Kodanev
0e03de0178 First commit to bbrkn project 2025-09-09 21:21:38 +03:00