feat: add configurable PID1-owned DoH forwarding

Default managed SOCKS hostname DNS to verified HTTPS with literal-IP bootstrap and no plaintext fallback. Supervise the loopback forwarder with private anchored readiness and preserve foreign markers. Include configuration, deployment, documentation and offline checks.

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-13 14:32:58 +03:00
1 parent ea886e5bc8
commit 367d956ae3
20 files changed
+2383 -37

No files matched your search

+15 -1
View File
@@ -23,6 +23,10 @@ assert " create_host_path: false\n" in compose
assert "SS_PASSWORD: ${SS_PASSWORD:?Set SS_PASSWORD in the deployment environment}" in compose
for setting in (
'SS_DNS_SERVER: ${SS_DNS_SERVER-}',
'ZAPRET_AUTOTUNE_DNS_MODE: ${ZAPRET_AUTOTUNE_DNS_MODE-doh}',
'ZAPRET_AUTOTUNE_DOH_URL: ${ZAPRET_AUTOTUNE_DOH_URL-https://dns.google/dns-query}',
'ZAPRET_AUTOTUNE_DOH_BOOTSTRAP_IPS: ${ZAPRET_AUTOTUNE_DOH_BOOTSTRAP_IPS-}',
'ZAPRET_AUTOTUNE_DOH_TIMEOUT_SEC: ${ZAPRET_AUTOTUNE_DOH_TIMEOUT_SEC-5}',
'ZAPRET_AUTOTUNE_YOUTUBE_SERVICE: ${ZAPRET_AUTOTUNE_YOUTUBE_SERVICE-0}',
'ZAPRET_AUTOTUNE_GOOGLEVIDEO_MODE: ${ZAPRET_AUTOTUNE_GOOGLEVIDEO_MODE-cold}',
'ZAPRET_AUTOTUNE_VIDEO_ID: ${ZAPRET_AUTOTUNE_VIDEO_ID-dQw4w9WgXcQ}',
@@ -30,7 +34,17 @@ for setting in (
):
assert setting in compose, setting
assert entrypoint.index('target-config-check || exit 64') < entrypoint.index('cat > "$config_dir/server.json"')
assert 'set -- "$@" -d "$SS_DNS_SERVER"' in entrypoint
assert 'set -- "$@" -d "$dns_address"' in entrypoint
assert entrypoint.index('start_dns || return $?') < entrypoint.index('set -- ss-server')
assert 'dns-forwarder readiness-check "$dns_pid"' in entrypoint
assert 'dns-forwarder readiness-cleanup "$dns_pid"' in entrypoint
assert 'exec 8<"$config_dir"' in entrypoint
assert 'exec 9<"$config_dir/dns-ready"' in entrypoint
assert 'rm -f "$config_dir/dns-ready"' not in entrypoint
assert 'while dns_alive && kill -0 "$server_pid"' in entrypoint
assert entrypoint.index('bounded_wait "$pid" 5') < entrypoint.index('bounded_wait "$dns_pid" 5')
assert '5353' not in compose
assert 'net.ipv4.ip_unprivileged_port_start: "0"' in compose
assert 'eval ' not in entrypoint
assert "secrets:" not in compose
assert "ss_password=${SS_PASSWORD-}" in entrypoint