Compare commits

...

3 Commits

Author SHA1 Message Date
itdoginfo
34d524ef51 Fix version 2025-02-15 12:20:28 +03:00
itdoginfo
c914d38ff2 Issue S99sing-box. Fixed repeat rulesset in sections 2025-02-15 11:52:31 +03:00
itdoginfo
543b66a6cc Message modification 2025-02-14 21:24:56 +03:00
5 changed files with 47 additions and 20 deletions

View File

@@ -147,6 +147,7 @@ Luci: Services/podkop
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
- [ ] Диагностика: podkop_domains: 0 elements как проверять что доходят запросы при fakeip? Мб врубать логи dnsmasq и их чекать.
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
- [ ] Валидации предустановленных значений. Если прописаны другие, то вывод в лог о неизвестной переменной и продолжение работы
Приоритет 2
- [x] Списки доменов и подсетей с роутера

View File

@@ -77,12 +77,12 @@ main() {
}
add_tunnel() {
echo "What type of VPN or proxy will be used? We also can automatically configure Wireguard and Amnezia WireGuard."
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) Skip this step"
echo "5) I use VLESS/SS. Skip this step"
while true; do
read -r -p '' TUNNEL

View File

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

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=podkop
PKG_VERSION:=0.3.0
PKG_VERSION:=0.3.2
PKG_RELEASE:=1
PKG_MAINTAINER:=ITDog <podkop@itdog.info>

View File

@@ -43,9 +43,16 @@ start_service() {
echo "The version of sing-box ($sing_box_version) is lower than the minimum version. Update sing-box: opkg update && opkg install sing-box"
exit 1
fi
migration
# S99sing-box issue
if sing-box -c $SING_BOX_CONFIG check >/dev/null 2>&1; then
/etc/init.d/sing-box start
fi
sleep 5
config_foreach wget_github
mkdir -p /tmp/podkop
@@ -305,6 +312,11 @@ wget_github() {
if [ "$domain_list_enabled" -eq 1 ] || [ "$subnets_list_enabled" -eq 1 ] ||
[ "$custom_download_domains_list_enabled" -eq 1 ] || [ "$custom_download_subnets_list_enabled" -eq 1 ] ; then
if ! nslookup google.com >/dev/null 2>&1; then
log "DNS not work"
exit 1
fi
while true; do
if ! curl -m 3 github.com; then
log "GitHub is not available. Check the internet availability [$count sec]"
@@ -497,20 +509,24 @@ sing_box_dns_rule_fakeip() {
sing_box_dns_rule_fakeip_section() {
local rule_set=$1
echo $rule_set
log "Adding section to fakeip route rules in sing-box"
jq \
--arg rule_set "$rule_set" \
'.dns.rules |= map(
if .server == "fakeip-server" then
.rule_set += [$rule_set]
if any(.rule_set[]?; . == $rule_set) then
.
else
.rule_set += [$rule_set]
end
else
.
end
)' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
)' "$SING_BOX_CONFIG" >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json "$SING_BOX_CONFIG"
}
sing_box_cache_file() {
log "Configure cache.db in sing-box"
jq \
@@ -531,7 +547,7 @@ sing_box_outdound() {
case "$mode" in
"vpn")
log "VPN mode"
log "You are using VPN mode, make sure you have installed all the necessary packages, configured, created the zone and forwarding."
log "You are using VPN mode, make sure you have installed all the necessary packages and configured."
config_get interface "$section" "interface"
sing_box_outbound_interface $section $interface
;;
@@ -970,27 +986,37 @@ process_domains_for_section() {
}
sing_box_ruleset_remote() {
log "Configure ruleset remote in sing-box"
local tag=$1
local type=$2
local update_interval=$3
url="$SRS_MAIN_URL/$tag.srs"
jq \
--arg tag "$tag" \
--arg type "$type" \
--arg url "$url" \
--arg update_interval "$update_interval" \
'.route |= (if . == null then {rule_set: []} else . end) |
.route.rule_set += [{
local tag_exists=$(jq -r --arg tag "$tag" '
.route.rule_set[]? | select(.tag == $tag) | .tag
' "$SING_BOX_CONFIG")
if [[ -n "$tag_exists" ]]; then
log "Ruleset with tag $tag already exists. Skipping addition."
else
jq \
--arg tag "$tag" \
--arg type "$type" \
--arg url "$url" \
--arg update_interval "$update_interval" \
'
.route.rule_set += [
{
"tag": $tag,
"type": $type,
"format": "binary",
"url": $url,
"update_interval": $update_interval
}]' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
}
]' "$SING_BOX_CONFIG" > /tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json "$SING_BOX_CONFIG"
log "Added new ruleset with tag $tag"
fi
}
list_subnets_download() {