testsAndMisc/linux_configuration/tests
Krzysztof kuhy Rudnicki 343d38eaf8
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
feat: add Pi-hole-like LAN DNS blocking served from the PC (dnsmasq)
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
2026-07-10 19:02:46 +02:00
..
__init__.py Harden runtime script deployment and enforce installer safety 2026-05-08 17:44:22 +02:00
conftest.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
test_android_guardian_post_fs_data.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
test_android_guardian_service.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
test_fast_count.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
test_hosts_file_monitor.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_hosts_guard_pacman_integration.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
test_i3blocks_efficiency.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_i3blocks_persist_common.sh fix(linux_configuration): harden polling/runtime scripts and add tests 2026-05-14 19:55:42 +02:00
test_makepkg_capped.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_monitor_report.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
test_music_parallelism.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_pacman_wrapper_security.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_security_hardening.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
test_setup_dns_blocker.sh feat: add Pi-hole-like LAN DNS blocking served from the PC (dnsmasq) 2026-07-10 19:02:46 +02:00
test_shutdown_timer_monitor.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_strip_workout_hosts.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
test_usage_monitoring_installer_efficiency.sh fix: sync test paths, drop stale assertions, fix coverage gap 2026-05-16 15:46:02 +02:00
test_usage_report_pmon_names.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
test_usage_report_since.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
test_validate_contract.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
test_validate_evidence.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00