Edited text from #96

This commit is contained in:
itdoginfo
2025-05-01 22:52:41 +03:00
parent 38acac1a31
commit 3c1b041b52
2 changed files with 27 additions and 29 deletions

View File

@@ -1463,7 +1463,7 @@ return view.extend({
bypassStatus: null
};
// Выполняем все проверки независимо друг от друга
// Perform all checks independently of each other
const checks = [
safeExec('/usr/bin/podkop', ['get_status'])
.then(result => results.podkopStatus = result)
@@ -1509,7 +1509,7 @@ return view.extend({
.catch(() => results.bypassStatus = { state: 'error', message: 'check error', color: STATUS_COLORS.WARNING })
];
// Ждем завершения всех проверок
// Waiting for all the checks to be completed
await Promise.allSettled(checks);
const container = document.getElementById('diagnostics-status');
@@ -1558,7 +1558,7 @@ return view.extend({
container.innerHTML = '';
container.appendChild(statusSection);
// Обновляем отдельные элементы статуса
// Updating individual status items
const updateStatusElement = (elementId, status, template) => {
const element = document.getElementById(elementId);
if (element) {

View File

@@ -2158,27 +2158,26 @@ print_global() {
}
global_check() {
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ SYSTEM INFO"
print_global "📦 Podkop: $(opkg list-installed podkop | awk '{print $3}')"
print_global "📦 LuCI App: $(opkg list-installed luci-app-podkop | awk '{print $3}')"
print_global " 🛠️ System info"
print_global "🕳️ Podkop: $(opkg list-installed podkop | awk '{print $3}')"
print_global "🕳️ LuCI App: $(opkg list-installed luci-app-podkop | awk '{print $3}')"
print_global "📦 Sing-box: $(sing-box version | head -n 1 | awk '{print $3}')"
print_global "🔧 OpenWrt: $(grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2)"
print_global "💻 Device: $(cat /tmp/sysinfo/model)"
print_global "🛜 OpenWrt: $(grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2)"
print_global "🛜 Device: $(cat /tmp/sysinfo/model)"
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ CONFIGURATION"
print_global " 📄 Podkop config"
show_config
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ SYSTEM CHECKS"
print_global " 🔧 System check"
if grep -E "^nameserver\s+([0-9]{1,3}\.){3}[0-9]{1,3}" "$RESOLV_CONF" | grep -vqE "127\.0\.0\.1|0\.0\.0\.0"; then
print_global "❌ /etc/resolv.conf contains external nameserver:"
cat /etc/resolv.conf
echo ""
else
print_global "✅ /etc/resolv.conf - OK"
print_global "✅ /etc/resolv.conf"
fi
cachesize="$(uci get dhcp.@dnsmasq[0].cachesize 2>/dev/null)"
@@ -2186,13 +2185,13 @@ global_check() {
server="$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)"
if [ "$cachesize" != "0" ] || [ "$noresolv" != "1" ] || [ "$server" != "127.0.0.42" ]; then
print_global "❌ DHCP configuration differs from template:"
print_global "❌ DHCP configuration differs from template. 📄 DHCP config:"
awk '/^config /{p=($2=="dnsmasq")} p' /etc/config/dhcp
elif [ "$(uci get podkop.main.dont_touch_dhcp 2>/dev/null)" = "1" ]; then
print_global "⚠️ dont_touch_dhcp is enabled:"
print_global "⚠️ dont_touch_dhcp is enabled. 📄 DHCP config:"
awk '/^config /{p=($2=="dnsmasq")} p' /etc/config/dhcp
else
print_global "✅ DHCP configuration - OK"
print_global "✅ /etc/config/dhcp"
fi
if ! pgrep -f "sing-box" >/dev/null; then
@@ -2202,7 +2201,7 @@ global_check() {
fi
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ NFT RULES"
print_global " 🧱 NFT table"
if ! nft list table inet PodkopTable >/dev/null 2>&1; then
print_global "❌ PodkopTable not found"
else
@@ -2210,7 +2209,7 @@ global_check() {
fi
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ WAN CONFIG"
print_global " 📄 WAN config"
if uci show network.wan >/dev/null 2>&1; then
awk '
/^config / {
@@ -2244,49 +2243,48 @@ global_check() {
ip_prefix=$(echo "$host" | cut -d'.' -f1,2)
if echo "$CLOUDFLARE_OCTETS" | grep -wq "$ip_prefix"; then
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ WARP DETECTION"
print_global "⚠️ WARP detected: $host"
fi
done
fi
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " ➡️ FAKEIP ROUTER TEST"
print_global " 🔁 FakeIP"
print_global "🔍 Testing system DNS resolver..."
print_global "➡️ DNS resolution: system DNS server"
nslookup -timeout=2 $TEST_DOMAIN
local working_resolver=$(find_working_resolver)
if [ -z "$working_resolver" ]; then
print_global "❌ No working external resolver found"
else
print_global "🔍 Testing external resolver ($working_resolver)..."
print_global "➡️ DNS resolution: external resolver ($working_resolver)"
nslookup -timeout=2 $TEST_DOMAIN $working_resolver
fi
print_global "🔍 Testing sing-box DNS server (127.0.0.42)..."
print_global "➡️ DNS resolution: sing-box DNS server (127.0.0.42)"
local result=$(nslookup -timeout=2 $TEST_DOMAIN 127.0.0.42 2>&1)
echo "$result"
if echo "$result" | grep -q "198.18"; then
print_global "✅ FakeIP is working correctly on router (198.18.x.x)"
else
print_global "❌ FakeIP test failed - domain did not resolve to FakeIP range"
print_global "❌ FakeIP test failed: Domain did not resolve to FakeIP range"
if ! pgrep -f "sing-box" >/dev/null; then
print_global " └─ sing-box is not running"
print_global " sing-box is not running"
else
print_global " └─ sing-box is running, checking configuration..."
print_global " 🤔 sing-box is running, checking configuration"
if [ -f "$SING_BOX_CONFIG" ]; then
local fakeip_enabled=$(jq -r '.dns.fakeip.enabled' "$SING_BOX_CONFIG")
local fakeip_range=$(jq -r '.dns.fakeip.inet4_range' "$SING_BOX_CONFIG")
local dns_rules=$(jq -r '.dns.rules[] | select(.server == "fakeip-server") | .domain' "$SING_BOX_CONFIG")
print_global " ├─ FakeIP enabled: $fakeip_enabled"
print_global " ├─ FakeIP range: $fakeip_range"
print_global " └─ FakeIP domain: $dns_rules"
print_global " 📦 FakeIP enabled: $fakeip_enabled"
print_global " 📦 FakeIP range: $fakeip_range"
print_global " 📦 FakeIP domain: $dns_rules"
else
print_global " └─ sing-box config file not found"
print_global " sing-box config file not found"
fi
fi
fi