mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 19:46:52 +03:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ee92123bc | ||
|
|
5fd0e23cf9 | ||
|
|
9b25669c8f | ||
|
|
4b020671cc | ||
|
|
6222221847 | ||
|
|
6fa215e343 | ||
|
|
a33835415f | ||
|
|
f76c657bd7 | ||
|
|
cceedd6c17 | ||
|
|
8fa1986961 | ||
|
|
8dec59d118 | ||
|
|
c1fac487c7 | ||
|
|
d934bcc5e9 | ||
|
|
fc99bd7aaa | ||
|
|
b6cf73b974 | ||
|
|
6df7c8abf8 | ||
|
|
8eb97a8023 | ||
|
|
cd43449585 | ||
|
|
16c174d624 | ||
|
|
1c02a2208b | ||
|
|
2c93e98755 | ||
|
|
66b179f282 | ||
|
|
4bbaae776c | ||
|
|
e31f313819 | ||
|
|
bd0e33781f | ||
|
|
ade2b844ec | ||
|
|
6f997a6e73 | ||
|
|
744de6aec2 | ||
|
|
ae06de8189 | ||
|
|
1663f6665f | ||
|
|
b005cbe50e | ||
|
|
6c752d59ce | ||
|
|
dbdd0560bf | ||
|
|
aeacd9d8fd | ||
|
|
ded0bff23a | ||
|
|
80ab7caee9 | ||
|
|
516063310a | ||
|
|
c6d72aa781 | ||
|
|
91fa2a2859 | ||
|
|
13e84afcf0 | ||
|
|
88c160d3f8 | ||
|
|
ebd185f633 | ||
|
|
e86bffb720 | ||
|
|
fb65b63639 | ||
|
|
daf7e30ed1 | ||
|
|
dd62ecfbeb | ||
|
|
41cb8cd650 | ||
|
|
b7ad256986 | ||
|
|
f88ffa1893 | ||
|
|
6f604ca765 | ||
|
|
52c6eeae12 | ||
|
|
778f2897bc | ||
|
|
ca7bb77356 | ||
|
|
da8195b795 | ||
|
|
98129720bb | ||
|
|
3c1865c8a3 | ||
|
|
77ac728d47 | ||
|
|
1b5cfa3371 |
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @itdoginfo
|
||||
23
README.md
23
README.md
@@ -2,11 +2,13 @@
|
||||
|
||||
- Это альфа версия, которая находится в активной разработке. Из версии в версию что-то может меняться.
|
||||
- Основной функционал работает, но побочные штуки сейчас могут сбоить.
|
||||
- При обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться.
|
||||
- При обновлении **обязатально** сбрасывайте кэш LuCI.
|
||||
- Также при обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться.
|
||||
- Необходимо минимум 15МБ свободного места на роутере. Роутерами с флешками на 16МБ сразу мимо.
|
||||
- При старте программы редактируется конфиг Dnsmasq.
|
||||
- Podkop редактирует конфиг sing-box. Обязательно сохраните ваш конфиг sing-box перед установкой, если он вам нужен.
|
||||
- Информация здесь может быть устаревшей. Все изменения фиксируются в телеграм-чате https://t.me/itdogchat - топик **Podkop**.
|
||||
- Если у вас не что-то не работает, то следуюет сходить в телеграм чат, прочитать закрепы и выполнить что там написано..
|
||||
- Если у вас установлен Getdomains, его следует удалить.
|
||||
|
||||
# Удаление GetDomains скриптом
|
||||
@@ -18,7 +20,8 @@ sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/domain-routing-openwr
|
||||
|
||||
# Установка Podkop
|
||||
Пакет работает на всех архитектурах.
|
||||
Тестировался на OpenWrt 23.05 и OpenWrt 24.10.
|
||||
Тестировался на **ванильной** OpenWrt 23.05 и OpenWrt 24.10.
|
||||
На FriendlyWrt 23.05 присуствуют зависимости от iptables, которые ломают tproxy. Если у вас появляется warning про это в логах, следуйте инструкции по приведённой там ссылке.
|
||||
|
||||
Поддержки APK на данный момент нет. APK будет сделан после того как разгребу основное.
|
||||
|
||||
@@ -43,7 +46,7 @@ sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/mai
|
||||
|
||||
# Удаление
|
||||
```
|
||||
opkg remove luci-app-podkop podkop
|
||||
opkg remove luci-i18n-podkop-ru luci-app-podkop podkop
|
||||
```
|
||||
|
||||
Если был установлен русский язык
|
||||
@@ -98,6 +101,10 @@ Luci: Services/podkop
|
||||
list doh_server '127.0.0.1#5053'
|
||||
list doh_server '127.0.0.1#5054'
|
||||
```
|
||||
- [x] Только кастомный remote list не создаёт секцию в route-rules-rule-set и dns-rules-ruleset
|
||||
- [ ] Не отрабатывает service podkop stop, если podkop запущен и не может, к пример, зарезолвить домен с сломанным DNS
|
||||
- [ ] Всплывает в логах при старте. Не каждый раз. На работу не влияет. Wed Feb 19 17:12:28 2025 daemon.err sh[17665]: Command failed: ubus call service delete { "name": "sing-box" } (Not found)
|
||||
|
||||
# ToDo
|
||||
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
|
||||
|
||||
@@ -149,6 +156,8 @@ Luci: Services/podkop
|
||||
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
|
||||
- [ ] Валидации предустановленных значений. Если прописаны другие, то вывод в лог о неизвестной переменной и продолжение работы
|
||||
- [ ] Добавление в список доменов домены первого уровня (LuCI)
|
||||
- [ ] Проверка, что версия в makefile совпадает с тегом
|
||||
- [ ] Don't touch my DHCP!
|
||||
|
||||
Приоритет 2
|
||||
- [x] Списки доменов и подсетей с роутера
|
||||
@@ -175,6 +184,14 @@ Wiki
|
||||
Хз как сделать
|
||||
- [ ] Добавить label от конфига vless\ss\etc в luci.
|
||||
|
||||
# Установка версии v0.2.5
|
||||
Удаляет полностью все пакеты podkop. Удаляет текущую конфигурацию podkop.
|
||||
После установки **обязательно** сбросьте кэш в LuCI.
|
||||
|
||||
```
|
||||
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/main/install-v0.2.5.sh)
|
||||
```
|
||||
|
||||
# Разработка
|
||||
Есть два варианта:
|
||||
- Просто поставить пакет на роутер или виртуалку и прям редактировать через SFTP (opkg install openssh-sftp-server)
|
||||
|
||||
97
install-v0.2.5.sh
Executable file
97
install-v0.2.5.sh
Executable file
@@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
|
||||
REPO="https://api.github.com/repos/itdoginfo/podkop/releases/tags/v0.2.5"
|
||||
|
||||
DOWNLOAD_DIR="/tmp/podkop"
|
||||
COUNT=3
|
||||
|
||||
rm -rf "$DOWNLOAD_DIR"
|
||||
mkdir -p "$DOWNLOAD_DIR"
|
||||
|
||||
main() {
|
||||
check_system
|
||||
|
||||
opkg update
|
||||
|
||||
if [ -f "/etc/init.d/podkop" ]; then
|
||||
echo "Remove current vesrion podkop"
|
||||
opkg remove luci-i18n-podkop-ru luci-app-podkop podkop
|
||||
rm /etc/config/podkop
|
||||
else
|
||||
echo "Installed podkop..."
|
||||
fi
|
||||
|
||||
wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk' | while read -r url; do
|
||||
filename=$(basename "$url")
|
||||
filepath="$DOWNLOAD_DIR/$filename"
|
||||
|
||||
attempt=0
|
||||
while [ $attempt -lt $COUNT ]; do
|
||||
if [ -f "$filepath" ] && [ -s "$filepath" ]; then
|
||||
echo "$filename has already been uploaded"
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Download $filename (count $((attempt+1)))..."
|
||||
wget -q -O "$filepath" "$url"
|
||||
|
||||
if [ -s "$filepath" ]; then
|
||||
echo "$filename successfully downloaded"
|
||||
else
|
||||
echo "Download error $filename. Retry..."
|
||||
rm -f "$filepath"
|
||||
fi
|
||||
attempt=$((attempt+1))
|
||||
done
|
||||
done
|
||||
|
||||
for pkg in podkop luci-app-podkop; do
|
||||
file=$(ls "$DOWNLOAD_DIR" | grep "^$pkg" | head -n 1)
|
||||
if [ -n "$file" ]; then
|
||||
echo "Installing $file"
|
||||
opkg install "$DOWNLOAD_DIR/$file"
|
||||
fi
|
||||
done
|
||||
|
||||
ru=$(ls "$DOWNLOAD_DIR" | grep "luci-i18n-podkop-ru" | head -n 1)
|
||||
if [ -n "$ru" ]; then
|
||||
printf "\033[32;1mРусский язык интерфейса ставим? y/n (Need a Russian translation?)\033[0m "
|
||||
while true; do
|
||||
read -r -p '' RUS
|
||||
case $RUS in
|
||||
y)
|
||||
opkg install "$DOWNLOAD_DIR/$ru"
|
||||
break
|
||||
;;
|
||||
n)
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Введите y или n"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
rm -f $DOWNLOAD_DIR/podkop*.ipk $DOWNLOAD_DIR/luci-app-podkop*.ipk $DOWNLOAD_DIR/luci-i18n-podkop-ru*.ipk
|
||||
|
||||
}
|
||||
|
||||
|
||||
check_system() {
|
||||
# Get router model
|
||||
MODEL=$(cat /tmp/sysinfo/model)
|
||||
echo "Router model: $MODEL"
|
||||
|
||||
if ! nslookup google.com >/dev/null 2>&1; then
|
||||
log "DNS not working"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if opkg list-installed | grep -qE "iptables|kmod-iptab"; then
|
||||
printf "\033[31;1mFound incompatible iptables packages. If you're using FriendlyWrt: https://t.me/itdogchat/44512/181082\033[0m\n"
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
145
install.sh
145
install.sh
@@ -11,39 +11,14 @@ mkdir -p "$DOWNLOAD_DIR"
|
||||
|
||||
main() {
|
||||
check_system
|
||||
|
||||
wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk' | while read -r url; do
|
||||
filename=$(basename "$url")
|
||||
filepath="$DOWNLOAD_DIR/$filename"
|
||||
|
||||
attempt=0
|
||||
while [ $attempt -lt $COUNT ]; do
|
||||
if [ -f "$filepath" ] && [ -s "$filepath" ]; then
|
||||
echo "$filename has already been uploaded"
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Download $filename (count $((attempt+1)))..."
|
||||
wget -q -O "$filepath" "$url"
|
||||
|
||||
if [ -s "$filepath" ]; then
|
||||
echo "$filename successfully downloaded"
|
||||
break
|
||||
else
|
||||
echo "Download error $filename. Retry..."
|
||||
rm -f "$filepath"
|
||||
fi
|
||||
attempt=$((attempt+1))
|
||||
done
|
||||
done
|
||||
|
||||
echo "opkg update"
|
||||
sing_box
|
||||
|
||||
opkg update
|
||||
|
||||
if [ -f "/etc/init.d/podkop" ]; then
|
||||
printf "\033[32;1mPodkop is already installed. Just upgrade it? (y/n)\033[0m\n"
|
||||
printf "\033[32;1my - Only upgrade podkop\033[0m\n"
|
||||
printf "\033[32;1mn - Upgrade and install proxy or tunnels\033[0m\n"
|
||||
printf "\033[32;1mn - Upgrade and install tunnels (WG, AWG, OpenVPN, OC)\033[0m\n"
|
||||
|
||||
while true; do
|
||||
read -r -p '' UPDATE
|
||||
@@ -68,29 +43,66 @@ main() {
|
||||
add_tunnel
|
||||
fi
|
||||
|
||||
opkg install $DOWNLOAD_DIR/podkop*.ipk
|
||||
opkg install $DOWNLOAD_DIR/luci-app-podkop*.ipk
|
||||
|
||||
echo "Русский язык интерфейса ставим? y/n (Need a Russian translation?)"
|
||||
while true; do
|
||||
read -r -p '' RUS
|
||||
case $RUS in
|
||||
y)
|
||||
opkg install $DOWNLOAD_DIR/luci-i18n-podkop-ru*.ipk
|
||||
break
|
||||
;;
|
||||
|
||||
n)
|
||||
break
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Please enter y or n"
|
||||
;;
|
||||
esac
|
||||
download_success=0
|
||||
while read -r url; do
|
||||
filename=$(basename "$url")
|
||||
filepath="$DOWNLOAD_DIR/$filename"
|
||||
|
||||
attempt=0
|
||||
while [ $attempt -lt $COUNT ]; do
|
||||
echo "Download $filename (count $((attempt+1)))..."
|
||||
if wget -q -O "$filepath" "$url"; then
|
||||
if [ -s "$filepath" ]; then
|
||||
echo "$filename successfully downloaded"
|
||||
download_success=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
echo "Download error $filename. Retry..."
|
||||
rm -f "$filepath"
|
||||
attempt=$((attempt+1))
|
||||
done
|
||||
|
||||
if [ $attempt -eq $COUNT ]; then
|
||||
echo "Failed to download $filename after $COUNT attempts"
|
||||
fi
|
||||
done < <(wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk')
|
||||
|
||||
if [ $download_success -eq 0 ]; then
|
||||
echo "No packages were downloaded successfully"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for pkg in podkop luci-app-podkop; do
|
||||
file=$(ls "$DOWNLOAD_DIR" | grep "^$pkg" | head -n 1)
|
||||
if [ -n "$file" ]; then
|
||||
echo "Installing $file"
|
||||
opkg install "$DOWNLOAD_DIR/$file"
|
||||
sleep 3
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f $DOWNLOAD_DIR/podkop*.ipk $DOWNLOAD_DIR/luci-app-podkop*.ipk $DOWNLOAD_DIR/luci-i18n-podkop-ru*.ipk
|
||||
ru=$(ls "$DOWNLOAD_DIR" | grep "luci-i18n-podkop-ru" | head -n 1)
|
||||
if [ -n "$ru" ]; then
|
||||
printf "\033[32;1mРусский язык интерфейса ставим? y/n (Need a Russian translation?)\033[0m "
|
||||
while true; do
|
||||
read -r -p '' RUS
|
||||
case $RUS in
|
||||
y)
|
||||
opkg install "$DOWNLOAD_DIR/$ru"
|
||||
break
|
||||
;;
|
||||
n)
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Введите y или n"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
find "$DOWNLOAD_DIR" -type f -name '*podkop*' -exec rm {} \;
|
||||
|
||||
if [ "$IS_SHOULD_RESTART_NETWORK" ]; then
|
||||
printf "\033[32;1mRestart network\033[0m\n"
|
||||
@@ -99,7 +111,7 @@ main() {
|
||||
}
|
||||
|
||||
add_tunnel() {
|
||||
echo "Will you be using Wireguard, AmneziaWG, OpenVPN, OpenConnect? If yes, select a number and they will be automatically installed"
|
||||
printf "\033[32;1mWill you be using Wireguard, AmneziaWG, OpenVPN, OpenConnect? If yes, select a number and they will be automatically installed\033[0m "
|
||||
echo "1) Wireguard"
|
||||
echo "2) AmneziaWG"
|
||||
echo "3) OpenVPN"
|
||||
@@ -151,7 +163,7 @@ add_tunnel() {
|
||||
;;
|
||||
|
||||
5)
|
||||
echo "Skip. Use this if you're installing an upgrade."
|
||||
echo "Installation without additional dependencies."
|
||||
break
|
||||
;;
|
||||
|
||||
@@ -389,18 +401,37 @@ check_system() {
|
||||
echo "Router model: $MODEL"
|
||||
|
||||
# Check available space
|
||||
AVAILABLE_SPACE=$(df /tmp | awk 'NR==2 {print $4}')
|
||||
AVAILABLE_SPACE=$(df /overlay | awk 'NR==2 {print $4}')
|
||||
REQUIRED_SPACE=15360 # 15MB in KB
|
||||
|
||||
echo "Available space: $((AVAILABLE_SPACE/1024))MB"
|
||||
echo "Required space: $((REQUIRED_SPACE/1024))MB"
|
||||
|
||||
if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ]; then
|
||||
echo "Error: Insufficient space in /tmp"
|
||||
printf "\033[31;1mError: Insufficient space in flash\033[0m\n"
|
||||
echo "Available: $((AVAILABLE_SPACE/1024))MB"
|
||||
echo "Required: $((REQUIRED_SPACE/1024))MB"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! nslookup google.com >/dev/null 2>&1; then
|
||||
log "DNS not working"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if opkg list-installed | grep -qE "iptables|kmod-iptab"; then
|
||||
printf "\033[31;1mFound incompatible iptables packages. If you're using FriendlyWrt: https://t.me/itdogchat/44512/181082\033[0m\n"
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
sing_box() {
|
||||
if ! opkg list-installed | grep -q "^sing-box"; then
|
||||
return
|
||||
fi
|
||||
|
||||
sing_box_version=$(sing-box version | head -n 1 | awk '{print $3}')
|
||||
required_version="1.11.1"
|
||||
|
||||
if [ "$(echo -e "$sing_box_version\n$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
||||
opkg remove sing-box
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-podkop
|
||||
PKG_VERSION:=0.3.4
|
||||
PKG_VERSION:=0.3.11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI podkop app
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,44 +25,59 @@ msgstr "Тип подключения"
|
||||
msgid "Select between VPN and Proxy connection methods for traffic routing"
|
||||
msgstr "Выберите между VPN и Proxy методами для маршрутизации трафика"
|
||||
|
||||
msgid "Configuration Type"
|
||||
msgstr "Тип конфигурации"
|
||||
|
||||
msgid "Select how to configure the proxy"
|
||||
msgstr "Выберите способ настройки прокси"
|
||||
|
||||
msgid "Connection URL"
|
||||
msgstr "URL подключения"
|
||||
|
||||
msgid "Outbound Config"
|
||||
msgstr "Конфигурация Outbound"
|
||||
|
||||
msgid "Proxy Configuration URL"
|
||||
msgstr "URL конфигурации прокси"
|
||||
|
||||
msgid "Enter connection string starting with vless:// or ss:// for proxy configuration"
|
||||
msgstr "Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси"
|
||||
|
||||
msgid "Outbound Configuration"
|
||||
msgstr "Конфигурация исходящего соединения"
|
||||
|
||||
msgid "Enter complete outbound configuration in JSON format"
|
||||
msgstr "Введите полную конфигурацию исходящего соединения в формате JSON"
|
||||
|
||||
msgid "Network Interface"
|
||||
msgstr "Сетевой интерфейс"
|
||||
|
||||
msgid "Select network interface for VPN connection"
|
||||
msgstr "Выберите сетевой интерфейс для VPN подключения"
|
||||
|
||||
msgid "Community Domain Lists"
|
||||
msgstr "Предустановленные списки доменов"
|
||||
msgid "Community Lists"
|
||||
msgstr "Предустановленные списки"
|
||||
|
||||
msgid "Domain List"
|
||||
msgstr "Список доменов"
|
||||
msgid "Service List"
|
||||
msgstr "Список сервисов"
|
||||
|
||||
msgid "Select a list"
|
||||
msgstr "Выберите список доменов"
|
||||
msgid "Select predefined service for routing"
|
||||
msgstr "Выберите предустановленные сервисы для маршрутизации"
|
||||
|
||||
msgid "Community Subnet Lists"
|
||||
msgstr "Предустановленные сети сервисов"
|
||||
msgid "User Domain List Type"
|
||||
msgstr "Тип пользовательского списка доменов"
|
||||
|
||||
msgid "Enable routing for popular services like Twitter, Meta, and Discord"
|
||||
msgstr "Включить маршрутизацию для популярных сервисов, таких как Twitter, Meta и Discord"
|
||||
msgid "Select how to add your custom domains"
|
||||
msgstr "Выберите способ добавления пользовательских доменов"
|
||||
|
||||
msgid "Service Networks"
|
||||
msgstr "Сети сервисов"
|
||||
msgid "Disabled"
|
||||
msgstr "Отключено"
|
||||
|
||||
msgid "Select predefined service networks for routing"
|
||||
msgstr "Выберите предустановленные сети сервисов для маршрутизации"
|
||||
msgid "Dynamic List"
|
||||
msgstr "Динамический список"
|
||||
|
||||
msgid "User Domain List"
|
||||
msgstr "Пользовательский список доменов"
|
||||
|
||||
msgid "Enable and manage your custom list of domains for selective routing"
|
||||
msgstr "Включить и управлять пользовательским списком доменов для выборочной маршрутизации"
|
||||
msgid "Text List"
|
||||
msgstr "Текстовый список"
|
||||
|
||||
msgid "User Domains"
|
||||
msgstr "Пользовательские домены"
|
||||
@@ -70,6 +85,24 @@ msgstr "Пользовательские домены"
|
||||
msgid "Enter domain names without protocols (example: sub.example.com or example.com)"
|
||||
msgstr "Введите имена доменов без протоколов (пример: sub.example.com или example.com)"
|
||||
|
||||
msgid "User Domains List"
|
||||
msgstr "Список пользовательских доменов"
|
||||
|
||||
msgid "Enter domain names separated by comma, space or newline (example: sub.example.com, example.com or one domain per line)"
|
||||
msgstr "Введите имена доменов через запятую, пробел или новую строку (пример: sub.example.com, example.com или один домен на строку)"
|
||||
|
||||
msgid "Local Domain Lists"
|
||||
msgstr "Локальные списки доменов"
|
||||
|
||||
msgid "Use the list from the router filesystem"
|
||||
msgstr "Использовать список из файловой системы роутера"
|
||||
|
||||
msgid "Local Domain Lists Path"
|
||||
msgstr "Путь к локальным спискам доменов"
|
||||
|
||||
msgid "Enter to the list file path"
|
||||
msgstr "Введите путь к файлу списка"
|
||||
|
||||
msgid "Remote Domain Lists"
|
||||
msgstr "Удаленные списки доменов"
|
||||
|
||||
@@ -82,17 +115,26 @@ msgstr "URL удаленных доменов"
|
||||
msgid "Enter full URLs starting with http:// or https://"
|
||||
msgstr "Введите полные URL, начинающиеся с http:// или https://"
|
||||
|
||||
msgid "User Subnet List"
|
||||
msgstr "Пользовательский список подсетей"
|
||||
msgid "User Subnet List Type"
|
||||
msgstr "Тип пользовательского списка подсетей"
|
||||
|
||||
msgid "Enable and manage your custom list of IP subnets for selective routing"
|
||||
msgstr "Включить и управлять пользовательским списком IP-подсетей для выборочной маршрутизации"
|
||||
msgid "Select how to add your custom subnets"
|
||||
msgstr "Выберите способ добавления пользовательских подсетей"
|
||||
|
||||
msgid "Text List (comma/space/newline separated)"
|
||||
msgstr "Текстовый список (разделенный запятыми/пробелами/новыми строками)"
|
||||
|
||||
msgid "User Subnets"
|
||||
msgstr "Пользовательские подсети"
|
||||
|
||||
msgid "Enter subnet in CIDR notation (example: 103.21.244.0/22)"
|
||||
msgstr "Введите подсеть в нотации CIDR (пример: 103.21.244.0/22)"
|
||||
msgid "Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses"
|
||||
msgstr "Введите подсети в нотации CIDR (пример: 103.21.244.0/22) или отдельные IP-адреса"
|
||||
|
||||
msgid "User Subnets List"
|
||||
msgstr "Список пользовательских подсетей"
|
||||
|
||||
msgid "Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline"
|
||||
msgstr "Введите подсети в нотации CIDR или отдельные IP-адреса через запятую, пробел или новую строку"
|
||||
|
||||
msgid "Remote Subnet Lists"
|
||||
msgstr "Удаленные списки подсетей"
|
||||
@@ -103,18 +145,6 @@ msgstr "Загрузка и использование списков подсе
|
||||
msgid "Remote Subnet URLs"
|
||||
msgstr "URL удаленных подсетей"
|
||||
|
||||
msgid "Domain Exclusions"
|
||||
msgstr "Исключения доменов"
|
||||
|
||||
msgid "Exclude specific domains from routing rules"
|
||||
msgstr "Исключить определенные домены из правил маршрутизации"
|
||||
|
||||
msgid "Excluded Domains"
|
||||
msgstr "Исключенные домены"
|
||||
|
||||
msgid "Domains to be excluded from routing"
|
||||
msgstr "Домены, которые будут исключены из маршрутизации"
|
||||
|
||||
msgid "IP for full redirection"
|
||||
msgstr "Принудительные прокси IP"
|
||||
|
||||
@@ -133,6 +163,27 @@ msgstr "Исключения прокси IP"
|
||||
msgid "Specify local IP addresses that will never use the configured route"
|
||||
msgstr "Укажите локальные IP-адреса, которые никогда не будут использовать настроенный маршрут"
|
||||
|
||||
msgid "Mixed enable"
|
||||
msgstr "Включить смешанный режим"
|
||||
|
||||
msgid "Browser port: 2080"
|
||||
msgstr "Порт браузера: 2080"
|
||||
|
||||
msgid "Yacd enable"
|
||||
msgstr "Включить Yacd"
|
||||
|
||||
msgid "Exclude NTP"
|
||||
msgstr "Исключить NTP"
|
||||
|
||||
msgid "For issues with open connections sing-box"
|
||||
msgstr "Для проблем с открытыми соединениями sing-box"
|
||||
|
||||
msgid "QUIC disable"
|
||||
msgstr "Отключить QUIC"
|
||||
|
||||
msgid "For issues with the video stream"
|
||||
msgstr "Для проблем с видеопотоком"
|
||||
|
||||
msgid "List Update Frequency"
|
||||
msgstr "Частота обновления списков"
|
||||
|
||||
@@ -145,6 +196,9 @@ msgstr "Каждый час"
|
||||
msgid "Every 2 hours"
|
||||
msgstr "Каждые 2 часа"
|
||||
|
||||
msgid "Every 3 hours"
|
||||
msgstr "Каждые 3 часа"
|
||||
|
||||
msgid "Every 4 hours"
|
||||
msgstr "Каждые 4 часа"
|
||||
|
||||
@@ -154,51 +208,18 @@ msgstr "Каждые 6 часов"
|
||||
msgid "Every 12 hours"
|
||||
msgstr "Каждые 12 часов"
|
||||
|
||||
msgid "Every day"
|
||||
msgstr "Каждый день"
|
||||
|
||||
msgid "Every 3 days"
|
||||
msgstr "Каждые 3 дня"
|
||||
|
||||
msgid "Once a day at 04:00"
|
||||
msgstr "Раз в день в 04:00"
|
||||
|
||||
msgid "Once a week on Sunday at 04:00"
|
||||
msgstr "Раз в неделю в воскресенье в 04:00"
|
||||
|
||||
msgid "Yacd enable"
|
||||
msgstr "Включить Yacd"
|
||||
|
||||
msgid "Mixed enable"
|
||||
msgstr "Включить смешанный режим"
|
||||
|
||||
msgid "Browser port: 2080"
|
||||
msgstr "Порт браузера: 2080"
|
||||
|
||||
msgid "Exclude NTP"
|
||||
msgstr "Исключить NTP"
|
||||
|
||||
msgid "For issues with open connections sing-box"
|
||||
msgstr "Для проблем с открытыми соединениями sing-box"
|
||||
|
||||
msgid "Service Domain List Enable"
|
||||
msgstr "Включить список доменов сервисов"
|
||||
|
||||
msgid "Enable predefined service domain lists for routing"
|
||||
msgstr "Включить предустановленные списки доменов для маршрутизации"
|
||||
|
||||
msgid "Service List"
|
||||
msgstr "Список сервисов"
|
||||
|
||||
msgid "Select predefined services for routing"
|
||||
msgstr "Выберите предустановленные сервисы для маршрутизации"
|
||||
|
||||
msgid "Domains"
|
||||
msgstr "Домены"
|
||||
|
||||
msgid "Subnet List"
|
||||
msgstr "Список подсетей"
|
||||
|
||||
msgid "Configure custom subnets for routing"
|
||||
msgstr "Настройка пользовательских подсетей для маршрутизации"
|
||||
|
||||
msgid "Subnets"
|
||||
msgstr "Подсети"
|
||||
|
||||
msgid "Invalid domain format. Enter domain without protocol (example: sub.example.com)"
|
||||
msgstr "Неверный формат домена. Введите домен без протокола (пример: sub.example.com)"
|
||||
|
||||
@@ -208,8 +229,8 @@ msgstr "URL должен использовать протокол http:// ил
|
||||
msgid "Invalid URL format. URL must start with http:// or https://"
|
||||
msgstr "Неверный формат URL. URL должен начинаться с http:// или https://"
|
||||
|
||||
msgid "Invalid subnet format. Use format: X.X.X.X/Y (like 192.168.1.0/24)"
|
||||
msgstr "Неверный формат подсети. Используйте формат: X.X.X.X/Y (например: 192.168.1.0/24)"
|
||||
msgid "Invalid format. Use format: X.X.X.X or X.X.X.X/Y"
|
||||
msgstr "Неверный формат. Используйте формат: X.X.X.X или X.X.X.X/Y"
|
||||
|
||||
msgid "IP address parts must be between 0 and 255"
|
||||
msgstr "Части IP-адреса должны быть между 0 и 255"
|
||||
@@ -220,71 +241,23 @@ msgstr "CIDR должен быть между 0 и 32"
|
||||
msgid "Invalid IP format. Use format: X.X.X.X (like 192.168.1.1)"
|
||||
msgstr "Неверный формат IP. Используйте формат: X.X.X.X (например: 192.168.1.1)"
|
||||
|
||||
msgid "User Domain List Type"
|
||||
msgstr "Тип пользовательского списка доменов"
|
||||
|
||||
msgid "Select how to add your custom domains"
|
||||
msgstr "Выберите способ добавления пользовательских доменов"
|
||||
|
||||
msgid "Disabled"
|
||||
msgstr "Отключено"
|
||||
|
||||
msgid "Dynamic List"
|
||||
msgstr "Динамический список"
|
||||
|
||||
msgid "Text List"
|
||||
msgstr "Текстовый список"
|
||||
|
||||
msgid "User Domains List"
|
||||
msgstr "Список пользовательских доменов"
|
||||
|
||||
msgid "Enter domain names separated by comma, space or newline (example: sub.example.com, example.com or one domain per line)"
|
||||
msgstr "Введите имена доменов через запятую, пробел или новую строку (пример: sub.example.com, example.com или один домен на строку)"
|
||||
|
||||
msgid "Invalid domain format: %s. Enter domain without protocol"
|
||||
msgstr "Неверный формат домена: %s. Введите домен без протокола"
|
||||
|
||||
msgid "User Subnet List Type"
|
||||
msgstr "Тип пользовательского списка подсетей"
|
||||
|
||||
msgid "Select how to add your custom subnets"
|
||||
msgstr "Выберите способ добавления пользовательских подсетей"
|
||||
|
||||
msgid "Text List (comma/space/newline separated)"
|
||||
msgstr "Текстовый список (разделенный запятыми/пробелами/новыми строками)"
|
||||
|
||||
msgid "Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses"
|
||||
msgstr "Введите подсети в нотации CIDR (пример: 103.21.244.0/22) или отдельные IP-адреса"
|
||||
|
||||
msgid "User Subnets List"
|
||||
msgstr "Список пользовательских подсетей"
|
||||
|
||||
msgid "Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline"
|
||||
msgstr "Введите подсети в нотации CIDR или отдельные IP-адреса через запятую, пробел или новую строку"
|
||||
|
||||
msgid "Invalid format. Use format: X.X.X.X or X.X.X.X/Y"
|
||||
msgstr "Неверный формат. Используйте формат: X.X.X.X или X.X.X.X/Y"
|
||||
msgid "Invalid format: %s. Use format: X.X.X.X or X.X.X.X/Y"
|
||||
msgstr "Неверный формат: %s. Используйте формат: X.X.X.X или X.X.X.X/Y"
|
||||
|
||||
msgid "IP parts must be between 0 and 255 in: %s"
|
||||
msgstr "Части IP-адреса должны быть между 0 и 255 в: %s"
|
||||
|
||||
msgid "Configuration Type"
|
||||
msgstr "Тип конфигурации"
|
||||
msgid "CIDR must be between 0 and 32 in: %s"
|
||||
msgstr "CIDR должен быть между 0 и 32 в: %s"
|
||||
|
||||
msgid "Select how to configure the proxy"
|
||||
msgstr "Выберите способ настройки прокси"
|
||||
msgid "Invalid path format. Path must start with \"/\" and contain only valid characters (letters, numbers, \"-\", \"_\", \"/\", \".\")"
|
||||
msgstr "Неверный формат пути. Путь должен начинаться с \"/\" и содержать только допустимые символы (буквы, цифры, \"-\", \"_\", \"/\", \".\")"
|
||||
|
||||
msgid "Connection URL"
|
||||
msgstr "URL подключения"
|
||||
|
||||
msgid "Outbound Config"
|
||||
msgstr "Конфигурация Outbound"
|
||||
|
||||
msgid "Outbound Configuration"
|
||||
msgstr "Конфигурация исходящего соединения"
|
||||
|
||||
msgid "Enter complete outbound configuration in JSON format"
|
||||
msgstr "Введите полную конфигурацию исходящего соединения в формате JSON"
|
||||
msgid "Invalid path format"
|
||||
msgstr "Неверный формат пути"
|
||||
|
||||
msgid "JSON must contain at least type, server and server_port fields"
|
||||
msgstr "JSON должен содержать как минимум поля type, server и server_port"
|
||||
@@ -292,41 +265,233 @@ msgstr "JSON должен содержать как минимум поля type
|
||||
msgid "Invalid JSON format"
|
||||
msgstr "Неверный формат JSON"
|
||||
|
||||
msgid "Diagnostics"
|
||||
msgstr "Диагностика"
|
||||
msgid "Warning: %s cannot be used together with %s. Previous selections have been removed."
|
||||
msgstr "Предупреждение: %s нельзя использовать вместе с %s. Предыдущие варианты были удалены."
|
||||
|
||||
msgid "Main Check"
|
||||
msgstr "Основная проверка"
|
||||
msgid "Regional options cannot be used together"
|
||||
msgstr "Нельзя использовать несколько региональных опций"
|
||||
|
||||
msgid "Run a comprehensive diagnostic check of all components"
|
||||
msgstr "Запустить комплексную диагностическую проверку всех компонентов"
|
||||
msgid "Warning: Russia inside can only be used with Meta, Twitter, Discord, and Telegram. %s already in Russia inside and have been removed from selection."
|
||||
msgstr "Внимание: Russia inside может использоваться только с Meta, Twitter, Discord и Telegram. %s были удалены из выбора."
|
||||
|
||||
msgid "Run Check"
|
||||
msgstr "Запустить проверку"
|
||||
msgid "Russia inside restrictions"
|
||||
msgstr "Ограничения Russia inside"
|
||||
|
||||
msgid "Full Diagnostic Results"
|
||||
msgstr "Полные результаты диагностики"
|
||||
msgid "URL must start with vless:// or ss://"
|
||||
msgstr "URL должен начинаться с vless:// или ss://"
|
||||
|
||||
msgid "Failed to copy: "
|
||||
msgstr "Ошибка копирования: "
|
||||
msgid "Invalid Shadowsocks URL format: missing method and password separator \":\""
|
||||
msgstr "Неверный формат URL Shadowsocks: отсутствует разделитель метода и пароля \":\""
|
||||
|
||||
msgid "Copy to Clipboard"
|
||||
msgstr "Скопировать в буфер"
|
||||
msgid "Invalid Shadowsocks URL format"
|
||||
msgstr "Неверный формат URL Shadowsocks"
|
||||
|
||||
msgid "Close"
|
||||
msgstr "Закрыть"
|
||||
msgid "Invalid Shadowsocks URL: missing server address"
|
||||
msgstr "Неверный URL Shadowsocks: отсутствует адрес сервера"
|
||||
|
||||
msgid "No output"
|
||||
msgstr "Нет данных"
|
||||
msgid "Invalid Shadowsocks URL: missing server"
|
||||
msgstr "Неверный URL Shadowsocks: отсутствует сервер"
|
||||
|
||||
msgid "System Logs"
|
||||
msgstr "Системные логи"
|
||||
msgid "Invalid Shadowsocks URL: missing port"
|
||||
msgstr "Неверный URL Shadowsocks: отсутствует порт"
|
||||
|
||||
msgid "View recent system logs related to Podkop"
|
||||
msgstr "Просмотр недавних системных логов, связанных с Podkop"
|
||||
msgid "Invalid port number. Must be between 1 and 65535"
|
||||
msgstr "Неверный номер порта. Должен быть между 1 и 65535"
|
||||
|
||||
msgid "View Logs"
|
||||
msgstr "Просмотр логов"
|
||||
msgid "Invalid Shadowsocks URL: missing or invalid server/port format"
|
||||
msgstr "Неверный URL Shadowsocks: отсутствует или неверный формат сервера/порта"
|
||||
|
||||
msgid "Failed to copy logs: "
|
||||
msgstr "Ошибка копирования логов: "
|
||||
msgid "Invalid VLESS URL: missing UUID"
|
||||
msgstr "Неверный URL VLESS: отсутствует UUID"
|
||||
|
||||
msgid "Invalid VLESS URL: missing server address"
|
||||
msgstr "Неверный URL VLESS: отсутствует адрес сервера"
|
||||
|
||||
msgid "Invalid VLESS URL: missing server"
|
||||
msgstr "Неверный URL VLESS: отсутствует сервер"
|
||||
|
||||
msgid "Invalid VLESS URL: missing port"
|
||||
msgstr "Неверный URL VLESS: отсутствует порт"
|
||||
|
||||
msgid "Invalid VLESS URL: missing or invalid server/port format"
|
||||
msgstr "Неверный URL VLESS: отсутствует или неверный формат сервера/порта"
|
||||
|
||||
msgid "Invalid VLESS URL: missing query parameters"
|
||||
msgstr "Неверный URL VLESS: отсутствуют параметры запроса"
|
||||
|
||||
msgid "Invalid VLESS URL: missing type parameter"
|
||||
msgstr "Неверный URL VLESS: отсутствует параметр type"
|
||||
|
||||
msgid "Invalid VLESS URL: missing security parameter"
|
||||
msgstr "Неверный URL VLESS: отсутствует параметр security"
|
||||
|
||||
msgid "Invalid VLESS URL: missing pbk parameter for reality security"
|
||||
msgstr "Неверный URL VLESS: отсутствует параметр pbk для security reality"
|
||||
|
||||
msgid "Invalid VLESS URL: missing fp parameter for reality security"
|
||||
msgstr "Неверный URL VLESS: отсутствует параметр fp для security reality"
|
||||
|
||||
msgid "Invalid VLESS URL: missing sni parameter for tls security"
|
||||
msgstr "Неверный URL VLESS: отсутствует параметр sni для security tls"
|
||||
|
||||
msgid "Invalid URL format: %s"
|
||||
msgstr "Неверный формат URL: %s"
|
||||
|
||||
msgid "Remote Domain Lists URL"
|
||||
msgstr "URL удаленных списков доменов"
|
||||
|
||||
msgid "Enter URL to download domain list"
|
||||
msgstr "Введите URL для загрузки списка доменов"
|
||||
|
||||
msgid "Update Interval"
|
||||
msgstr "Интервал обновления"
|
||||
|
||||
msgid "Select how often to update the lists"
|
||||
msgstr "Выберите, как часто обновлять списки"
|
||||
|
||||
msgid "Last Update"
|
||||
msgstr "Последнее обновление"
|
||||
|
||||
msgid "Last update time"
|
||||
msgstr "Время последнего обновления"
|
||||
|
||||
msgid "Next Update"
|
||||
msgstr "Следующее обновление"
|
||||
|
||||
msgid "Next scheduled update time"
|
||||
msgstr "Время следующего запланированного обновления"
|
||||
|
||||
msgid "Version"
|
||||
msgstr "Версия"
|
||||
|
||||
msgid "Component version"
|
||||
msgstr "Версия компонента"
|
||||
|
||||
msgid "Installed"
|
||||
msgstr "Установлено"
|
||||
|
||||
msgid "Not installed"
|
||||
msgstr "Не установлено"
|
||||
|
||||
msgid "Unknown version"
|
||||
msgstr "Неизвестная версия"
|
||||
|
||||
msgid "Error parsing version"
|
||||
msgstr "Ошибка разбора версии"
|
||||
|
||||
msgid "Error parsing status"
|
||||
msgstr "Ошибка разбора статуса"
|
||||
|
||||
msgid "Service is running"
|
||||
msgstr "Сервис запущен"
|
||||
|
||||
msgid "Service is stopped"
|
||||
msgstr "Сервис остановлен"
|
||||
|
||||
msgid "Service is enabled"
|
||||
msgstr "Сервис включен"
|
||||
|
||||
msgid "Service is disabled"
|
||||
msgstr "Сервис отключен"
|
||||
|
||||
msgid "Service Status"
|
||||
msgstr "Статус сервиса"
|
||||
|
||||
msgid "working"
|
||||
msgstr "работает"
|
||||
|
||||
msgid "not working"
|
||||
msgstr "не работает"
|
||||
|
||||
msgid "check error"
|
||||
msgstr "ошибка проверки"
|
||||
|
||||
msgid "Diagnostic check in progress..."
|
||||
msgstr "Выполняется диагностическая проверка..."
|
||||
|
||||
msgid "Diagnostic check completed"
|
||||
msgstr "Диагностическая проверка завершена"
|
||||
|
||||
msgid "Diagnostic check failed"
|
||||
msgstr "Диагностическая проверка не удалась"
|
||||
|
||||
msgid "Update in progress..."
|
||||
msgstr "Выполняется обновление..."
|
||||
|
||||
msgid "Update completed"
|
||||
msgstr "Обновление завершено"
|
||||
|
||||
msgid "Update failed"
|
||||
msgstr "Обновление не удалось"
|
||||
|
||||
msgid "Check in progress..."
|
||||
msgstr "Выполняется проверка..."
|
||||
|
||||
msgid "Check completed"
|
||||
msgstr "Проверка завершена"
|
||||
|
||||
msgid "Check failed"
|
||||
msgstr "Проверка не удалась"
|
||||
|
||||
msgid "Version Information"
|
||||
msgstr "Информация о версии"
|
||||
|
||||
msgid "Copied!"
|
||||
msgstr "Скопировано!"
|
||||
|
||||
msgid "Podkop Status"
|
||||
msgstr "Статус Podkop"
|
||||
|
||||
msgid "Start Podkop"
|
||||
msgstr "Запустить Podkop"
|
||||
|
||||
msgid "Stop Podkop"
|
||||
msgstr "Остановить Podkop"
|
||||
|
||||
msgid "Restart Podkop"
|
||||
msgstr "Перезапустить Podkop"
|
||||
|
||||
msgid "Enable Podkop"
|
||||
msgstr "Включить Podkop"
|
||||
|
||||
msgid "Disable Podkop"
|
||||
msgstr "Отключить Podkop"
|
||||
|
||||
msgid "Loading diagnostics..."
|
||||
msgstr "Загрузка диагностики..."
|
||||
|
||||
msgid "Error loading diagnostics"
|
||||
msgstr "Ошибка загрузки диагностики"
|
||||
|
||||
msgid "Sing-box Status"
|
||||
msgstr "Статус Sing-box"
|
||||
|
||||
msgid "Diagnostic Tools"
|
||||
msgstr "Инструменты диагностики"
|
||||
|
||||
msgid "Unknown"
|
||||
msgstr "Неизвестно"
|
||||
|
||||
msgid "Device Model: "
|
||||
msgstr "Модель устройства: "
|
||||
|
||||
msgid "OpenWrt Version: "
|
||||
msgstr "Версия OpenWrt: "
|
||||
|
||||
msgid "Sing-box: "
|
||||
msgstr "Sing-box: "
|
||||
|
||||
msgid "LuCI App: "
|
||||
msgstr "LuCI App: "
|
||||
|
||||
msgid "Podkop: "
|
||||
msgstr "Podkop: "
|
||||
|
||||
msgid "Check NFT Rules"
|
||||
msgstr "Проверить правила NFT"
|
||||
|
||||
msgid "Update Lists"
|
||||
msgstr "Обновить списки"
|
||||
|
||||
msgid "Lists Update Results"
|
||||
msgstr "Результаты обновления списков"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=podkop
|
||||
PKG_VERSION:=0.3.4
|
||||
PKG_VERSION:=0.3.11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||
@@ -33,6 +33,8 @@ define Package/podkop/prerm
|
||||
|
||||
grep -q "105 podkop" /etc/iproute2/rt_tables && sed -i "/105 podkop/d" /etc/iproute2/rt_tables
|
||||
|
||||
/etc/init.d/podkop stop
|
||||
|
||||
exit 0
|
||||
endef
|
||||
|
||||
|
||||
@@ -28,5 +28,7 @@ config main 'main'
|
||||
option yacd '0'
|
||||
option socks5 '0'
|
||||
option exclude_ntp '0'
|
||||
option quic_disable '0'
|
||||
option dont_touch_dhcp '0'
|
||||
option update_interval '1d'
|
||||
option custom_domains_text
|
||||
@@ -7,18 +7,22 @@ script=$(readlink "$initscript")
|
||||
NAME="$(basename ${script:-$initscript})"
|
||||
config_load "$NAME"
|
||||
|
||||
EXTRA_COMMANDS="list_update check_proxy check_nft check_github check_logs check_all check_three main show_config show_version"
|
||||
EXTRA_COMMANDS="main list_update check_proxy check_nft check_github check_logs check_sing_box_connections check_sing_box_logs check_dnsmasq show_config show_version show_sing_box_config show_luci_version show_sing_box_version show_system_info get_status get_sing_box_status"
|
||||
EXTRA_HELP=" list_update Updating domain and subnet lists
|
||||
sing_box_config_vless For test vless string
|
||||
check_proxy Check if sing-box proxy works correctly
|
||||
check_nft Show PodkopTable nftables rules
|
||||
check_github Check GitHub connectivity and lists availability
|
||||
check_logs Show podkop logs from system journal
|
||||
check_all Run all checks
|
||||
check_three Run check_proxy, check_nft and check_github
|
||||
main Main function
|
||||
check_sing_box_connections Show active sing-box network connections
|
||||
check_sing_box_logs Show recent sing-box logs
|
||||
check_dnsmasq Show current DNSMasq configuration
|
||||
show_config Show current configuration with masked sensitive data
|
||||
show_version Show current version"
|
||||
show_version Show current version
|
||||
show_sing_box_config Show current sing-box configuration
|
||||
show_luci_version Show LuCI app version
|
||||
show_sing_box_version Show sing-box version
|
||||
show_system_info Show OpenWrt version and device model
|
||||
get_sing_box_status Get sing-box status"
|
||||
|
||||
[ ! -L /usr/sbin/podkop ] && ln -s /etc/init.d/podkop /usr/sbin/podkop
|
||||
|
||||
@@ -35,10 +39,32 @@ SUBNETS_TELERAM="${GITHUB_RAW_URL}/Subnets/IPv4/telegram.lst"
|
||||
SING_BOX_CONFIG="/etc/sing-box/config.json"
|
||||
CACHE_FILE_PATH="/tmp/cache.db"
|
||||
FAKEIP="198.18.0.0/15"
|
||||
VALID_SERVICES="russia_inside russia_outside ukraine_inside geoblock block porn news anime youtube discord meta twitter hdrezka tiktok telegram"
|
||||
|
||||
start_service() {
|
||||
log "Start podkop"
|
||||
|
||||
sing_box_version=$(sing-box version | head -n 1 | awk '{print $3}')
|
||||
required_version="1.11.1"
|
||||
|
||||
if [ "$(echo -e "$sing_box_version\n$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
||||
echo "The version of sing-box ($sing_box_version) is lower than the minimum version. Update sing-box: opkg update && opkg remove sing-box && opkg install sing-box"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if opkg list-installed | grep -qE "iptables|kmod-iptab"; then
|
||||
printf "\033[31;1mFound incompatible iptables packages. If you're using FriendlyWrt: https://t.me/itdogchat/44512/181082\033[0m\n"
|
||||
fi
|
||||
|
||||
if ! ip addr | grep -q "br-lan"; then
|
||||
log "Interface br-lan not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
migration
|
||||
|
||||
config_foreach process_validate_service
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /bin/sh -c "/etc/init.d/podkop main &"
|
||||
procd_set_param stdout 1
|
||||
@@ -49,9 +75,13 @@ start_service() {
|
||||
stop_service() {
|
||||
log "Stopping the podkop"
|
||||
remove_cron_job
|
||||
dnsmasq_rm
|
||||
|
||||
rm -rf /tmp/podkop/*
|
||||
config_get_bool dont_touch_dhcp "main" "dont_touch_dhcp" "0"
|
||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||
dnsmasq_restore
|
||||
fi
|
||||
|
||||
rm -rf /tmp/podkop/*.lst
|
||||
|
||||
log "Flush nft"
|
||||
if nft list table inet PodkopTable >/dev/null 2>&1; then
|
||||
@@ -111,26 +141,12 @@ nolog() {
|
||||
}
|
||||
|
||||
main() {
|
||||
sing_box_version=$(sing-box version | head -n 1 | awk '{print $3}')
|
||||
required_version="1.11.1"
|
||||
|
||||
if [ "$(echo -e "$sing_box_version\n$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
||||
echo "The version of sing-box ($sing_box_version) is lower than the minimum version. Update sing-box: opkg update && opkg install sing-box"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
migration
|
||||
|
||||
sleep 5
|
||||
|
||||
config_foreach wget_github
|
||||
|
||||
mkdir -p /tmp/podkop
|
||||
|
||||
if ! ip addr | grep -q "br-lan"; then
|
||||
log "Interface br-lan not found"
|
||||
fi
|
||||
|
||||
|
||||
# base
|
||||
route_table_rule_mark
|
||||
create_nft_table
|
||||
@@ -141,6 +157,7 @@ main() {
|
||||
sing_box_dns
|
||||
sing_box_dns_rule_fakeip
|
||||
sing_box_rule_dns
|
||||
sing_box_add_secure_dns_probe_domain
|
||||
sing_box_cache_file
|
||||
process_socks5
|
||||
|
||||
@@ -178,6 +195,12 @@ main() {
|
||||
nft insert rule inet PodkopTable mangle udp dport 123 return
|
||||
fi
|
||||
|
||||
config_get_bool quic_disable "main" "quic_disable" "0"
|
||||
if [ "$quic_disable" -eq 1 ]; then
|
||||
log "Rule for disable QUIC"
|
||||
sing_box_quic_reject
|
||||
fi
|
||||
|
||||
sing_box_config_check
|
||||
/etc/init.d/sing-box restart
|
||||
/etc/init.d/sing-box enable
|
||||
@@ -186,22 +209,82 @@ main() {
|
||||
config_get interface "main" "interface"
|
||||
|
||||
if [ -n "$proxy_string" ] || [ -n "$interface" ]; then
|
||||
dnsmasq_add
|
||||
config_get_bool dont_touch_dhcp "main" "dont_touch_dhcp" "0"
|
||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||
dnsmasq_add_resolver
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Migrations funcs
|
||||
# Migrations and validation funcs
|
||||
migration() {
|
||||
# list migrate
|
||||
grep -q "list domain_list 'ru_inside'" /etc/config/podkop && sed -i "s/list domain_list 'ru_inside'/list domain_list 'russia_inside'/" /etc/config/podkop
|
||||
grep -q "list domain_list 'ru_outside'" /etc/config/podkop && sed -i "s/list domain_list 'ru_outside'/list domain_list 'russia_outside'/" /etc/config/podkop
|
||||
grep -q "list domain_list 'ua'" /etc/config/podkop && sed -i "s/list domain_list 'ua'/list domain_list 'ukraine_inside'/" /etc/config/podkop
|
||||
local CONFIG="/etc/config/podkop"
|
||||
|
||||
if grep -q "ru_inside" $CONFIG; then
|
||||
log "Depricated list found: ru_inside"
|
||||
sed -i '/ru_inside/d' $CONFIG
|
||||
fi
|
||||
|
||||
if grep -q "list domain_list 'ru_outside'" $CONFIG; then
|
||||
log "Depricated list found: sru_outside"
|
||||
sed -i '/ru_outside/d' $CONFIG
|
||||
fi
|
||||
|
||||
if grep -q "list domain_list 'ua'" $CONFIG; then
|
||||
log "Depricated list found: ua"
|
||||
sed -i '/ua/d' $CONFIG
|
||||
fi
|
||||
|
||||
# Subnet list
|
||||
if grep -q "list subnets" $CONFIG; then
|
||||
log "Depricated second section found"
|
||||
sed -i '/list subnets/d' $CONFIG
|
||||
fi
|
||||
|
||||
# second remove
|
||||
grep -q "config second 'second'" /etc/config/podkop && sed -i '/second/d' /etc/config/podkop
|
||||
if grep -q "config second 'second'" $CONFIG; then
|
||||
log "Depricated second section found"
|
||||
sed -i '/second/d' $CONFIG
|
||||
fi
|
||||
|
||||
# cron update
|
||||
grep -qE "^\s*option update_interval '[0-9*/,-]+( [0-9*/,-]+){4}'" /etc/config/podkop && sed -i "s|^\(\s*option update_interval\) '[0-9*/,-]\+\( [0-9*/,-]\+\)\{4\}'|\1 '1d'|" /etc/config/podkop
|
||||
if grep -qE "^\s*option update_interval '[0-9*/,-]+( [0-9*/,-]+){4}'" $CONFIG; then
|
||||
log "Depricated update_interval"
|
||||
sed -i "s|^\(\s*option update_interval\) '[0-9*/,-]\+\( [0-9*/,-]\+\)\{4\}'|\1 '1d'|" $CONFIG
|
||||
fi
|
||||
|
||||
# dnsmasq https
|
||||
if grep -q "^filter-rr=HTTPS" "/etc/dnsmasq.conf"; then
|
||||
log "Found and removed filter-rr=HTTPS in dnsmasq config"
|
||||
sed -i '/^filter-rr=HTTPS/d' "/etc/dnsmasq.conf"
|
||||
fi
|
||||
|
||||
# dhcp use-application-dns.net
|
||||
if grep -q "use-application-dns.net" "/etc/config/dhcp"; then
|
||||
log "Found and removed use-application-dns.net in dhcp config"
|
||||
sed -i '/use-application-dns/d' "/etc/config/dhcp"
|
||||
fi
|
||||
}
|
||||
|
||||
validate_service() {
|
||||
local domain="$1"
|
||||
|
||||
for valid_service in $VALID_SERVICES; do
|
||||
if [ "$domain" = "$valid_service" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
log "Invalid service in domain_list: $domain. Exiting. Check config and LuCI cache"
|
||||
exit 1
|
||||
}
|
||||
|
||||
process_validate_service() {
|
||||
config_get_bool domain_list_enabled "$section" "domain_list_enabled" "0"
|
||||
if [ "$domain_list_enabled" -eq 1 ]; then
|
||||
config_list_foreach "$section" domain_list validate_service
|
||||
fi
|
||||
}
|
||||
|
||||
# Main funcs
|
||||
@@ -245,31 +328,72 @@ create_nft_table() {
|
||||
nft add rule inet $table proxy meta mark 0x105 meta l4proto udp tproxy ip to :1602 counter
|
||||
}
|
||||
|
||||
dnsmasq_add() {
|
||||
## Future: Check config and skip restart
|
||||
save_dnsmasq_config() {
|
||||
local key="$1"
|
||||
local backup_key="$2"
|
||||
value=$(uci get "$key" 2>/dev/null)
|
||||
|
||||
if [ -z "$value" ]; then
|
||||
uci -q delete "$backup_key"
|
||||
else
|
||||
uci set "$backup_key"="$value"
|
||||
fi
|
||||
}
|
||||
|
||||
dnsmasq_add_resolver() {
|
||||
log "Save dnsmasq config"
|
||||
save_dnsmasq_config "dhcp.@dnsmasq[0].noresolv" "dhcp.@dnsmasq[0].podkop_noresolv"
|
||||
save_dnsmasq_config "dhcp.@dnsmasq[0].cachesize" "dhcp.@dnsmasq[0].podkop_cachesize"
|
||||
|
||||
uci -q delete dhcp.@dnsmasq[0].podkop_server
|
||||
for server in $(uci get dhcp.@dnsmasq[0].server 2>/dev/null); do
|
||||
if [[ "$server" == "127.0.0.42" ]]; then
|
||||
log "Dnsmasq save config error: server=127.0.0.42"
|
||||
else
|
||||
uci add_list dhcp.@dnsmasq[0].podkop_server="$server"
|
||||
fi
|
||||
done
|
||||
|
||||
log "Configure dnsmasq for sing-box"
|
||||
uci set dhcp.@dnsmasq[0].noresolv="1"
|
||||
uci set dhcp.@dnsmasq[0].filter_aaaa="1"
|
||||
uci set dhcp.@dnsmasq[0].cachesize="0"
|
||||
uci -q delete dhcp.@dnsmasq[0].server
|
||||
uci add_list dhcp.@dnsmasq[0].server="127.0.0.1#5353"
|
||||
uci add_list dhcp.@dnsmasq[0].server='/use-application-dns.net/'
|
||||
uci add_list dhcp.@dnsmasq[0].server="127.0.0.42"
|
||||
uci commit dhcp
|
||||
|
||||
grep -q "filter-rr=HTTPS" /etc/dnsmasq.conf || echo "filter-rr=HTTPS" >> /etc/dnsmasq.conf
|
||||
|
||||
/etc/init.d/dnsmasq restart
|
||||
}
|
||||
|
||||
dnsmasq_rm() {
|
||||
dnsmasq_restore() {
|
||||
log "Removing configuration for dnsmasq"
|
||||
uci set dhcp.@dnsmasq[0].noresolv="0"
|
||||
uci set dhcp.@dnsmasq[0].filter_aaaa="0"
|
||||
uci set dhcp.@dnsmasq[0].cachesize="1000"
|
||||
uci -q delete dhcp.@dnsmasq[0].server
|
||||
uci commit dhcp
|
||||
|
||||
sed -i '/filter-rr=HTTPS/d' /etc/dnsmasq.conf
|
||||
local cachesize=$(uci get dhcp.@dnsmasq[0].podkop_cachesize 2>/dev/null)
|
||||
if [ -z "$cachesize" ]; then
|
||||
log "dnsmasq revert: cachesize is unset"
|
||||
else
|
||||
uci set dhcp.@dnsmasq[0].cachesize="$cachesize"
|
||||
fi
|
||||
|
||||
local noresolv=$(uci get dhcp.@dnsmasq[0].podkop_noresolv 2>/dev/null)
|
||||
if [ -z "$noresolv" ]; then
|
||||
log "dnsmasq revert: noresolv is unset"
|
||||
else
|
||||
uci set dhcp.@dnsmasq[0].noresolv="$noresolv"
|
||||
fi
|
||||
|
||||
local server=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
|
||||
if [[ "$server" == "127.0.0.42" ]]; then
|
||||
uci -q delete dhcp.@dnsmasq[0].server
|
||||
for server in $(uci get dhcp.@dnsmasq[0].podkop_server 2>/dev/null); do
|
||||
uci add_list dhcp.@dnsmasq[0].server="$server"
|
||||
done
|
||||
uci delete dhcp.@dnsmasq[0].podkop_server
|
||||
fi
|
||||
|
||||
uci delete dhcp.@dnsmasq[0].podkop_cachesize
|
||||
uci delete dhcp.@dnsmasq[0].podkop_noresolv
|
||||
|
||||
uci commit dhcp
|
||||
|
||||
/etc/init.d/dnsmasq restart
|
||||
}
|
||||
@@ -484,8 +608,8 @@ sing_box_inbound_proxy() {
|
||||
{
|
||||
"tag": "dns-in",
|
||||
"type": "direct",
|
||||
"listen": "127.0.0.1",
|
||||
"listen_port": 5353
|
||||
"listen": "127.0.0.42",
|
||||
"listen_port": 53
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
@@ -526,6 +650,18 @@ sing_box_dns_rule_fakeip() {
|
||||
jq \
|
||||
'.dns += {
|
||||
"rules": [
|
||||
{
|
||||
"query_type": [
|
||||
"HTTPS"
|
||||
],
|
||||
"action": "reject"
|
||||
},
|
||||
{
|
||||
"domain_suffix": [
|
||||
"use-application-dns.net"
|
||||
],
|
||||
"action": "reject"
|
||||
},
|
||||
{
|
||||
"server": "fakeip-server",
|
||||
"rule_set": []
|
||||
@@ -686,8 +822,8 @@ sing_box_config_outbound_json() {
|
||||
{
|
||||
"tag": "dns-in",
|
||||
"type": "direct",
|
||||
"listen": "127.0.0.1",
|
||||
"listen_port": 5353
|
||||
"listen": "127.0.0.42",
|
||||
"listen_port": 53
|
||||
}
|
||||
],
|
||||
"outbounds": [],
|
||||
@@ -1111,6 +1247,25 @@ sing_box_rules() {
|
||||
fi
|
||||
}
|
||||
|
||||
sing_box_quic_reject() {
|
||||
local quic_rule_exists=$(jq -e '.route.rules[] | select(.protocol == "quic" and .action == "reject")' "$SING_BOX_CONFIG")
|
||||
|
||||
if [[ -z "$quic_rule_exists" ]]; then
|
||||
jq '
|
||||
.route.rules |= (
|
||||
reduce .[] as $rule ([];
|
||||
if $rule.protocol == "dns" and $rule.action == "hijack-dns" then
|
||||
. + [$rule, {"protocol": "quic", "action": "reject"}]
|
||||
else
|
||||
. + [$rule]
|
||||
end
|
||||
)
|
||||
)' "$SING_BOX_CONFIG" >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json "$SING_BOX_CONFIG"
|
||||
|
||||
log "QUIC reject rule added successfully"
|
||||
fi
|
||||
}
|
||||
|
||||
process_remote_ruleset() {
|
||||
config_get_bool domain_list_enabled "$section" "domain_list_enabled" "0"
|
||||
if [ "$domain_list_enabled" -eq 1 ]; then
|
||||
@@ -1123,8 +1278,11 @@ process_remote_ruleset() {
|
||||
sing_box_rule_preset() {
|
||||
config_get custom_domains_list_type "$section" "custom_domains_list_type"
|
||||
config_get custom_subnets_list_enabled "$section" "custom_subnets_list_enabled"
|
||||
config_get custom_local_domains_list_enabled "$section" "custom_local_domains_list_enabled"
|
||||
config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
|
||||
|
||||
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_subnets_list_enabled" != "disabled" ]; then
|
||||
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_subnets_list_enabled" != "disabled" ] ||
|
||||
[ "$custom_local_domains_list_enabled" = "1" ] || [ "$custom_download_domains_list_enabled" = "1" ]; then
|
||||
sing_box_rules "$section" "$section"
|
||||
sing_box_dns_rule_fakeip_section "$section" "$section"
|
||||
fi
|
||||
@@ -1303,15 +1461,29 @@ check_proxy() {
|
||||
fi
|
||||
|
||||
jq '
|
||||
walk(
|
||||
if type == "object" then
|
||||
with_entries(
|
||||
if [.key] | inside(["uuid", "server", "server_name", "password", "public_key", "short_id"]) then
|
||||
.value = "MASKED"
|
||||
else . end
|
||||
)
|
||||
else . end
|
||||
)' $SING_BOX_CONFIG
|
||||
walk(
|
||||
if type == "object" then
|
||||
with_entries(
|
||||
if .key == "uuid" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server_name" then
|
||||
.value = "MASKED"
|
||||
elif .key == "password" then
|
||||
.value = "MASKED"
|
||||
elif .key == "public_key" then
|
||||
.value = "MASKED"
|
||||
elif .key == "short_id" then
|
||||
.value = "MASKED"
|
||||
elif .key == "fingerprint" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server_port" then
|
||||
.value = "MASKED"
|
||||
else . end
|
||||
)
|
||||
else . end
|
||||
)' $SING_BOX_CONFIG
|
||||
|
||||
nolog "Checking proxy connection..."
|
||||
|
||||
@@ -1350,22 +1522,18 @@ check_nft() {
|
||||
|
||||
nolog "Checking PodkopTable rules..."
|
||||
|
||||
local sets="podkop_domains podkop_subnets podkop_subnets_discord localv4"
|
||||
|
||||
nolog "Sets statistics:"
|
||||
for set_name in $sets; do
|
||||
if nft list set inet PodkopTable $set_name >/dev/null 2>&1; then
|
||||
local count=$(nft list set inet PodkopTable $set_name 2>/dev/null | grep -c ",")
|
||||
nolog "- $set_name: $count elements"
|
||||
else
|
||||
nolog "- $set_name: not found"
|
||||
fi
|
||||
done
|
||||
# Check if table exists
|
||||
if ! nft list table inet PodkopTable >/dev/null 2>&1; then
|
||||
nolog "PodkopTable not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
nolog "Current chains and rules:"
|
||||
nft list table inet PodkopTable | grep "chain\|counter"
|
||||
# Get all sets
|
||||
nolog "\nSets configuration:"
|
||||
|
||||
nolog "NFT check completed"
|
||||
nft list table inet PodkopTable
|
||||
|
||||
nolog "\nNFT check completed"
|
||||
}
|
||||
|
||||
check_github() {
|
||||
@@ -1390,37 +1558,94 @@ check_github() {
|
||||
done
|
||||
}
|
||||
|
||||
check_dnsmasq() {
|
||||
nolog "Checking dnsmasq configuration..."
|
||||
|
||||
local config=$(uci show dhcp.@dnsmasq[0])
|
||||
if [ -z "$config" ]; then
|
||||
nolog "No dnsmasq configuration found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$config" | while IFS='=' read -r key value; do
|
||||
nolog "$key = $value"
|
||||
done
|
||||
}
|
||||
|
||||
check_sing_box_connections() {
|
||||
nolog "Checking sing-box connections..."
|
||||
|
||||
if ! command -v netstat >/dev/null 2>&1; then
|
||||
nolog "netstat is not installed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local connections=$(netstat -tuanp | grep sing-box)
|
||||
if [ -z "$connections" ]; then
|
||||
nolog "No active sing-box connections found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$connections" | while read -r line; do
|
||||
nolog "$line"
|
||||
done
|
||||
}
|
||||
|
||||
check_sing_box_logs() {
|
||||
nolog "Showing sing-box logs from system journal..."
|
||||
|
||||
local logs=$(logread -e sing-box | tail -n 50)
|
||||
if [ -z "$logs" ]; then
|
||||
nolog "No sing-box logs found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$logs"
|
||||
}
|
||||
|
||||
check_logs() {
|
||||
nolog "Showing podkop logs from system journal..."
|
||||
|
||||
if command -v logread >/dev/null 2>&1; then
|
||||
logread -e "podkop" | tail -n 50
|
||||
logread -e podkop | tail -n 50
|
||||
else
|
||||
nolog "Error: logread command not found"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_three() {
|
||||
nolog "\n=== Checking GitHub connectivity ==="
|
||||
check_github
|
||||
show_sing_box_config() {
|
||||
nolog "Current sing-box configuration:"
|
||||
|
||||
nolog "\n=== Checking proxy settings ==="
|
||||
check_proxy
|
||||
|
||||
nolog "\n=== Checking NFT rules ==="
|
||||
check_nft
|
||||
|
||||
nolog "\nFull diagnostic check completed"
|
||||
}
|
||||
if [ ! -f "$SING_BOX_CONFIG" ]; then
|
||||
nolog "Configuration file not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
check_all() {
|
||||
nolog "Starting full diagnostic check..."
|
||||
|
||||
nolog "\n=== Checking recent logs ==="
|
||||
check_logs
|
||||
|
||||
check_three
|
||||
jq '
|
||||
walk(
|
||||
if type == "object" then
|
||||
with_entries(
|
||||
if .key == "uuid" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server_name" then
|
||||
.value = "MASKED"
|
||||
elif .key == "password" then
|
||||
.value = "MASKED"
|
||||
elif .key == "public_key" then
|
||||
.value = "MASKED"
|
||||
elif .key == "short_id" then
|
||||
.value = "MASKED"
|
||||
elif .key == "fingerprint" then
|
||||
.value = "MASKED"
|
||||
elif .key == "server_port" then
|
||||
.value = "MASKED"
|
||||
else . end
|
||||
)
|
||||
else . end
|
||||
)' "$SING_BOX_CONFIG"
|
||||
}
|
||||
|
||||
show_config() {
|
||||
@@ -1451,4 +1676,126 @@ show_config() {
|
||||
show_version() {
|
||||
local version=$(opkg info podkop | grep -m 1 "Version:" | cut -d' ' -f2)
|
||||
echo "$version"
|
||||
}
|
||||
|
||||
show_luci_version() {
|
||||
local version=$(opkg info luci-app-podkop | grep -m 1 "Version:" | cut -d' ' -f2)
|
||||
echo "$version"
|
||||
}
|
||||
|
||||
show_sing_box_version() {
|
||||
local version=$(opkg info sing-box | grep -m 1 "Version:" | cut -d' ' -f2)
|
||||
echo "$version"
|
||||
}
|
||||
|
||||
show_system_info() {
|
||||
echo "=== OpenWrt Version ==="
|
||||
grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2
|
||||
echo
|
||||
echo "=== Device Model ==="
|
||||
cat /tmp/sysinfo/model
|
||||
}
|
||||
|
||||
get_sing_box_status() {
|
||||
local running=0
|
||||
local enabled=0
|
||||
local status=""
|
||||
local version=""
|
||||
|
||||
# Check if service is enabled
|
||||
if [ -x /etc/rc.d/S99sing-box ]; then
|
||||
enabled=1
|
||||
fi
|
||||
|
||||
# Check if service is running
|
||||
if pgrep -f "sing-box" >/dev/null; then
|
||||
running=1
|
||||
version=$(sing-box version | head -n 1 | awk '{print $3}')
|
||||
fi
|
||||
|
||||
# Format status message
|
||||
if [ $running -eq 1 ]; then
|
||||
if [ $enabled -eq 1 ]; then
|
||||
status="running & enabled"
|
||||
else
|
||||
status="running but disabled"
|
||||
fi
|
||||
else
|
||||
if [ $enabled -eq 1 ]; then
|
||||
status="stopped but enabled"
|
||||
else
|
||||
status="stopped & disabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "{\"running\":$running,\"enabled\":$enabled,\"status\":\"$status\"}"
|
||||
}
|
||||
|
||||
get_status() {
|
||||
local running=0
|
||||
local enabled=0
|
||||
local status=""
|
||||
|
||||
# Check if service is enabled
|
||||
if [ -x /etc/rc.d/S99podkop ]; then
|
||||
enabled=1
|
||||
fi
|
||||
|
||||
# Check if service is running
|
||||
if pgrep -f "sing-box" >/dev/null; then
|
||||
running=1
|
||||
fi
|
||||
|
||||
# Format status message
|
||||
if [ $running -eq 1 ]; then
|
||||
if [ $enabled -eq 1 ]; then
|
||||
status="running & enabled"
|
||||
else
|
||||
status="running but disabled"
|
||||
fi
|
||||
else
|
||||
if [ $enabled -eq 1 ]; then
|
||||
status="stopped but enabled"
|
||||
else
|
||||
status="stopped & disabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "{\"running\":$running,\"enabled\":$enabled,\"status\":\"$status\"}"
|
||||
}
|
||||
|
||||
sing_box_add_secure_dns_probe_domain() {
|
||||
local domain="httpbin.org"
|
||||
local override_address="numbersapi.com"
|
||||
|
||||
if [ -z "$override_address" ]; then
|
||||
log "Error: Could not get br-lan IP address"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log "Adding DNS probe domain ${domain} to fakeip-server configuration"
|
||||
|
||||
jq \
|
||||
--arg domain "$domain" \
|
||||
--arg override "$override_address" \
|
||||
'.dns.rules |= map(
|
||||
if .server == "fakeip-server" then
|
||||
{
|
||||
"server": .server,
|
||||
"domain": $domain,
|
||||
"rule_set": .rule_set
|
||||
}
|
||||
else
|
||||
.
|
||||
end
|
||||
) |
|
||||
.route.rules |= . + [
|
||||
{
|
||||
"domain": $domain,
|
||||
"action": "route-options",
|
||||
"override_address": $override
|
||||
}
|
||||
]' "$SING_BOX_CONFIG" >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json "$SING_BOX_CONFIG"
|
||||
|
||||
log "DNS probe domain ${domain} configured with override to ${override_address}"
|
||||
}
|
||||
Reference in New Issue
Block a user