fix: resolve managed probes through owned SS DNS

Canonicalize validated managed proxy schemes to socks5h for Player, metadata, resource and warmup probes; retain listener ownership, TLS/privacy checks and legacy CLI/pinned checker semantics. Stop canceled inventory requests before Player and metadata fallback, with explicit cancellation and runner-only DNS regressions.

Verification: full native Go tests, affected race tests, go vet and static/config/supervision fixtures passed. An extra whole-package race attempt exceeded its 180s deadline in unrelated TestTuneCLI; affected race coverage completed separately.

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-12 22:28:13 +03:00
1 parent e9a28c8cd3
commit 1afee7d3bd
20 files changed
+212 -30

No files matched your search

+7 -2
View File
@@ -104,8 +104,13 @@ without echoing input. DNS applies only to this target's native `ss-server`.
The image build checks installed `ss-server -h` for native `-d <addr>` support;
the validated nonsecret address is passed as a separate `-d` argv value, not
eval or an assumed JSON key. Passwords still go only to private JSON configs.
The reported `8.8.8.8` diagnostic corrected a tampered avatar response, but does
not fix/prove all thumbnail routes. Native DNS correction is **not full asset
Managed probes use `socks5h://127.0.0.1:1080`: Player, metadata, image,
media, recovery and warmup hostnames go through the owned SS listener rather than
curl's local DNS. Older private `socks5` overrides are validated and canonicalized
internally; credentials and unowned endpoints remain forbidden. Public legacy
discovery and root checker local `--resolve` pinning are unchanged.
This corrects a DNS path bypass, not a proven cause of earlier peer certificate
failures, and does not fix/prove all thumbnail routes. It is **not full asset
availability proof**. No DoH bridge, permanent Google IP pins or global host DNS
changes are supplied. PID 1 remains the sole startup/recovery owner.
+2 -1
View File
@@ -27,7 +27,7 @@ with tempfile.TemporaryDirectory(prefix='target-config-') as tmp:
ZAPRET_AUTOTUNE_YOUTUBE_SERVICE='0', ZAPRET_AUTOTUNE_GOOGLEVIDEO_MODE='cold',
ZAPRET_AUTOTUNE_VIDEO_ID='dQw4w9WgXcQ',
ZAPRET_AUTOTUNE_GOOGLEVIDEO_VIDEO_IDS='["dQw4w9WgXcQ"]',
ZAPRET_AUTOTUNE_SOCKS_PROXY='socks5://127.0.0.1:1080')
ZAPRET_AUTOTUNE_SOCKS_PROXY='socks5h://127.0.0.1:1080')
for dns, valid in (('', True), ('8.8.8.8', True), ('2001:4860:4860::8888', True),
('example.org', False), ('8.8.8.8\n', False), ('-d 8.8.8.8', False)):
for path in private.iterdir():
@@ -62,4 +62,5 @@ with tempfile.TemporaryDirectory(prefix='target-config-') as tmp:
assert settings['ZAPRET_AUTOTUNE_GOOGLEVIDEO_MODE'] == mode
assert json.loads(settings['ZAPRET_AUTOTUNE_GOOGLEVIDEO_VIDEO_IDS']) == ids
assert settings['SS_DNS_SERVER'] == overrides.get('SS_DNS_SERVER', '')
assert settings['ZAPRET_AUTOTUNE_SOCKS_PROXY'] == 'socks5h://127.0.0.1:1080'
print('target config fixtures passed')
+1
View File
@@ -15,6 +15,7 @@ assert " image: ${ZAPRET_AUTOTUNE_IMAGE:-zapret-autotune-managed-target:local
assert " cap_drop: [ALL]\n" in compose
assert " cap_add: [NET_ADMIN, NET_RAW, SETUID, SETGID, KILL, SYS_PTRACE]\n" in compose
assert "pid:" not in compose # Keep inspection confined to the private PID namespace.
assert 'ZAPRET_AUTOTUNE_SOCKS_PROXY: socks5h://127.0.0.1:1080' in compose
assert compose.count(" - type: bind\n") == 1
assert " source: ./target-state\n" in compose
assert " target: /var/lib/zapret-autotune/target\n" in compose
+1 -1
View File
@@ -22,7 +22,7 @@ services:
ZAPRET_AUTOTUNE_TARGET_ID: zapret-autotune-managed-v1
ZAPRET_AUTOTUNE_TARGET_DIR: /var/lib/zapret-autotune/target
ZAPRET_CONFIG: /var/lib/zapret-autotune/target/config
ZAPRET_AUTOTUNE_SOCKS_PROXY: socks5://127.0.0.1:1080
ZAPRET_AUTOTUNE_SOCKS_PROXY: socks5h://127.0.0.1:1080
ZAPRET_AUTOTUNE_DB: /var/lib/zapret-autotune/target/candidates.db
ports:
- "127.0.0.1:${ZAPRET_AUTOTUNE_HOST_SOCKS_PORT:-11080}:1080/tcp"