mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-07 12:06:56 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25b0dcaad5 | ||
|
|
cc59e756dd | ||
|
|
210714c499 | ||
|
|
8b6c336584 | ||
|
|
5c543c1608 |
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-podkop
|
||||
PKG_VERSION:=0.4.5
|
||||
PKG_VERSION:=0.4.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI podkop app
|
||||
|
||||
@@ -179,10 +179,6 @@ function createConfigSection(section, map, network) {
|
||||
if (!params.get('pbk')) return _('Invalid VLESS URL: missing pbk parameter for reality security');
|
||||
if (!params.get('fp')) return _('Invalid VLESS URL: missing fp parameter for reality security');
|
||||
}
|
||||
|
||||
if (security === 'tls' && type !== 'tcp' && !params.get('sni')) {
|
||||
return _('Invalid VLESS URL: missing sni parameter for tls security');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=podkop
|
||||
PKG_VERSION:=0.4.5
|
||||
PKG_VERSION:=0.4.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||
|
||||
@@ -35,7 +35,7 @@ config main 'main'
|
||||
option dns_server '8.8.8.8'
|
||||
option split_dns_enabled '1'
|
||||
option split_dns_type 'udp'
|
||||
option split_dns_server '8.8.8.8'
|
||||
option split_dns_server '1.1.1.1'
|
||||
option dns_rewrite_ttl '60'
|
||||
option cache_file '/tmp/cache.db'
|
||||
list iface 'br-lan'
|
||||
|
||||
@@ -35,12 +35,14 @@ service_triggers() {
|
||||
config_get mon_restart_ifaces "main" "mon_restart_ifaces"
|
||||
config_get restart_ifaces "main" "restart_ifaces"
|
||||
|
||||
PROCD_RELOAD_DELAY=2000
|
||||
|
||||
procd_open_trigger
|
||||
procd_add_config_trigger "config.change" "$NAME" "$initscript" restart 'on_config_change'
|
||||
|
||||
if [ "$mon_restart_ifaces" = "1" ]; then
|
||||
for iface in $restart_ifaces; do
|
||||
procd_add_reload_interface_trigger $iface
|
||||
procd_add_interface_trigger "interface.*.up" "$iface" /etc/init.d/podkop reload
|
||||
done
|
||||
fi
|
||||
procd_close_trigger
|
||||
|
||||
@@ -69,10 +69,6 @@ start_main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if opkg list-installed | grep -q iptables-mod-extra; then
|
||||
log "[critical] Conflicting package detected: iptables-mod-extra"
|
||||
fi
|
||||
|
||||
if grep -qE 'doh_backup_noresolv|doh_backup_server|doh_server' /etc/config/dhcp; then
|
||||
log "[critical] Detected https-dns-proxy in dhcp config. Edit /etc/config/dhcp"
|
||||
fi
|
||||
@@ -80,6 +76,8 @@ start_main() {
|
||||
migration
|
||||
|
||||
config_foreach process_validate_service
|
||||
|
||||
br_netfilter_disable
|
||||
|
||||
# Sync time for DoH/DoT
|
||||
/usr/sbin/ntpd -q -p 194.190.168.1 -p 216.239.35.0 -p 216.239.35.4 -p 162.159.200.1 -p 162.159.200.123
|
||||
@@ -302,6 +300,14 @@ process_validate_service() {
|
||||
fi
|
||||
}
|
||||
|
||||
br_netfilter_disable() {
|
||||
if lsmod | grep -q br_netfilter && [ "$(sysctl -n net.bridge.bridge-nf-call-iptables 2>/dev/null)" = "1" ]; then
|
||||
log "br_netfilter enabled detected. Disabling"
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=0
|
||||
sysctl -w net.bridge.bridge-nf-call-ip6tables=0
|
||||
fi
|
||||
}
|
||||
|
||||
# Main funcs
|
||||
|
||||
route_table_rule_mark() {
|
||||
@@ -419,8 +425,9 @@ dnsmasq_restore() {
|
||||
log "Removing configuration for dnsmasq"
|
||||
|
||||
local cachesize=$(uci get dhcp.@dnsmasq[0].podkop_cachesize 2>/dev/null)
|
||||
if [ -z "$cachesize" ]; then
|
||||
if [[ "$cachesize" == "unset" ]]; then
|
||||
log "dnsmasq revert: cachesize is unset"
|
||||
uci -q delete dhcp.@dnsmasq[0].cachesize
|
||||
else
|
||||
uci set dhcp.@dnsmasq[0].cachesize="$cachesize"
|
||||
fi
|
||||
@@ -1810,15 +1817,13 @@ sing_box_rules_source_ip_cidr() {
|
||||
local source_ip_cidr="$1"
|
||||
local outbound="$2"
|
||||
|
||||
local current_source_ip_cidr=$(jq -r '.route.rules[] | select(.outbound == "'"$outbound"'" and .action == "route" and (.rule_set | not))' $SING_BOX_CONFIG)
|
||||
|
||||
local current_source_ip_cidr=$(jq -r '.route.rules[] | select(.outbound == "'"$outbound"'" and .action == "route" and .source_ip_cidr and (.inbound // [] | contains(["tproxy-in"])))' $SING_BOX_CONFIG)
|
||||
|
||||
if [[ -n "$current_source_ip_cidr" ]]; then
|
||||
jq \
|
||||
--arg source_ip_cidr "$source_ip_cidr" \
|
||||
--arg outbound "$outbound" \
|
||||
'(.route.rules[] | select(.outbound == $outbound and .action == "route" and (.rule_set | not)) | .source_ip_cidr) += [$source_ip_cidr]' \
|
||||
"$SING_BOX_CONFIG" | build_sing_box_config
|
||||
'(.route.rules[] | select(.outbound == $outbound and .action == "route" and .source_ip_cidr and (.inbound // [] | contains(["tproxy-in"]))) | .source_ip_cidr) += [$source_ip_cidr]' "$SING_BOX_CONFIG" | build_sing_box_config
|
||||
else
|
||||
jq \
|
||||
--arg source_ip_cidr "$source_ip_cidr" \
|
||||
|
||||
Reference in New Issue
Block a user