mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f604ca765 | ||
|
|
52c6eeae12 | ||
|
|
778f2897bc | ||
|
|
ca7bb77356 | ||
|
|
da8195b795 | ||
|
|
98129720bb | ||
|
|
3c1865c8a3 | ||
|
|
77ac728d47 | ||
|
|
1b5cfa3371 | ||
|
|
590e040958 | ||
|
|
2323d426dd | ||
|
|
9bcc80f2be | ||
|
|
bfde7518fb | ||
|
|
18d466e166 | ||
|
|
a30752d2e9 | ||
|
|
eb18537370 | ||
|
|
aa86445332 | ||
|
|
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 |
85
README.md
85
README.md
@@ -1,6 +1,15 @@
|
||||
Это альфа версия, может не работать. Обсуждение https://t.me/itdogchat - топик Podkop dev
|
||||
# Вещи, которые вам нужно знать перед установкой
|
||||
|
||||
Если у вас установлен Getdomains, то его следует удалить.
|
||||
- Это альфа версия, которая находится в активной разработке. Из версии в версию что-то может меняться.
|
||||
- Основной функционал работает, но побочные штуки сейчас могут сбоить.
|
||||
- При обновлении **обязатально** сбрасывайте кэш LuCI.
|
||||
- Также при обновлении всегда заходите в конфигурацию и проверяйте свои настройки. Конфигурация может измениться.
|
||||
- Необходимо минимум 15МБ свободного места на роутере. Роутерами с флешками на 16МБ сразу мимо.
|
||||
- При старте программы редактируется конфиг Dnsmasq.
|
||||
- Podkop редактирует конфиг sing-box. Обязательно сохраните ваш конфиг sing-box перед установкой, если он вам нужен.
|
||||
- Информация здесь может быть устаревшей. Все изменения фиксируются в телеграм-чате https://t.me/itdogchat - топик **Podkop**.
|
||||
- Если у вас не что-то не работает, то следуюет сходить в телеграм чат, прочитать закрепы и выполнить что там написано..
|
||||
- Если у вас установлен Getdomains, его следует удалить.
|
||||
|
||||
# Удаление GetDomains скриптом
|
||||
```
|
||||
@@ -11,9 +20,9 @@ sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/domain-routing-openwr
|
||||
|
||||
# Установка Podkop
|
||||
Пакет работает на всех архитектурах.
|
||||
Будет точно работать только на OpenWrt 23.05.
|
||||
Тестировался на OpenWrt 23.05 и OpenWrt 24.10.
|
||||
|
||||
Нужен dnsmasq-full. В автоматическом режиме ставится сам. Вручную надо поставить [самостоятельно](https://github.com/itdoginfo/podkop/blob/952dd6215a2a83d65937cf9e33534c42809091ed/install.sh#L20).
|
||||
Поддержки APK на данный момент нет. APK будет сделан после того как разгребу основное.
|
||||
|
||||
## Автоматическая
|
||||
```
|
||||
@@ -28,6 +37,12 @@ sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/refs/heads/mai
|
||||
Сделать `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
|
||||
@@ -47,26 +62,20 @@ Luci: Services/podkop
|
||||
|
||||
### Proxy
|
||||
Для VLESS и Shadowsocks. Другие протоколы тоже будут, кидайте в чат примеры строк без чувствительных данных.
|
||||
Для использования этого режима нужен sing-box:
|
||||
```
|
||||
opkg update && opkg install sing-box
|
||||
```
|
||||
|
||||
В этом режиме просто копируйте строку в **Proxy String** и из неё автоматически настроится sing-box.
|
||||
|
||||
### VPN
|
||||
Здесь у вас должен быть уже настроен WG/OpenVPN/OpenConnect etc, создана Zone и Forwarding.
|
||||
Здесь у вас должен быть уже настроен WG/OpenVPN/OpenConnect etc, зона Zone и Forwarding не обязательны.
|
||||
|
||||
Просто выбрать интерфейс из списка.
|
||||
|
||||
## Настройка доменов и подсетей
|
||||
**Domain list enable** - Включить общий список.
|
||||
|
||||
**Delist domains from main list enable** - Выключение заданных доменов из общего списка. Задавать списком.
|
||||
**Community Lists** - Включить списки комьюнити
|
||||
|
||||
**Subnets list enable** - Включить подсети из общего списка, выбрать из предложенных.
|
||||
|
||||
**Custom domains enable** - Добавить свои домены. Задавать списком.
|
||||
**Custom domains enable** - Добавить свои домены
|
||||
|
||||
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
|
||||
|
||||
@@ -76,10 +85,24 @@ opkg update && opkg install sing-box
|
||||
- [x] All traffic for IP ломает инет на клиенте. Proxy mode
|
||||
- [x] Не отрабатывает рестарт, при awg и не применяются изменения при awg
|
||||
- [x] awg работает не стабильно
|
||||
- [ ] Сеть рестартится при любом раскладе
|
||||
- [ ] Выкл-вкл wg через luci не отрабатывает поднятие маршрута
|
||||
|
||||
- [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] Подсети дискорда.
|
||||
@@ -107,16 +130,32 @@ opkg update && opkg install sing-box
|
||||
Приоритет 1
|
||||
- [x] Изменить название "Alternative Config"
|
||||
- [x] "domain_service_enabled" Добавить _second
|
||||
- [ ] Установка Ru пакета в install.sh
|
||||
- [x] Установка Ru пакета в install.sh
|
||||
- [x] Правка nft mark, tproxy
|
||||
- [x] Правка перевода минимальная
|
||||
- [x] Вставлять готовый outdbound вместо строки. Отдельная галка, которая в идеале должны скрывать поле для строки
|
||||
- [ ] udp over tcp для ss сделать с выбором:
|
||||
1) отключен (ПО на сервере -Shadowsocks)
|
||||
2) включен, версия 2 (новые релизы xray-core, sing-box на сервере)
|
||||
3) включен, версия 1 (старые релизы xray, sing-box на сервере)
|
||||
Проблема в том, что это нужно только если SS. Выставлять выбор при парсинг из конфига вопрос можно ли. Если совсем тупо - сделать костыль в допонительные настройки
|
||||
- [x] Проверка места в скрипте install. Если доступно меньше 20MB - exit 1 c выводом колько надо и сколько доступно. + показ модели роутера
|
||||
- [ ] Правило запрещающее QUIC
|
||||
- [ ] Проверить обновление списков, отрабатывает ли
|
||||
- [ ] Проверка на ванильную openwrt
|
||||
- [ ] Проверка откуда установлен sing-box. Например, проверять установлен ли он из официального репозитория
|
||||
- [x] TG в сервисы
|
||||
- [ ] Выбор ткуда направлять трафик в туннель. В том числе чтоб откуда угодно, а не только br-lan
|
||||
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
|
||||
- [ ] Диагностика: podkop_domains: 0 elements как проверять что доходят запросы при fakeip? Мб врубать логи dnsmasq и их чекать.
|
||||
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
|
||||
- [ ] Валидации предустановленных значений. Если прописаны другие, то вывод в лог о неизвестной переменной и продолжение работы
|
||||
- [ ] Добавление в список доменов домены первого уровня (LuCI)
|
||||
|
||||
Приоритет 2
|
||||
- [ ] Списки доменов и подсетей с роутера
|
||||
- [ ] Кнопка обновления списка доменов и подсетей
|
||||
- [x] Списки доменов и подсетей с роутера
|
||||
- [ ] Кнопка обновления списка доменов и подсетей. Запихнуть в главное меню
|
||||
- [ ] IPv6
|
||||
- [ ] Придумать автонастройку DNS через stubby итд. Как лучше это реализовать.
|
||||
- [ ] Удаление подсетей CF из domain sets раз в N часов
|
||||
|
||||
Wiki
|
||||
- [x] Тема
|
||||
@@ -126,6 +165,7 @@ Wiki
|
||||
- [x] Переменная, раз во сколько часов обновлять списки
|
||||
- [ ] Галочка, которая режет доступ к doh серверам
|
||||
- [ ] Свой конфиг sing-box
|
||||
- [x] Поменять curl на wget, убрать зависимость. Проверять доступность списков лучше всего curl`ом
|
||||
|
||||
Рефактор
|
||||
- [ ] Handle для sing-box
|
||||
@@ -185,6 +225,9 @@ make package/luci-app-podkop/{clean,compile} V=s
|
||||
|
||||
.ipk лежат в `bin/packages/x86_64/base/`
|
||||
|
||||
## Примеры строкs
|
||||
https://github.com/itdoginfo/podkop/blob/main/String-example.md
|
||||
|
||||
## Ошибки
|
||||
```
|
||||
Makefile:17: /SDK/feeds/luci/luci.mk: No such file or directory
|
||||
|
||||
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
|
||||
```
|
||||
180
install.sh
180
install.sh
@@ -4,96 +4,115 @@ REPO="https://api.github.com/repos/itdoginfo/podkop/releases/latest"
|
||||
|
||||
IS_SHOULD_RESTART_NETWORK=
|
||||
DOWNLOAD_DIR="/tmp/podkop"
|
||||
COUNT=3
|
||||
|
||||
rm -rf "$DOWNLOAD_DIR"
|
||||
mkdir -p "$DOWNLOAD_DIR"
|
||||
|
||||
main() {
|
||||
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
|
||||
check_system
|
||||
sing_box
|
||||
|
||||
wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk' | while read -r url; do
|
||||
filename=$(basename "$url")
|
||||
filepath="$DOWNLOAD_DIR/$filename"
|
||||
|
||||
echo "opkg update"
|
||||
opkg update
|
||||
attempt=0
|
||||
while [ $attempt -lt $COUNT ]; do
|
||||
if [ -f "$filepath" ] && [ -s "$filepath" ]; then
|
||||
echo "$filename has already been uploaded"
|
||||
break
|
||||
fi
|
||||
|
||||
if opkg list-installed | grep -q dnsmasq-full; then
|
||||
echo "dnsmasq-full already installed"
|
||||
else
|
||||
echo "Installed dnsmasq-full"
|
||||
cd /tmp/ && opkg download dnsmasq-full
|
||||
opkg remove dnsmasq && opkg install dnsmasq-full --cache /tmp/
|
||||
echo "Download $filename (count $((attempt+1)))..."
|
||||
wget -q -O "$filepath" "$url"
|
||||
|
||||
if [ -s "$filepath" ]; then
|
||||
echo "$filename successfully downloaded"
|
||||
break
|
||||
else
|
||||
echo "Download error $filename. Retry..."
|
||||
rm -f "$filepath"
|
||||
fi
|
||||
attempt=$((attempt+1))
|
||||
done
|
||||
done
|
||||
|
||||
[ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp
|
||||
fi
|
||||
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"
|
||||
|
||||
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 '' UPDATE
|
||||
case $UPDATE in
|
||||
|
||||
read -r -p '' RUS
|
||||
case $RUS in
|
||||
y)
|
||||
echo "Upgraded podkop..."
|
||||
opkg install $DOWNLOAD_DIR/luci-i18n-podkop-ru*.ipk
|
||||
break
|
||||
;;
|
||||
|
||||
n)
|
||||
add_tunnel
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
*)
|
||||
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
|
||||
rm -f $DOWNLOAD_DIR/podkop*.ipk $DOWNLOAD_DIR/luci-app-podkop*.ipk $DOWNLOAD_DIR/luci-i18n-podkop-ru*.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
|
||||
;;
|
||||
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
|
||||
if [ "$IS_SHOULD_RESTART_NETWORK" ]; then
|
||||
printf "\033[32;1mRestart network\033[0m\n"
|
||||
/etc/init.d/network restart
|
||||
fi
|
||||
}
|
||||
|
||||
add_tunnel() {
|
||||
echo "What type of VPN or proxy will be used? We also can automatically configure Wireguard and Amnezia WireGuard."
|
||||
echo "1) VLESS, Shadowsocks (A sing-box will be installed)"
|
||||
echo "2) Wireguard"
|
||||
echo "3) AmneziaWG"
|
||||
echo "4) OpenVPN"
|
||||
echo "5) OpenConnect"
|
||||
echo "6) Skip this step"
|
||||
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 sing-box
|
||||
break
|
||||
;;
|
||||
|
||||
2)
|
||||
opkg install wireguard-tools luci-proto-wireguard luci-app-wireguard
|
||||
|
||||
printf "\033[32;1mDo you want to configure the wireguard interface? (y/n): \033[0m\n"
|
||||
@@ -108,7 +127,7 @@ add_tunnel() {
|
||||
break
|
||||
;;
|
||||
|
||||
3)
|
||||
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"
|
||||
@@ -121,19 +140,19 @@ add_tunnel() {
|
||||
break
|
||||
;;
|
||||
|
||||
4)
|
||||
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
|
||||
;;
|
||||
|
||||
5)
|
||||
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
|
||||
;;
|
||||
|
||||
6)
|
||||
5)
|
||||
echo "Skip. Use this if you're installing an upgrade."
|
||||
break
|
||||
;;
|
||||
@@ -366,4 +385,33 @@ wg_awg_setup() {
|
||||
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
|
||||
}
|
||||
|
||||
sing_box() {
|
||||
sing_box_version=$(sing-box version | head -n 1 | awk '{print $3}')
|
||||
required_version="1.11.1"
|
||||
|
||||
if [ "$(echo -e "$sing_box_version\n$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
||||
opkg remove sing-box
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-podkop
|
||||
PKG_VERSION:=0.2.4
|
||||
PKG_VERSION:=0.3.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI podkop app
|
||||
|
||||
@@ -3,13 +3,24 @@
|
||||
'require form';
|
||||
'require ui';
|
||||
'require network';
|
||||
'require fs';
|
||||
|
||||
return view.extend({
|
||||
async render() {
|
||||
document.getElementsByTagName('head')[0].insertAdjacentHTML('beforeend', `
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
`);
|
||||
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('podkop', _('Podkop configuration'), null, ['main', 'second']);
|
||||
|
||||
fs.exec('/etc/init.d/podkop', ['show_version']).then(function (res) {
|
||||
if (res.stdout) {
|
||||
m.title = _('Podkop') + ' v' + res.stdout.trim();
|
||||
}
|
||||
});
|
||||
s = m.section(form.TypedSection, 'main');
|
||||
s.anonymous = true;
|
||||
|
||||
@@ -17,15 +28,42 @@ return view.extend({
|
||||
o = s.tab('basic', _('Basic Settings'));
|
||||
|
||||
o = s.taboption('basic', form.ListValue, 'mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
|
||||
o.value('vpn', ('VPN'));
|
||||
o.value('proxy', ('Proxy'));
|
||||
o.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.ucisection = 'main';
|
||||
|
||||
o = s.taboption('basic', form.TextValue, 'proxy_string', _('Proxy Configuration URL'), _('Enter connection string starting with vless:// or ss:// for proxy configuration'));
|
||||
o.depends('mode', 'proxy');
|
||||
o.depends('proxy_config_type', 'url');
|
||||
o.rows = 5;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('basic', form.TextValue, 'outbound_json', _('Outbound Configuration'), _('Enter complete outbound configuration in JSON format'));
|
||||
o.depends('proxy_config_type', 'outbound');
|
||||
o.rows = 10;
|
||||
o.ucisection = 'main';
|
||||
o.validate = function (section_id, value) {
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(value);
|
||||
if (!parsed.type || !parsed.server || !parsed.server_port) {
|
||||
return _('JSON must contain at least type, server and server_port fields');
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
return _('Invalid JSON format');
|
||||
}
|
||||
};
|
||||
|
||||
o = s.taboption('basic', form.ListValue, 'interface', _('Network Interface'), _('Select network interface for VPN connection'));
|
||||
o.depends('mode', 'vpn');
|
||||
o.ucisection = 'main';
|
||||
@@ -48,54 +86,43 @@ return view.extend({
|
||||
console.error('Error fetching devices:', error);
|
||||
}
|
||||
|
||||
o = s.taboption('basic', form.Flag, 'domain_list_enabled', _('Community Domain Lists'));
|
||||
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.ListValue, 'domain_list', _('Domain List'), _('Select a list') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>');
|
||||
o.placeholder = 'placeholder';
|
||||
o.value('ru_inside', 'Russia inside');
|
||||
o.value('ru_outside', 'Russia outside');
|
||||
o.value('ua', 'Ukraine');
|
||||
o.depends('domain_list_enabled', '1');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('basic', form.Flag, 'delist_domains_enabled', _('Domain Exclusions'), _('Exclude specific domains from routing rules'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
o.depends('domain_list_enabled', '1');
|
||||
|
||||
o = s.taboption('basic', form.DynamicList, 'delist_domains', _('Excluded Domains'), _('Domains to be excluded from routing'));
|
||||
o.placeholder = 'Delist domains';
|
||||
o.depends('delist_domains_enabled', '1');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('basic', form.Flag, 'subnets_list_enabled', _('Community Subnet Lists'), _('Enable routing for popular services like Twitter, Meta, and Discord'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('basic', form.DynamicList, 'subnets', _('Service Networks'), _('Select predefined service networks for routing'));
|
||||
o.placeholder = 'Service network list';
|
||||
o.value('twitter', 'Twitter(x.com)');
|
||||
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('discord', 'Discord(voice)');
|
||||
o.depends('subnets_list_enabled', '1');
|
||||
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.Flag, 'custom_domains_list_enabled', _('User Domain List'), _('Enable and manage your custom list of domains for selective routing'));
|
||||
o.default = '0';
|
||||
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_enabled', '1');
|
||||
o.depends('custom_domains_list_type', 'dynamic');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
o.validate = function (section_id, value) {
|
||||
@@ -111,6 +138,57 @@ return view.extend({
|
||||
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;
|
||||
@@ -137,14 +215,18 @@ return view.extend({
|
||||
}
|
||||
};
|
||||
|
||||
o = s.taboption('basic', form.Flag, 'custom_subnets_list_enabled', _('User Subnet List'), _('Enable and manage your custom list of IP subnets for selective routing'));
|
||||
o.default = '0';
|
||||
|
||||
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 subnet in CIDR notation (example: 103.21.244.0/22)'));
|
||||
o.placeholder = 'Subnets list';
|
||||
o.depends('custom_subnets_list_enabled', '1');
|
||||
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) {
|
||||
@@ -152,15 +234,14 @@ return view.extend({
|
||||
return true;
|
||||
}
|
||||
|
||||
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}\/\d{1,2}$/;
|
||||
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/;
|
||||
|
||||
if (!subnetRegex.test(value)) {
|
||||
return _('Invalid subnet format. Use format: X.X.X.X/Y (like 103.21.244.0/22)');
|
||||
return _('Invalid format. Use format: X.X.X.X or X.X.X.X/Y');
|
||||
}
|
||||
|
||||
const [ip, cidr] = value.split('/');
|
||||
const ipParts = ip.split('.');
|
||||
const cidrNum = parseInt(cidr);
|
||||
|
||||
for (const part of ipParts) {
|
||||
const num = parseInt(part);
|
||||
@@ -169,13 +250,59 @@ return view.extend({
|
||||
}
|
||||
}
|
||||
|
||||
if (cidrNum < 0 || cidrNum > 32) {
|
||||
return _('CIDR must be between 0 and 32');
|
||||
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;
|
||||
@@ -266,62 +393,285 @@ return view.extend({
|
||||
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, 'socks5', _('Mixed enable'), _('Browser port: 2080'));
|
||||
o.default = '0';
|
||||
o.depends('mode', 'proxy');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('additional', form.Flag, 'exclude_ntp', _('Exclude NTP'), _('For issues with open connections sing-box'));
|
||||
o.default = '0';
|
||||
o.depends('mode', 'proxy');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('additional', form.Flag, 'quic_disable', _('QUIC disable'), _('For issues with the video stream'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = s.taboption('additional', form.ListValue, 'update_interval', _('List Update Frequency'), _('Select how often the lists will be updated'));
|
||||
o.value('0 */1 * * *', _('Every hour'));
|
||||
o.value('0 */2 * * *', _('Every 2 hours'));
|
||||
o.value('0 */4 * * *', _('Every 4 hours'));
|
||||
o.value('0 */6 * * *', _('Every 6 hours'));
|
||||
o.value('0 */12 * * *', _('Every 12 hours'));
|
||||
o.value('0 4 * * *', _('Once a day at 04:00'));
|
||||
o.value('0 4 * * 0', _('Once a week on Sunday at 04:00'));
|
||||
o.default = '0 4 * * *';
|
||||
o.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';
|
||||
|
||||
// Secondary Settings Tab
|
||||
o = s.tab('diagnostics', _('Diagnostics'));
|
||||
|
||||
o = s.tab('secondary_config', _('Secondary Config'));
|
||||
function formatDiagnosticOutput(output) {
|
||||
if (!output) return '';
|
||||
|
||||
o = s.taboption('secondary_config', form.Flag, 'second_enable', _('Secondary VPN/Proxy Enable'), _('Enable secondary VPN/Proxy configuration'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'second';
|
||||
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' ? '✓' : '✗'}`);
|
||||
}
|
||||
|
||||
o = s.taboption('secondary_config', form.ListValue, 'second_mode', _('Connection Type'), _('Select between VPN and Proxy connection methods for traffic routing'));
|
||||
o.value('vpn', ('VPN'));
|
||||
// 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, '_show_config');
|
||||
o.title = _('Show Config');
|
||||
o.description = _('Show current podkop configuration with masked sensitive data');
|
||||
o.inputtitle = _('Show Config');
|
||||
o.inputstyle = 'apply';
|
||||
o.onclick = function () {
|
||||
return fs.exec('/etc/init.d/podkop', ['show_config'])
|
||||
.then(function (res) {
|
||||
const formattedOutput = formatDiagnosticOutput(res.stdout || _('No output'));
|
||||
|
||||
const modalElement = ui.showModal(_('Podkop Configuration'), [
|
||||
E('div', { class: 'cbi-section' }, [
|
||||
E('pre', { class: 'cbi-value-field' }, formattedOutput)
|
||||
]),
|
||||
E('div', { style: 'display: flex; justify-content: space-between; margin-top: 1em;' }, [
|
||||
E('button', {
|
||||
'class': 'btn cbi-button-save',
|
||||
'click': function () {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = '```\n' + formattedOutput + '\n```';
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
ui.hideModal();
|
||||
} catch (err) {
|
||||
ui.addNotification(null, E('p', {}, _('Failed to copy: ') + err.message));
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
}, _('Copy to Clipboard')),
|
||||
E('button', {
|
||||
'class': 'btn cbi-button-neutral',
|
||||
'click': ui.hideModal
|
||||
}, _('Close'))
|
||||
])
|
||||
], 'large');
|
||||
|
||||
if (modalElement && modalElement.parentElement) {
|
||||
modalElement.parentElement.classList.add('modal-overlay-large');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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.depends('second_enable', '1');
|
||||
o.ucisection = 'second';
|
||||
o.value('vpn', ('VPN'));
|
||||
|
||||
o = s.taboption('secondary_config', form.TextValue, 'second_proxy_string', _('Proxy Configuration URL'), _('Enter connection string starting with vless:// or ss:// for proxy configuration'));
|
||||
o.depends('second_mode', 'proxy');
|
||||
o.ucisection = 'second';
|
||||
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('secondary_config', form.ListValue, 'second_interface', _('Network Interface'), _('Select network interface for VPN connection'));
|
||||
o.depends('second_mode', 'vpn');
|
||||
o.ucisection = 'second';
|
||||
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();
|
||||
@@ -341,30 +691,41 @@ return view.extend({
|
||||
console.error('Error fetching devices:', error);
|
||||
}
|
||||
|
||||
o = s.taboption('secondary_config', form.Flag, 'second_domain_service_enabled', _('Service Domain List Enable'), _('Enable predefined service domain lists for routing'));
|
||||
o = s.taboption('basic', form.Flag, 'domain_list_enabled', _('Community Lists'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.depends('second_enable', '1');
|
||||
o.ucisection = 'second';
|
||||
|
||||
o = s.taboption('secondary_config', form.ListValue, 'second_service_list', _('Service List'), _('Select predefined services for routing'));
|
||||
o.placeholder = 'placeholder';
|
||||
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 = '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.depends('second_domain_service_enabled', '1');
|
||||
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 = 'second';
|
||||
|
||||
o = s.taboption('secondary_config', form.Flag, 'second_custom_domains_list_enabled', _('User Domain List'), _('Enable and manage your custom list of domains for selective routing'));
|
||||
o.default = '0';
|
||||
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.depends('second_enable', '1');
|
||||
o.ucisection = 'second';
|
||||
|
||||
o = s.taboption('secondary_config', form.DynamicList, 'second_custom_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)'));
|
||||
o = 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('second_custom_domains_list_enabled', '1');
|
||||
o.depends('custom_domains_list_type', 'dynamic');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'second';
|
||||
o.validate = function (section_id, value) {
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
@@ -378,31 +739,104 @@ return view.extend({
|
||||
return true;
|
||||
};
|
||||
|
||||
o = s.taboption('secondary_config', form.Flag, 'second_custom_subnets_list_enabled', _('User Subnet List'), _('Enable and manage your custom list of IP subnets for selective routing'));
|
||||
o.default = '0';
|
||||
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.depends('second_enable', '1');
|
||||
o.ucisection = 'second';
|
||||
|
||||
o = s.taboption('secondary_config', form.DynamicList, 'second_custom_subnets', _('User Subnets'), _('Enter subnet in CIDR notation (example: 103.21.244.0/22)'));
|
||||
o.placeholder = 'Subnets list';
|
||||
o.depends('second_custom_subnets_list_enabled', '1');
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'second';
|
||||
o.validate = function (section_id, value) {
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}\/\d{1,2}$/;
|
||||
const domains = value.split(/[,\s\n]/)
|
||||
.map(d => d.trim())
|
||||
.filter(d => d.length > 0);
|
||||
|
||||
if (!subnetRegex.test(value)) {
|
||||
return _('Invalid subnet format. Use format: X.X.X.X/Y (like 103.21.244.0/22)');
|
||||
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 = 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.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 = 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('.');
|
||||
const cidrNum = parseInt(cidr);
|
||||
|
||||
for (const part of ipParts) {
|
||||
const num = parseInt(part);
|
||||
@@ -411,13 +845,116 @@ return view.extend({
|
||||
}
|
||||
}
|
||||
|
||||
if (cidrNum < 0 || cidrNum > 32) {
|
||||
return _('CIDR must be between 0 and 32');
|
||||
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();
|
||||
}
|
||||
});
|
||||
@@ -218,4 +218,115 @@ 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)"
|
||||
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 "Ошибка копирования логов: "
|
||||
@@ -218,4 +218,115 @@ 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 ""
|
||||
@@ -2,10 +2,14 @@
|
||||
"luci-app-podkop": {
|
||||
"description": "Grant UCI and RPC access to LuCI app podkop",
|
||||
"read": {
|
||||
"file": {
|
||||
"/etc/init.d/podkop": [
|
||||
"exec"
|
||||
]
|
||||
},
|
||||
"ubus": {
|
||||
"luci.podkop": [
|
||||
"get_sample1",
|
||||
"get_sample2"
|
||||
"service": [
|
||||
"list"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
@@ -18,4 +22,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=podkop
|
||||
PKG_VERSION:=0.2.4
|
||||
PKG_VERSION:=0.3.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/podkop
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+dnsmasq-full +curl +jq +kmod-nft-tproxy +coreutils-base64
|
||||
DEPENDS:=+sing-box +curl +jq +kmod-nft-tproxy +coreutils-base64
|
||||
TITLE:=Domain routing app
|
||||
URL:=https://itdog.info
|
||||
PKGARCH:=all
|
||||
@@ -33,8 +33,6 @@ define Package/podkop/prerm
|
||||
|
||||
grep -q "105 podkop" /etc/iproute2/rt_tables && sed -i "/105 podkop/d" /etc/iproute2/rt_tables
|
||||
|
||||
rm -f /etc/hotplug.d/iface/50-podkop
|
||||
|
||||
exit 0
|
||||
endef
|
||||
|
||||
@@ -49,12 +47,6 @@ define Package/podkop/install
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/etc/config/podkop $(1)/etc/config/podkop
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/podkop
|
||||
$(INSTALL_DATA) ./files/etc/podkop/* $(1)/etc/podkop/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DATA) ./files/etc/hotplug.d/iface/50-podkop $(1)/etc/hotplug.d/iface/50-podkop
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,podkop))
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
config main 'main'
|
||||
option mode ''
|
||||
option interface ''
|
||||
option mode 'proxy'
|
||||
#option interface ''
|
||||
option proxy_config_type ''
|
||||
#option outbound_json ''
|
||||
option proxy_string ''
|
||||
option domain_list_enabled '1'
|
||||
option domain_list 'ru_inside'
|
||||
option domain_list 'russia_inside'
|
||||
option subnets_list_enabled '0'
|
||||
#list subnets 'twitter'
|
||||
option custom_domains_list_enabled '0'
|
||||
option custom_domains_list_type 'disable'
|
||||
#list custom_domains ''
|
||||
#option custom_domains_text ''
|
||||
option custom_local_domains_list_enabled '0'
|
||||
#list custom_local_domains ''
|
||||
option custom_download_domains_list_enabled '0'
|
||||
#list custom_download_domains ''
|
||||
option custom_subnets_list_enabled '0'
|
||||
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'
|
||||
@@ -23,16 +28,6 @@ config main 'main'
|
||||
option yacd '0'
|
||||
option socks5 '0'
|
||||
option exclude_ntp '0'
|
||||
option update_interval ''
|
||||
|
||||
config second 'second'
|
||||
option second_enable '0'
|
||||
option second_mode 'proxy'
|
||||
option second_interface ''
|
||||
option second_proxy_string ''
|
||||
option second_domain_service_enabled '0'
|
||||
#list second_service_list 'youtube'
|
||||
option second_custom_domains_list_enabled '0'
|
||||
#list second_custom_domains 'ifconfig.io'
|
||||
option second_custom_subnets_list_enabled '0'
|
||||
#list second_custom_subnets ''
|
||||
option quic_disable '0'
|
||||
option update_interval '1d'
|
||||
option custom_domains_text
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
config_load "/etc/config/podkop"
|
||||
. /etc/init.d/podkop
|
||||
|
||||
config_get "interface" "main" "interface" "0"
|
||||
config_get "mode" "main" "mode" "0"
|
||||
if [ "$mode" = "vpn" ] && [ -n "$interface" ]; then
|
||||
add_route_interface "$interface" "podkop"
|
||||
fi
|
||||
|
||||
if [ "$mode" = "proxy" ]; then
|
||||
echo "Add route for main tproxy"
|
||||
add_route_tproxy podkop
|
||||
fi
|
||||
|
||||
config_get second_enable "second" "second_enable" "0"
|
||||
config_get second_interface "second" "second_interface" "0"
|
||||
config_get "second_mode" "second" "second_mode" "0"
|
||||
if [ "$second_enable" -eq "1" ] && [ "$second_mode" = "vpn" ] && [ -n "$second_interface" ]; then
|
||||
add_route_interface "$second_interface" "podkop2"
|
||||
fi
|
||||
|
||||
if [ "$second_enable" -eq "1" ] && [ "$second_mode" = "proxy" ]; then
|
||||
echo "Add route for second tproxy"
|
||||
add_route_tproxy podkop2
|
||||
fi
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "shadowsocks",
|
||||
"server": "$HOST",
|
||||
"server_port": "$PORT",
|
||||
"method": "$METHOD",
|
||||
"password": "$PASS",
|
||||
"udp_over_tcp": {
|
||||
"enabled": true,
|
||||
"version": 2
|
||||
},
|
||||
"tag": "$TAG"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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,35 +0,0 @@
|
||||
{
|
||||
"log": {
|
||||
"level": "warn"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "tproxy",
|
||||
"listen": "::",
|
||||
"listen_port": 1602,
|
||||
"sniff": false,
|
||||
"tag": "main"
|
||||
},
|
||||
{
|
||||
"type": "tproxy",
|
||||
"listen": "::",
|
||||
"listen_port": 1603,
|
||||
"sniff": false,
|
||||
"tag": "second"
|
||||
}
|
||||
],
|
||||
"outbounds": [],
|
||||
"route": {
|
||||
"rules": [
|
||||
{
|
||||
"inbound": "main",
|
||||
"outbound": "main"
|
||||
},
|
||||
{
|
||||
"inbound": "second",
|
||||
"outbound": "second"
|
||||
}
|
||||
],
|
||||
"auto_detect_interface": true
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "vless",
|
||||
"server": "$HOST",
|
||||
"server_port": "$PORT",
|
||||
"uuid": "$UUID",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"tls": {
|
||||
"enabled": true,
|
||||
"insecure": false,
|
||||
"server_name": "$FAKE_SERVER",
|
||||
"utls": {
|
||||
"enabled": true,
|
||||
"fingerprint": "chrome"
|
||||
},
|
||||
"reality": {
|
||||
"enabled": true,
|
||||
"public_key": "$PUBLIC_KEY",
|
||||
"short_id": "$SHORT_ID"
|
||||
}
|
||||
},
|
||||
"tag": "$TAG"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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