Edited text from #96
This commit is contained in:
@@ -1463,7 +1463,7 @@ return view.extend({
|
|||||||
bypassStatus: null
|
bypassStatus: null
|
||||||
};
|
};
|
||||||
|
|
||||||
// Выполняем все проверки независимо друг от друга
|
// Perform all checks independently of each other
|
||||||
const checks = [
|
const checks = [
|
||||||
safeExec('/usr/bin/podkop', ['get_status'])
|
safeExec('/usr/bin/podkop', ['get_status'])
|
||||||
.then(result => results.podkopStatus = result)
|
.then(result => results.podkopStatus = result)
|
||||||
@@ -1509,7 +1509,7 @@ return view.extend({
|
|||||||
.catch(() => results.bypassStatus = { state: 'error', message: 'check error', color: STATUS_COLORS.WARNING })
|
.catch(() => results.bypassStatus = { state: 'error', message: 'check error', color: STATUS_COLORS.WARNING })
|
||||||
];
|
];
|
||||||
|
|
||||||
// Ждем завершения всех проверок
|
// Waiting for all the checks to be completed
|
||||||
await Promise.allSettled(checks);
|
await Promise.allSettled(checks);
|
||||||
|
|
||||||
const container = document.getElementById('diagnostics-status');
|
const container = document.getElementById('diagnostics-status');
|
||||||
@@ -1558,7 +1558,7 @@ return view.extend({
|
|||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
container.appendChild(statusSection);
|
container.appendChild(statusSection);
|
||||||
|
|
||||||
// Обновляем отдельные элементы статуса
|
// Updating individual status items
|
||||||
const updateStatusElement = (elementId, status, template) => {
|
const updateStatusElement = (elementId, status, template) => {
|
||||||
const element = document.getElementById(elementId);
|
const element = document.getElementById(elementId);
|
||||||
if (element) {
|
if (element) {
|
||||||
|
|||||||
@@ -2158,27 +2158,26 @@ print_global() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
global_check() {
|
global_check() {
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
print_global " 🛠️ System info"
|
||||||
print_global " ➡️ SYSTEM INFO"
|
print_global "🕳️ Podkop: $(opkg list-installed podkop | awk '{print $3}')"
|
||||||
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 "📦 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 "📦 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 "🛜 OpenWrt: $(grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2)"
|
||||||
print_global "💻 Device: $(cat /tmp/sysinfo/model)"
|
print_global "🛜 Device: $(cat /tmp/sysinfo/model)"
|
||||||
|
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
print_global " ➡️ CONFIGURATION"
|
print_global " 📄 Podkop config"
|
||||||
show_config
|
show_config
|
||||||
|
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
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
|
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:"
|
print_global "❌ /etc/resolv.conf contains external nameserver:"
|
||||||
cat /etc/resolv.conf
|
cat /etc/resolv.conf
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
print_global "✅ /etc/resolv.conf - OK"
|
print_global "✅ /etc/resolv.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cachesize="$(uci get dhcp.@dnsmasq[0].cachesize 2>/dev/null)"
|
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)"
|
server="$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)"
|
||||||
|
|
||||||
if [ "$cachesize" != "0" ] || [ "$noresolv" != "1" ] || [ "$server" != "127.0.0.42" ]; then
|
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
|
awk '/^config /{p=($2=="dnsmasq")} p' /etc/config/dhcp
|
||||||
elif [ "$(uci get podkop.main.dont_touch_dhcp 2>/dev/null)" = "1" ]; then
|
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
|
awk '/^config /{p=($2=="dnsmasq")} p' /etc/config/dhcp
|
||||||
else
|
else
|
||||||
print_global "✅ DHCP configuration - OK"
|
print_global "✅ /etc/config/dhcp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! pgrep -f "sing-box" >/dev/null; then
|
if ! pgrep -f "sing-box" >/dev/null; then
|
||||||
@@ -2202,7 +2201,7 @@ global_check() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
print_global " ➡️ NFT RULES"
|
print_global " 🧱 NFT table"
|
||||||
if ! nft list table inet PodkopTable >/dev/null 2>&1; then
|
if ! nft list table inet PodkopTable >/dev/null 2>&1; then
|
||||||
print_global "❌ PodkopTable not found"
|
print_global "❌ PodkopTable not found"
|
||||||
else
|
else
|
||||||
@@ -2210,7 +2209,7 @@ global_check() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
print_global " ➡️ WAN CONFIG"
|
print_global " 📄 WAN config"
|
||||||
if uci show network.wan >/dev/null 2>&1; then
|
if uci show network.wan >/dev/null 2>&1; then
|
||||||
awk '
|
awk '
|
||||||
/^config / {
|
/^config / {
|
||||||
@@ -2244,49 +2243,48 @@ global_check() {
|
|||||||
ip_prefix=$(echo "$host" | cut -d'.' -f1,2)
|
ip_prefix=$(echo "$host" | cut -d'.' -f1,2)
|
||||||
if echo "$CLOUDFLARE_OCTETS" | grep -wq "$ip_prefix"; then
|
if echo "$CLOUDFLARE_OCTETS" | grep -wq "$ip_prefix"; then
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
print_global " ➡️ WARP DETECTION"
|
|
||||||
print_global "⚠️ WARP detected: $host"
|
print_global "⚠️ WARP detected: $host"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
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
|
nslookup -timeout=2 $TEST_DOMAIN
|
||||||
|
|
||||||
local working_resolver=$(find_working_resolver)
|
local working_resolver=$(find_working_resolver)
|
||||||
if [ -z "$working_resolver" ]; then
|
if [ -z "$working_resolver" ]; then
|
||||||
print_global "❌ No working external resolver found"
|
print_global "❌ No working external resolver found"
|
||||||
else
|
else
|
||||||
print_global "🔍 Testing external resolver ($working_resolver)..."
|
print_global "➡️ DNS resolution: external resolver ($working_resolver)"
|
||||||
nslookup -timeout=2 $TEST_DOMAIN $working_resolver
|
nslookup -timeout=2 $TEST_DOMAIN $working_resolver
|
||||||
fi
|
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)
|
local result=$(nslookup -timeout=2 $TEST_DOMAIN 127.0.0.42 2>&1)
|
||||||
echo "$result"
|
echo "$result"
|
||||||
|
|
||||||
if echo "$result" | grep -q "198.18"; then
|
if echo "$result" | grep -q "198.18"; then
|
||||||
print_global "✅ FakeIP is working correctly on router (198.18.x.x)"
|
print_global "✅ FakeIP is working correctly on router (198.18.x.x)"
|
||||||
else
|
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
|
if ! pgrep -f "sing-box" >/dev/null; then
|
||||||
print_global " └─ sing-box is not running"
|
print_global " ❌ sing-box is not running"
|
||||||
else
|
else
|
||||||
print_global " └─ sing-box is running, checking configuration..."
|
print_global " 🤔 sing-box is running, checking configuration"
|
||||||
|
|
||||||
if [ -f "$SING_BOX_CONFIG" ]; then
|
if [ -f "$SING_BOX_CONFIG" ]; then
|
||||||
local fakeip_enabled=$(jq -r '.dns.fakeip.enabled' "$SING_BOX_CONFIG")
|
local fakeip_enabled=$(jq -r '.dns.fakeip.enabled' "$SING_BOX_CONFIG")
|
||||||
local fakeip_range=$(jq -r '.dns.fakeip.inet4_range' "$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")
|
local dns_rules=$(jq -r '.dns.rules[] | select(.server == "fakeip-server") | .domain' "$SING_BOX_CONFIG")
|
||||||
|
|
||||||
print_global " ├─ FakeIP enabled: $fakeip_enabled"
|
print_global " 📦 FakeIP enabled: $fakeip_enabled"
|
||||||
print_global " ├─ FakeIP range: $fakeip_range"
|
print_global " 📦 FakeIP range: $fakeip_range"
|
||||||
print_global " └─ FakeIP domain: $dns_rules"
|
print_global " 📦 FakeIP domain: $dns_rules"
|
||||||
else
|
else
|
||||||
print_global " └─ sing-box config file not found"
|
print_global " ⛔ sing-box config file not found"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user