mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
parent
9916032c7a
commit
5f521932b2
185 changed files with 7761 additions and 4020 deletions
|
@ -6,7 +6,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Interface to bypass domains
|
||||
LUCI_DEPENDS:=+dnsmasq-full +shadowsocks-libev-ss-rules +iptables-mod-ndpi +iptables-mod-extra +kmod-ipt-ndpi +iptables
|
||||
LUCI_DEPENDS:=+dnsmasq-full +shadowsocks-libev-ss-rules +iptables-mod-extra +iptables
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ return L.view.extend({
|
|||
o = s.option(form.Flag, 'enabled', _('Enabled'));
|
||||
o.default = o.enabled;
|
||||
|
||||
o = s.option(form.Value, 'proto', _('Protocol/Service'));
|
||||
o = s.option(form.ListValue, 'proto', _('Protocol/Service'));
|
||||
o.rmempty = false;
|
||||
o.load = function(section_id) {
|
||||
return Promise.all([
|
||||
|
|
|
@ -2,7 +2,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2021-04-30 16:16+0000\n"
|
||||
"PO-Revision-Date: 2022-02-19 07:53+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsomr-bypass/fr/>\n"
|
||||
|
@ -11,7 +11,7 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.5.2\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js:166
|
||||
#: luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js:174
|
||||
|
@ -94,7 +94,7 @@ msgstr "Ports de destination"
|
|||
|
||||
#: luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js:90
|
||||
msgid "Ports source"
|
||||
msgstr ""
|
||||
msgstr "Ports source"
|
||||
|
||||
#: luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js:193
|
||||
msgid "Protocol/Service"
|
||||
|
|
|
@ -14,13 +14,18 @@ _add_proto() {
|
|||
if [ "$(dd if=/proc/net/xt_ndpi/proto bs=4096 2> /dev/null | grep $protoname)" = "" ]; then
|
||||
echo "add_custom $protoname" >/proc/net/xt_ndpi/proto
|
||||
fi
|
||||
allurls="$(dd if=/proc/net/xt_ndpi/host_proto bs=4096 2> /dev/null)"
|
||||
hosts="$( uci -q get omr-bypass.$protoname.url )"
|
||||
for url in $hosts; do
|
||||
echo "$protoname:$url" >/proc/net/xt_ndpi/host_proto
|
||||
if [ "$(echo "$allurls" | grep -i ^${protoname}: | grep $url)" = "" ]; then
|
||||
echo "$protoname:$url" >/proc/net/xt_ndpi/host_proto
|
||||
fi
|
||||
done
|
||||
ip="$( uci -q get omr-bypass.$protoname.ip )"
|
||||
for ip in $ips; do
|
||||
echo "$protoname:$ip" >/proc/net/xt_ndpi/ip_proto
|
||||
if [ "$(echo "$allurls" | grep -i ^${protoname}: | grep $ip)" = "" ]; then
|
||||
echo "$protoname:$ip" >/proc/net/xt_ndpi/ip_proto
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -100,12 +105,14 @@ _bypass_domain() {
|
|||
fi
|
||||
if [ "$(uci -q get dhcp.@dnsmasq[0].ipset | grep /$domain/)" = "" ]; then
|
||||
uci -q add_list dhcp.@dnsmasq[0].ipset="/$domain/omr_dst_bypass_$intf,omr6_dst_bypass_$intf"
|
||||
add_domains="true"
|
||||
else
|
||||
dnsmasqipset=$(uci -q get dhcp.@dnsmasq[0].ipset | sed 's/ /\n/g')
|
||||
for dnsipset in $dnsmasqipset; do
|
||||
if [ "$(echo $dnsipset | cut -d/ -f2)" = "$domain" ]; then
|
||||
uci -q del_list dhcp.@dnsmasq[0].ipset=$dnsipset
|
||||
uci -q add_list dhcp.@dnsmasq[0].ipset="$dnsipset,omr_dst_bypass_$intf,omr6_dst_bypass_$intf"
|
||||
add_domains="true"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
@ -501,9 +508,10 @@ _intf_rule_v2ray_rules() {
|
|||
|
||||
_intf_rule() {
|
||||
local intf
|
||||
config_get intf $1 ifname
|
||||
[ -z "$intf" ] && intf=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
intf=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -n "$(echo $intf | grep '@')" ] && intf=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
|
||||
[ -z "$intf" ] && config_get intf $1 device
|
||||
[ -n "$(echo $intf | grep '/')" ] && return
|
||||
#count=$((count+1))
|
||||
config_get count $1 metric
|
||||
local mode
|
||||
|
@ -537,7 +545,7 @@ _intf_rule() {
|
|||
EOF
|
||||
else
|
||||
ip rule add prio 1 fwmark 0x539$count lookup $count pref 1 > /dev/null 2>&1
|
||||
ip -6 rule add prio 1 fwmark 0x6539$count lookup 6$count > /dev/null 2>&1
|
||||
ip -6 rule add prio 1 fwmark 0x6539$count lookup 6$count pref 1 > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
if [ "$(iptables-save | grep omr-bypass | grep omr_dst_bypass_$intf)" = "" ]; then
|
||||
|
@ -680,6 +688,7 @@ boot() {
|
|||
start_service() {
|
||||
#local count
|
||||
logger -t "omr-bypass" "Starting OMR-ByPass..."
|
||||
add_domains="false"
|
||||
config_load omr-bypass
|
||||
config_foreach _add_proto proto
|
||||
disableipv6="$(uci -q get openmptcprouter.settings.disable_ipv6)"
|
||||
|
@ -797,11 +806,11 @@ start_service() {
|
|||
config_foreach _bypass_proto dpis
|
||||
uci -q commit omr-bypass
|
||||
|
||||
[ -z "$RELOAD" ] && {
|
||||
[ -z "$RELOAD" ] && [ "$add_domains" = "true" ] && {
|
||||
logger -t "omr-bypass" "Restart dnsmasq..."
|
||||
/etc/init.d/dnsmasq restart
|
||||
}
|
||||
[ -n "$RELOAD" ] && {
|
||||
[ -n "$RELOAD" ] && [ "$add_domains" = "true" ] && {
|
||||
logger -t "omr-bypass" "Reload dnsmasq..."
|
||||
/etc/init.d/dnsmasq reload
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue