mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 21:27:02 +01:00
setup_dns_blocker.sh turns this PC into a DNS server that serves the identical /etc/hosts blocklist to the whole LAN with no per-device app, by feeding generate_hosts_file.sh output into dnsmasq via addn-hosts (same StevenBlack variant + custom entries + unblocks). Adds status/ refresh subcommands, a daily refresh timer, Restart=always, and logging to /var/log/dns-blocker/. Because the ISP router cannot advertise a custom DNS server, a dhcp/ dhcp-off mode makes the PC the LAN DHCP server (static IP via nmcli with a gateway-ping self-check and safe, always-online rollback), handing out itself as the DNS server so every device is blocked automatically. setup_wireguard_ssh.sh gains an allow-dns subcommand that opens DNS (53, LAN saddr) and DHCP (67) in the single-owner nftables ruleset. The DHCP accept rule is placed before 'ct state invalid drop' because the 0.0.0.0->255.255.255.255 DHCP broadcast is classified INVALID and was otherwise dropped. Firewall detection now reads the actual loaded ruleset (a ruleset can be loaded while nftables.service reads inactive) and avoids a grep -q/pipefail SIGPIPE false-negative. Verified end-to-end: Pixel-6a leased 192.168.1.82 with DNS 192.168.1.43; youtube.com blocked, legit sites resolve. Regression tests added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018pqSnrLt8QoWup7n2Ymk77 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_android_guardian_post_fs_data.sh | ||
| test_android_guardian_service.sh | ||
| test_fast_count.py | ||
| test_hosts_file_monitor.sh | ||
| test_hosts_guard_pacman_integration.sh | ||
| test_i3blocks_efficiency.sh | ||
| test_i3blocks_persist_common.sh | ||
| test_makepkg_capped.sh | ||
| test_monitor_report.py | ||
| test_music_parallelism.sh | ||
| test_pacman_wrapper_security.sh | ||
| test_security_hardening.sh | ||
| test_setup_dns_blocker.sh | ||
| test_shutdown_timer_monitor.sh | ||
| test_strip_workout_hosts.py | ||
| test_usage_monitoring_installer_efficiency.sh | ||
| test_usage_report_pmon_names.py | ||
| test_usage_report_since.py | ||
| test_validate_contract.py | ||
| test_validate_evidence.py | ||