mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1e7bfc377 | ||
|
|
34d524ef51 | ||
|
|
c914d38ff2 | ||
|
|
543b66a6cc | ||
|
|
c046930032 | ||
|
|
12264b6ec0 | ||
|
|
d4b7d77e10 | ||
|
|
7f6cc66eb1 | ||
|
|
532fe10a1a | ||
|
|
b013572644 | ||
|
|
a6a171ef47 | ||
|
|
9e599450f6 | ||
|
|
e31b8b79a4 | ||
|
|
ab5e0afb92 | ||
|
|
2fb89b34b5 | ||
|
|
7ba5ed6347 | ||
|
|
7373b76a8e | ||
|
|
8b1da669bd | ||
|
|
86dafabee9 | ||
|
|
6ba2681cf2 | ||
|
|
45be28a223 | ||
|
|
1c14a3e7d5 | ||
|
|
e4eb4fe67a | ||
|
|
a4fcbfd70a | ||
|
|
5cfb3b14f5 | ||
|
|
b4c6f0a852 | ||
|
|
e66ee9dda6 | ||
|
|
d832be781a | ||
|
|
1d4f25dd45 | ||
|
|
2d05025533 | ||
|
|
63acd224e8 | ||
|
|
00ee716236 | ||
|
|
82c7c290d9 | ||
|
|
3b2c6de384 | ||
|
|
72ceb1046d | ||
|
|
55461a8810 | ||
|
|
2fe12f3f4d | ||
|
|
3c6e8366e1 | ||
|
|
10d74c6a6b | ||
|
|
f5fe9c6c99 | ||
|
|
fab4df338f | ||
|
|
5f50313e3d | ||
|
|
ba1f7781f8 | ||
|
|
4220678feb | ||
|
|
a813379f17 | ||
|
|
4b8223f464 | ||
|
|
c46984b1e1 | ||
|
|
fcb03ff51e | ||
|
|
34ef7e074b | ||
|
|
be1db9626d | ||
|
|
d232023140 | ||
|
|
a5d6b202a9 | ||
|
|
6cf88e319b | ||
|
|
f82503de0e | ||
|
|
f520270864 | ||
|
|
66c7eb0ccb | ||
|
|
52483887f4 | ||
|
|
5195dfa715 | ||
|
|
47699ee0d6 | ||
|
|
b6f1c4e747 | ||
|
|
b3678323ca | ||
|
|
d8a860fb2f | ||
|
|
56e93a3d5f | ||
|
|
1ac1aa8f74 | ||
|
|
79761d9ba7 | ||
|
|
6179306da9 | ||
|
|
8794fc72ed | ||
|
|
20d0d00620 | ||
|
|
9f5e99ab52 | ||
|
|
f4485ba0b5 | ||
|
|
795ea2e384 | ||
|
|
4ba30ea117 | ||
|
|
853af95404 | ||
|
|
cc427cbd8a | ||
|
|
96ea424498 | ||
|
|
0ad4133202 | ||
|
|
b29a187d46 | ||
|
|
adecd707cd | ||
|
|
eba1cbef64 | ||
|
|
ad21de83a9 | ||
|
|
fae0e42722 | ||
|
|
50f702aef9 | ||
|
|
d9c1f2a95c | ||
|
|
ee8bef67ee | ||
|
|
dcc0733b89 | ||
|
|
e154718e90 | ||
|
|
a53adb2df1 | ||
|
|
fe245c31c3 | ||
|
|
ee6bbe3f13 | ||
|
|
f48670018f | ||
|
|
8870a56885 | ||
|
|
8cf9f4b61b | ||
|
|
fea3ae8606 | ||
|
|
2524e08096 | ||
|
|
9754708fc1 | ||
|
|
afe96ff295 | ||
|
|
708cbe5a97 | ||
|
|
65efe20fd2 | ||
|
|
16f737914b | ||
|
|
6b19fbf7d9 | ||
|
|
7b9f7ba605 | ||
|
|
415b5df621 | ||
|
|
0c8896bb6f | ||
|
|
bdcbba1376 | ||
|
|
d070ba5c4e | ||
|
|
c8051bbbc8 | ||
|
|
50ba18d7ab | ||
|
|
c159baa283 | ||
|
|
74d3ee5374 | ||
|
|
62c9afaaff | ||
|
|
a641b5e040 | ||
|
|
00305a0762 | ||
|
|
5fca5840dd | ||
|
|
832bab3bca | ||
|
|
34c8e69d6a | ||
|
|
0ca37d38d3 | ||
|
|
9c30194b13 | ||
|
|
6ddbbc34fd | ||
|
|
0f64ceea5a | ||
|
|
249a2e3234 | ||
|
|
17172dbc54 | ||
|
|
9294b8a16f | ||
|
|
281aeb7540 | ||
|
|
e87eea0fd8 | ||
|
|
d7ea5d50a2 | ||
|
|
952dd6215a | ||
|
|
a230f48ba3 | ||
|
|
b2f3199895 | ||
|
|
c3e99399ae | ||
|
|
d0a1a2b801 | ||
|
|
cd0b19ae46 | ||
|
|
a4e5cd437d |
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@@ -1,5 +1,4 @@
|
|||||||
name: Build packages
|
name: Build packages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
@@ -9,7 +8,6 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build podkop and luci-app-podkop
|
name: Build podkop and luci-app-podkop
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.1
|
- 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/utilites/. ./bin/
|
||||||
docker cp podkop:/builder/bin/packages/x86_64/luci/. ./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
|
- name: Remove Docker container
|
||||||
run: docker rm podkop
|
run: docker rm podkop
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2.0.8
|
uses: softprops/action-gh-release@v2.0.8
|
||||||
with:
|
with:
|
||||||
files: ./bin/*.ipk
|
files: ./filtered-bin/*.ipk
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
FROM openwrt/sdk:x86_64-v23.05.5
|
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 ./podkop /builder/package/feeds/utilites/podkop
|
||||||
COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop
|
COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop
|
||||||
|
|||||||
252
README.md
252
README.md
@@ -1,2 +1,250 @@
|
|||||||
# podkop
|
# Вещи, которые вам нужно знать перед установкой
|
||||||
Dev podkop
|
|
||||||
|
- Это альфа версия, которая находится в активной разработке. Из версии в версию что-то может меняться.
|
||||||
|
- Основной функционал работает, но побочные штуки сейчас могут сбоить.
|
||||||
|
- При обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться.
|
||||||
|
- Необходимо минимум 15МБ свободного места на роутере. Роутерами с флешками на 16МБ сразу мимо.
|
||||||
|
- При старте программы редактируется конфиг Dnsmasq.
|
||||||
|
- Podkop редактирует конфиг sing-box. Обязательно сохраните ваш конфиг sing-box перед установкой, если он вам нужен.
|
||||||
|
- Информация здесь может быть устаревшей. Все изменения фиксируются в телеграм-чате https://t.me/itdogchat - топик **Podkop**.
|
||||||
|
- Если у вас установлен Getdomains, его следует удалить.
|
||||||
|
|
||||||
|
# Удаление GetDomains скриптом
|
||||||
|
```
|
||||||
|
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/domain-routing-openwrt/refs/heads/master/getdomains-uninstall.sh)
|
||||||
|
```
|
||||||
|
|
||||||
|
Оставляет туннели, зоны, forwarding. А также stubby и dnscrypt. Они не помешают. Конфиг sing-box будет перезаписан в podkop.
|
||||||
|
|
||||||
|
# Установка Podkop
|
||||||
|
Пакет работает на всех архитектурах.
|
||||||
|
Тестировался на OpenWrt 23.05 и OpenWrt 24.10.
|
||||||
|
|
||||||
|
Поддержки APK на данный момент нет. APK будет сделан после того как разгребу основное.
|
||||||
|
|
||||||
|
## Автоматическая
|
||||||
|
```
|
||||||
|
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` сначала первый, потом второй.
|
||||||
|
|
||||||
|
# Обновление
|
||||||
|
Та же самая команда, что для установки. Скрипт обнаружит уже установленный podkop и предложит обновиться.
|
||||||
|
```
|
||||||
|
sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/main/install.sh)
|
||||||
|
```
|
||||||
|
|
||||||
|
# Удаление
|
||||||
|
```
|
||||||
|
opkg remove luci-app-podkop podkop
|
||||||
|
```
|
||||||
|
|
||||||
|
Если был установлен русский язык
|
||||||
|
```
|
||||||
|
opkg remove luci-i18n-podkop-ru
|
||||||
|
```
|
||||||
|
|
||||||
|
# Использование
|
||||||
|
Конфиг: /etc/config/podkop
|
||||||
|
|
||||||
|
Luci: Services/podkop
|
||||||
|
|
||||||
|
## Режимы
|
||||||
|
|
||||||
|
### Proxy
|
||||||
|
Для VLESS и Shadowsocks. Другие протоколы тоже будут, кидайте в чат примеры строк без чувствительных данных.
|
||||||
|
|
||||||
|
В этом режиме просто копируйте строку в **Proxy String** и из неё автоматически настроится sing-box.
|
||||||
|
|
||||||
|
### VPN
|
||||||
|
Здесь у вас должен быть уже настроен WG/OpenVPN/OpenConnect etc, зона Zone и Forwarding не обязательны.
|
||||||
|
|
||||||
|
Просто выбрать интерфейс из списка.
|
||||||
|
|
||||||
|
## Настройка доменов и подсетей
|
||||||
|
**Community Lists** - Включить списки комьюнити
|
||||||
|
|
||||||
|
**Subnets list enable** - Включить подсети из общего списка, выбрать из предложенных.
|
||||||
|
|
||||||
|
**Custom domains enable** - Добавить свои домены
|
||||||
|
|
||||||
|
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
|
||||||
|
|
||||||
|
# Известные баги
|
||||||
|
- [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 не отрабатывает поднятие маршрута
|
||||||
|
- [ ] Если 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
|
||||||
|
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
|
||||||
|
|
||||||
|
Сделано
|
||||||
|
- [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
|
||||||
|
- [ ] Валидации предустановленных значений. Если прописаны другие, то вывод в лог о неизвестной переменной и продолжение работы
|
||||||
|
|
||||||
|
Приоритет 2
|
||||||
|
- [x] Списки доменов и подсетей с роутера
|
||||||
|
- [ ] Кнопка обновления списка доменов и подсетей. Запихнуть в главное меню
|
||||||
|
- [ ] IPv6
|
||||||
|
|
||||||
|
Wiki
|
||||||
|
- [x] Тема
|
||||||
|
- [x] Изначальное наполнение
|
||||||
|
|
||||||
|
Низкий приоритет
|
||||||
|
- [x] Переменная, раз во сколько часов обновлять списки
|
||||||
|
- [ ] Галочка, которая режет доступ к doh серверам
|
||||||
|
- [ ] Свой конфиг sing-box
|
||||||
|
- [x] Поменять curl на wget, убрать зависимость. Проверять доступность списков лучше всего curl`ом
|
||||||
|
|
||||||
|
Рефактор
|
||||||
|
- [ ] Handle для sing-box
|
||||||
|
- [ ] Handle для dnsmasq
|
||||||
|
- [ ] Формирование json для sing-box на уровне jq, а не шаблонов
|
||||||
|
- [ ] Unit тесты (BATS)
|
||||||
|
- [ ] Интеграционые тесты бекенда (OpenWrt rootfs + BATS)
|
||||||
|
|
||||||
|
Хз как сделать
|
||||||
|
- [ ] Добавить label от конфига vless\ss\etc в luci.
|
||||||
|
|
||||||
|
# Разработка
|
||||||
|
Есть два варианта:
|
||||||
|
- Просто поставить пакет на роутер или виртуалку и прям редактировать через SFTP (opkg install openssh-sftp-server)
|
||||||
|
- SDK, чтоб собирать пакеты
|
||||||
|
|
||||||
|
Для сборки пакетов нужен SDK, один из вариантов скачать прям файл и разархивировать
|
||||||
|
https://downloads.openwrt.org/releases/23.05.5/targets/x86/64/
|
||||||
|
Нужен файл с SDK в имени
|
||||||
|
|
||||||
|
```
|
||||||
|
wget https://downloads.openwrt.org/releases/23.05.5/targets/x86/64/openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64.tar.xz
|
||||||
|
tar xf openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64.tar.xz
|
||||||
|
mv openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64 SDK
|
||||||
|
```
|
||||||
|
Последнее для удобства.
|
||||||
|
|
||||||
|
Создаём директорию для пакета
|
||||||
|
```
|
||||||
|
mkdir package/utilites
|
||||||
|
```
|
||||||
|
|
||||||
|
Симлинк из репозитория
|
||||||
|
```
|
||||||
|
ln -s ~/podkop/podkop package/utilites/podkop
|
||||||
|
ln -s ~/podkop/luci-app-podkop package/luci-app-podkop
|
||||||
|
```
|
||||||
|
|
||||||
|
В первый раз для сборки luci-app необходимо обновить пакеты
|
||||||
|
```
|
||||||
|
./scripts/feeds update -a
|
||||||
|
```
|
||||||
|
|
||||||
|
Для make можно добавить флаг -j N, где N - количество ядер для сборки. Первый раз пройдёт быстрее.
|
||||||
|
|
||||||
|
При первом make выводится менюшка, можно просто save, exit и всё. Первый раз долго грузит зависимости.
|
||||||
|
|
||||||
|
Сборка пакета. Сами пакеты собираются быстро.
|
||||||
|
```
|
||||||
|
make package/podkop/{clean,compile} V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
Также для luci
|
||||||
|
```
|
||||||
|
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
|
||||||
|
make[2]: *** No rule to make target '/SDK/feeds/luci/luci.mk'. Stop.
|
||||||
|
time: package/luci/luci-app-podkop/clean#0.00#0.00#0.00
|
||||||
|
ERROR: package/luci/luci-app-podkop failed to build.
|
||||||
|
make[1]: *** [package/Makefile:129: package/luci/luci-app-podkop/clean] Error 1
|
||||||
|
make[1]: Leaving directory '/SDK'
|
||||||
|
make: *** [/SDK/include/toplevel.mk:226: package/luci-app-podkop/clean] Error 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Не загружены пакеты для luci
|
||||||
|
|
||||||
|
## make зависимости
|
||||||
|
https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
|
||||||
|
|
||||||
|
Ubuntu
|
||||||
|
```
|
||||||
|
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
63
String-example.md
Normal 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
|
||||||
|
```
|
||||||
384
install.sh
Executable file
384
install.sh
Executable file
@@ -0,0 +1,384 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
REPO="https://api.github.com/repos/itdoginfo/podkop/releases/latest"
|
||||||
|
|
||||||
|
IS_SHOULD_RESTART_NETWORK=
|
||||||
|
DOWNLOAD_DIR="/tmp/podkop"
|
||||||
|
mkdir -p "$DOWNLOAD_DIR"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
check_system
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "opkg update"
|
||||||
|
opkg update
|
||||||
|
|
||||||
|
if [ -f "/etc/init.d/podkop" ]; then
|
||||||
|
printf "\033[32;1mPodkop is already installed. Just upgrade it? (y/n)\033[0m\n"
|
||||||
|
printf "\033[32;1my - Only upgrade podkop\033[0m\n"
|
||||||
|
printf "\033[32;1mn - Upgrade and install proxy or tunnels\033[0m\n"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -r -p '' UPDATE
|
||||||
|
case $UPDATE in
|
||||||
|
y)
|
||||||
|
echo "Upgraded podkop..."
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
|
||||||
|
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 "Will you be using Wireguard, AmneziaWG, OpenVPN, OpenConnect? If yes, select a number and they will be automatically installed"
|
||||||
|
echo "1) Wireguard"
|
||||||
|
echo "2) AmneziaWG"
|
||||||
|
echo "3) OpenVPN"
|
||||||
|
echo "4) OpenConnect"
|
||||||
|
echo "5) I use VLESS/SS. Skip this step"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -r -p '' TUNNEL
|
||||||
|
case $TUNNEL in
|
||||||
|
|
||||||
|
1)
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
2)
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
3)
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
4)
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
|
5)
|
||||||
|
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}')
|
||||||
|
REQUIRED_SPACE=15360 # 15MB in KB
|
||||||
|
|
||||||
|
echo "Available space: $((AVAILABLE_SPACE/1024))MB"
|
||||||
|
echo "Required space: $((REQUIRED_SPACE/1024))MB"
|
||||||
|
|
||||||
|
if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ]; then
|
||||||
|
echo "Error: Insufficient space in /tmp"
|
||||||
|
echo "Available: $((AVAILABLE_SPACE/1024))MB"
|
||||||
|
echo "Required: $((REQUIRED_SPACE/1024))MB"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
@@ -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
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-podkop
|
PKG_NAME:=luci-app-podkop
|
||||||
PKG_VERSION:=0.1.3
|
PKG_VERSION:=0.3.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI podkop app
|
LUCI_TITLE:=LuCI podkop app
|
||||||
LUCI_DEPENDS:=+luci-base +podkop
|
LUCI_DEPENDS:=+luci-base +podkop
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
LUCI_LANG.ru:=Русский (Russian)
|
||||||
|
LUCI_LANG.en:=English
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0-or-later
|
PKG_LICENSE:=GPL-2.0-or-later
|
||||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||||
|
|
||||||
|
LUCI_LANGUAGES:=en ru
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
# call BuildPackage - OpenWrt buildroot signature
|
# call BuildPackage - OpenWrt buildroot signature
|
||||||
@@ -3,95 +3,901 @@
|
|||||||
'require form';
|
'require form';
|
||||||
'require ui';
|
'require ui';
|
||||||
'require network';
|
'require network';
|
||||||
|
'require fs';
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
async render() {
|
async render() {
|
||||||
var m, s, o;
|
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, 'podkop');
|
s = m.section(form.TypedSection, 'main');
|
||||||
s.anonymous = true;
|
s.anonymous = true;
|
||||||
|
|
||||||
o = s.option(form.ListValue, 'mode', _('Mode'), _('Select VPN or Proxy'))
|
// Basic Settings Tab
|
||||||
o.value('vpn', ('VPN'))
|
o = s.tab('basic', _('Basic Settings'));
|
||||||
o.value('proxy', ('Proxy'))
|
|
||||||
|
|
||||||
o = s.option(form.Value, 'proxy_string', _('Proxy String'), _('String vless:// or ss://'));
|
o = s.taboption('basic', form.ListValue, 'mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
|
||||||
|
o.value('proxy', ('Proxy'));
|
||||||
|
o.value('vpn', ('VPN'));
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
|
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.depends('mode', 'proxy');
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
// Get all interface
|
o = s.taboption('basic', form.TextValue, 'proxy_string', _('Proxy Configuration URL'), _('Enter connection string starting with vless:// or ss:// for proxy configuration'));
|
||||||
o = s.option(form.ListValue, 'interface', _('Interface'), _('Specify the interface'));
|
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.depends('mode', 'vpn');
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const devices = await network.getDevices();
|
const devices = await network.getDevices();
|
||||||
|
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0'];
|
||||||
const excludeInterfaces = ['br-lan', 'eth0', 'eth1'];
|
|
||||||
|
|
||||||
devices.forEach(function (device) {
|
devices.forEach(function (device) {
|
||||||
if (device.dev && device.dev.name) {
|
if (device.dev && device.dev.name) {
|
||||||
if (!excludeInterfaces.includes(device.dev.name)) {
|
const deviceName = device.dev.name;
|
||||||
o.value(device.dev.name, device.dev.name);
|
const isExcluded = excludeInterfaces.includes(deviceName) || /^lan\d+$/.test(deviceName);
|
||||||
|
|
||||||
|
if (!isExcluded) {
|
||||||
|
o.value(deviceName, deviceName);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.warn('Device name is undefined or empty');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching devices:', error);
|
console.error('Error fetching devices:', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
o = s.option(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 Lists'));
|
||||||
|
o.default = '0';
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.DynamicList, 'domain_list', _('Service List'), _('Select predefined service for routing') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>');
|
||||||
|
o.placeholder = 'Service list';
|
||||||
|
o.value('russia_inside', 'Russia inside');
|
||||||
|
o.value('russia_outside', 'Russia outside');
|
||||||
|
o.value('ukraine_inside', 'Ukraine');
|
||||||
|
o.value('geoblock', 'GEO Block');
|
||||||
|
o.value('block', 'Block');
|
||||||
|
o.value('porn', 'Porn');
|
||||||
|
o.value('news', 'News');
|
||||||
|
o.value('anime', 'Anime');
|
||||||
|
o.value('youtube', 'Youtube');
|
||||||
|
o.value('discord', 'Discord');
|
||||||
|
o.value('meta', 'Meta');
|
||||||
|
o.value('twitter', 'Twitter (X)');
|
||||||
|
o.value('hdrezka', 'HDRezka');
|
||||||
|
o.value('tiktok', 'Tik-Tok');
|
||||||
|
o.value('telegram', 'Telegram');
|
||||||
|
o.depends('domain_list_enabled', '1');
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.ListValue, 'custom_domains_list_type', _('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('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_type', 'dynamic');
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
o.validate = function (section_id, value) {
|
||||||
|
if (!value || value.length === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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_type', '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('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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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.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('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');
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.Flag, 'socks5', _('Mixed enable'), _('Browser port: 2080'));
|
||||||
|
o.default = '0';
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
|
// 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, '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('1h', _('Every hour'));
|
||||||
|
o.value('3h', _('Every 3 hours'));
|
||||||
|
o.value('12h', _('Every 12 hours'));
|
||||||
|
o.value('1d', _('Every day'));
|
||||||
|
o.value('3d', _('Every 3 days'));
|
||||||
|
o.default = '1d';
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
|
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 - full diagnostic
|
||||||
|
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'))
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Add new section 'extra'
|
||||||
|
var s = m.section(form.TypedSection, 'extra', _('Extra configurations'));
|
||||||
|
s.anonymous = false;
|
||||||
|
s.addremove = true;
|
||||||
|
s.addbtntitle = _('Add Section');
|
||||||
|
|
||||||
|
o = s.tab('basic', _('Extra configuration'));
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.ListValue, 'mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
|
||||||
|
o.value('proxy', ('Proxy'));
|
||||||
|
o.value('vpn', ('VPN'));
|
||||||
|
|
||||||
|
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 = 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 = 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.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');
|
||||||
|
|
||||||
|
try {
|
||||||
|
const devices = await network.getDevices();
|
||||||
|
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0'];
|
||||||
|
|
||||||
|
devices.forEach(function (device) {
|
||||||
|
if (device.dev && device.dev.name) {
|
||||||
|
const deviceName = device.dev.name;
|
||||||
|
const isExcluded = excludeInterfaces.includes(deviceName) || /^lan\d+$/.test(deviceName);
|
||||||
|
|
||||||
|
if (!isExcluded) {
|
||||||
|
o.value(deviceName, deviceName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching devices:', error);
|
||||||
|
}
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.Flag, 'domain_list_enabled', _('Community Lists'));
|
||||||
o.default = '0';
|
o.default = '0';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o = s.option(form.ListValue, 'domain_list', _('Domain list'), _('A select list'));
|
o = s.taboption('basic', form.DynamicList, 'domain_list', _('Service List'), _('Select predefined service networks for routing') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>');
|
||||||
o.placeholder = 'placeholder';
|
o.placeholder = 'Service list';
|
||||||
o.value('ru_inside', 'Russia inside');
|
o.value('russia_inside', 'Russia inside');
|
||||||
o.value('ru_outside', 'Russia outside');
|
o.value('russia_outside', 'Russia outside');
|
||||||
o.value('ua', 'Ukraine');
|
o.value('ukraine_inside', 'Ukraine');
|
||||||
|
o.value('geoblock', 'GEO Block');
|
||||||
|
o.value('block', 'Block');
|
||||||
|
o.value('porn', 'Porn');
|
||||||
|
o.value('news', 'News');
|
||||||
|
o.value('anime', 'Anime');
|
||||||
|
o.value('youtube', 'Youtube');
|
||||||
|
o.value('discord', 'Discord');
|
||||||
|
o.value('meta', 'Meta');
|
||||||
|
o.value('twitter', 'Twitter (X)');
|
||||||
|
o.value('hdrezka', 'HDRezka');
|
||||||
|
o.value('tiktok', 'Tik-Tok');
|
||||||
|
o.value('telegram', 'Telegram');
|
||||||
o.depends('domain_list_enabled', '1');
|
o.depends('domain_list_enabled', '1');
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o = s.option(form.Flag, 'delist_domains_enabled', _('Delist domains from main list enable'));
|
o = s.taboption('basic', form.ListValue, 'custom_domains_list_type', _('User Domain List Type'), _('Select how to add your custom domains'));
|
||||||
o.default = '0';
|
o.value('disabled', _('Disabled'));
|
||||||
|
o.value('dynamic', _('Dynamic List'));
|
||||||
|
o.value('text', _('Text List'));
|
||||||
|
o.default = 'disabled';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o = s.option(form.DynamicList, 'delist_domains', _('Delist domains'), _('Domains to be excluded'));
|
o = s.taboption('basic', form.DynamicList, 'custom_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)'));
|
||||||
o.placeholder = 'Delist domains';
|
|
||||||
o.depends('delist_domains_enabled', '1');
|
|
||||||
o.rmempty = false;
|
|
||||||
|
|
||||||
o = s.option(form.Flag, 'subnets_list_enabled', _('Subnets list enable'));
|
|
||||||
o.default = '0';
|
|
||||||
o.rmempty = false;
|
|
||||||
|
|
||||||
o = s.option(form.DynamicList, 'subnets', _('Subnets specify option'));
|
|
||||||
o.placeholder = 'Subnet list';
|
|
||||||
o.value('twitter', 'Twitter(x.com)');
|
|
||||||
o.value('meta', 'Meta');
|
|
||||||
o.depends('subnets_list_enabled', '1');
|
|
||||||
o.rmempty = false;
|
|
||||||
|
|
||||||
o = s.option(form.Flag, 'custom_domains_list_enabled', _('Custom domains enable'));
|
|
||||||
o.default = '0';
|
|
||||||
o.rmempty = false;
|
|
||||||
|
|
||||||
o = s.option(form.DynamicList, 'custom_domains', _('Your domains'));
|
|
||||||
o.placeholder = 'Domains list';
|
o.placeholder = 'Domains list';
|
||||||
o.depends('custom_domains_list_enabled', '1');
|
o.depends('custom_domains_list_type', 'dynamic');
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
o.validate = function (section_id, value) {
|
||||||
|
if (!value || value.length === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
o = s.option(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_type', 'text');
|
||||||
|
o.rows = 10;
|
||||||
|
o.rmempty = false;
|
||||||
|
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.default = '0';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o = s.option(form.DynamicList, 'custom_subnets', _('Your subnet'));
|
o = s.taboption('basic', form.DynamicList, 'custom_local_domains', _('Local Domain Lists Path'), _('Enter to the list file path'));
|
||||||
o.placeholder = 'Subnets list';
|
o.placeholder = '/path/file.lst';
|
||||||
o.depends('custom_subnets_list_enabled', '1');
|
o.depends('custom_local_domains_list_enabled', '1');
|
||||||
|
o.rmempty = false;
|
||||||
|
o.validate = function (section_id, value) {
|
||||||
|
if (!value || value.length === 0) {
|
||||||
|
return 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.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.rmempty = false;
|
||||||
|
|
||||||
|
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.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 = 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.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.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 = 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.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 = 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.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;
|
||||||
|
};
|
||||||
|
|
||||||
|
// For future
|
||||||
|
// o = s.taboption('basic', form.Flag, 'socks5', _('Mixed enable'), _('Browser port: 2080 (extra +1)'));
|
||||||
|
// o.default = '0';
|
||||||
|
// o.rmempty = false;
|
||||||
return m.render();
|
return m.render();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
332
luci-app-podkop/po/ru/podkop.po
Normal file
332
luci-app-podkop/po/ru/podkop.po
Normal 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 "Ошибка копирования логов: "
|
||||||
332
luci-app-podkop/po/templates/podkop.pot
Normal file
332
luci-app-podkop/po/templates/podkop.pot
Normal 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 ""
|
||||||
10
luci-app-podkop/root/etc/uci-defaults/50_luci-podkop
Normal file
10
luci-app-podkop/root/etc/uci-defaults/50_luci-podkop
Normal 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
|
||||||
@@ -2,10 +2,14 @@
|
|||||||
"luci-app-podkop": {
|
"luci-app-podkop": {
|
||||||
"description": "Grant UCI and RPC access to LuCI app podkop",
|
"description": "Grant UCI and RPC access to LuCI app podkop",
|
||||||
"read": {
|
"read": {
|
||||||
|
"file": {
|
||||||
|
"/etc/init.d/podkop": [
|
||||||
|
"exec"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ubus": {
|
"ubus": {
|
||||||
"luci.podkop": [
|
"service": [
|
||||||
"get_sample1",
|
"list"
|
||||||
"get_sample2"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"uci": [
|
"uci": [
|
||||||
@@ -18,4 +22,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=podkop
|
PKG_NAME:=podkop
|
||||||
PKG_VERSION:=0.1.3
|
PKG_VERSION:=0.3.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||||
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define Package/podkop
|
define Package/podkop
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
DEPENDS:=+curl +jq +kmod-nft-tproxy
|
DEPENDS:=+sing-box +curl +jq +kmod-nft-tproxy +coreutils-base64
|
||||||
TITLE:=Domain routing app
|
TITLE:=Domain routing app
|
||||||
URL:=https://itdog.info
|
URL:=https://itdog.info
|
||||||
PKGARCH:=all
|
PKGARCH:=all
|
||||||
@@ -28,20 +28,6 @@ endef
|
|||||||
define Build/Compile
|
define Build/Compile
|
||||||
endef
|
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
|
define Package/podkop/prerm
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
@@ -57,15 +43,10 @@ endef
|
|||||||
define Package/podkop/install
|
define Package/podkop/install
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/etc/init.d/podkop $(1)/etc/init.d/podkop
|
$(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_DIR) $(1)/etc/config
|
||||||
$(INSTALL_CONF) ./files/etc/config/podkop $(1)/etc/config/podkop
|
$(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
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,podkop))
|
$(eval $(call BuildPackage,podkop))
|
||||||
|
|||||||
@@ -1,16 +1,32 @@
|
|||||||
config podkop main
|
config main 'main'
|
||||||
option mode 'proxy'
|
option mode 'proxy'
|
||||||
option interface 'wg0'
|
#option interface ''
|
||||||
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 proxy_config_type ''
|
||||||
|
#option outbound_json ''
|
||||||
|
option proxy_string ''
|
||||||
option domain_list_enabled '1'
|
option domain_list_enabled '1'
|
||||||
option domain_list 'ru_inside'
|
option domain_list 'russia_inside'
|
||||||
option subnets_list_enabled '0'
|
option subnets_list_enabled '0'
|
||||||
list subnets 'twitter'
|
option custom_domains_list_type 'disable'
|
||||||
option custom_domains_list_enabled '0'
|
#list custom_domains ''
|
||||||
list custom_domains 'ifconfig.co'
|
#option custom_domains_text ''
|
||||||
option custom_subnets_list_enabled '0'
|
option custom_local_domains_list_enabled '0'
|
||||||
list custom_subnets '188.114.96.0/20'
|
#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'
|
option all_traffic_from_ip_enabled '0'
|
||||||
list all_traffic_ip '192.168.56.226'
|
#list all_traffic_ip ''
|
||||||
option delist_domains_enabled '0'
|
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 '1d'
|
||||||
|
option custom_domains_text
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
/etc/init.d/podkop add_route_interface
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user