1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'test' into develop

This commit is contained in:
suyuan 2020-11-05 23:07:34 +08:00
commit d71e1f85f1
28 changed files with 1127 additions and 874 deletions

View file

@ -126,8 +126,8 @@ _get_ss_redir() {
_get_ss_server() {
config_get cf_obfs $1 obfs
[ "$cf_obfs" = "1" ] && obfs="true"
config_get obfs_plugin $1 obfs_plugin
config_get obfs_type $1 obfs_type
config_get obfs_plugin $1 obfs_plugin "v2ray"
config_get obfs_type $1 obfs_type "http"
}
_set_ss_server_vps() {
@ -170,6 +170,22 @@ _set_ss_server_vps() {
fi
}
_set_v2ray_server_vps() {
enabled=$(uci -q get v2ray.main.enabled)
[ "$enabled" != "1" ] && return
userid=$(uci -q get v2ray.omrout.s_vless_user_id)
[ -z "$userid" ] && return
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
[ -z "$vps_config" ] && return
current_userid="$(echo "$vps_config" | jsonfilter -q -e '@.v2ray.config.key')"
if [ "$current_userid" != "$userid" ]; then
local settings
settings='{"userid": "'$userid'"}'
echo $(_set_json "v2ray" "$settings")
fi
}
_get_vps_config() {
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
[ -z "$vps_config" ] && return
@ -1524,6 +1540,7 @@ _config_service() {
if [ "$user_permission" != "ro" ]; then
config_load shadowsocks-libev
config_foreach _set_ss_server_vps server
_set_v2ray_server_vps
[ -z "$(_set_glorytun_vps)" ] && error=1
[ -z "$(_set_openvpn_vps)" ] && error=1
_set_vps_firewall

View file

@ -151,6 +151,13 @@ if [ "$(uci -q get firewall.blockquicproxy)" = "" ]; then
EOF
fi
# Fix firewall config from some old config
allintf=$(uci -q get firewall.@zone[1].network)
uci -q del firewall.@zone[1].network
for intf in $allintf; do
uci -q add_list firewall.@zone[1].network=$intf
done
uci -q batch <<-EOF >/dev/null
set firewall.@zone[0].mtu_fix='1'
set firewall.zone_vpn.mtu_fix='1'