Compare commits

..

118 Commits

Author SHA1 Message Date
itdoginfo
3d05fe8be4 0.3.21 2025-03-03 21:28:21 +03:00
itdoginfo
6ddf9d3b24 Fix section for all_traffic_ip 2025-03-03 21:28:12 +03:00
itdoginfo
b401243f74 0.3.20 2025-03-03 18:26:19 +03:00
itdoginfo
407ef404ac Fix ip_cidr+fakeip, all_traffic_from_ip_enabled list 2025-03-03 18:26:02 +03:00
itdoginfo
f2e45bbbb9 Fix default value 2025-03-03 11:21:49 +03:00
itdoginfo
c2b37a14f4 v0.3.19 2025-02-26 18:24:40 +03:00
itdoginfo
3d029edaea Update 2025-02-26 18:23:02 +03:00
itdoginfo
b86d6d6294 Merge pull request #52 from itdoginfo/fix/increase-timeout-safeexec
feat: add support for comments in proxy and domain/subnet configuration
2025-02-26 18:18:43 +03:00
Ivan K
5c48ead9e4 feat: add support for comments in proxy and domain/subnet configuration 2025-02-24 23:02:23 +03:00
Ivan K
53475b5e8a fix: increase timeout for safeExec function 2025-02-24 20:07:47 +03:00
Ivan K
59e1d75870 refactor: increase timeout for safeExec function 2025-02-24 19:37:59 +03:00
itdoginfo
3ec6cc4d84 0.3.18 2025-02-24 18:07:15 +03:00
itdoginfo
3413af9f94 Merge pull request #51 from itdoginfo/fix/vpn-devices
feat: add section_id parameter to getNetworkInterfaces function
2025-02-24 17:42:30 +03:00
Ivan K
76b5ceae5c feat: add section_id parameter to getNetworkInterfaces function 2025-02-24 17:39:56 +03:00
itdoginfo
99ccd9fbb3 0.3.17 2025-02-24 16:42:35 +03:00
itdoginfo
b82c6eb718 Merge pull request #50 from itdoginfo/fix/many-sni-support
feat: update network interface loading in podkop.js
2025-02-24 16:24:53 +03:00
Ivan K
ccc87d9aa0 feat: update network interface loading in podkop.js 2025-02-24 16:23:05 +03:00
itdoginfo
8bcdee87f5 0.3.16 2025-02-24 15:39:02 +03:00
itdoginfo
f77ef5626b default dns options 2025-02-24 15:38:50 +03:00
itdoginfo
b50a21ded7 rm wget_github 2025-02-24 15:38:24 +03:00
itdoginfo
a831054e5e Merge pull request #48 from itdoginfo/fix/many-sni-support
feat: add status panels and utility functions for better diagnostics UI
2025-02-24 10:05:05 +03:00
Ivan K
a8dbff816c fix: correct logic for checking fakeipStatus state 2025-02-24 10:00:51 +03:00
Ivan K
171381fa18 refactor: improve error handling and code readability in podkop.js and update init.d script to check sing-box status 2025-02-23 22:56:01 +03:00
Ivan K
b806586a5a fix: проверки диагностики только при активной вкладке 2025-02-23 18:13:41 +03:00
Ivan K
9e2b192181 feat: add status panels and utility functions for better diagnostics UI 2025-02-23 13:35:30 +03:00
itdoginfo
c5be041664 Update 2025-02-23 00:11:52 +03:00
itdoginfo
445ad6d3d2 Update todo 2025-02-22 17:31:17 +03:00
itdoginfo
9203315107 Merge pull request #42 from itdoginfo/fix/many-sni-support
fix: add missing URL decoding for semicolon
2025-02-22 14:52:03 +03:00
Ivan K
d8d8d79d68 feat: add support for outbound JSON configuration in sing-box 2025-02-22 14:15:27 +03:00
Ivan K
615928db4e Merge remote-tracking branch 'origin/main' into fix/many-sni-support 2025-02-22 12:49:59 +03:00
Ivan K
7697754a73 refactor: replace fs.exec with safeExec for command execution with timeout 2025-02-22 12:45:25 +03:00
Ivan K
25107a0481 refactor: simplify label fetching and decoding in podkop.js 2025-02-22 09:52:04 +03:00
itdoginfo
5f5b1cbe1f Warnning for friendlywrt, http-dns-proxy. Validation domains in local file 2025-02-22 00:04:24 +03:00
Ivan K
a278918e77 feat: add timeout and chunking to proxy label fetching 2025-02-21 17:55:39 +03:00
itdoginfo
2074ccecce 0.3.15 2025-02-21 17:41:35 +03:00
itdoginfo
06f9bee038 #42 2025-02-21 17:40:52 +03:00
Ivan K
febb69d0be fix: add enable/disable button for Podkop service 2025-02-21 17:38:57 +03:00
Ivan K
1a6ee45612 fix: add function to dynamically fetch network interfaces for VPN configuration 2025-02-21 17:34:31 +03:00
itdoginfo
891b8f713d Fix 2025-02-21 16:07:27 +03:00
itdoginfo
b96552fb49 Fix #41 2025-02-21 16:06:17 +03:00
itdoginfo
ce9a7cdc45 Fix \n 2025-02-21 15:40:22 +03:00
itdoginfo
6071a96e9c 0.3.14 2025-02-21 15:37:43 +03:00
Ivan K
000d2f8e18 fix: add missing URL decoding for semicolon 2025-02-21 15:37:30 +03:00
itdoginfo
e17422a0cf Fix #37 #41 2025-02-21 15:37:20 +03:00
itdoginfo
2e78b2b4b8 Merge pull request #41 from itdoginfo/refactor/deduplicate-sections
Refactor/deduplicate sections
2025-02-21 14:55:03 +03:00
Ivan K
b84f3b6782 feat: add get_proxy_label function to podkop init script 2025-02-21 12:01:46 +03:00
itdoginfo
0f66305e50 Fix 2025-02-21 11:53:08 +03:00
Ivan K
a32a5c600b fix: update domain validation regex to allow single-level domains 2025-02-21 11:47:14 +03:00
Ivan K
89737efcbc refactor: refactor checkFakeIP to return a promise and update updateDiagnostics to use async/await 2025-02-21 11:22:37 +03:00
Ivan K
4608bc31cd refactor: update podkop.js to modularize configuration sections and improve validation logic 2025-02-21 11:09:47 +03:00
itdoginfo
d9e9f2dfe4 Update 2025-02-21 00:50:53 +03:00
Nikita Skryabin
bb9318e96f Merge pull request #37 from vernette/feature/fakeip-cache-path-and-ttl
feat(podkop): add configurable cache file path and dns rewrite_ttl options
2025-02-21 00:20:15 +03:00
Nikita Skryabin
7ff49c3e4e chore(init.d/podkop): remove unused cache file path and constant 2025-02-21 00:17:43 +03:00
Nikita Skryabin
134a79cb3b refactor(podkop.js): remove redundant path validation logic 2025-02-20 23:56:20 +03:00
Nikita Skryabin
560dda8604 feat(podkop): add translations for cache file and rewrite ttl options 2025-02-20 23:49:41 +03:00
Nikita Skryabin
255c08a6de feat(podkop.js): add validation for cache file path to ensure it meets specific criteria 2025-02-20 23:44:32 +03:00
Nikita Skryabin
1f3a65347e feat(podkop): add DNS Rewrite TTL configuration option 2025-02-20 23:27:50 +03:00
Nikita Skryabin
ec936e2369 feat(podkop): add configurable cache file path support 2025-02-20 22:49:58 +03:00
itdoginfo
cee934d139 Merge pull request #34 from itdoginfo/feature/fakeip-updater
feat: enhance FakeIP status check with periodic updates
2025-02-20 21:59:04 +03:00
Ivan K
a25c6b8013 feat: enhance FakeIP status check with periodic updates 2025-02-20 20:28:51 +03:00
itdoginfo
ec3a281cef v0.3.13 2025-02-20 17:22:15 +03:00
itdoginfo
86947e7dee Fix dns_server value 2025-02-20 17:22:03 +03:00
itdoginfo
ff5d017acc Update and rm install 0.2.5 2025-02-20 16:50:06 +03:00
itdoginfo
22d919657c Merge remote-tracking branch 'origin/main' 2025-02-20 16:48:20 +03:00
itdoginfo
3271f23ae0 Fix noresolv bakup 2025-02-20 16:45:22 +03:00
itdoginfo
35ea1a14cf Merge pull request #33 from vernette/feature/dns-server-selection
feat(podkop): add DNS server and protocol selection options
2025-02-20 16:39:05 +03:00
unknown
51a9cc5934 feat(podkop.po): add translations for DNS server address validation messages 2025-02-20 16:34:55 +03:00
unknown
e1df26e62b feat(podkop.js): add DNS server validation for IP and domain formats 2025-02-20 16:33:23 +03:00
unknown
75b8bef0e0 fix(podkop.js): update DNS protocol type and server labels to use translation function 2025-02-20 16:07:38 +03:00
unknown
1a6b0cac46 chore(init.d/podkop): remove redundant comments 2025-02-20 16:03:15 +03:00
unknown
e49bd91109 feat(podkop.po): add translations for DNS protocol and server options 2025-02-20 16:01:23 +03:00
unknown
85642a2585 feat(podkop.pot): add new DNS protocol and server options for translation 2025-02-20 16:01:12 +03:00
unknown
c31785d20e feat(init.d/podkop): add DNS resolver discovery and dynamic configuration 2025-02-20 15:57:52 +03:00
unknown
a0af04037a feat(podkop.js): add DNS protocol type and server options to configuration 2025-02-20 15:57:18 +03:00
itdoginfo
51fb10e30e fix 2025-02-20 00:43:39 +03:00
itdoginfo
069ea41ef8 Hide don't touch my dhcp 2025-02-20 00:25:24 +03:00
itdoginfo
7ee92123bc Fix use-application-dns.net 2025-02-19 23:08:38 +03:00
itdoginfo
5fd0e23cf9 Added backup dhcp and don't touch dhcp. Firefox disable doh FQDN moved to sing-box 2025-02-19 22:40:17 +03:00
itdoginfo
9b25669c8f Merge #30 and #31 2025-02-19 19:48:36 +03:00
itdoginfo
4b020671cc Merge pull request #30 from itdoginfo/feature/web-versions-view
feat: add version information tab to diagnostics
2025-02-19 19:42:40 +03:00
Ivan K
6222221847 docs: update Russian translations and add new strings for FakeIP status check 2025-02-19 19:18:22 +03:00
itdoginfo
6fa215e343 Merge pull request #31 from vernette/feature/dns-check
feat(podkop): add secure DNS probe domain configuration
2025-02-19 18:23:34 +03:00
Nikita Skryabin
a33835415f feat(init.d/podkop): add secure DNS probe domain configuration 2025-02-19 13:11:22 +03:00
Ivan K
f76c657bd7 style: remove unused CSS and JavaScript for tooltips 2025-02-18 22:11:58 +03:00
Ivan K
cceedd6c17 docs: update Russian translations for error messages and UI strings 2025-02-18 21:27:56 +03:00
Ivan K
8fa1986961 docs: update Russian translations for luci-app-podkop 2025-02-18 21:20:15 +03:00
Ivan K
8dec59d118 docs: update Russian translations for new UI elements in luci-app-podkop 2025-02-18 21:17:02 +03:00
Ivan K
c1fac487c7 style: add tooltip functionality and adjust CSS for better UI 2025-02-18 21:05:02 +03:00
Ivan K
d934bcc5e9 refactor: add async to diagnostics section UI 2025-02-18 18:56:34 +03:00
Ivan K
fc99bd7aaa feat: add spacing and line break to diagnostic tools section 2025-02-18 18:28:52 +03:00
Ivan K
b6cf73b974 feat: add service status and diagnostic tools to podkop UI 2025-02-18 18:23:29 +03:00
Ivan K
6df7c8abf8 feat: add URL validation for Shadowsocks and VLESS configurations from examples 2025-02-18 17:18:34 +03:00
Ivan K
8eb97a8023 Merge remote-tracking branch 'origin/main' into feature/web-versions-view 2025-02-18 14:05:22 +03:00
Ivan K
cd43449585 feat: add version information tab to diagnostics 2025-02-18 13:59:04 +03:00
itdoginfo
16c174d624 v0.3.10 2025-02-18 13:21:52 +03:00
itdoginfo
1c02a2208b Stop service before rm 2025-02-18 13:21:31 +03:00
itdoginfo
2c93e98755 Merge pull request #29 from itdoginfo/feature/web-versions-view
feat: add validation and warning messages for regional lists
2025-02-18 13:16:04 +03:00
Ivan K
66b179f282 fix: add extra configurations section to podkop.js 2025-02-18 13:01:15 +03:00
itdoginfo
4bbaae776c Merge pull request #28 from vernette/main
fix(install): resolve update failure due to improper cleanup
2025-02-18 12:52:30 +03:00
Ivan K
e31f313819 feat: add validation and warning messages for regional options in podkop.js 2025-02-18 12:49:24 +03:00
unknown
bd0e33781f fix(install): correct continue logic for existing package files 2025-02-18 12:06:33 +03:00
Nikita Skryabin
ade2b844ec fix(init.d/podkop): change rm command to remove only *.lst files in /tmp/podkop directory 2025-02-18 10:05:34 +03:00
Nikita Skryabin
6f997a6e73 refactor(install.sh): improve download retry logic 2025-02-18 09:59:01 +03:00
Nikita Skryabin
744de6aec2 chore(install.sh): replace rm command with find 2025-02-18 09:45:49 +03:00
itdoginfo
ae06de8189 v0.3.9 2025-02-17 23:36:53 +03:00
itdoginfo
1663f6665f Fix #27, added copy and div 2025-02-17 23:36:37 +03:00
itdoginfo
b005cbe50e Fix rule for section custom_download 2025-02-17 19:42:39 +03:00
itdoginfo
6c752d59ce Merge pull request #27 from VizzleTF/main
Поправил диагностику
2025-02-17 19:41:26 +03:00
itdoginfo
dbdd0560bf Added CODEOWNERS 2025-02-17 19:21:07 +03:00
Ivan K
aeacd9d8fd docs: update README.md with installation instructions 2025-02-17 19:09:52 +03:00
Ivan K
ded0bff23a chore: update build workflow to simplify install script generation 2025-02-17 19:09:09 +03:00
Ivan K
80ab7caee9 chore: update build workflow to use git commit -am 2025-02-17 18:49:29 +03:00
Ivan K
516063310a refactor: update install script generation to use current version tag 2025-02-17 18:40:54 +03:00
Ivan K
c6d72aa781 docs: update README with installation instructions for specific version 2025-02-17 18:28:53 +03:00
Ivan K
91fa2a2859 Merge branch 'itdoginfo:main' into main 2025-02-17 18:08:37 +03:00
Ivan K
13e84afcf0 feat: add new diagnostic checks and update install script 2025-02-17 18:08:13 +03:00
itdoginfo
88c160d3f8 Fix 2025-02-17 17:22:45 +03:00
itdoginfo
ebd185f633 Added install for 0.2.5 2025-02-17 16:34:27 +03:00
10 changed files with 2981 additions and 1563 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @itdoginfo

104
README.md
View File

@@ -2,7 +2,7 @@
- Это альфа версия, которая находится в активной разработке. Из версии в версию что-то может меняться. - Это альфа версия, которая находится в активной разработке. Из версии в версию что-то может меняться.
- Основной функционал работает, но побочные штуки сейчас могут сбоить. - Основной функционал работает, но побочные штуки сейчас могут сбоить.
- При обновлении **обязатально** сбрасывайте кэш LuCI. - При обновлении **обязательно** сбрасывайте кэш LuCI.
- Также при обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться. - Также при обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться.
- Необходимо минимум 15МБ свободного места на роутере. Роутерами с флешками на 16МБ сразу мимо. - Необходимо минимум 15МБ свободного места на роутере. Роутерами с флешками на 16МБ сразу мимо.
- При старте программы редактируется конфиг Dnsmasq. - При старте программы редактируется конфиг Dnsmasq.
@@ -46,12 +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
```
Если был установлен русский язык
```
opkg remove luci-i18n-podkop-ru
``` ```
# Использование # Использование
@@ -74,111 +69,32 @@ Luci: Services/podkop
## Настройка доменов и подсетей ## Настройка доменов и подсетей
**Community Lists** - Включить списки комьюнити **Community Lists** - Включить списки комьюнити
**Subnets list enable** - Включить подсети из общего списка, выбрать из предложенных.
**Custom domains enable** - Добавить свои домены **Custom domains enable** - Добавить свои домены
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску. **Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
# Известные баги # Известные баги
- [x] Не работает proxy при режимах main vpn, second proxy - [ ] Не отрабатывает service podkop stop, если podkop запущен и не может, к пример, зарезолвить домен с сломанным DNS
- [x] Не всегда отрабатывает ucitrack (применение настроек из luci). Не удаётся повторить - [ ] Update list из remote url domain не удаляет старые домены. А добавляет новые. Для подсетей тоже самое скорее всего. Пересоздавать ruleset?
- [x] All traffic for IP ломает инет на клиенте. Proxy mode
- [x] Не отрабатывает рестарт, при awg и не применяются изменения при awg
- [x] awg работает не стабильно
- [x] Сеть рестартится при любом раскладе
- [x] Выкл-вкл wg через luci не отрабатывает поднятие маршрута
- [ ] Если eof после последней строки в rt_tables, то скрипт не добавляет перенос строки
- [ ] Парсинг VLESS не отрабатывает, если в SNI два домена. Пример `sni=telegram.org%3Bwww.telegram.org`
- [ ] `service network restart` ломает маршруты при sing-box
- [ ] Совпадение секции с ruleset ломает конфиг sing-box
- [ ] В каких-то случаях плохо отрабатывает localfile
- [ ] exit 1 если в конфиге присуствует
```
option doh_backup_noresolv '0'
list doh_backup_server ''
list doh_backup_server ''
list doh_server '127.0.0.1#5053'
list doh_server '127.0.0.1#5054'
```
# ToDo # ToDo
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме. Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
Сделано
- [x] Скрипт для автоматической установки.
- [x] Подсети дискорда.
- [x] Удаление getdomains через скрипт. Кроме туннеля и sing-box.
- [x] Дополнительная вкладка для ещё одного туннеля. Домены, подсети.
- [x] Улучшение скрипта автоматической установки. Спрашивать про туннели.
- [x] Зависимость от dnsmasq-full
- [x] Весь трафик для устойства пускать в туннель\прокси
- [x] Исключение для IP, не ходить в туннель\прокси совсем 0x0
- [x] Врубать галочкой yacd в sing-box
- [x] Свои списки. Просто список доменов с переносом строки
- [x] Свои списки ipv4
- [x] В nft разделить правило tproxy на маркировку и tproxy
- [x] Вернуть две цепочки nft
- [x] Ntp (порт 123) делать маркировку 0x0. По галке
- [x] Открытый прокси порт на роутере для браузеров
- [x] Автонастройка wireguard по примеру getdomains
- [x] Автонастройка awg по примеру getdomains
- [x] RU перевод
- [x] Переделать на PROCD и выкинуть ucitrack.
- [x] Нужен дебаг. Restart ucitrack в отдельный скрипт postinst, не отрабатывает.
- [x] Закомментировать дефолтные значения у list. interface поставить в пустое.
- [x] Скрипт установки: проверка установлен ли уже podkop. Если да, то просто предлагать обновится без установки тунелей и прокси.
Приоритет 1
- [x] Изменить название "Alternative Config"
- [x] "domain_service_enabled" Добавить _second
- [x] Установка Ru пакета в install.sh
- [x] Правка nft mark, tproxy
- [x] Правка перевода минимальная
- [x] Вставлять готовый outdbound вместо строки. Отдельная галка, которая в идеале должны скрывать поле для строки
- [ ] udp over tcp для ss сделать с выбором:
1) отключен (ПО на сервере -Shadowsocks)
2) включен, версия 2 (новые релизы xray-core, sing-box на сервере)
3) включен, версия 1 (старые релизы xray, sing-box на сервере)
Проблема в том, что это нужно только если SS. Выставлять выбор при парсинг из конфига вопрос можно ли. Если совсем тупо - сделать костыль в допонительные настройки
- [x] Проверка места в скрипте install. Если доступно меньше 20MB - exit 1 c выводом колько надо и сколько доступно. + показ модели роутера
- [ ] Правило запрещающее QUIC
- [ ] Проверить обновление списков, отрабатывает ли
- [ ] Проверка на ванильную openwrt
- [ ] Проверка откуда установлен sing-box. Например, проверять установлен ли он из официального репозитория
- [x] TG в сервисы
- [ ] Выбор ткуда направлять трафик в туннель. В том числе чтоб откуда угодно, а не только br-lan
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
- [ ] Диагностика: podkop_domains: 0 elements как проверять что доходят запросы при fakeip? Мб врубать логи dnsmasq и их чекать.
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
- [ ] Валидации предустановленных значений. Если прописаны другие, то вывод в лог о неизвестной переменной и продолжение работы
- [ ] Добавление в список доменов домены первого уровня (LuCI)
- [ ] Проверка, что версия в makefile совпадает с тегом - [ ] Проверка, что версия в makefile совпадает с тегом
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
Приоритет 2 - [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
- [x] Списки доменов и подсетей с роутера - [ ] Обработка ошибки `sing-box[9345]: FATAL[0000] start service: initialize DNS rule[2]: rule-set not found: main`. Когда не задана строка\интерфейс
- [ ] Кнопка обновления списка доменов и подсетей. Запихнуть в главное меню
- [ ] IPv6
Wiki
- [x] Тема
- [x] Изначальное наполнение
Низкий приоритет Низкий приоритет
- [x] Переменная, раз во сколько часов обновлять списки
- [ ] Галочка, которая режет доступ к doh серверам - [ ] Галочка, которая режет доступ к doh серверам
- [ ] Свой конфиг sing-box - [ ] IPv6. Только после наполнения Wiki
- [x] Поменять curl на wget, убрать зависимость. Проверять доступность списков лучше всего curl`ом
Рефактор Рефактор
- [ ] Handle для sing-box - [ ] Handle для sing-box
- [ ] Handle для dnsmasq - [ ] Handle для dnsmasq
- [ ] Формирование json для sing-box на уровне jq, а не шаблонов
- [ ] Unit тесты (BATS) - [ ] Unit тесты (BATS)
- [ ] Интеграционые тесты бекенда (OpenWrt rootfs + BATS) - [ ] Интеграционые тесты бекенда (OpenWrt rootfs + BATS)
Хз как сделать
- [ ] Добавить label от конфига vless\ss\etc в luci.
# Разработка # Разработка
Есть два варианта: Есть два варианта:
- Просто поставить пакет на роутер или виртуалку и прям редактировать через SFTP (opkg install openssh-sftp-server) - Просто поставить пакет на роутер или виртуалку и прям редактировать через SFTP (opkg install openssh-sftp-server)
@@ -227,7 +143,7 @@ make package/luci-app-podkop/{clean,compile} V=s
.ipk лежат в `bin/packages/x86_64/base/` .ipk лежат в `bin/packages/x86_64/base/`
## Примеры строкs ## Примеры строк
https://github.com/itdoginfo/podkop/blob/main/String-example.md https://github.com/itdoginfo/podkop/blob/main/String-example.md
## Ошибки ## Ошибки

View File

@@ -43,35 +43,42 @@ main() {
add_tunnel add_tunnel
fi fi
wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk' | while read -r url; do download_success=0
while read -r url; do
filename=$(basename "$url") filename=$(basename "$url")
filepath="$DOWNLOAD_DIR/$filename" filepath="$DOWNLOAD_DIR/$filename"
attempt=0 attempt=0
while [ $attempt -lt $COUNT ]; do 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)))..." echo "Download $filename (count $((attempt+1)))..."
wget -q -O "$filepath" "$url" if wget -q -O "$filepath" "$url"; then
if [ -s "$filepath" ]; then
if [ -s "$filepath" ]; then echo "$filename successfully downloaded"
echo "$filename successfully downloaded" download_success=1
else break
echo "Download error $filename. Retry..." fi
rm -f "$filepath"
fi fi
echo "Download error $filename. Retry..."
rm -f "$filepath"
attempt=$((attempt+1)) attempt=$((attempt+1))
done done
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 for pkg in podkop luci-app-podkop; do
file=$(ls "$DOWNLOAD_DIR" | grep "^$pkg" | head -n 1) file=$(ls "$DOWNLOAD_DIR" | grep "^$pkg" | head -n 1)
if [ -n "$file" ]; then if [ -n "$file" ]; then
echo "Installing $file" echo "Installing $file"
opkg install "$DOWNLOAD_DIR/$file" opkg install "$DOWNLOAD_DIR/$file"
sleep 3
fi fi
done done
@@ -95,8 +102,7 @@ main() {
done done
fi fi
find "$DOWNLOAD_DIR" -type f -name '*podkop*' -exec rm {} \;
rm -f $DOWNLOAD_DIR/podkop*.ipk $DOWNLOAD_DIR/luci-app-podkop*.ipk $DOWNLOAD_DIR/luci-i18n-podkop-ru*.ipk
if [ "$IS_SHOULD_RESTART_NETWORK" ]; then if [ "$IS_SHOULD_RESTART_NETWORK" ]; then
printf "\033[32;1mRestart network\033[0m\n" printf "\033[32;1mRestart network\033[0m\n"
@@ -105,7 +111,7 @@ main() {
} }
add_tunnel() { add_tunnel() {
printf "\033[32;1mWill you be using Wireguard, AmneziaWG, OpenVPN, OpenConnect? If yes, select a number and they will be automatically installed\033[0m " printf "\033[32;1mWill you be using Wireguard, AmneziaWG, OpenVPN, OpenConnect? If yes, select a number and they will be automatically installed\033[0m\n"
echo "1) Wireguard" echo "1) Wireguard"
echo "2) AmneziaWG" echo "2) AmneziaWG"
echo "3) OpenVPN" echo "3) OpenVPN"
@@ -406,7 +412,7 @@ check_system() {
fi fi
if ! nslookup google.com >/dev/null 2>&1; then if ! nslookup google.com >/dev/null 2>&1; then
log "DNS not working" printf "\033[31;1mDNS not working\033[0m\n"
exit 1 exit 1
fi fi
@@ -428,4 +434,4 @@ sing_box() {
fi fi
} }
main main

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-podkop PKG_NAME:=luci-app-podkop
PKG_VERSION:=0.3.8 PKG_VERSION:=0.3.21
PKG_RELEASE:=1 PKG_RELEASE:=1
LUCI_TITLE:=LuCI podkop app LUCI_TITLE:=LuCI podkop app

View File

@@ -25,44 +25,59 @@ msgstr "Тип подключения"
msgid "Select between VPN and Proxy connection methods for traffic routing" msgid "Select between VPN and Proxy connection methods for traffic routing"
msgstr "Выберите между VPN и Proxy методами для маршрутизации трафика" 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" msgid "Proxy Configuration URL"
msgstr "URL конфигурации прокси" msgstr "URL конфигурации прокси"
msgid "Enter connection string starting with vless:// or ss:// for proxy configuration" msgid "Enter connection string starting with vless:// or ss:// for proxy configuration"
msgstr "Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси" msgstr "Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси"
msgid "Outbound Configuration"
msgstr "Конфигурация исходящего соединения"
msgid "Enter complete outbound configuration in JSON format"
msgstr "Введите полную конфигурацию исходящего соединения в формате JSON"
msgid "Network Interface" msgid "Network Interface"
msgstr "Сетевой интерфейс" msgstr "Сетевой интерфейс"
msgid "Select network interface for VPN connection" msgid "Select network interface for VPN connection"
msgstr "Выберите сетевой интерфейс для VPN подключения" msgstr "Выберите сетевой интерфейс для VPN подключения"
msgid "Community Domain Lists" msgid "Community Lists"
msgstr "Предустановленные списки доменов" msgstr "Предустановленные списки"
msgid "Domain List" msgid "Service List"
msgstr "Список доменов" msgstr "Список сервисов"
msgid "Select a list" msgid "Select predefined service for routing"
msgstr "Выберите список доменов" msgstr "Выберите предустановленные сервисы для маршрутизации"
msgid "Community Subnet Lists" msgid "User Domain List Type"
msgstr "Предустановленные сети сервисов" msgstr "Тип пользовательского списка доменов"
msgid "Enable routing for popular services like Twitter, Meta, and Discord" msgid "Select how to add your custom domains"
msgstr "Включить маршрутизацию для популярных сервисов, таких как Twitter, Meta и Discord" msgstr "Выберите способ добавления пользовательских доменов"
msgid "Service Networks" msgid "Disabled"
msgstr "Сети сервисов" msgstr "Отключено"
msgid "Select predefined service networks for routing" msgid "Dynamic List"
msgstr "Выберите предустановленные сети сервисов для маршрутизации" msgstr "Динамический список"
msgid "User Domain List" msgid "Text List"
msgstr "Пользовательский список доменов" msgstr "Текстовый список"
msgid "Enable and manage your custom list of domains for selective routing"
msgstr "Включить и управлять пользовательским списком доменов для выборочной маршрутизации"
msgid "User Domains" msgid "User Domains"
msgstr "Пользовательские домены" msgstr "Пользовательские домены"
@@ -70,6 +85,24 @@ msgstr "Пользовательские домены"
msgid "Enter domain names without protocols (example: sub.example.com or example.com)" msgid "Enter domain names without protocols (example: sub.example.com or example.com)"
msgstr "Введите имена доменов без протоколов (пример: sub.example.com или 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" msgid "Remote Domain Lists"
msgstr "Удаленные списки доменов" msgstr "Удаленные списки доменов"
@@ -82,17 +115,26 @@ msgstr "URL удаленных доменов"
msgid "Enter full URLs starting with http:// or https://" msgid "Enter full URLs starting with http:// or https://"
msgstr "Введите полные URL, начинающиеся с http:// или https://" msgstr "Введите полные URL, начинающиеся с http:// или https://"
msgid "User Subnet List" msgid "User Subnet List Type"
msgstr "Пользовательский список подсетей" msgstr "Тип пользовательского списка подсетей"
msgid "Enable and manage your custom list of IP subnets for selective routing" msgid "Select how to add your custom subnets"
msgstr "Включить и управлять пользовательским списком IP-подсетей для выборочной маршрутизации" msgstr "Выберите способ добавления пользовательских подсетей"
msgid "Text List (comma/space/newline separated)"
msgstr "Текстовый список (разделенный запятыми/пробелами/новыми строками)"
msgid "User Subnets" msgid "User Subnets"
msgstr "Пользовательские подсети" msgstr "Пользовательские подсети"
msgid "Enter subnet in CIDR notation (example: 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)" 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" msgid "Remote Subnet Lists"
msgstr "Удаленные списки подсетей" msgstr "Удаленные списки подсетей"
@@ -103,18 +145,6 @@ msgstr "Загрузка и использование списков подсе
msgid "Remote Subnet URLs" msgid "Remote Subnet URLs"
msgstr "URL удаленных подсетей" 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" msgid "IP for full redirection"
msgstr "Принудительные прокси IP" msgstr "Принудительные прокси IP"
@@ -133,6 +163,27 @@ msgstr "Исключения прокси IP"
msgid "Specify local IP addresses that will never use the configured route" msgid "Specify local IP addresses that will never use the configured route"
msgstr "Укажите локальные IP-адреса, которые никогда не будут использовать настроенный маршрут" 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" msgid "List Update Frequency"
msgstr "Частота обновления списков" msgstr "Частота обновления списков"
@@ -145,6 +196,9 @@ msgstr "Каждый час"
msgid "Every 2 hours" msgid "Every 2 hours"
msgstr "Каждые 2 часа" msgstr "Каждые 2 часа"
msgid "Every 3 hours"
msgstr "Каждые 3 часа"
msgid "Every 4 hours" msgid "Every 4 hours"
msgstr "Каждые 4 часа" msgstr "Каждые 4 часа"
@@ -154,51 +208,18 @@ msgstr "Каждые 6 часов"
msgid "Every 12 hours" msgid "Every 12 hours"
msgstr "Каждые 12 часов" msgstr "Каждые 12 часов"
msgid "Every day"
msgstr "Каждый день"
msgid "Every 3 days"
msgstr "Каждые 3 дня"
msgid "Once a day at 04:00" msgid "Once a day at 04:00"
msgstr "Раз в день в 04:00" msgstr "Раз в день в 04:00"
msgid "Once a week on Sunday at 04:00" msgid "Once a week on Sunday at 04:00"
msgstr "Раз в неделю в воскресенье в 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)" msgid "Invalid domain format. Enter domain without protocol (example: sub.example.com)"
msgstr "Неверный формат домена. Введите домен без протокола (пример: 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://" msgid "Invalid URL format. URL must start with http:// or https://"
msgstr "Неверный формат URL. URL должен начинаться с http:// или https://" msgstr "Неверный формат URL. URL должен начинаться с http:// или https://"
msgid "Invalid subnet format. Use format: X.X.X.X/Y (like 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/Y (например: 192.168.1.0/24)" msgstr "Неверный формат. Используйте формат: X.X.X.X или X.X.X.X/Y"
msgid "IP address parts must be between 0 and 255" msgid "IP address parts must be between 0 and 255"
msgstr "Части IP-адреса должны быть между 0 и 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)" 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)" 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" msgid "Invalid domain format: %s. Enter domain without protocol"
msgstr "Неверный формат домена: %s. Введите домен без протокола" msgstr "Неверный формат домена: %s. Введите домен без протокола"
msgid "User Subnet List Type" msgid "Invalid format: %s. Use format: X.X.X.X or X.X.X.X/Y"
msgstr "Тип пользовательского списка подсетей" msgstr "Неверный формат: %s. Используйте формат: X.X.X.X или X.X.X.X/Y"
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 "IP parts must be between 0 and 255 in: %s" msgid "IP parts must be between 0 and 255 in: %s"
msgstr "Части IP-адреса должны быть между 0 и 255 в: %s" msgstr "Части IP-адреса должны быть между 0 и 255 в: %s"
msgid "Configuration Type" msgid "CIDR must be between 0 and 32 in: %s"
msgstr "Тип конфигурации" msgstr "CIDR должен быть между 0 и 32 в: %s"
msgid "Select how to configure the proxy" msgid "Invalid path format. Path must start with \"/\" and contain only valid characters (letters, numbers, \"-\", \"_\", \"/\", \".\")"
msgstr "Выберите способ настройки прокси" msgstr "Неверный формат пути. Путь должен начинаться с \"/\" и содержать только допустимые символы (буквы, цифры, \"-\", \"_\", \"/\", \".\")"
msgid "Connection URL" msgid "Invalid path format"
msgstr "URL подключения" msgstr "Неверный формат пути"
msgid "Outbound Config"
msgstr "Конфигурация Outbound"
msgid "Outbound Configuration"
msgstr "Конфигурация исходящего соединения"
msgid "Enter complete outbound configuration in JSON format"
msgstr "Введите полную конфигурацию исходящего соединения в формате JSON"
msgid "JSON must contain at least type, server and server_port fields" msgid "JSON must contain at least type, server and server_port fields"
msgstr "JSON должен содержать как минимум поля type, server и server_port" msgstr "JSON должен содержать как минимум поля type, server и server_port"
@@ -292,92 +265,461 @@ msgstr "JSON должен содержать как минимум поля type
msgid "Invalid JSON format" msgid "Invalid JSON format"
msgstr "Неверный формат JSON" msgstr "Неверный формат JSON"
msgid "Diagnostics" msgid "Warning: %s cannot be used together with %s. Previous selections have been removed."
msgstr "Диагностика" msgstr "Предупреждение: %s нельзя использовать вместе с %s. Предыдущие варианты были удалены."
msgid "Main Check" msgid "Regional options cannot be used together"
msgstr "Основная проверка" msgstr "Нельзя использовать несколько региональных опций"
msgid "Run a comprehensive diagnostic check of all components" 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 "Запустить комплексную диагностическую проверку всех компонентов" msgstr "Внимание: Russia inside может использоваться только с Meta, Twitter, Discord и Telegram. %s были удалены из выбора."
msgid "Run Check" msgid "Russia inside restrictions"
msgstr "Запустить проверку" msgstr "Ограничения Russia inside"
msgid "Full Diagnostic Results" msgid "URL must start with vless:// or ss://"
msgstr "Полные результаты диагностики" msgstr "URL должен начинаться с vless:// или ss://"
msgid "Failed to copy: " msgid "Invalid Shadowsocks URL format: missing method and password separator \":\""
msgstr "Ошибка копирования: " msgstr "Неверный формат URL Shadowsocks: отсутствует разделитель метода и пароля \":\""
msgid "Invalid Shadowsocks URL format"
msgstr "Неверный формат URL Shadowsocks"
msgid "Invalid Shadowsocks URL: missing server address"
msgstr "Неверный URL Shadowsocks: отсутствует адрес сервера"
msgid "Invalid Shadowsocks URL: missing server"
msgstr "Неверный URL Shadowsocks: отсутствует сервер"
msgid "Invalid Shadowsocks URL: missing port"
msgstr "Неверный URL Shadowsocks: отсутствует порт"
msgid "Invalid port number. Must be between 1 and 65535"
msgstr "Неверный номер порта. Должен быть между 1 и 65535"
msgid "Invalid Shadowsocks URL: missing or invalid server/port format"
msgstr "Неверный URL Shadowsocks: отсутствует или неверный формат сервера/порта"
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 "Результаты обновления списков"
msgid "DNS Protocol Type"
msgstr "Тип DNS протокола"
msgid "Select DNS protocol to use"
msgstr "Выберите протокол DNS"
msgid "DNS over HTTPS (DoH)"
msgstr "DNS через HTTPS (DoH)"
msgid "DNS over TLS (DoT)"
msgstr "DNS через TLS (DoT)"
msgid "UDP (Unprotected DNS)"
msgstr "UDP (Незащищённый DNS)"
msgid "DNS Server"
msgstr "DNS сервер"
msgid "Select or enter DNS server address"
msgstr "Выберите или введите адрес DNS сервера"
msgid "DNS server address cannot be empty"
msgstr "Адрес DNS сервера не может быть пустым"
msgid "Invalid DNS server format. Examples: 8.8.8.8 or dns.example.com"
msgstr "Неверный формат DNS сервера. Примеры: 8.8.8.8 или dns.example.com"
msgid "DNS Rewrite TTL"
msgstr "Перезапись TTL для DNS"
msgid "Time in seconds for DNS record caching (default: 600)"
msgstr "Время в секундах для кэширования DNS записей (по умолчанию: 600)"
msgid "TTL value cannot be empty"
msgstr "Значение TTL не может быть пустым"
msgid "TTL must be a positive number"
msgstr "TTL должно быть положительным числом"
msgid "Cache File Path"
msgstr "Путь к файлу кэша"
msgid "Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing"
msgstr "Выберите или введите путь к файлу кэша sing-box. Меняйте ТОЛЬКО если знаете, что делаете"
msgid "Cache file path cannot be empty"
msgstr "Путь к файлу кэша не может быть пустым"
msgid "Path must be absolute (start with /)"
msgstr "Путь должен быть абсолютным (начинаться с /)"
msgid "Path must end with cache.db"
msgstr "Путь должен заканчиваться на cache.db"
msgid "Path must contain at least one directory (like /tmp/cache.db)"
msgstr "Путь должен содержать хотя бы одну директорию (например /tmp/cache.db)"
msgid "Invalid path format. Must be like /tmp/cache.db"
msgstr "Неверный формат пути. Пример: /tmp/cache.db"
msgid "Copy to Clipboard" msgid "Copy to Clipboard"
msgstr "Скопировать в буфер" msgstr "Копировать в буфер обмена"
msgid "Close" msgid "Close"
msgstr "Закрыть" msgstr "Закрыть"
msgid "No output" msgid "Loading..."
msgstr "Нет данных" msgstr "Загрузка..."
msgid "System Logs" msgid "Loading version information..."
msgstr "Системные логи" msgstr "Загрузка информации о версии..."
msgid "View recent system logs related to Podkop" msgid "Checking FakeIP..."
msgstr "Просмотр недавних системных логов, связанных с Podkop" msgstr "Проверка FakeIP..."
msgid "View Logs" msgid "timeout"
msgstr "Просмотр логов" msgstr "таймаут"
msgid "Failed to copy logs: " msgid "Current config: "
msgstr "Ошибка копирования логов: " msgstr "Текущая конфигурация: "
msgid "Show Config" msgid "Invalid VLESS URL: type must be one of tcp, udp, grpc, http"
msgstr "Показать конфигурацию" msgstr "Неверный URL VLESS: тип должен быть одним из tcp, udp, grpc, http"
msgid "Show current podkop configuration with masked sensitive data" msgid "Invalid VLESS URL: security must be one of tls, reality, none"
msgstr "Показать текущую конфигурацию podkop с маскированными конфиденциальными данными" msgstr "Неверный URL VLESS: security должен быть одним из tls, reality, none"
msgid "Podkop"
msgstr "Podkop"
msgid "Proxy"
msgstr "Прокси"
msgid "VPN"
msgstr "VPN"
msgid "http://openwrt.lan:9090/ui"
msgstr "http://openwrt.lan:9090/ui"
msgid "Podkop Configuration" msgid "Podkop Configuration"
msgstr "Конфигурация Podkop" msgstr "Конфигурация Podkop"
msgid "Update lists" msgid "Active Connections"
msgstr "Обновить списки" msgstr "Активные соединения"
msgid "Update all lists in config" msgid "DNSMasq Configuration"
msgstr "Обновить все списки в конфигурации" msgstr "Конфигурация DNSMasq"
msgid "List Update" msgid "Sing-box Configuration"
msgstr "Обновление списков" msgstr "Конфигурация Sing-box"
msgid "Lists will be updated in background. You can check the progress in system logs."
msgstr "Списки будут обновлены в фоновом режиме. Вы можете проверить прогресс в системных логах."
msgid "Extra configurations" msgid "Extra configurations"
msgstr "Дополнительные конфигурации" msgstr "Дополнительные конфигурации"
msgid "Extra configuration"
msgstr "Дополнительная конфигурация"
msgid "Add Section" msgid "Add Section"
msgstr "Добавить раздел" msgstr "Добавить раздел"
msgid "QUIC disable" msgid "No output"
msgstr "Отключить QUIC" msgstr "Нет вывода"
msgid "For issues with the video stream" msgid "Failed to copy: "
msgstr "Для проблем с видеопотоком" msgstr "Не удалось скопировать: "
msgid "Community Lists" msgid "Show Config"
msgstr "Списки сообщества" msgstr "Показать конфигурацию"
msgid "Local Domain Lists" msgid "View Logs"
msgstr "Локальные списки доменов" msgstr "Просмотр логов"
msgid "Use the list from the router filesystem" msgid "Check Connections"
msgstr "Использовать список из файловой системы роутера" msgstr "Проверить соединения"
msgid "Local Domain Lists Path" msgid "FakeIP Status"
msgstr "Путь к локальным спискам доменов" msgstr "Статус FakeIP"
msgid "Enter to the list file path" msgid "Device Model: "
msgstr "Введите путь к файлу списка" msgstr "Модель устройства: "
msgid "OpenWrt Version: "
msgstr "Версия OpenWrt: "
msgid "Check DNSMasq"
msgstr "Проверить DNSMasq"
msgid "Check NFT Rules"
msgstr "Проверить правила NFT"
msgid "Update Lists"
msgstr "Обновить списки"
msgid "Lists Update Results"
msgstr "Результаты обновления списков"
msgid "NFT Rules"
msgstr "Правила NFT"
msgid "GitHub Connectivity"
msgstr "Подключение к GitHub"
msgid "Check GitHub"
msgstr "Проверить GitHub"
msgid "GitHub Connectivity Results"
msgstr "Результаты проверки подключения к GitHub"
msgid "Sing-Box Logs"
msgstr "Логи Sing-Box"
msgid "View recent sing-box logs from system journal"
msgstr "Просмотр последних логов sing-box из системного журнала"
msgid "View Sing-Box Logs"
msgstr "Просмотр логов Sing-Box"
msgid "Podkop Logs"
msgstr "Логи Podkop"
msgid "View recent podkop logs from system journal"
msgstr "Просмотр последних логов podkop из системного журнала"
msgid "View Podkop Logs"
msgstr "Просмотр логов Podkop"
msgid "Active Connections"
msgstr "Активные соединения"
msgid "View active sing-box network connections"
msgstr "Просмотр активных сетевых подключений sing-box"
msgid "DNSMasq Configuration"
msgstr "Конфигурация DNSMasq"
msgid "View current DNSMasq configuration settings"
msgstr "Просмотр текущих настроек конфигурации DNSMasq"
msgid "Sing-Box Configuration"
msgstr "Конфигурация Sing-Box"
msgid "Show current sing-box configuration"
msgstr "Показать текущую конфигурацию sing-box"
msgid "Show Sing-Box Config"
msgstr "Показать конфигурацию Sing-Box"
msgid "Diagnostic Tools"
msgstr "Инструменты диагностики"
msgid "Unknown"
msgstr "Неизвестно"
msgid "sing-box not running"
msgstr "sing-box не запущен"
msgid "DNS not configured"
msgstr "DNS не настроен"
msgid "running & enabled"
msgstr "запущен и активирован"
msgid "running but disabled"
msgstr "запущен, но деактивирован"
msgid "stopped but enabled"
msgstr "остановлен, но активирован"
msgid "stopped & disabled"
msgstr "остановлен и деактивирован"

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=podkop PKG_NAME:=podkop
PKG_VERSION:=0.3.8 PKG_VERSION:=0.3.21
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=ITDog <podkop@itdog.info> 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 grep -q "105 podkop" /etc/iproute2/rt_tables && sed -i "/105 podkop/d" /etc/iproute2/rt_tables
/etc/init.d/podkop stop
exit 0 exit 0
endef endef

View File

@@ -1,13 +1,13 @@
config main 'main' config main 'main'
option mode 'proxy' option mode 'proxy'
#option interface '' #option interface ''
option proxy_config_type '' option proxy_config_type 'url'
#option outbound_json '' #option outbound_json ''
option proxy_string '' option proxy_string ''
option domain_list_enabled '1' option domain_list_enabled '1'
option domain_list 'russia_inside' list domain_list 'russia_inside'
option subnets_list_enabled '0' option subnets_list_enabled '0'
option custom_domains_list_type 'disable' option custom_domains_list_type 'disabled'
#list custom_domains '' #list custom_domains ''
#option custom_domains_text '' #option custom_domains_text ''
option custom_local_domains_list_enabled '0' option custom_local_domains_list_enabled '0'
@@ -29,5 +29,9 @@ config main 'main'
option socks5 '0' option socks5 '0'
option exclude_ntp '0' option exclude_ntp '0'
option quic_disable '0' option quic_disable '0'
option dont_touch_dhcp '0'
option update_interval '1d' option update_interval '1d'
option custom_domains_text option dns_type 'doh'
option dns_server '1.1.1.1'
option dns_rewrite_ttl '600'
option cache_file '/tmp/cache.db'

View File

@@ -7,18 +7,22 @@ script=$(readlink "$initscript")
NAME="$(basename ${script:-$initscript})" NAME="$(basename ${script:-$initscript})"
config_load "$NAME" 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 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_proxy Check if sing-box proxy works correctly
check_nft Show PodkopTable nftables rules check_nft Show PodkopTable nftables rules
check_github Check GitHub connectivity and lists availability check_github Check GitHub connectivity and lists availability
check_logs Show podkop logs from system journal check_logs Show podkop logs from system journal
check_all Run all checks check_sing_box_connections Show active sing-box network connections
check_three Run check_proxy, check_nft and check_github check_sing_box_logs Show recent sing-box logs
main Main function check_dnsmasq Show current DNSMasq configuration
show_config Show current configuration with masked sensitive data 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 [ ! -L /usr/sbin/podkop ] && ln -s /etc/init.d/podkop /usr/sbin/podkop
@@ -33,9 +37,10 @@ SUBNETS_META="${GITHUB_RAW_URL}/Subnets/IPv4/meta.lst"
SUBNETS_DISCORD="${GITHUB_RAW_URL}/Subnets/IPv4/discord.lst" SUBNETS_DISCORD="${GITHUB_RAW_URL}/Subnets/IPv4/discord.lst"
SUBNETS_TELERAM="${GITHUB_RAW_URL}/Subnets/IPv4/telegram.lst" SUBNETS_TELERAM="${GITHUB_RAW_URL}/Subnets/IPv4/telegram.lst"
SING_BOX_CONFIG="/etc/sing-box/config.json" SING_BOX_CONFIG="/etc/sing-box/config.json"
CACHE_FILE_PATH="/tmp/cache.db"
FAKEIP="198.18.0.0/15" 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" VALID_SERVICES="russia_inside russia_outside ukraine_inside geoblock block porn news anime youtube discord meta twitter hdrezka tiktok telegram"
DNS_RESOLVERS="1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 9.9.9.9 9.9.9.11 94.140.14.14 94.140.15.15 208.67.220.220 208.67.222.222 77.88.8.1 77.88.8.8"
TEST_DOMAIN="google.com"
start_service() { start_service() {
log "Start podkop" log "Start podkop"
@@ -48,8 +53,12 @@ start_service() {
exit 1 exit 1
fi fi
if opkg list-installed | grep -qE "iptables|kmod-iptab"; then if grep -q FriendlyWrt /etc/banner; then
printf "\033[31;1mFound incompatible iptables packages. If you're using FriendlyWrt: https://t.me/itdogchat/44512/181082\033[0m\n" printf "\033[31;1mYou use FriendlyWrt. If you have problems, check out: https://t.me/itdogchat/44512/181082\033[0m\n"
fi
if grep -qE 'doh_backup_noresolv|doh_backup_server|doh_server' /etc/config/dhcp; then
printf "\033[31;1mDetected https-dns-proxy. Disable or uninstall it for correct functionality.\033[0m\n"
fi fi
if ! ip addr | grep -q "br-lan"; then if ! ip addr | grep -q "br-lan"; then
@@ -71,9 +80,13 @@ start_service() {
stop_service() { stop_service() {
log "Stopping the podkop" log "Stopping the podkop"
remove_cron_job 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" log "Flush nft"
if nft list table inet PodkopTable >/dev/null 2>&1; then if nft list table inet PodkopTable >/dev/null 2>&1; then
@@ -133,9 +146,7 @@ nolog() {
} }
main() { main() {
sleep 5 sleep 3
config_foreach wget_github
mkdir -p /tmp/podkop mkdir -p /tmp/podkop
@@ -149,6 +160,7 @@ main() {
sing_box_dns sing_box_dns
sing_box_dns_rule_fakeip sing_box_dns_rule_fakeip
sing_box_rule_dns sing_box_rule_dns
sing_box_add_secure_dns_probe_domain
sing_box_cache_file sing_box_cache_file
process_socks5 process_socks5
@@ -198,9 +210,13 @@ main() {
config_get proxy_string "main" "proxy_string" config_get proxy_string "main" "proxy_string"
config_get interface "main" "interface" config_get interface "main" "interface"
config_get outbound_json "main" "outbound_json"
if [ -n "$proxy_string" ] || [ -n "$interface" ]; then if [ -n "$proxy_string" ] || [ -n "$interface" ] || [ -n "$outbound_json" ]; 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 fi
} }
@@ -247,6 +263,12 @@ migration() {
log "Found and removed filter-rr=HTTPS in dnsmasq config" log "Found and removed filter-rr=HTTPS in dnsmasq config"
sed -i '/^filter-rr=HTTPS/d' "/etc/dnsmasq.conf" sed -i '/^filter-rr=HTTPS/d' "/etc/dnsmasq.conf"
fi 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() { validate_service() {
@@ -310,27 +332,72 @@ create_nft_table() {
nft add rule inet $table proxy meta mark 0x105 meta l4proto udp tproxy ip to :1602 counter nft add rule inet $table proxy meta mark 0x105 meta l4proto udp tproxy ip to :1602 counter
} }
dnsmasq_add() { save_dnsmasq_config() {
## Future: Check config and skip restart local key="$1"
local backup_key="$2"
value=$(uci get "$key" 2>/dev/null)
if [ -z "$value" ]; then
uci set "$backup_key"="unset"
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" log "Configure dnsmasq for sing-box"
uci set dhcp.@dnsmasq[0].noresolv="1" uci set dhcp.@dnsmasq[0].noresolv="1"
uci set dhcp.@dnsmasq[0].filter_aaaa="1"
uci set dhcp.@dnsmasq[0].cachesize="0" uci set dhcp.@dnsmasq[0].cachesize="0"
uci -q delete dhcp.@dnsmasq[0].server uci -q delete dhcp.@dnsmasq[0].server
uci add_list dhcp.@dnsmasq[0].server="127.0.0.42" uci add_list dhcp.@dnsmasq[0].server="127.0.0.42"
uci add_list dhcp.@dnsmasq[0].server='/use-application-dns.net/'
uci commit dhcp uci commit dhcp
/etc/init.d/dnsmasq restart /etc/init.d/dnsmasq restart
} }
dnsmasq_rm() { dnsmasq_restore() {
log "Removing configuration for dnsmasq" log "Removing configuration for dnsmasq"
uci set dhcp.@dnsmasq[0].noresolv="0"
uci set dhcp.@dnsmasq[0].filter_aaaa="0" local cachesize=$(uci get dhcp.@dnsmasq[0].podkop_cachesize 2>/dev/null)
uci set dhcp.@dnsmasq[0].cachesize="1000" if [ -z "$cachesize" ]; then
uci -q delete dhcp.@dnsmasq[0].server log "dnsmasq revert: cachesize is unset"
uci add_list dhcp.@dnsmasq[0].server="8.8.8.8" else
uci set dhcp.@dnsmasq[0].cachesize="$cachesize"
fi
local noresolv=$(uci get dhcp.@dnsmasq[0].podkop_noresolv 2>/dev/null)
if [[ "$noresolv" == "unset" ]]; then
log "dnsmasq revert: noresolv is unset"
uci -q delete dhcp.@dnsmasq[0].noresolv
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 uci commit dhcp
/etc/init.d/dnsmasq restart /etc/init.d/dnsmasq restart
@@ -343,14 +410,17 @@ process_domains_text() {
local tmp_file=$(mktemp) local tmp_file=$(mktemp)
echo "$text" > "$tmp_file" echo "$text" > "$tmp_file"
sed 's/[, ]\+/\n/g' "$tmp_file" | while IFS= read -r domain; do # First filter out full comment lines and remove comments after domains
grep -v "^[[:space:]]*\/\/" "$tmp_file" | sed 's/\/\/.*$//' > "${tmp_file}.filtered"
sed 's/[, ]\+/\n/g' "${tmp_file}.filtered" | while IFS= read -r domain; do
domain=$(echo "$domain" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') domain=$(echo "$domain" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$domain" ]; then if [ -n "$domain" ]; then
sing_box_ruleset_domains "$domain" "$name" sing_box_ruleset_domains "$domain" "$name"
fi fi
done done
rm -f "$tmp_file" rm -f "$tmp_file" "${tmp_file}.filtered"
} }
process_subnets_text() { process_subnets_text() {
@@ -360,7 +430,10 @@ process_subnets_text() {
local tmp_file=$(mktemp) local tmp_file=$(mktemp)
echo "$text" > "$tmp_file" echo "$text" > "$tmp_file"
sed 's/[, ]\+/\n/g' "$tmp_file" | while IFS= read -r subnet; do # First filter out full comment lines and remove comments after subnets
grep -v "^[[:space:]]*\/\/" "$tmp_file" | sed 's/\/\/.*$//' > "${tmp_file}.filtered"
sed 's/[, ]\+/\n/g' "${tmp_file}.filtered" | while IFS= read -r subnet; do
subnet=$(echo "$subnet" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') subnet=$(echo "$subnet" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$subnet" ]; then if [ -n "$subnet" ]; then
if ! echo "$subnet" | grep -q "/"; then if ! echo "$subnet" | grep -q "/"; then
@@ -370,66 +443,9 @@ process_subnets_text() {
fi fi
done done
rm -f "$tmp_file" rm -f "$tmp_file" "${tmp_file}.filtered"
} }
wget_github() {
local count_nslookup=0
local count_curl=0
config_get domain_list_enabled "$section" "domain_list_enabled"
config_get subnets_list_enabled "$section" "subnets_list_enabled"
config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
config_get custom_download_subnets_list_enabled "$section" "custom_download_subnets_list_enabled"
if [ "$domain_list_enabled" -eq 1 ] || [ "$subnets_list_enabled" -eq 1 ] ||
[ "$custom_download_domains_list_enabled" -eq 1 ] || [ "$custom_download_subnets_list_enabled" -eq 1 ] ; then
while true; do
if ! nslookup google.com >/dev/null 2>&1; then
log "DNS not working. Retrying... [$count_nslookup sec]"
count_nslookup=$((count_nslookup + 1))
else
return
fi
if [ $count_nslookup -lt 30 ]; then
sleep_interval=1
elif [ $count_nslookup -ge 30 ] && [ $count_nslookup -lt 60 ]; then
sleep_interval=5
elif [ $count_nslookup -ge 60 ] && [ $count_nslookup -lt 90 ]; then
sleep_interval=10
else
sleep_interval=30
fi
sleep $sleep_interval
done
while true; do
if ! curl -m 3 github.com; then
log "GitHub is not available. Check the internet availability [$count_curl sec]"
count_curl=$((count_curl + 1))
else
return
fi
if [ $count_curl -lt 30 ]; then
sleep_interval=1
elif [ $count_curl -ge 30 ] && [ $count_curl -lt 60 ]; then
sleep_interval=5
elif [ $count_curl -ge 60 ] && [ $count_curl -lt 90 ]; then
sleep_interval=10
else
sleep_interval=30
fi
sleep $sleep_interval
done
fi
}
add_cron_job() { add_cron_job() {
## Future: make a check so that it doesn't recreate many times ## Future: make a check so that it doesn't recreate many times
config_get domain_list_enabled "$section" "domain_list_enabled" config_get domain_list_enabled "$section" "domain_list_enabled"
@@ -483,6 +499,17 @@ list_update() {
config_foreach process_subnet_for_section_remote config_foreach process_subnet_for_section_remote
} }
find_working_resolver() {
local resolver_found=""
for resolver in $DNS_RESOLVERS; do
if nslookup $TEST_DOMAIN $resolver >/dev/null 2>&1; then
echo "$resolver"
return 0
fi
done
echo "8.8.8.8"
return 1
}
# sing-box funcs # sing-box funcs
@@ -560,32 +587,86 @@ sing_box_inbound_proxy() {
} }
sing_box_dns() { sing_box_dns() {
local dns_type
local dns_server
local resolver_tag="resolver"
config_get dns_type "main" "dns_type" "doh"
config_get dns_server "main" "dns_server" "1.1.1.1"
local server_json
local is_ip=$(echo "$dns_server" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' && echo "1" || echo "0")
if [ "$is_ip" = "0" ]; then
log "Finding working DNS resolver"
local dns_resolver=$(find_working_resolver)
log "Found working resolver: $dns_resolver"
fi
log "Configure DNS in sing-box" log "Configure DNS in sing-box"
server_json=$(jq -n \
--arg type "$dns_type" \
--arg server "$dns_server" \
--arg resolver "$resolver_tag" \
--arg is_ip "$is_ip" \
'{
"servers": [
{
"tag": "dns-server",
"address": (
if $type == "doh" then
"https://" + $server + "/dns-query"
elif $type == "dot" then
"tls://" + $server
else
$server
end
),
"detour": "direct-out"
} + (
if $is_ip == "0" then
{"address_resolver": $resolver}
else
{}
end
)
]
}')
if [ "$is_ip" = "0" ]; then
server_json=$(echo "$server_json" | jq \
--arg resolver "$resolver_tag" \
--arg address "$dns_resolver" \
'.servers += [{
"tag": $resolver,
"address": $address
}]')
fi
server_json=$(echo "$server_json" | jq '.servers += [{"tag": "fakeip-server", "address": "fakeip"}]')
jq \ jq \
--arg FAKEIP "$FAKEIP" \ --argjson dns_config "$server_json" \
'.dns = { --arg fakeip "$FAKEIP" \
"strategy": "ipv4_only", '.dns = {
"fakeip": { "strategy": "ipv4_only",
"enabled": true, "fakeip": {
"inet4_range": $FAKEIP "enabled": true,
}, "inet4_range": $fakeip
"servers": [
{
"tag": "cloudflare-doh-server",
"address": "https://1.1.1.1/dns-query",
"detour": "direct-out"
}, },
{ "servers": $dns_config.servers
"tag": "fakeip-server", }' $SING_BOX_CONFIG > /tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
"address": "fakeip"
}
]
}' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
} }
sing_box_dns_rule_fakeip() { sing_box_dns_rule_fakeip() {
log "Configure fakeip route in sing-box" local rewrite_ttl
config_get rewrite_ttl "main" "dns_rewrite_ttl" "600"
log "Configure fakeip route in sing-box and set TTL to $rewrite_ttl seconds"
jq \ jq \
--arg ttl "$rewrite_ttl" \
'.dns += { '.dns += {
"rules": [ "rules": [
{ {
@@ -595,7 +676,15 @@ sing_box_dns_rule_fakeip() {
"action": "reject" "action": "reject"
}, },
{ {
"domain_suffix": [
"use-application-dns.net"
],
"action": "reject"
},
{
"server": "fakeip-server", "server": "fakeip-server",
"domain": "",
"rewrite_ttl": ($ttl | tonumber),
"rule_set": [] "rule_set": []
} }
] ]
@@ -623,14 +712,17 @@ sing_box_dns_rule_fakeip_section() {
} }
sing_box_cache_file() { sing_box_cache_file() {
log "Configure cache.db in sing-box" config_get cache_file "main" "cache_file" "/tmp/cache.db"
log "Configure sing-box cache.db path"
jq \ jq \
--arg CACHE_FILE_PATH "$CACHE_FILE_PATH" \ --arg cache_file "$cache_file" \
'.experimental = { '.experimental = {
"cache_file": { "cache_file": {
"enabled": true, "enabled": true,
"store_fakeip": true, "store_fakeip": true,
"path": $CACHE_FILE_PATH "path": $cache_file
} }
}' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG }' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
} }
@@ -654,17 +746,26 @@ sing_box_outdound() {
config_get outbound_json $section "outbound_json" config_get outbound_json $section "outbound_json"
if [ -n "$outbound_json" ]; then if [ -n "$outbound_json" ]; then
log "Using JSON outbound configuration" log "Using JSON outbound configuration"
sing_box_config_outbound_json "$outbound_json" sing_box_config_outbound_json "$outbound_json" "$section"
else else
log "Missing outbound JSON configuration" log "Missing outbound JSON configuration"
return return
fi fi
else else
config_get proxy_string $section "proxy_string" config_get proxy_string $section "proxy_string"
if [[ "$proxy_string" =~ ^ss:// ]]; then
sing_box_config_shadowsocks "$section" "$proxy_string" # Extract the first non-comment line as the active configuration
elif [[ "$proxy_string" =~ ^vless:// ]]; then active_proxy_string=$(echo "$proxy_string" | grep -v "^[[:space:]]*\/\/" | head -n 1)
sing_box_config_vless "$section" "$proxy_string"
if [ -z "$active_proxy_string" ]; then
log "No active proxy configuration found"
return
fi
if [[ "$active_proxy_string" =~ ^ss:// ]]; then
sing_box_config_shadowsocks "$section" "$active_proxy_string"
elif [[ "$active_proxy_string" =~ ^vless:// ]]; then
sing_box_config_vless "$section" "$active_proxy_string"
else else
log "Unsupported proxy type or missing configuration" log "Unsupported proxy type or missing configuration"
return return
@@ -736,40 +837,35 @@ sing_box_config_check() {
sing_box_config_outbound_json() { sing_box_config_outbound_json() {
local json_config="$1" local json_config="$1"
local listen_port="$2" local section="$2"
cat > /tmp/base_config.json << EOF # Create new object with tag first, then merge with the rest of the config
{ local modified_config=$(echo "$json_config" | jq --arg section "$section" \
"log": { 'del(.tag) | {"tag": $section} + .')
"level": "warn"
}, jq --argjson outbound "$modified_config" \
"inbounds": [ --arg section "$section" \
{ '. |
"type": "tproxy", .outbounds |= (
"listen": "::", map(
"listen_port": $listen_port, if .tag == $section then
"tcp_fast_open": true, $outbound
"udp_fragment": true else . end
}, ) +
{ (
"tag": "dns-in", if (map(select(.tag == $section)) | length) == 0 then
"type": "direct", [$outbound]
"listen": "127.0.0.42", else [] end
"listen_port": 53 )
} )' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
],
"outbounds": [], if [ $? -eq 0 ]; then
"route": { log "Outbound config updated successfully"
"auto_detect_interface": true else
} log "Error: Invalid JSON config generated"
return 1
fi
} }
EOF
jq --argjson outbound "$json_config" '.outbounds += [$outbound]' /tmp/base_config.json > $SING_BOX_CONFIG
rm -f /tmp/base_config.json
}
sing_box_config_shadowsocks() { sing_box_config_shadowsocks() {
local section="$1" local section="$1"
@@ -841,7 +937,7 @@ sing_box_config_vless() {
get_param() { get_param() {
local param="$1" local param="$1"
local value=$(echo "$STRING" | sed -n "s/.*[?&]$param=\([^&?#]*\).*/\1/p") local value=$(echo "$STRING" | sed -n "s/.*[?&]$param=\([^&?#]*\).*/\1/p")
value=$(echo "$value" | sed 's/%2F/\//g; s/%2C/,/g; s/%3D/=/g; s/%2B/+/g; s/%20/ /g' | tr -d '\n' | tr -d '\r') value=$(echo "$value" | sed 's/%2F/\//g; s/%2C/,/g; s/%3D/=/g; s/%2B/+/g; s/%20/ /g; s/%3B/;/g' | tr -d '\n' | tr -d '\r')
echo "$value" echo "$value"
} }
@@ -1139,7 +1235,7 @@ list_subnets_download() {
esac esac
local filename=$(basename "$URL") local filename=$(basename "$URL")
wget -q -O "/tmp/podkop/$filename" "$URL" wget -O "/tmp/podkop/$filename" "$URL"
while IFS= read -r subnet; do while IFS= read -r subnet; do
if [ "$service" = "discord" ]; then if [ "$service" = "discord" ]; then
@@ -1210,9 +1306,18 @@ process_remote_ruleset() {
sing_box_rule_preset() { sing_box_rule_preset() {
config_get custom_domains_list_type "$section" "custom_domains_list_type" 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_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"
config_get custom_download_subnets_list_enabled "$section" "custom_download_subnets_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" ] ||
[ "$custom_download_subnets_list_enabled" = "1" ]; then
sing_box_rules "$section" "$section" sing_box_rules "$section" "$section"
fi
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_local_domains_list_enabled" = "1" ] ||
[ "$custom_download_domains_list_enabled" = "1" ]; then
sing_box_dns_rule_fakeip_section "$section" "$section" sing_box_dns_rule_fakeip_section "$section" "$section"
fi fi
@@ -1230,8 +1335,13 @@ list_custom_local_domains_create() {
local filename=$(basename "$local_file" | cut -d. -f1) local filename=$(basename "$local_file" | cut -d. -f1)
while IFS= read -r domain; do while IFS= read -r domain; do
log "From local file: $domain" domain=$(echo "$domain" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
sing_box_ruleset_domains $domain $section if [ -n "$domain" ] && echo "$domain" | grep -E -q '^([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}$'; then
log "Added $domain from local file"
sing_box_ruleset_domains "$domain" "$section"
else
log "Invalid domain skipped: $domain"
fi
done <"$local_file" done <"$local_file"
} }
@@ -1315,14 +1425,14 @@ process_all_traffic_for_section() {
if [ "$all_traffic_from_ip_enabled" -eq "1" ]; then if [ "$all_traffic_from_ip_enabled" -eq "1" ]; then
log "Adding an IP to redirect all traffic" log "Adding an IP to redirect all traffic"
config_list_foreach $section all_traffic_ip list_all_traffic_from_ip config_list_foreach $section all_traffic_ip list_all_traffic_from_ip
config_list_foreach $section all_traffic_ip sing_box_rules_source_ip_cidr "$section" "$all_traffic_ip" config_list_foreach $section all_traffic_ip sing_box_rules_source_ip_cidr
fi fi
} }
sing_box_rules_source_ip_cidr() { sing_box_rules_source_ip_cidr() {
log "Configure source_ip_cidr rule in sing-box" log "Configure source_ip_cidr rule in sing-box"
local outbound="$2"
local source_ip_cidr="$1" local source_ip_cidr="$1"
local outbound="$section"
local current_source_ip_cidr=$(jq -r ".route.rules[] | select(.outbound == \"$outbound\" and .source_ip_cidr) | .rule_set" $SING_BOX_CONFIG) local current_source_ip_cidr=$(jq -r ".route.rules[] | select(.outbound == \"$outbound\" and .source_ip_cidr) | .rule_set" $SING_BOX_CONFIG)
@@ -1390,15 +1500,29 @@ check_proxy() {
fi fi
jq ' jq '
walk( walk(
if type == "object" then if type == "object" then
with_entries( with_entries(
if [.key] | inside(["uuid", "server", "server_name", "password", "public_key", "short_id"]) then if .key == "uuid" then
.value = "MASKED" .value = "MASKED"
else . end elif .key == "server" then
) .value = "MASKED"
else . end elif .key == "server_name" then
)' $SING_BOX_CONFIG .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..." nolog "Checking proxy connection..."
@@ -1437,22 +1561,18 @@ check_nft() {
nolog "Checking PodkopTable rules..." nolog "Checking PodkopTable rules..."
local sets="podkop_domains podkop_subnets podkop_subnets_discord localv4" # Check if table exists
if ! nft list table inet PodkopTable >/dev/null 2>&1; then
nolog "Sets statistics:" nolog "PodkopTable not found"
for set_name in $sets; do return 1
if nft list set inet PodkopTable $set_name >/dev/null 2>&1; then fi
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
nolog "Current chains and rules:" # Get all sets
nft list table inet PodkopTable | grep "chain\|counter" nolog "\nSets configuration:"
nolog "NFT check completed" nft list table inet PodkopTable
nolog "\nNFT check completed"
} }
check_github() { check_github() {
@@ -1477,37 +1597,94 @@ check_github() {
done 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() { check_logs() {
nolog "Showing podkop logs from system journal..." nolog "Showing podkop logs from system journal..."
if command -v logread >/dev/null 2>&1; then if command -v logread >/dev/null 2>&1; then
logread -e "podkop" | tail -n 50 logread -e podkop | tail -n 50
else else
nolog "Error: logread command not found" nolog "Error: logread command not found"
return 1 return 1
fi fi
} }
check_three() { show_sing_box_config() {
nolog "\n=== Checking GitHub connectivity ===" nolog "Current sing-box configuration:"
check_github
nolog "\n=== Checking proxy settings ===" if [ ! -f "$SING_BOX_CONFIG" ]; then
check_proxy nolog "Configuration file not found"
return 1
nolog "\n=== Checking NFT rules ===" fi
check_nft
nolog "\nFull diagnostic check completed"
}
check_all() { jq '
nolog "Starting full diagnostic check..." walk(
if type == "object" then
nolog "\n=== Checking recent logs ===" with_entries(
check_logs if .key == "uuid" then
.value = "MASKED"
check_three 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() { show_config() {
@@ -1538,4 +1715,131 @@ show_config() {
show_version() { show_version() {
local version=$(opkg info podkop | grep -m 1 "Version:" | cut -d' ' -f2) local version=$(opkg info podkop | grep -m 1 "Version:" | cut -d' ' -f2)
echo "$version" 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=""
local dns_configured=0
# 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
# Check DNS configuration
local dns_server=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
if [ "$dns_server" = "127.0.0.42" ]; then
dns_configured=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\",\"dns_configured\":$dns_configured}"
}
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
. + {
"domain": $domain
}
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}"
} }