Compare commits

..

109 Commits

Author SHA1 Message Date
itdoginfo
b013572644 Version 0.2.5 2024-12-14 23:27:13 +03:00
itdoginfo
a6a171ef47 Fixed #9, #10, #11 2024-12-14 22:56:31 +03:00
itdoginfo
9e599450f6 Merge pull request #11 from VizzleTF/main
feat: Add diagnostic checks
2024-12-14 14:53:31 +03:00
Ivan K
e31b8b79a4 refactor: Improve proxy config masking 2024-12-13 19:28:34 +03:00
Ivan K
ab5e0afb92 fix: jq double output with 2 outputs in sing-box config 2024-12-13 18:07:01 +03:00
Ivan K
2fb89b34b5 chore: small rename 2024-12-13 17:49:16 +03:00
Ivan K
7ba5ed6347 feat: Кнопка обновления списка доменов и подсетей
refactor: Поменять curl на wget, убрать зависимость
2024-12-13 17:46:41 +03:00
Ivan K
7373b76a8e feat: Add translate for new functions 2024-12-13 16:04:06 +03:00
Ivan K
8b1da669bd Add diagnostic tab 2024-12-13 14:14:04 +03:00
Ivan K
86dafabee9 feat: Add diagnostics tab 2024-12-13 14:12:03 +03:00
Ivan K
6ba2681cf2 feat: Add diagnostic checks 2024-12-13 12:32:30 +03:00
itdoginfo
45be28a223 Merge pull request #10 from VizzleTF/main
Add some features
2024-12-12 22:15:51 +03:00
itdoginfo
1c14a3e7d5 Merge branch 'main' into main 2024-12-12 22:15:39 +03:00
Ivan K
e4eb4fe67a chore: add missing default vars 2024-12-12 16:59:09 +03:00
Ivan K
a4fcbfd70a chore: move to jq 2024-12-12 16:34:56 +03:00
itdoginfo
5cfb3b14f5 Update 2024-12-12 00:16:38 +03:00
itdoginfo
b4c6f0a852 Merge pull request #9 from Akiyamov/main
Custom domains from local file and dnsmasq.d confdir
2024-12-11 23:55:21 +03:00
Ivan K
e66ee9dda6 feat: Add declare ALPN variable 2024-12-09 12:23:51 +03:00
Akiyamov
d832be781a Execute confdir only for 24 and newer versions 2024-12-05 15:55:05 +05:00
Akiyamov
1d4f25dd45 Confdir for 24.10 2024-12-05 15:17:40 +05:00
Ivan K
2d05025533 Fix: if/fi construction 2024-12-04 11:09:23 +03:00
Ivan K
63acd224e8 Fix: remove duplicate function sing_box_config_outbound_json 2024-12-01 14:12:56 +03:00
Ivan K
00ee716236 Feature: Support tcp type to vless config 2024-12-01 13:55:45 +03:00
Ivan K
82c7c290d9 feat: Enhance custom domain/subnet input 2024-12-01 13:55:45 +03:00
Akiyamov
3b2c6de384 Fix filename 2024-11-30 20:22:46 +05:00
Akiyamov
72ceb1046d Merge branch 'itdoginfo:main' into main 2024-11-30 18:47:02 +05:00
Akiyamov
55461a8810 Added custom domains from local file, no luci version right now 2024-11-30 18:46:36 +05:00
Ivan K
2fe12f3f4d refactor: Add support configurations from String-examle.md 2024-11-30 14:42:57 +03:00
Ivan K
3c6e8366e1 refactor: Optimize configuration generation 2024-11-30 14:41:24 +03:00
Ivan K
10d74c6a6b feat: Add proxy configuration options 2024-11-30 14:07:54 +03:00
itdoginfo
f5fe9c6c99 Update 2024-11-29 11:42:29 +03:00
itdoginfo
fab4df338f Update 2024-11-29 00:03:04 +03:00
itdoginfo
5f50313e3d Update 2024-11-28 23:59:50 +03:00
itdoginfo
ba1f7781f8 Update 2024-11-14 18:08:47 +03:00
itdoginfo
4220678feb Added string example 2024-11-14 18:08:12 +03:00
itdoginfo
a813379f17 Fix 2024-11-13 16:30:51 +03:00
itdoginfo
4b8223f464 Fix case 2024-11-13 16:27:50 +03:00
itdoginfo
c46984b1e1 0.2.4 2024-11-13 15:43:16 +03:00
itdoginfo
fcb03ff51e Added install rus translate 2024-11-13 15:41:57 +03:00
itdoginfo
34ef7e074b Fix value #6 2024-11-13 15:41:21 +03:00
itdoginfo
be1db9626d Fixed alternative 2024-11-13 00:47:34 +03:00
itdoginfo
d232023140 Nft move br-lan to mark, renamed secondary, fixed po template 2024-11-13 00:44:26 +03:00
itdoginfo
a5d6b202a9 Update todo 2024-11-12 18:31:35 +03:00
itdoginfo
6cf88e319b Some fixes for #6 2024-11-12 18:11:44 +03:00
itdoginfo
f82503de0e Merge pull request #6 from VizzleTF/main
Вкладки + cron + перевод + ci
2024-11-12 16:09:15 +03:00
Ivan Kvashonkin
f520270864 refactor: Extract version from tag and add to translate ipk file 2024-11-11 21:23:25 +03:00
Ivan Kvashonkin
66c7eb0ccb feat: Improve custom routing options 2024-11-11 19:59:04 +03:00
Ivan Kvashonkin
52483887f4 fix: Rollout podkop init.d configuration 2024-11-11 19:08:06 +03:00
Ivan Kvashonkin
5195dfa715 feat: Add language translation package correct version 2024-11-11 18:51:34 +03:00
Ivan Kvashonkin
47699ee0d6 refactor: Optimize VPN/Proxy configuration messages 2024-11-11 18:46:52 +03:00
Ivan Kvashonkin
b6f1c4e747 refactor: Rename and update settings tab 2024-11-11 18:38:05 +03:00
Ivan Kvashonkin
b3678323ca feat: Consolidate settings into basic tab 2024-11-11 18:28:58 +03:00
Ivan Kvashonkin
d8a860fb2f fix: second proxy configuration fixing 2024-11-10 18:39:14 +03:00
Ivan Kvashonkin
56e93a3d5f refactor: Add ucisection attribute to taboptions 2024-11-10 17:40:23 +03:00
Ivan Kvashonkin
1ac1aa8f74 ci: Update CI build configuration 2024-11-10 16:11:03 +03:00
Ivan Kvashonkin
79761d9ba7 Merge branch 'main' of github.com:VizzleTF/podkop 2024-11-10 16:08:30 +03:00
Ivan Kvashonkin
6179306da9 fix: Fix secondary route configuration 2024-11-10 16:07:59 +03:00
Ivan K
8794fc72ed Update README.md 2024-11-09 20:29:13 +03:00
Ivan Kvashonkin
20d0d00620 docs: Remove GitHub link from description 2024-11-09 00:41:44 +03:00
Ivan K
9f5e99ab52 Streamline build (#1)
feat: Добавлена группировка по вкладкам
feat: Выбор частоты обновления списков по cron на вкладке Дополнительные настройки
feat: Перевод на русский язык
cicd: Добавлена поддержка пакета luci-i18n-podkop-ru
2024-11-09 00:04:17 +03:00
itdoginfo
f4485ba0b5 Merge pull request #3 from Slava-Shchipunov/main
Заменил инпут proxy string на textarea
2024-11-08 11:26:40 +03:00
Slava-Shchipunov
795ea2e384 feat: replace proxy string input to textarea 2024-11-08 02:10:33 +07:00
itdoginfo
4ba30ea117 Merge pull request #2 from Slava-Shchipunov/main
Добавил валидацию поля для ввода домена
2024-11-07 11:32:55 +03:00
Slava-Shchipunov
853af95404 feat: add domain input validation 2024-11-07 11:33:32 +07:00
itdoginfo
cc427cbd8a correct processing of procd 2024-11-06 18:19:29 +03:00
itdoginfo
96ea424498 0.2.2 2024-11-06 14:00:25 +03:00
itdoginfo
0ad4133202 Fix hotplug, added logger, fix add_route 2024-11-06 13:59:15 +03:00
itdoginfo
b29a187d46 0.2.1 2024-11-05 18:31:04 +03:00
itdoginfo
adecd707cd Update 2024-11-05 18:27:44 +03:00
itdoginfo
eba1cbef64 Added interface up waiting 2024-11-05 18:27:36 +03:00
itdoginfo
ad21de83a9 Comment all list values 2024-11-05 18:26:48 +03:00
itdoginfo
fae0e42722 Uprade only mode, small refactor 2024-11-05 18:26:23 +03:00
itdoginfo
50f702aef9 Update 2024-11-05 14:05:11 +03:00
itdoginfo
d9c1f2a95c Merge pull request #1 from Slava-Shchipunov/main
Добавил автоматическую настройку туннелей awmneziawg и wg
2024-11-05 11:43:13 +03:00
Slava-Shchipunov
ee8bef67ee refactor: add handler_network_restart 2024-11-05 10:27:57 +07:00
Slava-Shchipunov
dcc0733b89 docs: update readme 2024-11-03 22:38:55 +07:00
Slava-Shchipunov
e154718e90 refactor: move wg-awg setup to install.sh 2024-11-03 22:19:36 +07:00
Slava-Shchipunov
a53adb2df1 refactor: move install awg packages to install.sh 2024-11-03 22:16:34 +07:00
Slava-Shchipunov
fe245c31c3 refactor: move add tunnel to function 2024-11-03 22:13:16 +07:00
Slava-Shchipunov
ee6bbe3f13 Merge remote-tracking branch 'upstream/main' 2024-11-03 22:06:52 +07:00
itdoginfo
f48670018f 0.2.0 2024-11-01 22:30:32 +03:00
itdoginfo
8870a56885 Move to PROCD 2024-11-01 22:02:58 +03:00
Slava-Shchipunov
8cf9f4b61b fix: add lost quotation mark 2024-11-01 21:22:40 +07:00
Slava-Shchipunov
fea3ae8606 Merge pull request #1 from Slava-Shchipunov/feat/add-amneziawg-auto-install
Feat/add amneziawg auto install
2024-11-01 20:42:43 +07:00
Slava-Shchipunov
2524e08096 feat: update obfuscation Jc 2024-11-01 20:33:27 +07:00
Slava-Shchipunov
9754708fc1 refactor: add raw base url 2024-11-01 20:25:37 +07:00
Slava-Shchipunov
afe96ff295 fix: fix syntax error 2024-11-01 18:07:56 +07:00
Slava-Shchipunov
708cbe5a97 feat: add wg obfuscation 2024-11-01 17:54:33 +07:00
Slava-Shchipunov
65efe20fd2 feat: add wg auto setup 2024-11-01 17:26:31 +07:00
itdoginfo
16f737914b Update 2024-10-30 16:56:25 +03:00
itdoginfo
6b19fbf7d9 Fix all traffic to trpoxy for IP, two chains, exclude NTP 2024-10-30 16:54:58 +03:00
Slava-Shchipunov
7b9f7ba605 fix: move network restart run 2024-10-30 10:23:52 +07:00
Slava-Shchipunov
415b5df621 fix: fix run wg-awg-setup 2024-10-30 10:13:57 +07:00
Slava-Shchipunov
0c8896bb6f feat: add wg_awg_setup script 2024-10-30 10:00:38 +07:00
Slava-Shchipunov
bdcbba1376 feat: add awg install script 2024-10-30 09:29:11 +07:00
Slava-Shchipunov
d070ba5c4e feat: add awg install to install.sh 2024-10-30 09:23:08 +07:00
itdoginfo
c8051bbbc8 Update 2024-10-29 18:50:28 +03:00
itdoginfo
50ba18d7ab Update todo 2024-10-29 18:39:18 +03:00
itdoginfo
c159baa283 Remove alpn for reality 2024-10-29 18:38:42 +03:00
itdoginfo
74d3ee5374 Added: exclude for IP, URL lists, yacd, socks for browser and other 2024-10-29 17:47:38 +03:00
itdoginfo
62c9afaaff Update todo 2024-10-29 17:44:27 +03:00
itdoginfo
a641b5e040 Update versions 2024-10-29 17:44:17 +03:00
itdoginfo
00305a0762 Fix tproxy for second 2024-10-28 20:56:56 +03:00
itdoginfo
5fca5840dd Update 2024-10-26 17:28:04 +03:00
itdoginfo
832bab3bca dnsmaqs-full dep 2024-10-26 17:27:48 +03:00
itdoginfo
34c8e69d6a fix 2024-10-26 12:28:14 +03:00
itdoginfo
0ca37d38d3 uninstall getdomains 2024-10-26 01:02:51 +03:00
itdoginfo
9c30194b13 0.1.7 2024-10-23 16:36:16 +03:00
itdoginfo
6ddbbc34fd Fixed delist for second tun 2024-10-23 16:34:54 +03:00
20 changed files with 2820 additions and 641 deletions

View File

@@ -1,5 +1,4 @@
name: Build packages
on:
push:
tags:
@@ -9,7 +8,6 @@ jobs:
build:
name: Build podkop and luci-app-podkop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.1
@@ -27,10 +25,20 @@ jobs:
docker cp podkop:/builder/bin/packages/x86_64/utilites/. ./bin/
docker cp podkop:/builder/bin/packages/x86_64/luci/. ./bin/
- name: Filter IPK files
run: |
# Извлекаем версию из тега, убирая префикс 'v'
VERSION=${GITHUB_REF#refs/tags/v}
mkdir -p ./filtered-bin
cp ./bin/luci-i18n-podkop-ru_*.ipk "./filtered-bin/luci-i18n-podkop-ru_${VERSION}.ipk"
cp ./bin/podkop_*.ipk ./filtered-bin/
cp ./bin/luci-app-podkop_*.ipk ./filtered-bin/
- name: Remove Docker container
run: docker rm podkop
- name: Release
uses: softprops/action-gh-release@v2.0.8
with:
files: ./bin/*.ipk
files: ./filtered-bin/*.ipk

View File

@@ -1,6 +1,6 @@
FROM openwrt/sdk:x86_64-v23.05.5
RUN ./scripts/feeds update -a && mkdir -p /builder/package/feeds/utilites/ && mkdir -p /builder/package/feeds/luci/
RUN ./scripts/feeds update -a && ./scripts/feeds install luci-base && mkdir -p /builder/package/feeds/utilites/ && mkdir -p /builder/package/feeds/luci/
COPY ./podkop /builder/package/feeds/utilites/podkop
COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop

130
README.md
View File

@@ -1,33 +1,35 @@
Это альфа версия, может не работать. Обсуждение https://t.me/itdogchat - топик Podkop dev
Это альфа версия, может не работать. Обсуждение https://t.me/itdogchat - топик **Podkop**
# Выпил getdomains
По минимуму
Если у вас установлен Getdomains, то его следует удалить.
# Удаление GetDomains скриптом
```
rm /etc/hotplug.d/iface/30-vpnroute
sed -i '/getdomains start/d' /etc/crontabs/root
rm /tmp/dnsmasq.d/domains.lst
service getdomains disable
rm /etc/init.d/getdomains
ip route del default scope link table vpn
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/domain-routing-openwrt/refs/heads/master/getdomains-uninstall.sh)
```
Может потребоваться удалить правила фаервола касающиеся vpn_subnet, internal итд.
Оставляет туннели, зоны, forwarding. А также stubby и dnscrypt. Они не помешают. Конфиг sing-box будет перезаписан в podkop.
# Установка
# Установка Podkop
Пакет работает на всех архитектурах.
Будет точно работать только на OpenWrt 23.05.
Нужен dnsmasq-full. В автоматическом режиме ставится сам. Вручную надо поставить [самостоятельно](https://github.com/itdoginfo/podkop/blob/952dd6215a2a83d65937cf9e33534c42809091ed/install.sh#L20).
## Автоматическая
```
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/main/install.sh)
```
Скрипт также предложит выбрать, какой туннель будет использоваться. Для выбранного туннеля будут установлены нужные пакеты, а для Wireguard и AmneziaWG также будет предложена автоматическая настройка - прямо в консоли скрипт запросит данные конфига. Для AmneziaWG можно также выбрать вариант с использованием конфига обычного Wireguard и автоматической обфускацией до AmneziaWG.
Для AmneziaWG скрипт проверяет наличие пакетов под вашу платформу в [стороннем репозитории](https://github.com/Slava-Shchipunov/awg-openwrt/releases), так как в официальном репозитории OpenWRT они отсутствуют, и автоматически их устанавливает.
## Вручную
Сделать `opkg update`, чтоб установились зависимости.
Скачать пакеты `podkop_*.ipk` и `luci-app-podkop_*.ipk` из релиза. `opkg install` сначала первый, потом второй.
```
/etc/init.d/ucitrack restart
```
## Автоматическая
# Обновление
Та же самая команда, что для установки. Скрипт обнаружит уже установленный podkop и предложит обновиться.
```
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/main/install.sh)
```
@@ -37,6 +39,11 @@ sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/mai
opkg remove luci-app-podkop podkop
```
Если был установлен русский язык
```
opkg remove luci-i18n-podkop-ru
```
# Использование
Конфиг: /etc/config/podkop
@@ -70,29 +77,83 @@ opkg update && opkg install sing-box
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
# Известные баги
1. Не работает proxy при режимах main vpn, second proxy
2. Не всегда отрабатывает ucitrack (применение настроек из luci)
- [x] Не работает proxy при режимах main vpn, second proxy
- [x] Не всегда отрабатывает ucitrack (применение настроек из luci). Не удаётся повторить
- [x] All traffic for IP ломает инет на клиенте. Proxy mode
- [x] Не отрабатывает рестарт, при awg и не применяются изменения при awg
- [x] awg работает не стабильно
- [x] Сеть рестартится при любом раскладе
- [x] Выкл-вкл wg через luci не отрабатывает поднятие маршрута
- [ ] Проблема скачивания списка из github release. Нужен curl -L
- [ ] Если eof после последней строки в rt_tables, то скрипт не добавляет перенос строки
# ToDo
Сделано
- [x] Скрипт для автоматической установки.
- [x] Подсети дискорда.
- [ ] Удаление getdomains через скрипт. Кроме туннеля и sing-box.
- [х] Дополнительная вкладка для ещё одного туннеля. Домены, подсети.
- [ ] Wiki
- [ ] IPv6
- [ ] Весь трафик для устойства пускать в туннель\прокси
- [ ] Исключение для IP, не ходить в туннель\прокси совсем 0x0
- [ ] Придумать автонастройку DNS через stubby итд. Как лучше это реализовать.
- [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] Правка перевода минимальная
- [ ] Вставлять готовый outdbound вместо строки. Отдельная галка, которая в идеале должны скрывать поле для строки
- [ ] udp over tcp для ss сделать с выбором:
1) отключен (ПО на сервере -Shadowsocks)
2) включен, версия 2 (новые релизы xray-core, sing-box на сервере)
3) включен, версия 1 (старые релизы xray, sing-box на сервере)
Проблема в том, что это нужно только если SS. Выставлять выбор при парсинг из конфига вопрос можно ли. Если совсем тупо - сделать костыль в допонительные настройки
- [ ] Проверка места в скрипте install. Если доступно меньше 20MB - exit 1 c выводом колько надо и сколько доступно. + показ модели роутера
- [ ] Правило запрещающее QUIC
Приоритет 2
- [ ] Списки доменов и подсетей с роутера
- [ ] Кнопка обновления списка доменов и подсетей
- [ ] IPv6
- [ ] Придумать автонастройку DNS через stubby итд. Как лучше это реализовать.
- [ ] Удаление подсетей CF из domain sets раз в N часов
- [ ] Поменять curl на wget, убрать зависимость
Wiki
- [x] Тема
- [x] Изначальное наполнение
Низкий приоритет
- [x] Переменная, раз во сколько часов обновлять списки
- [ ] Галочка, которая режет доступ к doh серверам
- [ ] Свой конфиг sing-box
Рефактор
- [ ] Handle для sing-box
- [ ] Handle для dnsmasq
- [ ] Формирование json для sing-box на уровне jq, а не шаблонов
- [ ] Unit тесты (BATS)
- [ ] Интеграционые тесты бекенда (OpenWrt rootfs + BATS)
- [ ] Добавить label от конфига vless\ss\etc в luci. Хз как
- [ ] Удаление подсетей CF из domain sets раз в N часов
- [ ] Врубать галочкой yacd в sing-box
- [ ] Свои списки. Вопрос форматирования
- [ ] В скрипт автоустановки добавить установку AWG по примеру getdomains
- [ ] Галочка, которая режет доступ к doh серверам
- [ ] Рефактор dnsmasq restart
Хз как сделать
- [ ] Добавить label от конфига vless\ss\etc в luci.
# Разработка
Есть два варианта:
@@ -142,6 +203,9 @@ make package/luci-app-podkop/{clean,compile} V=s
.ipk лежат в `bin/packages/x86_64/base/`
## Примеры строкs
https://github.com/itdoginfo/podkop/blob/main/String-example.md
## Ошибки
```
Makefile:17: /SDK/feeds/luci/luci.mk: No such file or directory
@@ -164,4 +228,4 @@ sudo apt update
sudo apt install build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \
python3-distutils rsync unzip zlib1g-dev file wget
```
```

63
String-example.md Normal file
View File

@@ -0,0 +1,63 @@
# Shadowsocks
Тут всё просто
## Shadowsocks-old
```
ss://YWVzLTI1Ni1nY206RmJwUDJnSStPczJKK1kzdkVhTnVuOUZ2ZjJZYUhNUlN1L1BBdEVqMks1VT0@example.com:80?type=tcp#example-ss-old
```
## Shadowsocks-2022
```
ss://2022-blake3-aes-128-gcm:5NgF%2B9eM8h4OnrTbHp%2B8UA%3D%3D%3Am8tbs5aKLYG7dN9f3xsiKA%3D%3D@example.com:80#example-ss2022
```
```
ss://MjAyMi1ibGFrZTMtYWVzLTEyOC1nY206Y21lZklCdDhwMTJaZm1QWUplMnNCNThRd3R3NXNKeVpUV0Z6ZENKV2taOD06eEJHZUxiMWNPTjFIeE9CenF6UlN0VFdhUUh6YWM2cFhRVFNZd2dVV2R1RT0@example.com:81?type=tcp#example-ss2022
```
Может быть без `?type=tcp`
# VLESS
## Reality
```
vless://eb445f4b-ddb4-4c79-86d5-0833fc674379@example.com:443?type=tcp&security=reality&pbk=ARQzddtXPJZHinwkPbgVpah9uwPTuzdjU9GpbUkQJkc&fp=chrome&sni=yahoo.com&sid=6cabf01472a3&spx=%2F&flow=xtls-rprx-vision#vless-reality
```
```
vless://UUID@IP:2082?security=reality&sni=dash.cloudflare.com&alpn=h2,http/1.1&allowInsecure=1&fp=chrome&pbk=pukkey&sid=id&type=grpc&encryption=none#vless-reality-strange
```
## TLS
1.
```
vless://8100b6eb-3fd1-4e73-8ccf-b4ac961232d6@example.com:443?type=tcp&security=tls&fp=&alpn=h3%2Ch2%2Chttp%2F1.1#vless-tls
```
2.
```
vless://8b60389a-7a01-4365-9244-c87f12bb98cf@example.com:443?security=tls&sni=SITE&fp=chrome&type=tcp&flow=xtls-rprx-vision&encryption=none#vless-tls-withot-alpn
```
3.
```
vless://8b60389a-7a01-4365-9244-c87f12bb98cf@example.com:443/?type=ws&encryption=none&path=%2Fwebsocket&security=tls&sni=sni.server.com&fp=chrome#vless-tls-ws
```
4.
```
vless://[someid]@[someserver]?security=tls&sni=[somesni]&type=ws&path=/?ed%3D2560&host=[somesni]&encryption=none#vless-tls-ws-2
```
5.
```
vless://uuid@server:443?security=tls&sni=server&fp=chrome&type=ws&path=/websocket&encryption=none#vless-tls-ws-3
```
6.
```
vless://33333@example.com:443/?type=ws&encryption=none&path=%2Fwebsocket&security=tls&sni=example.com&fp=chrome#vless-tls-ws-4
```
## No security
```
vless://8b60389a-7a01-4365-9244-c87f12bb98cf@example.com:443?type=tcp&security=none#vless-tls-no-encrypt
```

View File

@@ -2,34 +2,411 @@
REPO="https://api.github.com/repos/itdoginfo/podkop/releases/latest"
IS_SHOULD_RESTART_NETWORK=
DOWNLOAD_DIR="/tmp/podkop"
mkdir -p "$DOWNLOAD_DIR"
wget -qO- "$REPO" | grep -o 'https://[^"]*\.ipk' | while read -r url; do
filename=$(basename "$url")
echo "Download $filename..."
wget -q -O "$DOWNLOAD_DIR/$filename" "$url"
done
main() {
check_system
echo "opkg update"
opkg update
wget -qO- "$REPO" | grep -o 'https://[^"]*\.ipk' | while read -r url; do
filename=$(basename "$url")
echo "Download $filename..."
wget -q -O "$DOWNLOAD_DIR/$filename" "$url"
done
if opkg list-installed | grep -q dnsmasq-full; then
echo "dnsmasq-full already installed"
else
echo "Installed dnsmasq-full"
cd /tmp/ && opkg download dnsmasq-full
opkg remove dnsmasq && opkg install dnsmasq-full --cache /tmp/
echo "opkg update"
opkg update
[ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp
fi
if opkg list-installed | grep -q dnsmasq-full; then
echo "dnsmasq-full already installed"
else
echo "Installed dnsmasq-full"
cd /tmp/ && opkg download dnsmasq-full
opkg remove dnsmasq && opkg install dnsmasq-full --cache /tmp/
echo "Installed..."
opkg install $DOWNLOAD_DIR/podkop*.ipk
opkg install $DOWNLOAD_DIR/luci-app-podkop*.ipk
[ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp
fi
rm -f $DOWNLOAD_DIR/podkop*.ipk $DOWNLOAD_DIR/luci-app-podkop*.ipk
openwrt_release=$(cat /etc/openwrt_release | grep -Eo [0-9]{2}[.][0-9]{2}[.][0-9]* | cut -d '.' -f 1 | tail -n 1)
if [ $openwrt_release -ge 24 ]; then
if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then
echo "confdir alreadt set"
else
printf "Setting confdir"
uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d'
uci commit dhcp
fi
fi
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"
#/etc/init.d/ucitrack restart
while true; do
read -r -p '' UPDATE
case $UPDATE in
y)
echo "Upgraded podkop..."
break
;;
echo "Install sing-box for proxy, or install and configure WG/OpenVPN/AWG/etc for VPN mode"
n)
add_tunnel
break
;;
*)
echo "Please enter y or n"
;;
esac
done
else
echo "Installed podkop..."
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
done
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
printf "\033[32;1mRestart network\033[0m\n"
/etc/init.d/network restart
fi
}
add_tunnel() {
echo "What type of VPN or proxy will be used? We also can automatically configure Wireguard and Amnezia WireGuard."
echo "1) VLESS, Shadowsocks (A sing-box will be installed)"
echo "2) Wireguard"
echo "3) AmneziaWG"
echo "4) OpenVPN"
echo "5) OpenConnect"
echo "6) Skip this step"
while true; do
read -r -p '' TUNNEL
case $TUNNEL in
1)
opkg install sing-box
break
;;
2)
opkg install wireguard-tools luci-proto-wireguard luci-app-wireguard
printf "\033[32;1mDo you want to configure the wireguard interface? (y/n): \033[0m\n"
read IS_SHOULD_CONFIGURE_WG_INTERFACE
if [ "$IS_SHOULD_CONFIGURE_WG_INTERFACE" = "y" ] || [ "$IS_SHOULD_CONFIGURE_WG_INTERFACE" = "Y" ]; then
wg_awg_setup Wireguard
else
printf "\e[1;32mUse these instructions to manual configure https://itdog.info/nastrojka-klienta-wireguard-na-openwrt/\e[0m\n"
fi
break
;;
3)
install_awg_packages
printf "\033[32;1mThere are no instructions for manual configure yet. Do you want to configure the amneziawg interface? (y/n): \033[0m\n"
read IS_SHOULD_CONFIGURE_WG_INTERFACE
if [ "$IS_SHOULD_CONFIGURE_WG_INTERFACE" = "y" ] || [ "$IS_SHOULD_CONFIGURE_WG_INTERFACE" = "Y" ]; then
wg_awg_setup AmneziaWG
fi
break
;;
4)
opkg install opkg install openvpn-openssl luci-app-openvpn
printf "\e[1;32mUse these instructions to configure https://itdog.info/nastrojka-klienta-openvpn-na-openwrt/\e[0m\n"
break
;;
5)
opkg install opkg install openconnect luci-proto-openconnect
printf "\e[1;32mUse these instructions to configure https://itdog.info/nastrojka-klienta-openconnect-na-openwrt/\e[0m\n"
break
;;
6)
echo "Skip. Use this if you're installing an upgrade."
break
;;
*)
echo "Choose from the following options"
;;
esac
done
}
handler_network_restart() {
IS_SHOULD_RESTART_NETWORK=true
}
install_awg_packages() {
# Получение pkgarch с наибольшим приоритетом
PKGARCH=$(opkg print-architecture | awk 'BEGIN {max=0} {if ($3 > max) {max = $3; arch = $2}} END {print arch}')
TARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 1)
SUBTARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 2)
VERSION=$(ubus call system board | jsonfilter -e '@.release.version')
PKGPOSTFIX="_v${VERSION}_${PKGARCH}_${TARGET}_${SUBTARGET}.ipk"
BASE_URL="https://github.com/Slava-Shchipunov/awg-openwrt/releases/download/"
AWG_DIR="/tmp/amneziawg"
mkdir -p "$AWG_DIR"
if opkg list-installed | grep -q kmod-amneziawg; then
echo "kmod-amneziawg already installed"
else
KMOD_AMNEZIAWG_FILENAME="kmod-amneziawg${PKGPOSTFIX}"
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${KMOD_AMNEZIAWG_FILENAME}"
wget -O "$AWG_DIR/$KMOD_AMNEZIAWG_FILENAME" "$DOWNLOAD_URL"
if [ $? -eq 0 ]; then
echo "kmod-amneziawg file downloaded successfully"
else
echo "Error downloading kmod-amneziawg. Please, install kmod-amneziawg manually and run the script again"
exit 1
fi
opkg install "$AWG_DIR/$KMOD_AMNEZIAWG_FILENAME"
if [ $? -eq 0 ]; then
echo "kmod-amneziawg file downloaded successfully"
else
echo "Error installing kmod-amneziawg. Please, install kmod-amneziawg manually and run the script again"
exit 1
fi
fi
if opkg list-installed | grep -q amneziawg-tools; then
echo "amneziawg-tools already installed"
else
AMNEZIAWG_TOOLS_FILENAME="amneziawg-tools${PKGPOSTFIX}"
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${AMNEZIAWG_TOOLS_FILENAME}"
wget -O "$AWG_DIR/$AMNEZIAWG_TOOLS_FILENAME" "$DOWNLOAD_URL"
if [ $? -eq 0 ]; then
echo "amneziawg-tools file downloaded successfully"
else
echo "Error downloading amneziawg-tools. Please, install amneziawg-tools manually and run the script again"
exit 1
fi
opkg install "$AWG_DIR/$AMNEZIAWG_TOOLS_FILENAME"
if [ $? -eq 0 ]; then
echo "amneziawg-tools file downloaded successfully"
else
echo "Error installing amneziawg-tools. Please, install amneziawg-tools manually and run the script again"
exit 1
fi
fi
if opkg list-installed | grep -q luci-app-amneziawg; then
echo "luci-app-amneziawg already installed"
else
LUCI_APP_AMNEZIAWG_FILENAME="luci-app-amneziawg${PKGPOSTFIX}"
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${LUCI_APP_AMNEZIAWG_FILENAME}"
wget -O "$AWG_DIR/$LUCI_APP_AMNEZIAWG_FILENAME" "$DOWNLOAD_URL"
if [ $? -eq 0 ]; then
echo "luci-app-amneziawg file downloaded successfully"
else
echo "Error downloading luci-app-amneziawg. Please, install luci-app-amneziawg manually and run the script again"
exit 1
fi
opkg install "$AWG_DIR/$LUCI_APP_AMNEZIAWG_FILENAME"
if [ $? -eq 0 ]; then
echo "luci-app-amneziawg file downloaded successfully"
else
echo "Error installing luci-app-amneziawg. Please, install luci-app-amneziawg manually and run the script again"
exit 1
fi
fi
rm -rf "$AWG_DIR"
}
wg_awg_setup() {
PROTOCOL_NAME=$1
printf "\033[32;1mConfigure ${PROTOCOL_NAME}\033[0m\n"
if [ "$PROTOCOL_NAME" = 'Wireguard' ]; then
INTERFACE_NAME="wg0"
CONFIG_NAME="wireguard_wg0"
PROTO="wireguard"
ZONE_NAME="wg"
fi
if [ "$PROTOCOL_NAME" = 'AmneziaWG' ]; then
INTERFACE_NAME="awg0"
CONFIG_NAME="amneziawg_awg0"
PROTO="amneziawg"
ZONE_NAME="awg"
echo "Do you want to use AmneziaWG config or basic Wireguard config + automatic obfuscation?"
echo "1) AmneziaWG"
echo "2) Wireguard + automatic obfuscation"
read CONFIG_TYPE
fi
read -r -p "Enter the private key (from [Interface]):"$'\n' WG_PRIVATE_KEY_INT
while true; do
read -r -p "Enter internal IP address with subnet, example 192.168.100.5/24 (from [Interface]):"$'\n' WG_IP
if echo "$WG_IP" | egrep -oq '^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]+$'; then
break
else
echo "This IP is not valid. Please repeat"
fi
done
read -r -p "Enter the public key (from [Peer]):"$'\n' WG_PUBLIC_KEY_INT
read -r -p "If use PresharedKey, Enter this (from [Peer]). If your don't use leave blank:"$'\n' WG_PRESHARED_KEY_INT
read -r -p "Enter Endpoint host without port (Domain or IP) (from [Peer]):"$'\n' WG_ENDPOINT_INT
read -r -p "Enter Endpoint host port (from [Peer]) [51820]:"$'\n' WG_ENDPOINT_PORT_INT
WG_ENDPOINT_PORT_INT=${WG_ENDPOINT_PORT_INT:-51820}
if [ "$WG_ENDPOINT_PORT_INT" = '51820' ]; then
echo $WG_ENDPOINT_PORT_INT
fi
if [ "$PROTOCOL_NAME" = 'AmneziaWG' ]; then
if [ "$CONFIG_TYPE" = '1' ]; then
read -r -p "Enter Jc value (from [Interface]):"$'\n' AWG_JC
read -r -p "Enter Jmin value (from [Interface]):"$'\n' AWG_JMIN
read -r -p "Enter Jmax value (from [Interface]):"$'\n' AWG_JMAX
read -r -p "Enter S1 value (from [Interface]):"$'\n' AWG_S1
read -r -p "Enter S2 value (from [Interface]):"$'\n' AWG_S2
read -r -p "Enter H1 value (from [Interface]):"$'\n' AWG_H1
read -r -p "Enter H2 value (from [Interface]):"$'\n' AWG_H2
read -r -p "Enter H3 value (from [Interface]):"$'\n' AWG_H3
read -r -p "Enter H4 value (from [Interface]):"$'\n' AWG_H4
elif [ "$CONFIG_TYPE" = '2' ]; then
#Default values to wg automatic obfuscation
AWG_JC=4
AWG_JMIN=40
AWG_JMAX=70
AWG_S1=0
AWG_S2=0
AWG_H1=1
AWG_H2=2
AWG_H3=3
AWG_H4=4
fi
fi
uci set network.${INTERFACE_NAME}=interface
uci set network.${INTERFACE_NAME}.proto=$PROTO
uci set network.${INTERFACE_NAME}.private_key=$WG_PRIVATE_KEY_INT
uci set network.${INTERFACE_NAME}.listen_port='51821'
uci set network.${INTERFACE_NAME}.addresses=$WG_IP
if [ "$PROTOCOL_NAME" = 'AmneziaWG' ]; then
uci set network.${INTERFACE_NAME}.awg_jc=$AWG_JC
uci set network.${INTERFACE_NAME}.awg_jmin=$AWG_JMIN
uci set network.${INTERFACE_NAME}.awg_jmax=$AWG_JMAX
uci set network.${INTERFACE_NAME}.awg_s1=$AWG_S1
uci set network.${INTERFACE_NAME}.awg_s2=$AWG_S2
uci set network.${INTERFACE_NAME}.awg_h1=$AWG_H1
uci set network.${INTERFACE_NAME}.awg_h2=$AWG_H2
uci set network.${INTERFACE_NAME}.awg_h3=$AWG_H3
uci set network.${INTERFACE_NAME}.awg_h4=$AWG_H4
fi
if ! uci show network | grep -q ${CONFIG_NAME}; then
uci add network ${CONFIG_NAME}
fi
uci set network.@${CONFIG_NAME}[0]=$CONFIG_NAME
uci set network.@${CONFIG_NAME}[0].name="${INTERFACE_NAME}_client"
uci set network.@${CONFIG_NAME}[0].public_key=$WG_PUBLIC_KEY_INT
uci set network.@${CONFIG_NAME}[0].preshared_key=$WG_PRESHARED_KEY_INT
uci set network.@${CONFIG_NAME}[0].route_allowed_ips='0'
uci set network.@${CONFIG_NAME}[0].persistent_keepalive='25'
uci set network.@${CONFIG_NAME}[0].endpoint_host=$WG_ENDPOINT_INT
uci set network.@${CONFIG_NAME}[0].allowed_ips='0.0.0.0/0'
uci set network.@${CONFIG_NAME}[0].endpoint_port=$WG_ENDPOINT_PORT_INT
uci commit network
if ! uci show firewall | grep -q "@zone.*name='${ZONE_NAME}'"; then
printf "\033[32;1mZone Create\033[0m\n"
uci add firewall zone
uci set firewall.@zone[-1].name=$ZONE_NAME
uci set firewall.@zone[-1].network=$INTERFACE_NAME
uci set firewall.@zone[-1].forward='REJECT'
uci set firewall.@zone[-1].output='ACCEPT'
uci set firewall.@zone[-1].input='REJECT'
uci set firewall.@zone[-1].masq='1'
uci set firewall.@zone[-1].mtu_fix='1'
uci set firewall.@zone[-1].family='ipv4'
uci commit firewall
fi
if ! uci show firewall | grep -q "@forwarding.*name='${ZONE_NAME}'"; then
printf "\033[32;1mConfigured forwarding\033[0m\n"
uci add firewall forwarding
uci set firewall.@forwarding[-1]=forwarding
uci set firewall.@forwarding[-1].name="${ZONE_NAME}-lan"
uci set firewall.@forwarding[-1].dest=${ZONE_NAME}
uci set firewall.@forwarding[-1].src='lan'
uci set firewall.@forwarding[-1].family='ipv4'
uci commit firewall
fi
handler_network_restart
}
check_system() {
# Get router model
MODEL=$(cat /tmp/sysinfo/model)
echo "Router model: $MODEL"
# Check available space
AVAILABLE_SPACE=$(df /tmp | awk 'NR==2 {print $4}')
# Change after switch sing-box
REQUIRED_SPACE=1024 # 20MB 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"
echo "Available: $((AVAILABLE_SPACE/1024))MB"
echo "Required: $((REQUIRED_SPACE/1024))MB"
exit 1
fi
}
main

View File

@@ -1,19 +1,20 @@
# See /LICENSE for more information.
# This is free software, licensed under the GNU General Public License v2.
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-podkop
PKG_VERSION:=0.1.6
PKG_VERSION:=0.2.5
PKG_RELEASE:=1
LUCI_TITLE:=LuCI podkop app
LUCI_DEPENDS:=+luci-base +podkop
LUCI_PKGARCH:=all
LUCI_LANG.ru:=Русский (Russian)
LUCI_LANG.en:=English
PKG_LICENSE:=GPL-2.0-or-later
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
LUCI_LANGUAGES:=en ru
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -3,33 +3,63 @@
'require form';
'require ui';
'require network';
'require fs';
return view.extend({
async render() {
var m, s, o;
m = new form.Map('podkop', _('Podkop configuration'));
m = new form.Map('podkop', _('Podkop configuration'), null, ['main', 'second']);
s = m.section(form.TypedSection, 'main');
s.anonymous = true;
o = s.tab('main', _('Main'));
// Basic Settings Tab
o = s.tab('basic', _('Basic Settings'));
o = s.taboption('main', form.ListValue, 'mode', _('Mode'), _('Select VPN or Proxy'));
o = s.taboption('basic', form.ListValue, 'mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
o.value('vpn', ('VPN'));
o.value('proxy', ('Proxy'));
o.ucisection = 'main';
o = s.taboption('main', form.Value, 'proxy_string', _('Proxy String'), _('String vless:// or ss://'));
o = s.taboption('basic', form.ListValue, 'proxy_config_type', _('Configuration Type'), _('Select how to configure the proxy'));
o.value('url', _('Connection URL'));
o.value('outbound', _('Outbound Config'));
o.default = 'url';
o.depends('mode', 'proxy');
o.ucisection = 'main';
// Get all interface
o = s.taboption('main', form.ListValue, 'interface', _('Interface'), _('Specify the interface'));
o = s.taboption('basic', form.TextValue, 'proxy_string', _('Proxy Configuration URL'), _('Enter connection string starting with vless:// or ss:// for proxy configuration'));
o.depends('proxy_config_type', 'url');
o.rows = 5;
o.ucisection = 'main';
o = s.taboption('basic', form.TextValue, 'outbound_json', _('Outbound Configuration'), _('Enter complete outbound configuration in JSON format'));
o.depends('proxy_config_type', 'outbound');
o.rows = 10;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
try {
const parsed = JSON.parse(value);
if (!parsed.type || !parsed.server || !parsed.server_port) {
return _('JSON must contain at least type, server and server_port fields');
}
return true;
} catch (e) {
return _('Invalid JSON format');
}
};
o = s.taboption('basic', form.ListValue, 'interface', _('Network Interface'), _('Select network interface for VPN connection'));
o.depends('mode', 'vpn');
o.ucisection = 'main';
try {
const devices = await network.getDevices();
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0'];
devices.forEach(function (device) {
@@ -40,89 +70,421 @@ return view.extend({
if (!isExcluded) {
o.value(deviceName, deviceName);
}
} else {
console.warn('Device name is undefined or empty');
}
});
} catch (error) {
console.error('Error fetching devices:', error);
}
o = s.taboption('main', form.Flag, 'domain_list_enabled', _('Domain list enable'), _('<a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>'));
o = s.taboption('basic', form.Flag, 'domain_list_enabled', _('Community Domain Lists'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.ListValue, 'domain_list', _('Domain list'), _('Select a list'));
o = s.taboption('basic', form.ListValue, 'domain_list', _('Domain List'), _('Select a list') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>');
o.placeholder = 'placeholder';
o.value('ru_inside', 'Russia inside');
o.value('ru_outside', 'Russia outside');
o.value('ua', 'Ukraine');
o.depends('domain_list_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.Flag, 'delist_domains_enabled', _('Delist domains from main list enable'));
o = s.taboption('basic', form.Flag, 'delist_domains_enabled', _('Domain Exclusions'), _('Exclude specific domains from routing rules'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o.depends('domain_list_enabled', '1');
o = s.taboption('main', form.DynamicList, 'delist_domains', _('Delist domains'), _('Domains to be excluded'));
o = s.taboption('basic', form.DynamicList, 'delist_domains', _('Excluded Domains'), _('Domains to be excluded from routing'));
o.placeholder = 'Delist domains';
o.depends('delist_domains_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.Flag, 'subnets_list_enabled', _('Subnets list enable'));
o = s.taboption('basic', form.Flag, 'subnets_list_enabled', _('Community Subnet Lists'), _('Enable routing for popular services like Twitter, Meta, and Discord'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.DynamicList, 'subnets', _('Subnets specify option'));
o.placeholder = 'Subnet list';
o = s.taboption('basic', form.DynamicList, 'subnets', _('Service Networks'), _('Select predefined service networks for routing'));
o.placeholder = 'Service network list';
o.value('twitter', 'Twitter(x.com)');
o.value('meta', 'Meta');
o.value('discord', 'Discord(voice)');
o.depends('subnets_list_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.Flag, 'custom_domains_list_enabled', _('Custom domains enable'));
o.default = '0';
o = s.taboption('basic', form.ListValue, 'custom_domains_list_enabled', _('User Domain List Type'), _('Select how to add your custom domains'));
o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List'));
o.default = 'disabled';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.DynamicList, 'custom_domains', _('Your domains'));
o = s.taboption('basic', form.DynamicList, 'custom_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)'));
o.placeholder = 'Domains list';
o.depends('custom_domains_list_enabled', '1');
o.depends('custom_domains_list_enabled', 'dynamic');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
o = s.taboption('main', form.Flag, 'custom_subnets_list_enabled', _('Custom subnets enable'));
const domainRegex = /^(?!-)[A-Za-z0-9-]+([-.][A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
if (!domainRegex.test(value)) {
return _('Invalid domain format. Enter domain without protocol (example: sub.example.com)');
}
return true;
};
o = s.taboption('basic', form.TextValue, 'custom_domains_text', _('User Domains List'), _('Enter domain names separated by comma, space or newline (example: sub.example.com, example.com or one domain per line)'));
o.placeholder = 'example.com, sub.example.com\ndomain.com test.com\nsubdomain.domain.com another.com, third.com';
o.depends('custom_domains_list_enabled', 'text');
o.rows = 10;
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const domains = value.split(/[,\s\n]/)
.map(d => d.trim())
.filter(d => d.length > 0);
const domainRegex = /^(?!-)[A-Za-z0-9-]+([-.][A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
for (const domain of domains) {
if (!domainRegex.test(domain)) {
return _('Invalid domain format: ' + domain + '. Enter domain without protocol');
}
}
return true;
};
o = s.taboption('basic', form.Flag, 'custom_local_domains_list_enabled', _('Local Domain Lists'), _('Use the list from the router filesystem'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('main', form.DynamicList, 'custom_subnets', _('Your subnet'));
o.placeholder = 'Subnets list';
o.depends('custom_subnets_list_enabled', '1');
o = s.taboption('basic', form.DynamicList, 'custom_local_domains', _('Local Domain Lists Path'), _('Enter to the list file path'));
o.placeholder = '/path/file.lst';
o.depends('custom_local_domains_list_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
s = m.section(form.TypedSection, 'second');
s.anonymous = true;
try {
const pathRegex = /^\/[a-zA-Z0-9_\-\/\.]+$/;
if (!pathRegex.test(value)) {
throw new Error(_('Invalid path format. Path must start with "/" and contain only valid characters (letters, numbers, "-", "_", "/", ".")'));
}
return true;
} catch (e) {
return _('Invalid path format');
}
};
o = s.tab('second', _('Second'));
o = s.taboption('second', form.Flag, 'second_enable', _('Second enable'));
o = s.taboption('basic', form.Flag, 'custom_download_domains_list_enabled', _('Remote Domain Lists'), _('Download and use domain lists from remote URLs'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('second', form.ListValue, 'mode', _('Mode'), _('Select VPN or Proxy'));
o = s.taboption('basic', form.DynamicList, 'custom_download_domains', _('Remote Domain URLs'), _('Enter full URLs starting with http:// or https://'));
o.placeholder = 'URL';
o.depends('custom_download_domains_list_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
try {
const url = new URL(value);
if (!['http:', 'https:'].includes(url.protocol)) {
return _('URL must use http:// or https:// protocol');
}
return true;
} catch (e) {
return _('Invalid URL format. URL must start with http:// or https://');
}
};
o = s.taboption('basic', form.ListValue, 'custom_subnets_list_enabled', _('User Subnet List Type'), _('Select how to add your custom subnets'));
o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List (comma/space/newline separated)'));
o.default = 'disabled';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('basic', form.DynamicList, 'custom_subnets', _('User Subnets'), _('Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses'));
o.placeholder = 'IP or subnet';
o.depends('custom_subnets_list_enabled', 'dynamic');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/;
if (!subnetRegex.test(value)) {
return _('Invalid format. Use format: X.X.X.X or X.X.X.X/Y');
}
// Разбираем IP и маску
const [ip, cidr] = value.split('/');
const ipParts = ip.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP address parts must be between 0 and 255');
}
}
if (cidr !== undefined) {
const cidrNum = parseInt(cidr);
if (cidrNum < 0 || cidrNum > 32) {
return _('CIDR must be between 0 and 32');
}
}
return true;
};
o = s.taboption('basic', form.TextValue, 'custom_subnets_text', _('User Subnets List'), _('Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline'));
o.placeholder = '103.21.244.0/22\n8.8.8.8\n1.1.1.1/32, 9.9.9.9 10.10.10.10';
o.depends('custom_subnets_list_enabled', 'text');
o.rows = 10;
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
// Split by commas, spaces and newlines
const subnets = value.split(/[,\s\n]/)
.map(s => s.trim())
.filter(s => s.length > 0);
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/;
for (const subnet of subnets) {
if (!subnetRegex.test(subnet)) {
return _('Invalid format: ' + subnet + '. Use format: X.X.X.X or X.X.X.X/Y');
}
const [ip, cidr] = subnet.split('/');
const ipParts = ip.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP parts must be between 0 and 255 in: ' + subnet);
}
}
if (cidr !== undefined) {
const cidrNum = parseInt(cidr);
if (cidrNum < 0 || cidrNum > 32) {
return _('CIDR must be between 0 and 32 in: ' + subnet);
}
}
}
return true;
};
o = s.taboption('basic', form.Flag, 'custom_download_subnets_list_enabled', _('Remote Subnet Lists'), _('Download and use subnet lists from remote URLs'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('basic', form.DynamicList, 'custom_download_subnets', _('Remote Subnet URLs'), _('Enter full URLs starting with http:// or https://'));
o.placeholder = 'URL';
o.depends('custom_download_subnets_list_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
try {
const url = new URL(value);
if (!['http:', 'https:'].includes(url.protocol)) {
return _('URL must use http:// or https:// protocol');
}
return true;
} catch (e) {
return _('Invalid URL format. URL must start with http:// or https://');
}
};
o = s.taboption('basic', form.Flag, 'all_traffic_from_ip_enabled', _('IP for full redirection'), _('Specify local IP addresses whose traffic will always use the configured route'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('basic', form.DynamicList, 'all_traffic_ip', _('Local IPs'), _('Enter valid IPv4 addresses'));
o.placeholder = 'IP';
o.depends('all_traffic_from_ip_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const ipRegex = /^(\d{1,3}\.){3}\d{1,3}$/;
if (!ipRegex.test(value)) {
return _('Invalid IP format. Use format: X.X.X.X (like 192.168.1.1)');
}
const ipParts = value.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP address parts must be between 0 and 255');
}
}
return true;
};
o = s.taboption('basic', form.Flag, 'exclude_from_ip_enabled', _('IP for exclusion'), _('Specify local IP addresses that will never use the configured route'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('basic', form.DynamicList, 'exclude_traffic_ip', _('Local IPs'), _('Enter valid IPv4 addresses'));
o.placeholder = 'IP';
o.depends('exclude_from_ip_enabled', '1');
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const ipRegex = /^(\d{1,3}\.){3}\d{1,3}$/;
if (!ipRegex.test(value)) {
return _('Invalid IP format. Use format: X.X.X.X (like 192.168.1.1)');
}
const ipParts = value.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP address parts must be between 0 and 255');
}
}
return true;
};
// Additional Settings Tab
o = s.tab('additional', _('Additional Settings'));
o = s.taboption('additional', form.Flag, 'yacd', _('Yacd enable'), _('http://openwrt.lan:9090/ui'));
o.default = '0';
o.depends('mode', 'proxy');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('additional', form.Flag, 'socks5', _('Mixed enable'), _('Browser port: 2080'));
o.default = '0';
o.depends('mode', 'proxy');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('additional', form.Flag, 'exclude_ntp', _('Exclude NTP'), _('For issues with open connections sing-box'));
o.default = '0';
o.depends('mode', 'proxy');
o.rmempty = false;
o.ucisection = 'main';
o = s.taboption('additional', form.ListValue, 'update_interval', _('List Update Frequency'), _('Select how often the lists will be updated'));
o.value('0 */1 * * *', _('Every hour'));
o.value('0 */2 * * *', _('Every 2 hours'));
o.value('0 */4 * * *', _('Every 4 hours'));
o.value('0 */6 * * *', _('Every 6 hours'));
o.value('0 */12 * * *', _('Every 12 hours'));
o.value('0 4 * * *', _('Once a day at 04:00'));
o.value('0 4 * * 0', _('Once a week on Sunday at 04:00'));
o.default = '0 4 * * *';
o.rmempty = false;
o.ucisection = 'main';
// Secondary Settings Tab
o = s.tab('secondary_config', _('Secondary Config'));
o = s.taboption('secondary_config', form.Flag, 'second_enable', _('Secondary VPN/Proxy Enable'), _('Enable secondary VPN/Proxy configuration'));
o.default = '0';
o.rmempty = false;
o.ucisection = 'second';
o = s.taboption('secondary_config', form.ListValue, 'second_mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
o.value('vpn', ('VPN'));
o.value('proxy', ('Proxy'));
o.depends('second_enable', '1');
o.ucisection = 'second';
o = s.taboption('second', form.Value, 'proxy_string', _('Proxy String'), _('String vless:// or ss://'));
o.depends('mode', 'proxy');
o = s.taboption('secondary_config', form.ListValue, 'second_proxy_config_type', _('Configuration Type'), _('Select how to configure the proxy'));
o.value('url', _('Connection URL'));
o.value('outbound', _('Outbound Config'));
o.default = 'url';
o.depends('second_mode', 'proxy');
o.ucisection = 'second';
// Get all interface
o = s.taboption('second', form.ListValue, 'interface', _('Interface'), _('Specify the interface'));
o.depends('mode', 'vpn');
o = s.taboption('secondary_config', form.TextValue, 'second_proxy_string', _('Proxy Configuration URL'), _('Enter connection string starting with vless:// or ss:// for proxy configuration'));
o.depends('second_proxy_config_type', 'url');
o.rows = 5;
o.ucisection = 'second';
o = s.taboption('secondary_config', form.TextValue, 'second_outbound_json', _('Outbound Configuration'), _('Enter complete outbound configuration in JSON format'));
o.depends('second_proxy_config_type', 'outbound');
o.rows = 10;
o.ucisection = 'second';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
try {
const parsed = JSON.parse(value);
if (!parsed.type || !parsed.server || !parsed.server_port) {
return _('JSON must contain at least type, server and server_port fields');
}
return true;
} catch (e) {
return _('Invalid JSON format');
}
};
o = s.taboption('secondary_config', form.ListValue, 'second_interface', _('Network Interface'), _('Select network interface for VPN connection'));
o.depends('second_mode', 'vpn');
o.ucisection = 'second';
try {
const devices = await network.getDevices();
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0'];
devices.forEach(function (device) {
@@ -133,44 +495,320 @@ return view.extend({
if (!isExcluded) {
o.value(deviceName, deviceName);
}
} else {
console.warn('Device name is undefined or empty');
}
});
} catch (error) {
console.error('Error fetching devices:', error);
}
o = s.taboption('second', form.Flag, 'domain_service_enabled', _('Domain service enable'));
o = s.taboption('secondary_config', form.Flag, 'second_domain_service_enabled', _('Service Domain List Enable'), _('Enable predefined service domain lists for routing'));
o.default = '0';
o.rmempty = false;
o.depends('second_enable', '1');
o.ucisection = 'second';
o = s.taboption('second', form.ListValue, 'service_list', _('Service list'), _('Select a list'));
o = s.taboption('secondary_config', form.ListValue, 'second_service_list', _('Service List'), _('Select predefined services for routing'));
o.placeholder = 'placeholder';
o.value('youtube', 'Youtube');
o.depends('domain_service_enabled', '1');
o.depends('second_domain_service_enabled', '1');
o.rmempty = false;
o.ucisection = 'second';
o = s.taboption('second', form.Flag, 'custom_domains_list_enabled', _('Custom domains enable'));
o.default = '0';
o = s.taboption('secondary_config', form.ListValue, 'second_custom_domains_list_enabled', _('User Domain List Type'), _('Select how to add your custom domains'));
o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List'));
o.default = 'disabled';
o.rmempty = false;
o.depends('second_enable', '1');
o.ucisection = 'second';
o = s.taboption('second', form.DynamicList, 'custom_domains', _('Your domains'));
o = s.taboption('secondary_config', form.DynamicList, 'second_custom_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)'));
o.placeholder = 'Domains list';
o.depends('custom_domains_list_enabled', '1');
o.depends('second_custom_domains_list_enabled', 'dynamic');
o.rmempty = false;
o.ucisection = 'second';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
o = s.taboption('second', form.Flag, 'custom_subnets_list_enabled', _('Custom subnets enable'));
o.default = '0';
const domainRegex = /^(?!-)[A-Za-z0-9-]+([-.][A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
if (!domainRegex.test(value)) {
return _('Invalid domain format. Enter domain without protocol (example: sub.example.com)');
}
return true;
};
o = s.taboption('secondary_config', form.TextValue, 'second_custom_domains_text', _('User Domains List'), _('Enter domain names separated by comma, space or newline (example: sub.example.com, example.com or one domain per line)'));
o.placeholder = 'example.com, sub.example.com\ndomain.com test.com\nsubdomain.domain.com another.com, third.com';
o.depends('second_custom_domains_list_enabled', 'text');
o.rows = 10;
o.rmempty = false;
o.ucisection = 'second';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const domains = value.split(/[,\s\n]/)
.map(d => d.trim())
.filter(d => d.length > 0);
const domainRegex = /^(?!-)[A-Za-z0-9-]+([-.][A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
for (const domain of domains) {
if (!domainRegex.test(domain)) {
return _('Invalid domain format: ' + domain + '. Enter domain without protocol');
}
}
return true;
};
o = s.taboption('secondary_config', form.ListValue, 'second_custom_subnets_list_enabled', _('User Subnet List Type'), _('Select how to add your custom subnets'));
o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List'));
o.default = 'disabled';
o.rmempty = false;
o.depends('second_enable', '1');
o.ucisection = 'second';
o = s.taboption('second', form.DynamicList, 'custom_subnets', _('Your subnet'));
o.placeholder = 'Subnets list';
o.depends('custom_subnets_list_enabled', '1');
o = s.taboption('secondary_config', form.DynamicList, 'second_custom_subnets', _('User Subnets'), _('Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses'));
o.placeholder = 'IP or subnet';
o.depends('second_custom_subnets_list_enabled', 'dynamic');
o.rmempty = false;
o.ucisection = 'second';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/;
if (!subnetRegex.test(value)) {
return _('Invalid format. Use format: X.X.X.X or X.X.X.X/Y');
}
const [ip, cidr] = value.split('/');
const ipParts = ip.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP address parts must be between 0 and 255');
}
}
if (cidr !== undefined) {
const cidrNum = parseInt(cidr);
if (cidrNum < 0 || cidrNum > 32) {
return _('CIDR must be between 0 and 32');
}
}
return true;
};
o = s.taboption('secondary_config', form.TextValue, 'second_custom_subnets_text', _('User Subnets List'), _('Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline'));
o.placeholder = '103.21.244.0/22\n8.8.8.8\n1.1.1.1/32, 9.9.9.9 10.10.10.10';
o.depends('second_custom_subnets_list_enabled', 'text');
o.rows = 10;
o.rmempty = false;
o.ucisection = 'second';
o.validate = function (section_id, value) {
if (!value || value.length === 0) {
return true;
}
const subnets = value.split(/[,\s\n]/)
.map(s => s.trim())
.filter(s => s.length > 0);
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/;
for (const subnet of subnets) {
if (!subnetRegex.test(subnet)) {
return _('Invalid format: ' + subnet + '. Use format: X.X.X.X or X.X.X.X/Y');
}
const [ip, cidr] = subnet.split('/');
const ipParts = ip.split('.');
for (const part of ipParts) {
const num = parseInt(part);
if (num < 0 || num > 255) {
return _('IP parts must be between 0 and 255 in: ' + subnet);
}
}
if (cidr !== undefined) {
const cidrNum = parseInt(cidr);
if (cidrNum < 0 || cidrNum > 32) {
return _('CIDR must be between 0 and 32 in: ' + subnet);
}
}
}
return true;
};
o = s.tab('diagnostics', _('Diagnostics'));
function formatDiagnosticOutput(output) {
if (!output) return '';
return output
.replace(/\x1B\[[0-9;]*[mK]/g, '')
.replace(/\[[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\] /g, '')
.replace(/\n{3,}/g, '\n\n')
.replace(/===\s+(.*?)\s+===/g, (_, title) => `\n${title}\n${'─'.repeat(title.length)}`)
.replace(/^Checking\s+(.+)\.{3}/gm, '► Checking $1...')
.replace(/:\s+(available|not found)$/gm, (_, status) =>
`: ${status === 'available' ? '✓' : '✗'}`);
}
// Check All - полная диагностика
o = s.taboption('diagnostics', form.Button, '_check_all');
o.title = _('Main Check');
o.description = _('Run a comprehensive diagnostic check of all components');
o.inputtitle = _('Run Check');
o.inputstyle = 'apply';
o.onclick = function () {
return fs.exec('/etc/init.d/podkop', ['check_three'])
.then(function (res) {
const formattedOutput = formatDiagnosticOutput(res.stdout || _('No output'));
const modalElement = ui.showModal(_('Full Diagnostic Results'), [
E('div', {
style:
'max-height: 70vh;' +
'overflow-y: auto;' +
'margin: 1em 0;' +
'padding: 1.5em;' +
'background: #f8f9fa;' +
'border: 1px solid #e9ecef;' +
'border-radius: 4px;' +
'font-family: monospace;' +
'white-space: pre-wrap;' +
'word-wrap: break-word;' +
'line-height: 1.5;' +
'font-size: 14px;'
}, [
E('pre', { style: 'margin: 0;' }, formattedOutput)
]),
E('div', {
style: 'display: flex; justify-content: space-between; margin-top: 1em;'
}, [
E('button', {
'class': 'btn',
'click': function () {
const textarea = document.createElement('textarea');
textarea.value = '```txt\n' + formattedOutput + '\n```';
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand('copy');
} catch (err) {
ui.addNotification(null, E('p', {}, _('Failed to copy: ') + err.message));
}
document.body.removeChild(textarea);
}
}, _('Copy to Clipboard')),
E('button', {
'class': 'btn',
'click': ui.hideModal
}, _('Close'))
])
], 'large');
if (modalElement && modalElement.parentElement) {
modalElement.parentElement.style.width = '90%';
modalElement.parentElement.style.maxWidth = '1200px';
modalElement.parentElement.style.margin = '2rem auto';
}
});
};
o = s.taboption('diagnostics', form.Button, '_check_logs');
o.title = _('System Logs');
o.description = _('View recent system logs related to Podkop');
o.inputtitle = _('View Logs');
o.inputstyle = 'apply';
o.onclick = function () {
return fs.exec('/etc/init.d/podkop', ['check_logs'])
.then(function (res) {
const formattedOutput = formatDiagnosticOutput(res.stdout || _('No output'));
const modalElement = ui.showModal(_('System Logs'), [
E('div', {
style:
'max-height: 70vh;' +
'overflow-y: auto;' +
'margin: 1em 0;' +
'padding: 1.5em;' +
'background: #f8f9fa;' +
'border: 1px solid #e9ecef;' +
'border-radius: 4px;' +
'font-family: monospace;' +
'white-space: pre-wrap;' +
'word-wrap: break-word;' +
'line-height: 1.5;' +
'font-size: 14px;'
}, [
E('pre', { style: 'margin: 0;' }, formattedOutput)
]),
E('div', {
style: 'display: flex; justify-content: space-between; margin-top: 1em;'
}, [
E('button', {
'class': 'btn',
'click': function () {
const textarea = document.createElement('textarea');
textarea.value = '```txt\n' + formattedOutput + '\n```';
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand('copy');
} catch (err) {
ui.addNotification(null, E('p', {}, _('Failed to copy: ') + err.message));
}
document.body.removeChild(textarea);
}
}, _('Copy to Clipboard')),
E('button', {
'class': 'btn',
'click': ui.hideModal
}, _('Close'))
])
], 'large');
if (modalElement && modalElement.parentElement) {
modalElement.parentElement.style.width = '90%';
modalElement.parentElement.style.maxWidth = '1200px';
modalElement.parentElement.style.margin = '2rem auto';
}
});
};
o = s.taboption('diagnostics', form.Button, '_list_update');
o.title = _('Update lists');
o.description = _('Update all lists in config');
o.inputtitle = _('Update lists');
o.inputstyle = 'apply';
o.onclick = function () {
fs.exec('/etc/init.d/podkop', ['list_update']);
ui.showModal(_('List Update'), [
E('p', {}, _('Lists will be updated in background. You can check the progress in system logs.')),
E('div', { class: 'right' }, [
E('button', {
'class': 'btn',
'click': ui.hideModal
}, _('Close'))
])
]);
};
return m.render();
}

View File

@@ -0,0 +1,332 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Podkop configuration"
msgstr "Настройка Podkop"
msgid "Basic Settings"
msgstr "Основные настройки"
msgid "Additional Settings"
msgstr "Дополнительные настройки"
msgid "Secondary Config"
msgstr "Второй маршрут"
msgid "Secondary VPN/Proxy Enable"
msgstr "Включить второй VPN/Proxy"
msgid "Enable secondary VPN/Proxy configuration"
msgstr "Включить конфигурацию второго VPN/Proxy"
msgid "Connection Type"
msgstr "Тип подключения"
msgid "Select between VPN and Proxy connection methods for traffic routing"
msgstr "Выберите между VPN и Proxy методами для маршрутизации трафика"
msgid "Proxy Configuration URL"
msgstr "URL конфигурации прокси"
msgid "Enter connection string starting with vless:// or ss:// for proxy configuration"
msgstr "Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси"
msgid "Network Interface"
msgstr "Сетевой интерфейс"
msgid "Select network interface for VPN connection"
msgstr "Выберите сетевой интерфейс для VPN подключения"
msgid "Community Domain Lists"
msgstr "Предустановленные списки доменов"
msgid "Domain List"
msgstr "Список доменов"
msgid "Select a list"
msgstr "Выберите список доменов"
msgid "Community Subnet Lists"
msgstr "Предустановленные сети сервисов"
msgid "Enable routing for popular services like Twitter, Meta, and Discord"
msgstr "Включить маршрутизацию для популярных сервисов, таких как Twitter, Meta и Discord"
msgid "Service Networks"
msgstr "Сети сервисов"
msgid "Select predefined service networks for routing"
msgstr "Выберите предустановленные сети сервисов для маршрутизации"
msgid "User Domain List"
msgstr "Пользовательский список доменов"
msgid "Enable and manage your custom list of domains for selective routing"
msgstr "Включить и управлять пользовательским списком доменов для выборочной маршрутизации"
msgid "User Domains"
msgstr "Пользовательские домены"
msgid "Enter domain names without protocols (example: sub.example.com or example.com)"
msgstr "Введите имена доменов без протоколов (пример: sub.example.com или example.com)"
msgid "Remote Domain Lists"
msgstr "Удаленные списки доменов"
msgid "Download and use domain lists from remote URLs"
msgstr "Загрузка и использование списков доменов с удаленных URL"
msgid "Remote Domain URLs"
msgstr "URL удаленных доменов"
msgid "Enter full URLs starting with http:// or https://"
msgstr "Введите полные URL, начинающиеся с http:// или https://"
msgid "User Subnet List"
msgstr "Пользовательский список подсетей"
msgid "Enable and manage your custom list of IP subnets for selective routing"
msgstr "Включить и управлять пользовательским списком IP-подсетей для выборочной маршрутизации"
msgid "User Subnets"
msgstr "Пользовательские подсети"
msgid "Enter subnet in CIDR notation (example: 103.21.244.0/22)"
msgstr "Введите подсеть в нотации CIDR (пример: 103.21.244.0/22)"
msgid "Remote Subnet Lists"
msgstr "Удаленные списки подсетей"
msgid "Download and use subnet lists from remote URLs"
msgstr "Загрузка и использование списков подсетей с удаленных URL"
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"
msgid "Specify local IP addresses whose traffic will always use the configured route"
msgstr "Укажите локальные IP-адреса, трафик которых всегда будет использовать настроенный маршрут"
msgid "Local IPs"
msgstr "Локальные IP"
msgid "Enter valid IPv4 addresses"
msgstr "Введите действительные IPv4 адреса"
msgid "IP for exclusion"
msgstr "Исключения прокси IP"
msgid "Specify local IP addresses that will never use the configured route"
msgstr "Укажите локальные IP-адреса, которые никогда не будут использовать настроенный маршрут"
msgid "List Update Frequency"
msgstr "Частота обновления списков"
msgid "Select how often the lists will be updated"
msgstr "Выберите, как часто будут обновляться списки"
msgid "Every hour"
msgstr "Каждый час"
msgid "Every 2 hours"
msgstr "Каждые 2 часа"
msgid "Every 4 hours"
msgstr "Каждые 4 часа"
msgid "Every 6 hours"
msgstr "Каждые 6 часов"
msgid "Every 12 hours"
msgstr "Каждые 12 часов"
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)"
msgid "URL must use http:// or https:// protocol"
msgstr "URL должен использовать протокол http:// или https://"
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 "IP address parts must be between 0 and 255"
msgstr "Части IP-адреса должны быть между 0 и 255"
msgid "CIDR must be between 0 and 32"
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 "IP parts must be between 0 and 255 in: %s"
msgstr "Части IP-адреса должны быть между 0 и 255 в: %s"
msgid "Configuration Type"
msgstr "Тип конфигурации"
msgid "Select how to configure the proxy"
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 "JSON must contain at least type, server and server_port fields"
msgstr "JSON должен содержать как минимум поля type, server и server_port"
msgid "Invalid JSON format"
msgstr "Неверный формат JSON"
msgid "Diagnostics"
msgstr "Диагностика"
msgid "Main Check"
msgstr "Основная проверка"
msgid "Run a comprehensive diagnostic check of all components"
msgstr "Запустить комплексную диагностическую проверку всех компонентов"
msgid "Run Check"
msgstr "Запустить проверку"
msgid "Full Diagnostic Results"
msgstr "Полные результаты диагностики"
msgid "Failed to copy: "
msgstr "Ошибка копирования: "
msgid "Copy to Clipboard"
msgstr "Скопировать в буфер"
msgid "Close"
msgstr "Закрыть"
msgid "No output"
msgstr "Нет данных"
msgid "System Logs"
msgstr "Системные логи"
msgid "View recent system logs related to Podkop"
msgstr "Просмотр недавних системных логов, связанных с Podkop"
msgid "View Logs"
msgstr "Просмотр логов"
msgid "Failed to copy logs: "
msgstr "Ошибка копирования логов: "

View File

@@ -0,0 +1,332 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Podkop configuration"
msgstr ""
msgid "Basic Settings"
msgstr ""
msgid "Additional Settings"
msgstr ""
msgid "Secondary Config"
msgstr ""
msgid "Secondary VPN/Proxy Enable"
msgstr ""
msgid "Enable secondary VPN/Proxy configuration"
msgstr ""
msgid "Connection Type"
msgstr ""
msgid "Select between VPN and Proxy connection methods for traffic routing"
msgstr ""
msgid "Proxy Configuration URL"
msgstr ""
msgid "Enter connection string starting with vless:// or ss:// for proxy configuration"
msgstr ""
msgid "Network Interface"
msgstr ""
msgid "Select network interface for VPN connection"
msgstr ""
msgid "Community Domain Lists"
msgstr ""
msgid "Domain List"
msgstr ""
msgid "Select a list"
msgstr ""
msgid "Community Subnet Lists"
msgstr ""
msgid "Enable routing for popular services like Twitter, Meta, and Discord"
msgstr ""
msgid "Service Networks"
msgstr ""
msgid "Select predefined service networks for routing"
msgstr ""
msgid "User Domain List"
msgstr ""
msgid "Enable and manage your custom list of domains for selective routing"
msgstr ""
msgid "User Domains"
msgstr ""
msgid "Enter domain names without protocols (example: sub.example.com or example.com)"
msgstr ""
msgid "Remote Domain Lists"
msgstr ""
msgid "Download and use domain lists from remote URLs"
msgstr ""
msgid "Remote Domain URLs"
msgstr ""
msgid "Enter full URLs starting with http:// or https://"
msgstr ""
msgid "User Subnet List"
msgstr ""
msgid "Enable and manage your custom list of IP subnets for selective routing"
msgstr ""
msgid "User Subnets"
msgstr ""
msgid "Enter subnet in CIDR notation (example: 103.21.244.0/22)"
msgstr ""
msgid "Remote Subnet Lists"
msgstr ""
msgid "Download and use subnet lists from remote URLs"
msgstr ""
msgid "Remote Subnet URLs"
msgstr ""
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 ""
msgid "Specify local IP addresses whose traffic will always use the configured route"
msgstr ""
msgid "Local IPs"
msgstr ""
msgid "Enter valid IPv4 addresses"
msgstr ""
msgid "IP for exclusion"
msgstr ""
msgid "Specify local IP addresses that will never use the configured route"
msgstr ""
msgid "List Update Frequency"
msgstr ""
msgid "Select how often the lists will be updated"
msgstr ""
msgid "Every hour"
msgstr ""
msgid "Every 2 hours"
msgstr ""
msgid "Every 4 hours"
msgstr ""
msgid "Every 6 hours"
msgstr ""
msgid "Every 12 hours"
msgstr ""
msgid "Once a day at 04:00"
msgstr ""
msgid "Once a week on Sunday at 04:00"
msgstr ""
msgid "Yacd enable"
msgstr ""
msgid "Mixed enable"
msgstr ""
msgid "Browser port: 2080"
msgstr ""
msgid "Exclude NTP"
msgstr ""
msgid "For issues with open connections sing-box"
msgstr ""
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 ""
msgid "URL must use http:// or https:// protocol"
msgstr ""
msgid "Invalid URL format. URL must start with http:// or https://"
msgstr ""
msgid "Invalid subnet format. Use format: X.X.X.X/Y (like 103.21.244.0/22)"
msgstr ""
msgid "IP address parts must be between 0 and 255"
msgstr ""
msgid "CIDR must be between 0 and 32"
msgstr ""
msgid "Invalid IP format. Use format: X.X.X.X (like 192.168.1.1)"
msgstr ""
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 ""
msgid "Invalid domain format: %s. Enter domain without protocol"
msgstr ""
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 ""
msgid "User Subnets List"
msgstr ""
msgid "Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline"
msgstr ""
msgid "Invalid format. Use format: X.X.X.X or X.X.X.X/Y"
msgstr ""
msgid "IP parts must be between 0 and 255 in: %s"
msgstr ""
msgid "Configuration Type"
msgstr ""
msgid "Select how to configure the proxy"
msgstr ""
msgid "Connection URL"
msgstr ""
msgid "Outbound Config"
msgstr ""
msgid "Outbound Configuration"
msgstr ""
msgid "Enter complete outbound configuration in JSON format"
msgstr ""
msgid "JSON must contain at least type, server and server_port fields"
msgstr ""
msgid "Invalid JSON format"
msgstr ""
msgid "Diagnostics"
msgstr ""
msgid "Main Check"
msgstr ""
msgid "Run a comprehensive diagnostic check of all components"
msgstr ""
msgid "Run Check"
msgstr ""
msgid "Full Diagnostic Results"
msgstr ""
msgid "Failed to copy: "
msgstr ""
msgid "Copy to Clipboard"
msgstr ""
msgid "Close"
msgstr ""
msgid "No output"
msgstr ""
msgid "System Logs"
msgstr ""
msgid "View recent system logs related to Podkop"
msgstr ""
msgid "View Logs"
msgstr ""
msgid "Failed to copy logs: "
msgstr ""

View File

@@ -0,0 +1,10 @@
#!/bin/sh
rm -f /var/luci-indexcache*
rm -f /tmp/luci-indexcache*
[ -x /etc/init.d/rpcd ] && /etc/init.d/rpcd reload
logger -t "podkop" "$timestamp uci-defaults script executed"
exit 0

View File

@@ -2,10 +2,14 @@
"luci-app-podkop": {
"description": "Grant UCI and RPC access to LuCI app podkop",
"read": {
"file": {
"/etc/init.d/podkop": [
"exec"
]
},
"ubus": {
"luci.podkop": [
"get_sample1",
"get_sample2"
"service": [
"list"
]
},
"uci": [
@@ -18,4 +22,4 @@
]
}
}
}
}

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=podkop
PKG_VERSION:=0.1.6
PKG_VERSION:=0.2.5
PKG_RELEASE:=1
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/podkop
SECTION:=net
CATEGORY:=Network
DEPENDS:=+curl +jq +kmod-nft-tproxy +coreutils-base64
DEPENDS:=+dnsmasq-full +curl +jq +kmod-nft-tproxy +coreutils-base64
TITLE:=Domain routing app
URL:=https://itdog.info
PKGARCH:=all
@@ -28,25 +28,13 @@ endef
define Build/Compile
endef
define Package/podkop/postinst
#!/bin/sh
if ! uci show ucitrack | grep -q 'podkop'; then
uci add ucitrack podkop
uci set ucitrack.@podkop[-1].init=podkop
uci commit ucitrack
/etc/init.d/ucitrack restart
fi
exit 0
endef
define Package/podkop/prerm
#!/bin/sh
grep -q "105 podkop" /etc/iproute2/rt_tables && sed -i "/105 podkop/d" /etc/iproute2/rt_tables
rm -f /etc/hotplug.d/iface/50-podkop
exit 0
endef
@@ -57,13 +45,11 @@ endef
define Package/podkop/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/podkop $(1)/etc/init.d/podkop
sed -i "s/VERSION_FROM_MAKEFILE/$(PKG_VERSION)/g" $(1)/etc/init.d/podkop
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/podkop $(1)/etc/config/podkop
$(INSTALL_DIR) $(1)/etc/podkop
$(INSTALL_DATA) ./files/etc/podkop/* $(1)/etc/podkop/
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_DATA) ./files/etc/hotplug.d/iface/50-podkop $(1)/etc/hotplug.d/iface/50-podkop
endef

View File

@@ -1,28 +1,49 @@
config main 'main'
option mode 'proxy'
option interface 'wg0'
option proxy_string 'vless://60e7a3b2-5edb-4c0e-aa96-16702e4e0501@test.test:443/?type=tcp&encryption=none&flow=xtls-rprx-vision&sni=www.microsoft.com&fp=chrome&security=reality&pbk=O-IOLOcpVuzn9Eo3htHi0lxJ4YmeToNb6BhqUC7f7TQ&sid=4283c431d5a2263d#VLESS-podkop'
option mode ''
option interface ''
option proxy_config_type ''
#option outbound_json ''
#option proxy_string ''
option domain_list_enabled '1'
option domain_list 'ru_inside'
option subnets_list_enabled '0'
list subnets 'twitter'
option custom_domains_list_enabled '0'
list custom_domains 'ifconfig.co'
option custom_subnets_list_enabled '0'
list custom_subnets '188.114.96.0/20'
#list subnets 'twitter'
option custom_domains_list_type 'disable'
#list custom_domains ''
#option custom_domains_text ''
option custom_local_domains_list_enabled '0'
#list custom_local_domains ''
option custom_download_domains_list_enabled '0'
#list custom_download_domains ''
option custom_domains_list_type 'disable'
#list custom_subnets ''
#custom_subnets_text ''
option custom_download_subnets_list_enabled '0'
#list custom_download_subnets ''
option all_traffic_from_ip_enabled '0'
list all_traffic_ip '192.168.56.226'
#list all_traffic_ip ''
option delist_domains_enabled '0'
list delist_domains 'zerossl.com'
#list delist_domains ''
option exclude_from_ip_enabled '0'
#list exclude_traffic_ip ''
option yacd '0'
option socks5 '0'
option exclude_ntp '0'
option update_interval ''
option custom_domains_text
config second 'second'
option second_enable '0'
option mode 'proxy'
option interface 'wg1'
option proxy_string ''
option domain_list_enabled '0'
list domains 'youtube'
option custom_domains_list_enabled '0'
list custom_domains 'ifconfig.io'
option custom_subnets_list_enabled '0'
list custom_subnets '-'
option second_mode 'proxy'
option second_interface ''
option second_proxy_config_type ''
#option second_outbound_json ''
#option second_proxy_string ''
option second_domain_service_enabled '0'
#list second_service_list 'youtube'
option second_custom_domains_type 'disable'
#list second_custom_domains 'ifconfig.io'
#option second_custom_domains_text ''
option second_custom_subnets_type 'disable'
#list second_custom_subnets ''
#porion second_custom_subnets_text ''

View File

@@ -1,3 +1,28 @@
#!/bin/sh
/etc/init.d/podkop add_route_interface
. /lib/functions.sh
config_load "/etc/config/podkop"
. /etc/init.d/podkop
config_get "interface" "main" "interface" "0"
config_get "mode" "main" "mode" "0"
if [ "$mode" = "vpn" ] && [ -n "$interface" ]; then
add_route_interface "$interface" "podkop"
fi
if [ "$mode" = "proxy" ]; then
echo "Add route for main tproxy"
add_route_tproxy podkop
fi
config_get second_enable "second" "second_enable" "0"
config_get second_interface "second" "second_interface" "0"
config_get "second_mode" "second" "second_mode" "0"
if [ "$second_enable" -eq "1" ] && [ "$second_mode" = "vpn" ] && [ -n "$second_interface" ]; then
add_route_interface "$second_interface" "podkop2"
fi
if [ "$second_enable" -eq "1" ] && [ "$second_mode" = "proxy" ]; then
echo "Add route for second tproxy"
add_route_tproxy podkop2
fi

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
{
"outbounds": [
{
"type": "shadowsocks",
"server": "$HOST",
"server_port": "$PORT",
"method": "$METHOD",
"password": "$PASS",
"udp_over_tcp": {
"enabled": true,
"version": 2
},
"tag": "$TAG"
}
]
}

View File

@@ -1,29 +0,0 @@
{
"log": {
"level": "warn"
},
"inbounds": [
{
"type": "tproxy",
"listen": "::",
"listen_port": 1602,
"sniff": false
}
],
"outbounds": [
{
"type": "shadowsocks",
"server": "$HOST",
"server_port": "$PORT",
"method": "$METHOD",
"password": "$PASS",
"udp_over_tcp": {
"enabled": true,
"version": 2
}
}
],
"route": {
"auto_detect_interface": true
}
}

View File

@@ -1,35 +0,0 @@
{
"log": {
"level": "warn"
},
"inbounds": [
{
"type": "tproxy",
"listen": "::",
"listen_port": 1602,
"sniff": false,
"tag": "main"
},
{
"type": "tproxy",
"listen": "::",
"listen_port": 1603,
"sniff": false,
"tag": "second"
}
],
"outbounds": [],
"route": {
"rules": [
{
"inbound": "main",
"outbound": "main"
},
{
"inbound": "second",
"outbound": "second"
}
],
"auto_detect_interface": true
}
}

View File

@@ -1,26 +0,0 @@
{
"outbounds": [
{
"type": "vless",
"server": "$HOST",
"server_port": "$PORT",
"uuid": "$UUID",
"flow": "xtls-rprx-vision",
"tls": {
"enabled": true,
"insecure": false,
"server_name": "$FAKE_SERVER",
"utls": {
"enabled": true,
"fingerprint": "chrome"
},
"reality": {
"enabled": true,
"public_key": "$PUBLIC_KEY",
"short_id": "$SHORT_ID"
}
},
"tag": "$TAG"
}
]
}

View File

@@ -1,39 +0,0 @@
{
"log": {
"level": "warn"
},
"inbounds": [
{
"type": "tproxy",
"listen": "::",
"listen_port": 1602,
"sniff": false
}
],
"outbounds": [
{
"type": "vless",
"server": "$HOST",
"server_port": "$PORT",
"uuid": "$UUID",
"flow": "xtls-rprx-vision",
"tls": {
"enabled": true,
"insecure": false,
"server_name": "$FAKE_SERVER",
"utls": {
"enabled": true,
"fingerprint": "chrome"
},
"reality": {
"enabled": true,
"public_key": "$PUBLIC_KEY",
"short_id": "$SHORT_ID"
}
}
}
],
"route": {
"auto_detect_interface": true
}
}