testsAndMisc/python_pkg
Krzysztof kuhy Rudnicki e3d5e1dd18 Serve the blocklist over DoT and hand the policy to the app as an asset
Two gaps stopped the unrooted path working end to end. The phone had no way to
read the focus policy, and the blocklist was only reachable as a hosts file or
over plain UDP/53 on the LAN -- while the rooted enforcer actively rejected
every DoT connection, so a self-hosted resolver could not have worked even if
one existed.

focus_owner now loads a generated policy.json instead of hardcoding anything,
so config.sh stays the single source of truth across Python, shell and Kotlin.
The committed asset is rendered with --redact-home and a test fails if home
coordinates ever appear in it. An unknown schema_version is rejected outright:
silently accepting a newer schema means enforcing a policy the app has misread,
and a misread allowlist is one that blocks the dialer.

dns_enforcer.sh rejected ALL port 853 traffic and pinned Private DNS off, every
20 seconds. That is right when DoT is a bypass channel and exactly wrong when
DoT is the enforcement channel, which is what an unrooted phone needs -- it has
no hosts file to fall back to. With DNS_TRUSTED_DOT_HOST set it now ACCEPTs the
trusted resolver before the blanket REJECT, and pins Private DNS to that
hostname so the user cannot pick an unfiltered one. Rule order is load-bearing:
iptables takes the first match, so an ACCEPT appended after the REJECT would
never be reached. expected_rule_count() counts the new rules, because a
mismatch there makes chain_intact() rebuild the chain every 20s -- a silent
fork storm that also drops the connection each time. With the variable empty
the behaviour is byte-identical, so the rooted phone is untouched until this is
deployed.

setup_dot_resolver.sh terminates DoT with stunnel rather than Caddy: DoT is a
raw TLS stream and stock caddy:2.8 has no layer4 module, so using Caddy would
have meant an xcaddy rebuild of a container serving five live sites. It reuses
the certificate Caddy already renews, so nothing competes for port 80. It binds
to the WireGuard address, not 0.0.0.0 -- a public DoT endpoint is an open
resolver, and over the existing tunnel it needs no port-forward, no firewall
rule and no rate limiting. Verified: example.com resolves, pornhub.com returns
0.0.0.0, TLS 1.3 against the LE cert, and both the LAN and public addresses
refuse.

The Device Owner checklist is planning only. Checking the device rather than
the config settled the one open risk: Google Wallet is not installed and no NFC
payment default is set, so the unconfirmable tap-to-pay question does not apply
here. The same check found that Aegis, MS Authenticator, Oracle IDM and PKO IKO
are absent -- they are in config.sh's whitelist, which describes the rooted
phone, not this one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AwepyL5Lxs5QKbKkMpxxxL
2026-08-05 09:36:11 +02:00
..
app_icons app_icons: finish the epopeja_karta entry; whitelist it on the phone 2026-08-03 12:41:13 +02:00
billsplit_coverage Move billsplit Flutter app into the monorepo 2026-08-03 12:22:22 +02:00
brother_printer fix(brother-printer): split oversized files, fix order-dependent entry test 2026-07-17 15:06:25 +02:00
code_tutor Make code_tutor OSError fingerprint test Python-version-robust 2026-07-11 00:22:57 +02:00
focus_policy Serve the blocklist over DoT and hand the policy to the app as an asset 2026-08-05 09:36:11 +02:00
live_calc refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
morning_routine Remove wake_alarm (extracted to kuhyx/wake-alarm) and fix the orchestrator 2026-06-22 12:47:06 +02:00
random_jpg feat: added run sh and makefile scripts 2026-02-22 22:00:50 +01:00
shared Migrate wake_alarm to the shared gatelock backend 2026-06-22 07:33:49 +02:00
tests python_pkg: the file-length test was blind to its own CI venv 2026-07-25 16:32:32 +02:00
wsg_grabber wsg_grabber: scrape /wsg/, download every new video, triage with keep/pass 2026-07-27 14:55:30 +02:00
__init__.py feat(screen_locker): harden table tennis verification, remove running option 2026-02-02 21:38:52 +01:00
.gitignore screen_locker: enhance workout logging and UI 2025-12-02 23:22:13 +01:00
conftest.py test: achieve 100% branch coverage across all python_pkg packages 2026-03-21 17:51:36 +01:00