From fbdd759b836ac64fedb33d7fbd4c62d17e0a5a03 Mon Sep 17 00:00:00 2001 From: Ivan K Date: Thu, 15 May 2025 11:53:30 +0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(podkop):=20remove?= =?UTF-8?q?=20redundant=20DNS/sing-box=20checks=20in=20fakeip=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/view/podkop/podkop.js | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js index cb48305..b03f6ae 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js @@ -1134,27 +1134,6 @@ async function checkFakeIP() { }); try { - const singboxStatusResult = await safeExec('/usr/bin/podkop', ['get_sing_box_status']); - const singboxStatus = JSON.parse(singboxStatusResult.stdout || '{"running":0,"dns_configured":0}'); - - if (!singboxStatus.running) { - return createStatus('not_working', 'sing-box not running', 'ERROR'); - } - - // Load UCI config to check dont_touch_dhcp - let dontTouchDhcp = false; - try { - const data = await uci.load('podkop'); - dontTouchDhcp = uci.get('podkop', 'main', 'dont_touch_dhcp') === '1'; - } catch (e) { - console.error('Error loading UCI config:', e); - } - - // If dont_touch_dhcp is enabled, we don't check dns_configured - if (!dontTouchDhcp && !singboxStatus.dns_configured) { - return createStatus('not_working', 'DNS not configured', 'ERROR'); - } - const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT); @@ -1193,20 +1172,6 @@ async function checkFakeIPCLI() { return createStatus('not_working', 'sing-box not running', 'ERROR'); } - // Load UCI config to check dont_touch_dhcp - let dontTouchDhcp = false; - try { - const data = await uci.load('podkop'); - dontTouchDhcp = uci.get('podkop', 'main', 'dont_touch_dhcp') === '1'; - } catch (e) { - console.error('Error loading UCI config:', e); - } - - // If dont_touch_dhcp is enabled, we don't check dns_configured - if (!dontTouchDhcp && !singboxStatus.dns_configured) { - return createStatus('not_working', 'DNS not configured', 'ERROR'); - } - const result = await safeExec('nslookup', ['-timeout=2', 'fakeip.podkop.fyi', '127.0.0.42']); if (result.stdout && result.stdout.includes('198.18')) {