luci-app-vssr: update source

This commit is contained in:
CN_SZTL 2020-02-17 18:25:13 +08:00
parent 4bb8ed5195
commit 5fe46613d3
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
861 changed files with 34250 additions and 1342 deletions

View File

@ -28,12 +28,11 @@ luci-app-autoipsetadder source: [rufengsuixing/luci-app-autoipsetadder](https://
luci-app-adguardhome source: [rufengsuixing/luci-app-adguardhome](https://github.com/rufengsuixing/luci-app-adguardhome).<br/>
Rclone-OpenWrt source: [ElonH/Rclone-OpenWrt](https://github.com/ElonH/Rclone-OpenWrt).<br/>
luci-app-usb3disable source: [rufengsuixing/luci-app-usb3disable](https://github.com/rufengsuixing/luci-app-usb3disable).<br/>
luci-app-vssr source: [Flowers-in-thorns/luci-app-vssr-coexist](https://github.com/Flowers-in-thorns/luci-app-vssr-coexist).<br/>
luci-app-vssr source: [Leo-Jo-My/luci-app-vssr](https://github.com/Leo-Jo-My/luci-app-vssr).<br/>
luci-app-diskman source: [lisaac/luci-app-diskman](https://github.com/lisaac/luci-app-diskman).<br/>
NanoPi R1s(h5) support: [jerrykuku/openwrt-nanopi-r1s-h5](https://github.com/jerrykuku/openwrt-nanopi-r1s-h5).<br/>
NanoPi support: [speedyworldclub/nlede](https://github.com/speedyworldclub/nlede).<br/>
qntfs-driver source: [lbbboy/qntfs-driver](https://github.com/lbbboy/qntfs-driver).<br/>
Package qca: [jollaman999/openwrt](https://github.com/jollaman999/openwrt).
qntfs-driver source: [lbbboy/qntfs-driver](https://github.com/lbbboy/qntfs-driver).
## License
### Depending on their own License.

View File

@ -1,95 +0,0 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local m, s, o
local vssr = "vssr"
local sid = arg[1]
local encrypt_methods = {
"rc4-md5",
"rc4-md5-6",
"rc4",
"table",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
}
local protocol = {
"origin",
}
obfs = {
"plain",
"http_simple",
"http_post",
}
m = Map(vssr, translate("Edit vssr Server"))
m.redirect = luci.dispatcher.build_url("admin/vpn/vssr/server")
if m.uci:get(vssr, sid) ~= "server_config" then
luci.http.redirect(m.redirect)
return
end
-- [[ Server Setting ]]--
s = m:section(NamedSection, sid, "server_config")
s.anonymous = true
s.addremove = false
o = s:option(Flag, "enable", translate("Enable"))
o.default = 1
o.rmempty = false
o = s:option(Value, "server_port", translate("Server Port"))
o.datatype = "port"
o.default = 8388
o.rmempty = false
o = s:option(Value, "timeout", translate("Connection Timeout"))
o.datatype = "uinteger"
o.default = 60
o.rmempty = false
o = s:option(Value, "password", translate("Password"))
o.password = true
o.rmempty = false
o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
for _, v in ipairs(encrypt_methods) do o:value(v) end
o.rmempty = false
o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = false
o = s:option(ListValue, "obfs", translate("Obfs"))
for _, v in ipairs(obfs) do o:value(v) end
o.rmempty = false
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
o = s:option(Flag, "fast_open", translate("TCP Fast Open"))
o.rmempty = false
return m

View File

@ -1,189 +0,0 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local IPK_Version="202000109"
local m, s, o
local redir_run=0
local reudp_run=0
local sock5_run=0
local ssock5_run=0
local v2sock5_run=0
local server_run=0
local kcptun_run=0
local tunnel_run=0
local udp2raw_run=0
local udpspeeder_run=0
local gfw_count=0
local ad_count=0
local ip_count=0
local gfwmode=0
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
gfwmode=1
end
local vssr = "vssr"
-- html constants
font_blue = [[<font color="green">]]
font_off = [[</font>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
local fs = require "nixio.fs"
local sys = require "luci.sys"
local kcptun_version=translate("Unknown")
local kcp_file="/usr/bin/kcptun-client"
if not fs.access(kcp_file) then
kcptun_version=translate("Not exist")
else
if not fs.access(kcp_file, "rwx", "rx", "rx") then
fs.chmod(kcp_file, 755)
end
kcptun_version=sys.exec(kcp_file .. " -v | awk '{printf $3}'")
if not kcptun_version or kcptun_version == "" then
kcptun_version = translate("Unknown")
end
end
if gfwmode==1 then
gfw_count = tonumber(sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l"))/2
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
ad_count=tonumber(sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l"))
end
end
if nixio.fs.access("/etc/china_ssr.txt") then
ip_count = sys.exec("cat /etc/china_ssr.txt | wc -l")
end
local icount=sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l")
if tonumber(icount)>0 then
reudp_run=1
else
icount=sys.exec("ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l")
if tonumber(icount)>0 then
reudp_run=1
end
end
if luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0 then
redir_run=1
end
if luci.sys.call("pidof ssr-local >/dev/null") == 0 then
sock5_run=1
end
if luci.sys.call("pidof ss-local >/dev/null") == 0 then
ssock5_run=1
end
if luci.sys.call("ps -w | grep v2-ssr-local | grep -v grep >/dev/null") == 0 then
v2sock5_run=1
end
if luci.sys.call("pidof kcptun-client >/dev/null") == 0 then
kcptun_run=1
end
if luci.sys.call("pidof ssr-server >/dev/null") == 0 then
server_run=1
end
if luci.sys.call("ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then
tunnel_run=1
end
if luci.sys.call("pidof pdnsd >/dev/null") == 0 then
pdnsd_run=1
end
m = SimpleForm("Version")
m.reset = false
m.submit = false
s=m:field(DummyValue,"redir_run",translate("Global Client"))
s.rawhtml = true
if redir_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"reudp_run",translate("Game Mode UDP Relay"))
s.rawhtml = true
if reudp_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"pdnsd_run",translate("PDNSD"))
s.rawhtml = true
if pdnsd_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
if nixio.fs.access("/usr/bin/ss-local") then
s=m:field(DummyValue,"ssock5_run",translate("SSOCKS5 Proxy"))
s.rawhtml = true
if ssock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ssr-local") then
s=m:field(DummyValue,"sock5_run",translate("SSR SOCKS5 Proxy"))
s.rawhtml = true
if sock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/v2ray/v2ray") then
s=m:field(DummyValue,"ssock5_run",translate("V2SOCKS5 Proxy"))
s.rawhtml = true
if v2sock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ssr-server") then
s=m:field(DummyValue,"server_run",translate("Global SSR Server"))
s.rawhtml = true
if server_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/kcptun-client") then
s=m:field(DummyValue,"kcp_version",translate("KcpTun Version"))
s.rawhtml = true
s.value =kcptun_version
s=m:field(DummyValue,"kcptun_run",translate("KcpTun"))
s.rawhtml = true
if kcptun_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
s=m:field(DummyValue,"version",translate("IPK Version"))
s.rawhtml = true
s.value =IPK_Version
return m

View File

@ -1,612 +0,0 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2017 openwrt-ssr
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
# Copyright (C) 2018 lean <coolsnowwolf@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
START=90
STOP=15
SERVICE_DAEMONIZE=1
NAME=vssr
EXTRA_COMMANDS=rules
#定义配置文件名称
CONFIG_FILE=/var/etc/${NAME}_t.json
CONFIG_UDP_FILE=/var/etc/${NAME}_u.json
CONFIG_SOCK5_FILE=/var/etc/${NAME}_s.json
server_count=0
redir_tcp=0
redir_udp=0
tunnel_enable=0
local_enable=0
kcp_enable_flag=0
kcp_flag=0
pdnsd_enable_flag=0
switch_enable=0
switch_server=$1
MAXFD=32768
CRON_FILE=/etc/crontabs/root
threads=1
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_get_by_type() {
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
echo ${ret:=$3}
}
add_cron() {
sed -i '/vssr.log/d' $CRON_FILE
echo '0 1 * * 0 echo "" > /tmp/vssr.log' >>$CRON_FILE
[ -n "$(grep -w "/usr/share/vssr/subscribe.sh" $CRON_FILE)" ] && sed -i '/\/usr\/share\/vssr\/subscribe.sh/d' $CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/vssr/subscribe.sh" >>$CRON_FILE
[ -z "$(grep -w "/usr/share/vssr/update.sh" $CRON_FILE)" ] && echo "0 5 * * 0 /usr/share/vssr/update.sh" >>$CRON_FILE
crontab $CRON_FILE
}
del_cron() {
sed -i '/vssr/d' $CRON_FILE
sed -i '/vssr.log/d' $CRON_FILE
/etc/init.d/cron restart
}
run_mode=$(uci_get_by_type global run_mode)
gen_config_file() {
local host=$(uci_get_by_name $1 server)
if echo $host|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
hostip=${host}
elif [ "$host" != "${host#*:[0-9a-fA-F]}" ] ;then
hostip=${host}
else
hostip=`ping ${host} -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1`
if echo $hostip|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
hostip=${hostip}
else
hostip=`cat /etc/ssr_ip`
fi
fi
[ $2 = "0" -a $kcp_flag = "1" ] && hostip="127.0.0.1"
if [ $2 = "0" ] ;then
config_file=$CONFIG_FILE
elif [ $2 = "1" ]; then
config_file=$CONFIG_UDP_FILE
else
config_file=$CONFIG_SOCK5_FILE
fi
if [ $(uci_get_by_name $1 fast_open 0) = "1" ] ;then
fastopen="true";
else
fastopen="false";
fi
local stype=$(uci_get_by_name $1 type)
local plugin=$(uci_get_by_name $1 plugin)
if [ "$stype" == "ss" ] ;then
if [ "$plugin" == "none" ] ;then
cat <<-EOF >$config_file
{
"server": "$hostip",
"server_port": $(uci_get_by_name $1 server_port),
"local_address": "0.0.0.0",
"local_port": $(uci_get_by_name $1 local_port),
"password": "$(uci_get_by_name $1 password)",
"timeout": $(uci_get_by_name $1 timeout 60),
"method": "$(uci_get_by_name $1 encrypt_method_ss)",
"reuse_port": true,
"fast_open": $fastopen
}
EOF
else
cat <<-EOF >$config_file
{
"server": "$hostip",
"server_port": $(uci_get_by_name $1 server_port),
"local_address": "0.0.0.0",
"local_port": $(uci_get_by_name $1 local_port),
"password": "$(uci_get_by_name $1 password)",
"timeout": $(uci_get_by_name $1 timeout 60),
"method": "$(uci_get_by_name $1 encrypt_method_ss)",
"plugin": "$(uci_get_by_name $1 plugin)",
"plugin_opts": "$(uci_get_by_name $1 plugin_opts)",
"reuse_port": true,
"fast_open": $fastopen
}
EOF
fi
elif [ "$stype" == "ssr" ] ;then
cat <<-EOF >$config_file
{
"server": "$hostip",
"server_port": $(uci_get_by_name $1 server_port),
"local_address": "0.0.0.0",
"local_port": $(uci_get_by_name $1 local_port),
"password": "$(uci_get_by_name $1 password)",
"timeout": $(uci_get_by_name $1 timeout 60),
"method": "$(uci_get_by_name $1 encrypt_method)",
"protocol": "$(uci_get_by_name $1 protocol)",
"protocol_param": "$(uci_get_by_name $1 protocol_param)",
"obfs": "$(uci_get_by_name $1 obfs)",
"obfs_param": "$(uci_get_by_name $1 obfs_param)",
"reuse_port": true,
"fast_open": $fastopen
}
EOF
elif [ "$stype" == "v2ray" ] ;then
lua /usr/share/vssr/genv2config.lua $GLOBAL_SERVER tcp $(uci_get_by_name $1 local_port) > /var/etc/v2-ssr-retcp.json
sed -i 's/\\//g' /var/etc/v2-ssr-retcp.json
elif [ "$stype" == "trojan" ] ;then
lua /usr/share/vssr/gentrojanconfig.lua $GLOBAL_SERVER nat $(uci_get_by_name $1 local_port) > /var/etc/trojan-ssr-retcp.json
sed -i 's/\\//g' /var/etc/trojan-ssr-retcp.json
fi
}
get_arg_out() {
case "$(uci_get_by_type access_control router_proxy 1)" in
1) echo "-o";;
2) echo "-O";;
esac
}
start_rules() {
local server=$(uci_get_by_name $GLOBAL_SERVER server)
#resolve name
if echo $server|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
server=${server}
elif [ "$server" != "${server#*:[0-9a-fA-F]}" ] ;then
server=${server}
else
server=`ping ${server} -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1`
if echo $server|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
echo $server >/etc/ssr_ip
else
server=`cat /etc/ssr_ip`
fi
fi
kcp_server=$server
local kcp_enable=$(uci_get_by_name $GLOBAL_SERVER kcp_enable 0)
if [ $kcp_enable = "1" ]; then
kcp_flag=1
fi
local local_port=$(uci_get_by_name $GLOBAL_SERVER local_port)
local lan_ac_ips=$(uci_get_by_type access_control lan_ac_ips)
local lan_ac_mode="b"
local router_proxy=$(uci_get_by_type access_control router_proxy)
if [ "$GLOBAL_SERVER" = "$UDP_RELAY_SERVER" -a $kcp_flag = 0 ]; then
ARG_UDP="-u"
elif [ -n "$UDP_RELAY_SERVER" ]; then
ARG_UDP="-U"
local udp_server=$(uci_get_by_name $UDP_RELAY_SERVER server)
local udp_local_port=$(uci_get_by_name $UDP_RELAY_SERVER local_port)
fi
if [ -n "$lan_ac_ips" ]; then
case "$lan_ac_mode" in
w | W | b | B) local ac_ips="$lan_ac_mode$lan_ac_ips" ;;
esac
fi
#deal gfw firewall rule
local gfwmode=""
if [ "$run_mode" = "gfw" ]; then
gfwmode="-g"
elif [ "$run_mode" = "router" ]; then
gfwmode="-r"
elif [ "$run_mode" = "oversea" ]; then
gfwmode="-c"
elif [ "$run_mode" = "all" ]; then
gfwmode="-z"
fi
local dports=$(uci_get_by_type global dports 1)
if [ $dports = "1" ]; then
proxyport=" "
else
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443 "
fi
/usr/bin/vssr-rules \
-s "$server" \
-l "$local_port" \
-S "$udp_server" \
-L "$udp_local_port" \
-a "$ac_ips" \
-i "$(uci_get_by_type access_control wan_bp_list)" \
-b "$(uci_get_by_type access_control wan_bp_ips)" \
-w "$(uci_get_by_type access_control wan_fw_ips)" \
-p "$(uci_get_by_type access_control lan_fp_ips)" \
-G "$(uci_get_by_type access_control lan_gm_ips)" \
-D "$proxyport" \
$(get_arg_out) $gfwmode $ARG_UDP
return $?
}
start_pdnsd() {
local usr_dns="$1"
local usr_port="$2"
local tcp_dns_list="208.67.222.222, 208.67.220.220"
[ -z "$usr_dns" ] && usr_dns="8.8.8.8"
[ -z "$usr_port" ] && usr_port="53"
[ -d /var/etc ] || mkdir -p /var/etc
if [ ! -d /var/pdnsd ];then
mkdir -p /var/pdnsd
echo -ne "pd13\000\000\000\000" >/var/pdnsd/pdnsd.cache
chown -R nobody:nogroup /var/pdnsd
fi
cat >/var/etc/pdnsd.conf <<EOF
global {
perm_cache=1024;
cache_dir="/var/pdnsd";
pid_file = /var/run/pdnsd.pid;
run_as="nobody";
server_ip = 127.0.0.1;
server_port = 5335;
status_ctl = on;
query_method = tcp_only;
min_ttl=1h;
max_ttl=1w;
timeout=10;
neg_domain_pol=on;
proc_limit=2;
procq_limit=8;
}
server {
label= "ssr-usrdns";
ip = $usr_dns;
port = $usr_port;
timeout=6;
uptest=none;
interval=10m;
purge_cache=off;
}
server {
label= "ssr-pdnsd";
ip = $tcp_dns_list;
port = 5353;
timeout=6;
uptest=none;
interval=10m;
purge_cache=off;
}
EOF
/usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d
}
start_redir() {
case "$(uci_get_by_name $GLOBAL_SERVER auth_enable)" in
1|on|true|yes|enabled) ARG_OTA="-A";;
*) ARG_OTA="";;
esac
#deal kcp
local kcp_enable=$(uci_get_by_name $GLOBAL_SERVER kcp_enable 0)
if [ $kcp_enable = "1" ] ;then
[ ! -f "/usr/bin/kcptun-client" ] && return 1
local kcp_str=`/usr/bin/kcptun-client -v |grep kcptun|wc -l`
[ "0" = $kcp_str ] && return 1
local kcp_port=$(uci_get_by_name $GLOBAL_SERVER kcp_port)
local server_port=$(uci_get_by_name $GLOBAL_SERVER server_port)
local password=$(uci_get_by_name $GLOBAL_SERVER kcp_password)
local kcp_param=$(uci_get_by_name $GLOBAL_SERVER kcp_param)
[ "$password" != "" ] && password="--key "${password}
service_start /usr/bin/kcptun-client \
-r $kcp_server:$kcp_port \
-l :$server_port $password $kcp_param
kcp_enable_flag=1
fi
gen_config_file $GLOBAL_SERVER 0
local stype=$(uci_get_by_name $GLOBAL_SERVER type)
if [ "$stype" == "ss" ] ;then
sscmd="/usr/bin/ss-redir"
elif [ "$stype" == "ssr" ] ;then
sscmd="/usr/bin/ssr-redir"
elif [ "$stype" == "v2ray" ] ;then
sscmd="/usr/bin/v2ray/v2ray"
elif [ "$stype" == "trojan" ] ;then
sscmd="/usr/sbin/trojan"
fi
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
if [ "$utype" == "ss" ] ;then
ucmd="/usr/bin/ss-redir"
elif [ "$utype" == "ssr" ] ;then
ucmd="/usr/bin/ssr-redir"
elif [ "$utype" == "v2ray" ] ;then
ucmd="/usr/bin/v2ray/v2ray"
elif [ "$utype" == "trojan" ] ;then
ucmd="/usr/sbin/trojan"
fi
if [ "$(uci_get_by_type global threads 0)" = "0" ] ;then
threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
else
threads=$(uci_get_by_type global threads)
fi
#转发TCP
redir_tcp=1
if [ "$stype" == "ss" -o "$stype" == "ssr" ] ;then
local last_config_file=$CONFIG_FILE
local pid_file="/var/run/ssr-retcp.pid"
for i in $(seq 1 $threads)
do
$sscmd -c $CONFIG_FILE $ARG_OTA -f /var/run/ssr-retcp_$i.pid >/dev/null 2>&1
done
echo "$(date "+%Y-%m-%d %H:%M:%S") Shadowsocks/ShadowsocksR $threads 线程 已启动!" >> /tmp/vssr.log
elif [ "$stype" == "v2ray" ] ;then
$sscmd -config /var/etc/v2-ssr-retcp.json >/dev/null 2>&1 &
echo "$(date "+%Y-%m-%d %H:%M:%S") $($sscmd -version | head -1) 已启动!" >> /tmp/vssr.log
elif [ "$stype" == "trojan" ] ;then
$sscmd --config /var/etc/trojan-ssr-retcp.json >/dev/null 2>&1 &
echo "$(date "+%Y-%m-%d %H:%M:%S") $($sscmd --version 2>&1 | head -1) 已启动!" >> /tmp/vssr.log
fi
#转发UDP
if [ -n "$UDP_RELAY_SERVER" ] ;then
redir_udp=1
if [ "$utype" == "ss" -o "$utype" == "ssr" ] ;then
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
1|on|true|yes|enabled) ARG_OTA="-A";;
*) ARG_OTA="";;
esac
gen_config_file $UDP_RELAY_SERVER 1
last_config_file=$CONFIG_UDP_FILE
pid_file="/var/run/ssr-reudp.pid"
$ucmd -c $last_config_file $ARG_OTA -U -f /var/run/ssr-reudp.pid >/dev/null 2>&1
elif [ "$utype" == "v2ray" ] ; then
lua /usr/share/vssr/genv2config.lua $UDP_RELAY_SERVER udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) > /var/etc/v2-ssr-reudp.json
sed -i 's/\\//g' /var/etc/v2-ssr-reudp.json
$ucmd -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &
elif [ "$utype" == "trojan" ] ;then
lua /usr/share/vssr/gentrojanconfig.lua $GLOBAL_SERVER client 10801 > /var/etc/trojan-ssr-reudp.json
sed -i 's/\\//g' /var/etc/trojan-ssr-reudp.json
$ucmd --config /var/etc/trojan-ssr-reudp.json >/dev/null 2>&1 &
ipt2socks -U -4 -b 0.0.0.0 -s 127.0.0.1 -p 10801 -l $(uci_get_by_name $UDP_RELAY_SERVER local_port) >/dev/null 2>&1 &
fi
fi
#deal with dns
if [ "$(uci_get_by_type global pdnsd_enable)" = "1" ] ;then
local dnsstr="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
local dnsserver=`echo "$dnsstr"|awk -F ':' '{print $1}'`
local dnsport=`echo "$dnsstr"|awk -F ':' '{print $2}'`
if [ "$run_mode" = "gfw" ]; then
ipset add gfwlist $dnsserver 2>/dev/null
elif [ "$run_mode" = "oversea" ]; then
ipset add oversea $dnsserver 2>/dev/null
else
ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null
fi
start_pdnsd $dnsserver $dnsport
pdnsd_enable_flag=1
fi
if [ "$(uci_get_by_type global enable_switch)" = "1" ] ;then
if [ "$(uci_get_by_name $GLOBAL_SERVER switch_enable)" = "1" ] ;then
if [ -z "$switch_server" ] ;then
local switch_time=$(uci_get_by_type global switch_time)
local switch_timeout=$(uci_get_by_type global switch_timeout)
service_start /usr/bin/vssr-switch start $switch_time $switch_timeout
switch_enable=1
fi
fi
fi
add_cron
return $?
}
gen_service_file() {
if [ $(uci_get_by_name $1 fast_open) = "1" ] ;then
fastopen="true";
else
fastopen="false";
fi
cat <<-EOF >$2
{
"server": "0.0.0.0",
"server_port": $(uci_get_by_name $1 server_port),
"password": "$(uci_get_by_name $1 password)",
"timeout": $(uci_get_by_name $1 timeout 60),
"method": "$(uci_get_by_name $1 encrypt_method)",
"protocol": "$(uci_get_by_name $1 protocol)",
"protocol_param": "$(uci_get_by_name $1 protocol_param)",
"obfs": "$(uci_get_by_name $1 obfs)",
"obfs_param": "$(uci_get_by_name $1 obfs_param)",
"fast_open": $fastopen
}
EOF
}
start_service() {
[ $(uci_get_by_name $1 enable) = "0" ] && return 1
let server_count=server_count+1
if [ $server_count = 1 ] ;then
iptables -N SSR-SERVER-RULE && \
iptables -t filter -I INPUT -j SSR-SERVER-RULE
fi
gen_service_file $1 /var/etc/${NAME}_${server_count}.json
/usr/bin/ssr-server -c /var/etc/${NAME}_${server_count}.json -u -f /var/run/ssr-server${server_count}.pid >/dev/null 2>&1
iptables -t filter -A SSR-SERVER-RULE -p tcp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
return 0
}
gen_serv_include() {
FWI=$(uci get firewall.vssr.path 2>/dev/null)
[ -n "$FWI" ] || return 0
if [ ! -f $FWI ] ;then
echo '#!/bin/sh' >$FWI
fi
extract_rules() {
echo "*filter"
iptables-save -t filter | grep SSR-SERVER-RULE|sed -e "s/^-A INPUT/-I INPUT/"
echo 'COMMIT'
}
cat <<-EOF >>$FWI
iptables-save -c | grep -v "SSR-SERVER" | iptables-restore -c
iptables-restore -n <<-EOT
$(extract_rules)
EOT
EOF
}
start_server() {
SERVER_ENABLE=$(uci_get_by_type server_global enable_server)
[ "$SERVER_ENABLE" = 0 ] && return 0
mkdir -p /var/run /var/etc
config_load $NAME
config_foreach start_service server_config
gen_serv_include
return 0
}
start_local() {
local local_server=$(uci_get_by_type socks5_proxy server)
local http_enable=$(uci_get_by_type socks5_proxy http_enable)
local stype=$(uci_get_by_name $local_server type)
[ "$local_server" = "nil" ] && return 1
mkdir -p /var/run /var/etc
gen_config_file $local_server 2
if [ "$stype" == "ssr" ] ;then
/usr/bin/ssr-local -c $CONFIG_SOCK5_FILE -u \
-l $(uci_get_by_type socks5_proxy local_port 1080) \
-b $(uci_get_by_type socks5_proxy local_address 0.0.0.0) \
-f /var/run/ssr-local.pid >/dev/null 2>&1
local_enable=1
elif [ "$stype" == "ss" ] ;then
/usr/bin/ss-local -c $CONFIG_SOCK5_FILE -u \
-l $(uci_get_by_type socks5_proxy local_port 1080) \
-b $(uci_get_by_type socks5_proxy local_address 0.0.0.0) \
-f /var/run/ss-local.pid >/dev/null 2>&1
local_enable=2
elif [ "$stype" == "v2ray" ] ;then
lua /usr/share/vssr/genv2config_local.lua $local_server tcp $(uci_get_by_name $local_server local_port) $(uci_get_by_type socks5_proxy local_port 1080) > /var/etc/v2-ssr-local.json
sed -i 's/\\//g' /var/etc/v2-ssr-local.json
/usr/bin/v2ray/v2ray -config /var/etc/v2-ssr-local.json >/dev/null 2>&1 &
local_enable=3
fi
}
rules() {
[ "$GLOBAL_SERVER" = "nil" ] && return 1
mkdir -p /var/run /var/etc
UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
[ "$UDP_RELAY_SERVER" = "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
if start_rules ;then
return 0
else
return 1
fi
}
start() {
if [ -z "$switch_server" ] ;then
GLOBAL_SERVER=$(uci_get_by_type global global_server)
else
GLOBAL_SERVER=$switch_server
switch_enable=1
fi
if rules ;then
start_redir
mkdir -p /tmp/dnsmasq.d && cp -a /etc/dnsmasq.ssr /tmp/ && cp -a /etc/dnsmasq.oversea /tmp/
if ! [ "$run_mode" = "oversea" ] ;then
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
conf-dir=/tmp/dnsmasq.ssr
EOF
else
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
conf-dir=/tmp/dnsmasq.oversea
EOF
fi
/usr/share/vssr/gfw2ipset.sh
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
start_server
start_local
if [ $(uci_get_by_type global monitor_enable) = 1 ] ;then
let total_count=server_count+redir_tcp+redir_udp+tunnel_enable+kcp_enable_flag+local_enable+pdnsd_enable_flag+switch_enable
if [ $total_count -gt 0 ]
then
#param:server(count) redir_tcp(0:no,1:yes) redir_udp tunnel kcp local gfw
service_start /usr/bin/vssr-monitor $server_count $redir_tcp $redir_udp $tunnel_enable $kcp_enable_flag $local_enable $pdnsd_enable_flag $switch_enable
fi
fi
ENABLE_SERVER=$(uci_get_by_type global global_server)
[ "$ENABLE_SERVER" = "nil" ] && return 1
}
boot() {
(/usr/share/vssr/chinaipset.sh && sleep 5 && start >/dev/null 2>&1) &
}
stop() {
/usr/bin/vssr-rules -f
srulecount=`iptables -L|grep SSR-SERVER-RULE|wc -l`
if [ $srulecount -gt 0 ] ;then
iptables -F SSR-SERVER-RULE
iptables -t filter -D INPUT -j SSR-SERVER-RULE
iptables -X SSR-SERVER-RULE 2>/dev/null
fi
if [ -z "$switch_server" ] ;then
kill -9 $(busybox ps -w | grep vssr-switch | grep -v grep | awk '{print $1}') >/dev/null 2>&1
fi
if [ $(uci_get_by_type global monitor_enable) = 1 ] ;then
kill -9 $(busybox ps -w | grep vssr-monitor | grep -v grep | awk '{print $1}') >/dev/null 2>&1
fi
killall -q -9 vssr-monitor
killall -q -9 ss-redir
killall -q -9 ssr-redir
killall -q -9 ssr-local
killall -q -9 v2ray-plugin
killall -q -9 obfs-local
killall -q -9 obfs-server
killall -q -9 gq-client
killall -q -9 gq-server
killall -q -9 ss-local
killall -q -9 v2ray
killall -q -9 trojan
killall -q -9 ipt2socks
killall -q -9 ssr-server
killall -q -9 kcptun-client
killall -q -9 ssr-local
if [ -f /var/run/pdnsd.pid ] ;then
kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1
else
kill -9 $(busybox ps -w | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1
fi
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then
rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
del_cron
}

View File

@ -1,159 +0,0 @@
#!/bin/sh
#
# Copyright (C) 2017 openwrt-ssr
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
NAME=vssr
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_get_by_type() {
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
echo ${ret:=$3}
}
server_process_count=$1
redir_tcp_process=$2
redir_udp_process=$3
tunnel_process=$4
kcp_process=$5
local_process=$6
pdnsd_process=$7
if [ -z "$pdnsd_process" ] ;then
pdnsd_process=0
fi
i=0
GLOBAL_SERVER=$(uci_get_by_type global global_server)
server=$(uci_get_by_name $GLOBAL_SERVER server)
lkcp_port=$(uci_get_by_name $GLOBAL_SERVER kcp_port)
server_port=$(uci_get_by_name $GLOBAL_SERVER server_port)
password=$(uci_get_by_name $GLOBAL_SERVER kcp_password)
kcp_param=$(uci_get_by_name $GLOBAL_SERVER kcp_param)
[ "$password" != "" ] && password="--key "${password}
sock5_port=$(uci_get_by_type socks5_proxy local_port 1080)
if echo $server|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
server=${server}
else
server=`cat /etc/ssr_ip`
fi
while [ "1" = "1" ] #死循环
do
sleep 30
#redir tcp
if [ $redir_tcp_process -gt 0 ] ;then
icount=`busybox ps -w | grep ssr-retcp |grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr redir tcp error.restart!"
/etc/init.d/vssr restart
exit 0
fi
fi
#redir udp
if [ $redir_udp_process -gt 0 ] ;then
icount=`busybox ps -w | grep ssr-reudp|grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr redir udp error.restart!"
/etc/init.d/vssr restart
exit 0
fi
fi
#tunnel
if [ $tunnel_process -gt 0 ] ;then
icount=`busybox ps -w | grep ssr-tunnel |grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr tunnel error.restart!"
/etc/init.d/vssr restart
exit 0
fi
fi
#server
if [ $server_process_count -gt 0 ] ;then
icount=`busybox ps -w | grep ssr-server |grep -v grep| wc -l`
if [ $icount -lt $server_process_count ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr server error.restart!"
killall -q -9 ssr-server
for i in `seq $server_process_count`
do
/usr/bin/ssr-server -c /var/etc/vssr_$i.json -u -f /var/run/ssr-server$i.pid
done
fi
fi
#kcptun
if [ $kcp_process -gt 0 ] ;then
icount=`busybox ps -w | grep kcptun-client |grep -v grep| wc -l`
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr kcptun error.restart!"
killall -q -9 kcptun-client
( /usr/bin/kcptun-client -r $server:$kcp_port -l :$server_port $password $kcp_param &)
fi
fi
#local
if [ $local_process -eq 1 ] ;then
icount=`ps -w | grep ssr-local |grep -v grep| wc -l`
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr local error.restart!" >> ${logfile}
killall -q -9 ssr-local
( /usr/bin/ssr-local -c /var/etc/vssr_s.json -u -l $sock5_port -f /var/run/ssr-local.pid &)
fi
fi
#local
if [ $local_process -eq 2 ] ;then
local_processs=1
icount=`ps -w | grep ss-local |grep -v grep| wc -l`
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ss local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ss local error.restart!" >> ${logfile}
killall -q -9 ss-local
( /usr/bin/ss-local -c /var/etc/vssr_s.json -u -l $sock5_port -f /var/run/ss-local.pid &)
fi
fi
#local
if [ $local_process -eq 3 ] ;then
local_processs=1
icount=`ps -w | grep v2-ssr-local |grep -v grep| wc -l`
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
then
logger -t "$NAME" "v2ray local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray local error.restart!" >> ${logfile}
kill -9 $(ps | grep v2-ssr-local | grep -v grep | awk '{print $1}') >/dev/null 2>&1
( /usr/bin/v2ray/v2ray -config /var/etc/v2-ssr-local.json >/dev/null 2>&1 &)
fi
fi
#pdnsd
if [ $pdnsd_process -gt 0 ] ;then
icount=`busybox ps -w | grep pdnsd |grep -v grep| wc -l`
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "pdnsd tunnel error.restart!"
if [ -f /var/run/pdnsd.pid ] ;then
kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1
else
kill -9 $(ps | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1
fi
( /usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d &)
fi
fi
done

View File

@ -1,180 +0,0 @@
local ucursor = require"luci.model.uci".cursor()
local name = "vssr"
local json = require "luci.jsonc"
local server_section = arg[1]
local proto = arg[2]
local local_port = arg[3]
local host = arg[4]
local v2ray_flow = ucursor:get_first(name, 'global', 'v2ray_flow', '0')
local youtube_server = ucursor:get_first(name, 'global', 'youtube_server')
local tw_video_server = ucursor:get_first(name, 'global', 'tw_video_server')
local netflix_server = ucursor:get_first(name, 'global', 'netflix_server')
local disney_server = ucursor:get_first(name, 'global', 'disney_server')
local prime_server = ucursor:get_first(name, 'global', 'prime_server')
function gen_outbound(server_node, tags)
local bound = {}
if server_node == "nil" then
bound = nil
else
local server = ucursor:get_all(name, server_node)
bound = {
tag = tags,
protocol = "vmess",
settings = {
vnext = {
{
address = server.server,
port = tonumber(server.server_port),
users = {
{
id = server.vmess_id,
alterId = tonumber(server.alter_id),
security = server.security
}
}
}
}
},
-- 底层传输配置
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {
allowInsecure = (server.insecure == "1") and true or false,
serverName = server.ws_host
},
kcpSettings = (server.transport == "kcp") and {
mtu = tonumber(server.mtu),
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
readBufferSize = tonumber(server.read_buffer_size),
writeBufferSize = tonumber(server.write_buffer_size),
header = {type = server.kcp_guise}
} or nil,
wsSettings = (server.transport == "ws") and
(server.ws_path ~= nil or server.ws_host ~= nil) and {
path = server.ws_path,
headers = (server.ws_host ~= nil) and
{Host = server.ws_host} or nil
} or nil,
httpSettings = (server.transport == "h2") and
{path = server.h2_path, host = server.h2_host} or nil,
quicSettings = (server.transport == "quic") and {
security = server.quic_security,
key = server.quic_key,
header = {type = server.quic_guise}
} or nil
},
mux = {
enabled = (server.mux == "1") and true or false,
concurrency = tonumber(server.concurrency)
}
}
end
return bound
end
local outbounds_table = {}
table.insert(outbounds_table, gen_outbound(server_section, "main"))
if v2ray_flow == "1" then
table.insert(outbounds_table, gen_outbound(youtube_server, "youtube"))
table.insert(outbounds_table, gen_outbound(tw_video_server, "twvideo"))
table.insert(outbounds_table, gen_outbound(netflix_server, "netflix"))
table.insert(outbounds_table, gen_outbound(disney_server, "disney"))
table.insert(outbounds_table, gen_outbound(prime_server, "prime"))
end
-- rules gen
local youtube_rule = {
type = "field",
domain = {"youtube", "googlevideo.com", "gvt2.com", "youtu.be"},
outboundTag = "youtube"
}
local tw_video_rule = {
type = "field",
domain = {
"vidol.tv", "hinet.net", "books.com", "litv.tv", "pstatic.net",
"app-measurement.com", "kktv.com.tw", "gamer.com.tw"
},
outboundTag = "twvideo"
}
local netflix_rule = {
type = "field",
domain = {
"netflix.com", "netflix.net", "nflxso.net", "nflxext.com",
"nflximg.com", "nflximg.net", "nflxvideo.net"
},
ip = {
"23.246.0.0/12", "37.77.0.0/12", "45.57.0.0/12", "64.120.128.0/17",
"66.197.128.0/17", "108.175.0.0/12", "185.2.0.0/12", "185.9.188.0/22",
"192.173.64.0/18", "198.38.0.0/12", "198.45.0.0/12"
},
outboundTag = "netflix"
}
local disney_rule = {
type = "field",
domain = {
"cdn.registerdisney.go.com", "disneyplus.com", "disney-plus.net",
"dssott.com", "bamgrid.com", "execute-api.us-east-1.amazonaws.com"
},
outboundTag = "disney"
}
local prime_rule = {
type = "field",
domain = {"aiv-cdn.net", "amazonaws.com", "amazonvideo.com", "llnwd.net"},
outboundTag = "prime"
}
local rules_table = {}
if (youtube_server ~= "nil" and v2ray_flow == "1") then
table.insert(rules_table, youtube_rule)
end
if (tw_video_server ~= "nil" and v2ray_flow == "1") then
table.insert(rules_table, tw_video_rule)
end
if (netflix_server ~= "nil" and v2ray_flow == "1") then
table.insert(rules_table, netflix_rule)
end
if (disney_server ~= "nil" and v2ray_flow == "1") then
table.insert(rules_table, disney_rule)
end
if (prime_server ~= "nil" and v2ray_flow == "1") then
table.insert(rules_table, prime_rule)
end
local v2ray = {
log = {
-- error = "/var/ssrplus.log",
loglevel = "warning"
},
-- 传入连接
inbounds = {
{
port = local_port,
protocol = "dokodemo-door",
settings = {network = proto, followRedirect = true},
sniffing = {enabled = true, destOverride = {"http", "tls"}}
}
},
-- 传出连接
outbounds = outbounds_table,
routing = {domainStrategy = "IPIfNonMatch", rules = rules_table}
}
print(json.stringify(v2ray, 1))

View File

@ -1,17 +1,25 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr-coexist
PKG_VERSION:=1.07
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.09
PKG_RELEASE:=20200217-4
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnscrypt_proxy \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_haproxy \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_privoxy \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs\
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server\
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-client\
@ -21,7 +29,6 @@ PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/config
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
bool "Include Shadowsocks New Version"
default y
@ -29,72 +36,112 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
bool "Include V2ray"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
bool "Include Trojan"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
bool "Include Kcptun"
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks
bool "Include Shadowsocks Socks and Tunnel"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
bool "Include ShadowsocksR Server"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server
bool "Include Shadowsocks Server"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
bool "Include ShadowsocksR Socks and Tunnel"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks
bool "Include Shadowsocks Socks and Tunnel"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks
bool "Include ipt2socks"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_dnscrypt_proxy
bool "Include dnscrypt-proxy-full"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder
bool "Include dnsforwarder"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS
bool "Include chinadns"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_haproxy
bool "Include haproxy"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_privoxy
bool "Include privoxy http local"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs
bool "Include simple-obfsl"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server
bool "Include simple-obfs-server"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder
bool "Include udpspeeder"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel
bool "Include udp2raw-tunnel"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-client
bool "Include GoQuiet-client"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-server
bool "Include GoQuiet-server"
default n
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin
bool "Include v2ray-plugin"
default y
default y
endef
define Package/luci-app-vssr-coexist
define Package/luci-app-vssr
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=A New SS/SSR/V2Ray/Trojan LuCI interface
PKGARCH:=all
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +luasocket +jshn +lua-cjson +coreutils-nohup +python3-maxminddb +curl\
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +luasocket +jshn +lua-cjson +coreutils-nohup +python3-maxminddb +curl \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
+PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks:ipt2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs:simple-obfs \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server:shadowsocks-libev-ss-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks:shadowsocks-libev-ss-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks:ipt2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_dnscrypt_proxy:dnscrypt-proxy-full \
+PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder:dnsforwarder \
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS:ChinaDNS \
+PACKAGE_$(PKG_NAME)_INCLUDE_haproxy:haproxy \
+PACKAGE_$(PKG_NAME)_INCLUDE_privoxy:privoxy \
+PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder:udpspeeder \
+PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel:udp2raw-tunnel \
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs:simple-obfs \
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server:simple-obfs-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-client:gq-client \
+PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-server:gq-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks:shadowsocks-libev-ss-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local
+PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-server:gq-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin:v2ray-plugin
endef
define Build/Prepare
@ -103,12 +150,12 @@ endef
define Build/Compile
endef
define Package/luci-app-vssr-coexist/conffiles
define Package/luci-app-vssr/conffiles
/etc/ssr_ip
/etc/dnsmasq.ssr/gfw_list.conf
endef
define Package/luci-app-vssr-coexist/install
define Package/luci-app-vssr/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
$(INSTALL_DIR) $(1)/
@ -117,7 +164,7 @@ define Package/luci-app-vssr-coexist/install
po2lmo ./po/zh-cn/vssr.po $(1)/usr/lib/lua/luci/i18n/vssr.zh-cn.lmo
endef
define Package/luci-app-vssr-coexist/postinst
define Package/luci-app-vssr/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/uci-defaults/luci-vssr ) && rm -f /etc/uci-defaults/luci-vssr
@ -128,7 +175,7 @@ fi
exit 0
endef
define Package/luci-app-vssr-coexist/prerm
define Package/luci-app-vssr/prerm
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/vssr disable
@ -137,5 +184,6 @@ fi
exit 0
endef
$(eval $(call BuildPackage,luci-app-vssr-coexist))
$(eval $(call BuildPackage,luci-app-vssr))

View File

@ -19,13 +19,20 @@ end
entry({"admin", "vpn", "vssr", "servers"},
arcombine(cbi("vssr/servers"), cbi("vssr/client-config")),
_("Node List"), 11).leaf = true -- 编辑节点
entry({"admin", "vpn", "vssr", "subscription"},cbi("vssr/subscription"), _("Subscription"),12).leaf = true
entry({"admin", "vpn", "vssr", "subscription"},cbi("vssr/subscription"),
_("Subscription"),12).leaf = true
entry({"admin", "vpn", "vssr", "control"}, cbi("vssr/control"),
_("Access Control"), 13).leaf = true -- 访问控制
entry({"admin", "vpn", "vssr", "servers-list"}, cbi("vssr/servers-list"),
_("Severs Nodes"), 14).leaf = true
entry({"admin", "vpn", "vssr", "appointlist"},form("vssr/appointlist"),
_("Appointlist List"), 15).leaf = true
entry({"admin", "vpn", "vssr", "udp2raw"},cbi("vssr/udp2raw"),
_("udp2raw tunnel"),16).leaf = true
entry({"admin", "vpn", "vssr", "advanced"}, cbi("vssr/advanced"),
_("Advanced Settings"), 15).leaf = true -- 高级设置
_("Advanced Settings"), 17).leaf = true -- 高级设置
elseif nixio.fs.access("/usr/bin/ssr-server") then
entry({"admin", "vpn", "vssr"},
alias("admin", "vpn", "vssr", "server"), _("vssr"), 10).dependent =
@ -53,6 +60,7 @@ entry({"admin", "vpn", "vssr", "status"},form("vssr/status"),_("Status"), 23).le
entry({"admin", "vpn", "vssr", "subscribe"}, call("get_subscribe")) -- 执行订阅
entry({"admin", "vpn", "vssr", "flag"}, call("get_flag")) -- 获取节点国旗 iso code
entry({"admin", "vpn", "vssr", "ip"}, call("check_ip")) -- 获取ip情况
end
-- 执行订阅
@ -137,8 +145,72 @@ function act_status()
local e = {}
-- 全局服务器
e.global=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0
-- 检测PDNSD状态
e.pdnsd = luci.sys.call("pidof pdnsd >/dev/null") == 0
--检测负载均衡状态
if tonumber(luci.sys.exec("ps -w | grep haproxy |grep -v grep| wc -l"))>0 then
e.haproxy= true
end
--检测kcptun状态
if tonumber(luci.sys.exec("ps -w | grep kcptun-client |grep -v grep| wc -l"))>0 then
e.kcptun= true
end
--检测HTTP代理状态
if luci.sys.call("pidof privoxy >/dev/null") == 0 then
e.privoxy= true
end
--检测chinadns状态
if tonumber(luci.sys.exec("ps -w | grep chinadns |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsparsing |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnscrypt-proxy |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep pdnsd |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsforwarder |grep -v grep| wc -l"))>0 then
e.chinadns= true
end
--检测SOCKS5状态
if tonumber(luci.sys.exec("ps -w | grep ssr-local |grep -v grep| wc -l"))>0 then
e.SOCKS5= true
elseif tonumber(luci.sys.exec("ps -w | grep ss-local |grep -v grep| wc -l"))>0 then
e.SOCKS5= true
elseif tonumber(luci.sys.exec("ps -w | grep v2-ssr-local |grep -v grep| wc -l"))>0 then
e.SOCKS5= true
elseif tonumber(luci.sys.exec("ps -w | grep trojan-ssr-local |grep -v grep| wc -l"))>0 then
e.SOCKS5= true
end
--检测UDP2RAW状态
if tonumber(luci.sys.exec("ps -w | grep udp2raw |grep -v grep| wc -l"))>0 then
e.udp2raw= true
end
--检测UDPspeeder状态
if tonumber(luci.sys.exec("ps -w | grep udpspeeder |grep -v grep| wc -l"))>0 then
e.udpspeeder= true
end
--检测服务端状态
if tonumber(luci.sys.exec("ps -w | grep ssr-server |grep -v grep| wc -l"))>0 then
e.server= true
end
if luci.sys.call("pidof ssr-server >/dev/null") == 0 then
e.ssr_server= true
end
if luci.sys.call("pidof ss-server >/dev/null") == 0 then
e.ss_server= true
end
if luci.sys.call("ps -w | grep trojan-server | grep -v grep >/dev/null") == 0 then
e.trojan_server= true
end
if luci.sys.call("ps -w | grep v2ray-server | grep -v grep >/dev/null") == 0 then
e.v2_server= true
end
-- 检测游戏模式状态
e.game = false
if tonumber(luci.sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l"))>0 then

View File

@ -5,7 +5,6 @@ local server_table = {}
local gfwmode=0
local gfw_count=0
local ip_count=0
local ad_count = 0
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
gfwmode=1
@ -68,6 +67,32 @@ o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 3
-- [[ adblock ]]--
s = m:section(TypedSection, "global", translate("adblock settings"))
s.anonymous = true
o = s:option(Flag, "adblock", translate("Enable adblock"))
o.rmempty = false
-- [[ haProxy ]]--
s = m:section(TypedSection, "global_haproxy", translate("haProxy settings"))
s.anonymous = true
o = s:option(Flag, "admin_enable", translate("Enabling the Management Console"))
o.rmempty = false
o.default = 1
o = s:option(Value, "admin_port", translate("Service Port"))
o.datatype = "uinteger"
o.default = 1111
o = s:option(Value, "admin_user", translate("User name"))
o.default = "admin"
o = s:option(Value, "admin_password", translate("Password"))
o.default = "root"
-- [[ SOCKS5 Proxy ]]--
if nixio.fs.access("/usr/bin/ssr-local") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))
@ -84,17 +109,25 @@ o.datatype = "port"
o.default = 1080
o.rmempty = false
end
-- [[ adblock ]]--
s = m:section(TypedSection, "global", translate("adblock settings"))
s.anonymous = true
o = s:option(Flag, "adblock", translate("Enable adblock"))
-- [[ HTTP Proxy ]]--
if nixio.fs.access("/usr/sbin/privoxy") then
o = s:option(Flag, "http_enable", translate("Enable HTTP Proxy"))
o.rmempty = false
o = s:option(Value, "http_port", translate("HTTP Port"))
o.datatype = "port"
o.default = 1081
o.rmempty = false
end
end
return m

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/etc/dnsmasq.ssr/appoint_list.conf"
f = SimpleForm("custom", translate("Appoint dns List"))
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/dnsmasq restart")
end
end
return true
end
return f

View File

@ -105,6 +105,8 @@ o.rmempty = true
o:depends("type", "ssr")
o:depends("type", "ss")
o:depends("type", "trojan")
o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
for _, v in ipairs(encrypt_methods) do o:value(v) end
o.rmempty = true
@ -115,6 +117,8 @@ for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
o.rmempty = true
o:depends("type", "ss")
-- Shadowsocks Plugin
o = s:option(ListValue, "plugin", translate("plugin"))
o:value("none", "None")
if nixio.fs.access("/usr/bin/v2ray-plugin") then

View File

@ -4,7 +4,6 @@
local m, s, sec, o, kcp_enable
local vssr = "vssr"
local gfw_count=0
local ad_count=0
local ip_count=0
@ -41,8 +40,7 @@ uci:foreach(vssr, "servers", function(s)
elseif s.server and s.server_port then
server_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
end
if s.type == "v2ray" then
if s.type == "v2ray" then
if s.alias then
v2ray_table[s[".name"]] = "[%s]:%s" %{string.upper(s.type), s.alias}
elseif s.server and s.server_port then
@ -66,11 +64,16 @@ end
table.sort(key_table_v2)
-- [[ Global Setting ]]--
s = m:section(TypedSection, "global",translate("Basic Settings"))
s = m:section(TypedSection, "global", translate("Basic Settings"))
s.anonymous = true
o = s:option(ListValue, "global_server", translate("Main Server"))
o:value("nil", translate("Disable"))
if nixio.fs.access("/usr/sbin/haproxy")then
o:value("__haproxy__", translate("Load Balancing"))
end
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
o.default = "nil"
o.rmempty = false
@ -80,6 +83,7 @@ o:value("", translate("Disable"))
o:value("same", translate("Same as Global Server"))
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
o = s:option(Flag, "v2ray_flow", translate("Open v2ray split-flow"))
o.rmempty = false
o.description = translate("When open v2ray split-flow,your main server must be a v2ray server")
@ -131,20 +135,53 @@ o.rmempty = false
o = s:option(ListValue, "run_mode", translate("Running Mode"))
o:value("gfw", translate("GFW List Mode"))
o:value("router", translate("IP Route Mode"))
o:value("routers", translate("Oversea IP Route Mode"))
o:value("oversea", translate("Oversea GFW List Mode"))
o:value("all", translate("Global Mode"))
o:value("oversea", translate("Oversea Mode"))
o.default = "router"
o = s:option(ListValue, "dports", translate("Proxy Ports"))
o:value("1", translate("All Ports"))
o:value("2", translate("Only Common Ports"))
o.default = 1
o.default = gfw
o = s:option(ListValue, "pdnsd_enable", translate("Resolve Dns Mode"))
o:value("1", translate("Use Pdnsd tcp query and cache"))
o:value("0", translate("Use Local DNS Service listen port 5335"))
o:value("1", translate("Use Pdnsd tcp query and cache"))
o:value("2", translate("Use Pdnsd udp query and cache"))
if nixio.fs.access("/usr/bin/dnsforwarder") then
o:value("3", translate("Use dnsforwarder tcp query and cache"))
o:value("4", translate("Use dnsforwarder udp query and cache"))
end
if nixio.fs.access("/usr/bin/dnscrypt-proxy") then
o:value("5", translate("Use dnscrypt-proxy query and cache"))
end
if nixio.fs.access("/usr/bin/chinadns") then
o:value("6", translate("Use chinadns query and cache"))
end
o.default = 1
o = s:option(ListValue, "chinadns_enable", translate("Chiadns Resolve Dns Mode"))
o:value("0", translate("Use Local DNS Service"))
o:value("1", translate("Use Pdnsd tcp query and cache"))
o:value("2", translate("Use Pdnsd udp query and cache"))
if nixio.fs.access("/usr/bin/dnsforwarder") then
o:value("3", translate("Use dnsforwarder tcp query and cache"))
o:value("4", translate("Use dnsforwarder udp query and cache"))
end
if nixio.fs.access("/usr/bin/dnscrypt-proxy") then
o:value("5", translate("Use dnscrypt-proxy query and cache"))
end
if nixio.fs.access("/usr/sbin/smartdns") then
o:value("6", translate("Use smartdns query and cache"))
end
if nixio.fs.access("/usr/sbin/https_dns_proxy") then
o:value("7", translate("Use https_dns_proxy query and cache"))
end
o.default = 1
o:depends("pdnsd_enable", "6")
o = s:option(Value, "tunnel_forward", translate("Anti-pollution DNS Server"))
o:value("0.0.0.0:53", translate("Using System Default DNS"))
o:value("0.0.0.0:5333", translate("Using acceleration center DNS"))
o:value("8.8.4.4:53", translate("Google Public DNS (8.8.4.4)"))
o:value("8.8.8.8:53", translate("Google Public DNS (8.8.8.8)"))
o:value("208.67.222.222:53", translate("OpenDNS (208.67.222.222)"))
@ -159,6 +196,23 @@ o:value("1.1.1.1:53", translate("Cloudflare DNS (1.1.1.1)"))
o:value("114.114.114.114:53", translate("Oversea Mode DNS-1 (114.114.114.114)"))
o:value("114.114.115.115:53", translate("Oversea Mode DNS-2 (114.114.115.115)"))
o:depends("pdnsd_enable", "1")
o:depends("pdnsd_enable", "2")
o:depends("pdnsd_enable", "3")
o:depends("pdnsd_enable", "4")
o:depends("pdnsd_enable", "6")
o.default = "8.8.4.4:53"
o = s:option(Flag, "bt", translate("Kill BT"))
o.default = 0
o.rmempty = false
o.description = translate("Prohibit downloading tool ports through proxy")
o = s:option(Value, "bt_port", translate("BT Port"))
o.default = "1236:65535"
o.rmempty = true
o:depends("bt", "1")
o = s:option(Button,"gfw_data",translate("GFW List Data"))
o.rawhtml = true
@ -179,5 +233,4 @@ o = s:option(Button,"check_port",translate("Check Server Port"))
o.template = "vssr/checkport"
o.value =translate("No Check")
m:section(SimpleSection).template = "vssr/status2"
return m

View File

@ -0,0 +1,378 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local m, s, o
local vssr = "vssr"
local uci = luci.model.uci.cursor()
local fs = require "nixio.fs"
local sys = require "luci.sys"
local sid = arg[1]
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
local http = luci.http
local ucursor = require "luci.model.uci".cursor()
local server_table = {}
local encrypt_methods = {
"none",
"table",
"rc4",
"rc4-md5-6",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
}
local encrypt_methods_ss = {
-- aead
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
-- stream
"table",
"rc4",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
}
local protocol = {
"origin",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"auth_chain_b",
"auth_chain_c",
"auth_chain_d",
"auth_chain_e",
"auth_chain_f",
}
obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
}
local obfs_opts = {
"none",
"http",
"tls",
}
local securitys = {
"auto",
"none",
"aes-128-gcm",
"chacha20-poly1305"
}
m = Map(vssr, translate("Edit vssr Server"))
m.redirect = luci.dispatcher.build_url("admin/vpn/vssr/server")
if m.uci:get(vssr, sid) ~= "server_config" then
luci.http.redirect(m.redirect)
return
end
-- [[ Server Setting ]]--
s = m:section(NamedSection, sid, "server_config")
s.anonymous = true
s.addremove = false
o = s:option(Flag, "enable", translate("Enable"))
o.default = 1
o.rmempty = false
o = s:option(ListValue, "type", translate("Server Node Type"))
if nixio.fs.access("/usr/bin/ssr-server") then
o:value("ssr", translate("ShadowsocksR"))
end
if nixio.fs.access("/usr/bin/ss-server") then
o:value("ss", translate("Shadowsocks New Version"))
end
if nixio.fs.access("/usr/bin/v2ray/v2ray") then
o:value("v2ray", translate("V2Ray"))
end
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
o = s:option(Flag, "ipv4_ipv6", translate("Enabling IPv6 server"))
o.default = 0
o.rmempty = false
o = s:option(Value, "server_port", translate("Server Port"))
o.datatype = "port"
o.default = 8388
o.rmempty = false
o = s:option(Value, "timeout", translate("Connection Timeout"))
o.datatype = "uinteger"
o.default = 60
o.rmempty = false
o = s:option(Value, "password", translate("Password"))
o.password = true
o.rmempty = true
o:depends("type", "ssr")
o:depends("type", "ss")
o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
for _, v in ipairs(encrypt_methods) do o:value(v) end
o.rmempty = true
o:depends("type", "ssr")
o:depends("type", "ss")
o = s:option(ListValue, "plugin", translate("plugin"))
o:value("none", "None")
if nixio.fs.access("/usr/bin/v2ray-plugin") then
o:value("/usr/bin/v2ray-plugin", "v2ray-plugin")
end
if nixio.fs.access("/usr/bin/obfs-server") then
o:value("/usr/bin/obfs-server", "obfs-server")
end
if nixio.fs.access("/usr/bin/gq-server") then
o:value("/usr/bin/gq-server", "GoQuiet")
end
o.rmempty = false
o.default = "none"
o:depends("type", "ss")
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
o.rmempty = true
o:depends("plugin", "/usr/bin/v2ray-plugin")
o:depends("plugin", "/usr/bin/obfs-server")
o:depends("plugin", "/usr/bin/gq-server")
o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = true
o:depends("type", "ssr")
o = s:option(ListValue, "obfs", translate("Obfs"))
for _, v in ipairs(obfs) do o:value(v) end
o.rmempty = true
o:depends("type", "ssr")
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
o:depends("type", "ssr")
-- AlterId
o = s:option(Value, "alter_id", translate("AlterId"))
o.default = 100
o.rmempty = true
o:depends("type", "v2ray")
o=s:option(Value,"VMess_level",translate("User Level"))
o.default=1
o:depends("type", "v2ray")
-- VmessId
o = s:option(Value, "vmess_id", translate("VmessId (UUID)"))
o.rmempty = true
o.default = uuid
o:depends("type", "v2ray")
-- 加密方式
o = s:option(ListValue, "security", translate("Encrypt Method"))
for _, v in ipairs(securitys) do o:value(v, v:upper()) end
o.rmempty = true
o:depends("type", "v2ray")
-- 传输协议
o = s:option(ListValue, "transport", translate("Transport"))
o:value("tcp", "TCP")
o:value("kcp", "mKCP")
o:value("ws", "WebSocket")
o:value("h2", "HTTP/2")
o:value("quic", "QUIC")
o.rmempty = true
o:depends("type", "v2ray")
-- [[ TCP部分 ]]--
-- TCP伪装
o = s:option(ListValue, "tcp_guise", translate("Camouflage Type"))
o:depends("transport", "tcp")
o:value("none", translate("None"))
o:value("http", "HTTP")
o.rmempty = true
-- HTTP域名
o = s:option(DynamicList, "http_host", translate("HTTP Host"))
o:depends("tcp_guise", "http")
o.rmempty = true
-- HTTP路径
o = s:option(DynamicList, "http_path", translate("HTTP Path"))
o:depends("tcp_guise", "http")
o.rmempty = true
-- [[ WS部分 ]]--
-- WS域名
o = s:option(Value, "ws_host", translate("WebSocket Host"))
o:depends("transport", "ws")
o.rmempty = true
-- WS路径
o = s:option(Value, "ws_path", translate("WebSocket Path"))
o:depends("transport", "ws")
o.rmempty = true
-- [[ H2部分 ]]--
-- H2域名
o = s:option(DynamicList, "h2_host", translate("HTTP/2 Host"))
o:depends("transport", "h2")
o.rmempty = true
-- H2路径
o = s:option(Value, "h2_path", translate("HTTP/2 Path"))
o:depends("transport", "h2")
o.rmempty = true
-- [[ QUIC部分 ]]--
o = s:option(ListValue, "quic_security", translate("QUIC Security"))
o:depends("transport", "quic")
o.rmempty = true
o:value("none", translate("None"))
o:value("aes-128-gcm", translate("aes-128-gcm"))
o:value("chacha20-poly1305", translate("chacha20-poly1305"))
o = s:option(Value, "quic_key", translate("QUIC Key"))
o:depends("transport", "quic")
o.rmempty = true
o = s:option(ListValue, "quic_guise", translate("Header"))
o:depends("transport", "quic")
o.rmempty = true
o:value("none", translate("None"))
o:value("srtp", translate("VideoCall (SRTP)"))
o:value("utp", translate("BitTorrent (uTP)"))
o:value("wechat-video", translate("WechatVideo"))
o:value("dtls", "DTLS 1.2")
o:value("wireguard", "WireGuard")
-- [[ mKCP部分 ]]--
o = s:option(ListValue, "kcp_guise", translate("Camouflage Type"))
o:depends("transport", "kcp")
o:value("none", translate("None"))
o:value("srtp", translate("VideoCall (SRTP)"))
o:value("utp", translate("BitTorrent (uTP)"))
o:value("wechat-video", translate("WechatVideo"))
o:value("dtls", "DTLS 1.2")
o:value("wireguard", "WireGuard")
o.rmempty = true
o = s:option(Value, "mtu", translate("MTU"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 1350
o.rmempty = true
o = s:option(Value, "tti", translate("TTI"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 50
o.rmempty = true
o = s:option(Value, "uplink_capacity", translate("Uplink Capacity"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 50
o.rmempty = true
o = s:option(Value, "downlink_capacity", translate("Downlink Capacity"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 20
o.rmempty = true
o = s:option(Value, "read_buffer_size", translate("Read Buffer Size"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 2
o.rmempty = true
o = s:option(Value, "write_buffer_size", translate("Write Buffer Size"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o.default = 2
o.rmempty = true
o = s:option(Flag, "congestion", translate("Congestion"))
o:depends("transport", "kcp")
o.rmempty = true
-- [[ allowInsecure ]]--
o = s:option(Flag, "insecure", translate("allowInsecure"))
o.rmempty = true
o:depends("type", "v2ray")
-- [[ TLS ]]--
o = s:option(Flag, "tls", translate("TLS"))
o.rmempty = true
o.default = "0"
o:depends("type", "v2ray")
-- [[ Mux ]]--
o = s:option(Flag, "mux", translate("Mux"))
o.rmempty = true
o.default = "0"
o:depends("type", "v2ray")
o = s:option(Value, "concurrency", translate("Concurrency"))
o.datatype = "uinteger"
o.rmempty = true
o.default = "8"
o:depends("mux", "1")
o = s:option(Flag, "fast_open", translate("TCP Fast Open"))
o.rmempty = true
o:depends("type", "ssr")
return m

View File

@ -6,8 +6,13 @@ local vssr = "vssr"
local uci = luci.model.uci.cursor()
local ipkg = require("luci.model.ipkg")
m = Map(vssr, translate("vssr Server"))
m = Map(vssr)
m:section(SimpleSection).template = "vssr/status3"
local type = {
"ssr",
"ss",
"v2ray",
}
local encrypt_methods = {
"table",
@ -19,7 +24,10 @@ local encrypt_methods = {
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"aes-256-ctr",
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
@ -32,6 +40,8 @@ local encrypt_methods = {
"salsa20",
"chacha20",
"chacha20-ietf",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
}
local protocol = {
@ -43,7 +53,7 @@ local protocol = {
"auth_chain_a",
}
obfs = {
local obfs = {
"plain",
"http_simple",
"http_post",
@ -54,14 +64,10 @@ obfs = {
-- [[ Global Setting ]]--
sec = m:section(TypedSection, "server_global", translate("Global Setting"))
sec.anonymous = true
o = sec:option(Flag, "enable_server", translate("Enable Server"))
o.rmempty = false
@ -69,6 +75,7 @@ o.rmempty = false
sec = m:section(TypedSection, "server_config", translate("Server Setting"))
sec.anonymous = true
sec.addremove = true
sec.sortable = true
sec.template = "cbi/tblsection"
sec.extedit = luci.dispatcher.build_url("admin/vpn/vssr/server/%s")
function sec.create(...)
@ -85,30 +92,25 @@ function o.cfgvalue(...)
end
o.rmempty = false
o = sec:option(DummyValue, "type", translate("Server Node Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
o = sec:option(DummyValue, "server_port", translate("Server Port"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
o = sec:option(DummyValue, "encrypt_method", translate("Encrypt Method"))
function o.cfgvalue(...)
local v = Value.cfgvalue(...)
return v and v:upper() or "?"
end
o.width="10%"
o = sec:option(DummyValue, "protocol", translate("Protocol"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
o.width="10%"
o = sec:option(DummyValue, "obfs", translate("Obfs"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
o.width="10%"
m:append(Template("vssr/server_list"))
return m

View File

@ -0,0 +1,369 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local IPK_Version="20200217.1.08"
local m, s, o
local redir_run=0
local reudp_run=0
local sock5_run=0
local ssock5_run=0
local v2sock5_run=0
local server_run=0
local sserver_run=0
local v2server_run=0
local kcptun_run=0
local tunnel_run=0
local udp2raw_run=0
local udpspeeder_run=0
local gfw_count=0
local ad_count=0
local ip_count=0
local gfwmode=0
local pdnsd_run=0
local dnsforwarder_run=0
local dnscrypt_proxy_run=0
local chinadns_run=0
local haproxy_run=0
local privoxy_run=0
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
gfwmode=1
end
local vssr= "vssr"
-- html constants
font_blue = [[<font color="green">]]
font_off = [[</font>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
local fs = require "nixio.fs"
local sys = require "luci.sys"
local kcptun_version=translate("Unknown")
local kcp_file="/usr/bin/kcptun-client"
if not fs.access(kcp_file) then
kcptun_version=translate("Not exist")
else
if not fs.access(kcp_file, "rwx", "rx", "rx") then
fs.chmod(kcp_file, 755)
end
kcptun_version=sys.exec(kcp_file .. " -v | awk '{printf $3}'")
if not kcptun_version or kcptun_version == "" then
kcptun_version = translate("Unknown")
end
end
local udp2raw_version=translate("Unknown")
local udp2raw_file="/usr/bin/udp2raw"
if not fs.access(udp2raw_file) then
udp2raw_version=translate("Not exist")
else
if not fs.access(udp2raw_file, "rwx", "rx", "rx") then
fs.chmod(udp2raw_file, 755)
end
udp2raw_version=sys.exec(udp2raw_file .. " -h |grep 'git version' |awk -F ':' '{print $2}'|awk '{print $1}'")
if not udp2raw_version or udp2raw_version == "" then
udp2raw_version = translate("Unknown")
end
end
local udpspeeder_version=translate("Unknown")
local udpspeeder_file="/usr/bin/udpspeeder"
if not fs.access(udpspeeder_file) then
udpspeeder_version=translate("Not exist")
else
if not fs.access(udpspeeder_file, "rwx", "rx", "rx") then
fs.chmod(udpspeeder_file, 755)
end
udpspeeder_version=sys.exec(udpspeeder_file .. " -h |grep 'git version' |awk -F ':' '{print $2}'|awk '{print $1}'")
if not udpspeeder_version or udpspeeder_version == "" then
udpspeeder_version = translate("Unknown")
end
end
if gfwmode==1 then
gfw_count = tonumber(sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l"))/2
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
ad_count=tonumber(sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l"))
end
end
if nixio.fs.access("/etc/china_ssr.txt") then
ip_count = sys.exec("cat /etc/china_ssr.txt | wc -l")
end
local icount=sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l")
if tonumber(icount)>0 then
reudp_run=1
else
icount=sys.exec("ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l")
if tonumber(icount)>0 then
reudp_run=1
end
end
if luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0 then
redir_run=1
end
if luci.sys.call("pidof ssr-local >/dev/null") == 0 then
sock5_run=1
end
if luci.sys.call("pidof ss-local >/dev/null") == 0 then
ssock5_run=1
end
if luci.sys.call("ps -w | grep v2-ssr-local | grep -v grep >/dev/null") == 0 then
v2sock5_run=1
end
if luci.sys.call("pidof privoxy >/dev/null") == 0 then
privoxy_run=1
end
if luci.sys.call("pidof kcptun-client >/dev/null") == 0 then
kcptun_run=1
end
if luci.sys.call("pidof ssr-server >/dev/null") == 0 then
server_run=1
end
if luci.sys.call("busybox ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then
tunnel_run=1
end
if luci.sys.call("pidof ss-server >/dev/null") == 0 then
sserver_run=1
end
if luci.sys.call("ps -w | grep v2ray-server | grep -v grep >/dev/null") == 0 then
v2server_run=1
end
if luci.sys.call("ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then
tunnel_run=1
end
if luci.sys.call("pidof udp2raw >/dev/null") == 0 then
udp2raw_run=1
end
if luci.sys.call("pidof udpspeeder >/dev/null") == 0 then
udpspeeder_run=1
end
if luci.sys.call("pidof chinadns >/dev/null") == 0 then
chinadns_run=1
end
if luci.sys.call("pidof pdnsd >/dev/null") == 0 then
pdnsd_run=1
end
if luci.sys.call("pidof dnsparsing >/dev/null") == 0 then
dnsforwarder_run=1
end
if luci.sys.call("pidof dnscrypt-proxy >/dev/null") == 0 then
dnscrypt_proxy_run=1
end
if luci.sys.call("pidof haproxy >/dev/null") == 0 then
haproxy_run=1
end
m = SimpleForm("Version")
m.reset = false
m.submit = false
s=m:field(DummyValue,"redir_run",translate("Global Client"))
s.rawhtml = true
if redir_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"reudp_run",translate("Game Mode UDP Relay"))
s.rawhtml = true
if reudp_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"haproxy_run",translate("Load Balancing"))
s.rawhtml = true
if haproxy_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
if nixio.fs.access("/usr/bin/chinadns") then
s=m:field(DummyValue,"chinadns_run",translate("ChinaDNS"))
s.rawhtml = true
if chinadns_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
s=m:field(DummyValue,"pdnsd_run",translate("PDNSD"))
s.rawhtml = true
if pdnsd_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"dnsforwarder_run",translate("dnsforwarder"))
s.rawhtml = true
if dnsforwarder_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"dnscrypt_proxy_run",translate("dnscrypt_proxy"))
s.rawhtml = true
if dnscrypt_proxy_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
if nixio.fs.access("/usr/bin/ssr-local") then
s=m:field(DummyValue,"sock5_run",translate("SOCKS5 Proxy"))
s.rawhtml = true
if sock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ss-local") then
s=m:field(DummyValue,"ssock5_run",translate("SSOCKS5 Proxy"))
s.rawhtml = true
if ssock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/v2ray/v2ray") then
s=m:field(DummyValue,"ssock5_run",translate("V2SOCKS5 Proxy"))
s.rawhtml = true
if v2sock5_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/sbin/privoxy") then
s=m:field(DummyValue,"privoxy_run",translate("HTTP Proxy"))
s.rawhtml = true
if privoxy_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ssr-server") then
s=m:field(DummyValue,"server_run",translate("Global SSR Server"))
s.rawhtml = true
if server_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ss-server") then
s=m:field(DummyValue,"sserver_run",translate("Global SS Server"))
s.rawhtml = true
if sserver_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/v2ray") then
s=m:field(DummyValue,"v2server_run",translate("Global V2RAY Server"))
s.rawhtml = true
if v2server_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/kcptun-client") then
s=m:field(DummyValue,"kcp_version",translate("KcpTun Version"))
s.rawhtml = true
s.value =kcptun_version
s=m:field(DummyValue,"kcptun_run",translate("KcpTun"))
s.rawhtml = true
if kcptun_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
end
s=m:field(DummyValue,"version",translate("IPK Version"))
s.rawhtml = true
s.value =IPK_Version
s=m:field(DummyValue,"udp2raw_version",translate("udp2raw Version"))
s.rawhtml = true
s.value =udp2raw_version
s=m:field(DummyValue,"udp2raw_run",translate("udp2raw"))
s.rawhtml = true
if udp2raw_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"udpspeeder_version",translate("UDPspeeder Version"))
s.rawhtml = true
s.value =udpspeeder_version
s=m:field(DummyValue,"udpspeeder_run",translate("UDPspeeder"))
s.rawhtml = true
if udpspeeder_run == 1 then
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
else
s.value = translate("Not Running")
end
s=m:field(DummyValue,"feedback",translate("Feedback"))
s.template = "vssr/feedback"
s.value =translate("No feedback")
return m

View File

@ -0,0 +1,197 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com> github.com/ywb94
-- Copyright (C) 2018 lean <coolsnowwolf@gmail.com> github.com/coolsnowwolf
-- Licensed to the public under the GNU General Public License v3.
local m, s, sec, o, kcp_enable
local vssr = "vssr"
m = Map(vssr)
local server_table = {}
local encrypt_methods = {
"none",
"table",
"rc4",
"rc4-md5-6",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
}
local protocol = {
"origin",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"auth_chain_b",
"auth_chain_c",
"auth_chain_d",
"auth_chain_e",
"auth_chain_f",
}
obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
}
local raw_mode = {
"faketcp",
"udp",
"icmp",
}
local seq_mode = {
"0",
"1",
"2",
"3",
"4",
}
local cipher_mode = {
"none",
"xor",
"aes128cbc",
}
local auth_mode = {
"none",
"simple",
"md5",
"crc32",
}
local speeder_mode = {
"0",
"1",
}
-- [[ udp2raw ]]--
if nixio.fs.access("/usr/bin/udp2raw") then
s = m:section(TypedSection, "udp2raw", translate(" UDP2raw "))
s.anonymous = true
o = s:option(Flag, "udp2raw_enable", translate("Enable udp2raw"))
o.default = 0
o.rmempty = false
o = s:option(Value, "server", translate("Server Address"))
o.datatype = "host"
o.rmempty = false
o = s:option(Value, "server_port", translate("Server Port"))
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "local_port", translate("Local Port"))
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "key", translate("Password"))
o.password = true
o.rmempty = false
o = s:option(ListValue, "raw_mode", translate("Raw Mode"))
for _, v in ipairs(raw_mode) do o:value(v) end
o.default = "faketcp"
o.rmempty = false
o = s:option(ListValue, "seq_mode", translate("Seq Mode"))
for _, v in ipairs(seq_mode) do o:value(v) end
o.default = "3"
o.rmempty = false
o = s:option(ListValue, "cipher_mode", translate("Cipher Mode"))
for _, v in ipairs(cipher_mode) do o:value(v) end
o.default = "xor"
o.rmempty = false
o = s:option(ListValue, "auth_mode", translate("Auth Mode"))
for _, v in ipairs(auth_mode) do o:value(v) end
o.default = "simple"
o.rmempty = false
end
-- [[ udpspeeder ]]--
if nixio.fs.access("/usr/bin/udpspeeder") then
s = m:section(TypedSection, "udpspeeder", translate("UDPspeeder"))
s.anonymous = true
o = s:option(Flag, "udpspeeder_enable", translate("Enable UDPspeeder"))
o.default = 0
o.rmempty = false
o = s:option(Value, "server", translate("Server Address"))
o.datatype = "host"
o.rmempty = false
o = s:option(Value, "server_port", translate("Server Port"))
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "local_port", translate("Local Port"))
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "key", translate("Password"))
o.password = true
o.rmempty = false
o = s:option(ListValue, "speeder_mode", translate("Speeder Mode"))
for _, v in ipairs(speeder_mode) do o:value(v) end
o.default = "0"
o.rmempty = false
o = s:option(Value, "fec", translate("Fec"))
o.default = "20:10"
o.rmempty = false
o = s:option(Value, "mtu", translate("Mtu"))
o.datatype = "uinteger"
o.default = 1250
o.rmempty = false
o = s:option(Value, "queue_len", translate("Queue Len"))
o.datatype = "uinteger"
o.default = 200
o.rmempty = false
o = s:option(Value, "timeout", translate("Fec Timeout"))
o.datatype = "uinteger"
o.default = 8
o.rmempty = false
end
return m

View File

@ -0,0 +1,21 @@
</style>
<div class="cbi-value">
<label class="cbi-value-title">udp2raw 项目</label>
<div class="cbi-value-field">
<input type="button" class="cbi-button cbi-input-reload" value="点击前往" onclick="javascript:window.open('https://github.com/wangyu-/udp2raw-tunnel','target');" />
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title">UDPspeeder 项目</label>
<div class="cbi-value-field">
<input type="button" class="cbi-button cbi-input-reload" value="点击前往" onclick="javascript:window.open('https://github.com/wangyu-/UDPspeeder','target');" />
</div>
</div>
</fieldset>
</fieldset>

View File

@ -6,6 +6,7 @@ math.randomseed(os.time())
<head>
<link rel="stylesheet" href="/luci-static/vssr/css/vssr.css??v=<%=math.random(1,100000)%>">
<script src="<%=media%>/js/jquery.min.js"></script>
</head>
<body>
@ -67,11 +68,11 @@ math.randomseed(os.time())
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="pdnsd_status">PDNSD<br /><span class="red"><%:Not Running%></span></h4>
<h4 id="chinadns_status">𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br /><span class="red"><%:Not Running%></span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="/luci-static/vssr/img/pdnsd.svg">
<img src="https://i.imgur.com/3hkGjsK.png" >
</div>
</div>
</div>
@ -79,7 +80,7 @@ math.randomseed(os.time())
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="socks5_status">SOCKS5<br /><span class="red"><%:Not Running%></span></h4>
<h4 id="socks5_status">𝙎𝙊𝘾𝙆𝙎5<br /><span class="red"><%:Not Running%></span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
@ -107,7 +108,7 @@ math.randomseed(os.time())
var tb1 = document.getElementById('google_status');
var tb2 = document.getElementById('baidu_status');
var tb3 = document.getElementById('game_status');
var tb4 = document.getElementById('pdnsd_status');
var tb4 = document.getElementById('chinadns_status');
var tb5 = document.getElementById('socks5_status');
if (data && tb) {
if (data.global) {
@ -130,15 +131,15 @@ math.randomseed(os.time())
} else {
tb3.innerHTML = '<%:Game Mode%><br><span class="red"><%:Not Running%></span>';
}
if (data.pdnsd) {
tb4.innerHTML = 'PDNSD<br><span class="green"><%:Running%></span>';
if (data.chinadns) {
tb4.innerHTML = '𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br><span class="green"><%:Running%></span>';
} else {
tb4.innerHTML = 'PDNSD<br><span class="red"><%:Not Running%></span>';
tb4.innerHTML = '𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br><span class="red"><%:Not Running%></span>';
}
if (data.socks5) {
tb5.innerHTML = 'SOCKS5<br><span class="green"><%:Running%></span>';
tb5.innerHTML = '𝙎𝙊𝘾𝙆𝙎5<br><span class="green"><%:Running%></span>';
} else {
tb5.innerHTML = 'SOCKS5<br><span class="red"><%:Not Running%></span>';
tb5.innerHTML = '𝙎𝙊𝘾𝙆𝙎5<br><span class="red"><%:Not Running%></span>';
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,7 @@ msgstr "停用"
msgid "Enable Servers"
msgstr "开启服务"
msgid "Open v2ray split-flow"
msgstr "开启V2ray分流"
@ -47,7 +48,6 @@ msgstr "密码"
msgid "Ping All Servers"
msgstr "PING 所有节点"
msgid "Ping Latency"
msgstr "Ping 延迟"
@ -66,6 +66,14 @@ msgstr "订阅,请不要刷新!"
msgid "Check Try Count"
msgstr "切换检查重试次数"
msgid "Log"
msgstr "日志"
msgid "Bypass Domain List"
msgstr "不走代理的域名"
msgid "Black Domain List"
msgstr "强制走代理的域名"
msgid "Node List"
msgstr "节点列表"
@ -430,6 +438,9 @@ msgstr "【服务器端口】检查"
msgid "Check Connect"
msgstr "检查连通性"
msgid "Basic Settings"
msgstr "服务器设置"
msgid "Check Server"
msgstr "检查服务器"
@ -635,5 +646,124 @@ msgid "Only Common Ports"
msgstr "仅常用端口不走P2P流量到代理"
msgid "Use dnscrypt-proxy query and cache"
msgstr "使用dnscrypt-proxy TCP查询并缓存"
msgid "Use dnsforwarder tcp query and cache"
msgstr "使用dnsforwarder TCP查询并缓存"
msgid "Use dnsforwarder udp query and cache"
msgstr "使用dnsforwarder UDP查询并缓存"
msgid "Use chinadns query and cache"
msgstr "使用ChinaDNS查询并缓存"
msgid "Chiadns Resolve Dns Mode"
msgstr "ChinaDNS的上游服务器"
msgid "Use Local DNS Service"
msgstr "使用设定DNS解析"
msgid "Oversea GFW List Mode"
msgstr "海外用户回国域名列表模式"
msgid "Oversea IP Route Mode"
msgstr "海外用户回国IP路由模式"
msgid "Use Local DNS Service"
msgstr "使用设定DNS解析"
msgid "Using System Default DNS"
msgstr "使用系统默认DNS"
msgid "Using acceleration center DNS"
msgstr "使用加速中心DNS"
msgid "Appoint dns List"
msgstr "指定DNS解析列表"
msgid "Use https_dns_proxy query and cache"
msgstr "使用https_dns_proxy TCP查询并缓存"
msgid "Use smartdns query and cache"
msgstr "使用SmartDNS TCP查询并缓存"
msgid "Use Pcap_DNSProxy query and cache"
msgstr "使用Pcap DNSProxy TCP查询并缓存"
msgid "Kill BT"
msgstr "禁止 BT"
msgid "BT Port"
msgstr "BT 端口"
msgid "Enabling IPv6 server"
msgstr "启用ipv6服务"
msgid "Prohibit downloading tool ports through proxy"
msgstr "禁止BT端口走代理"
msgid "udp2raw Version"
msgstr "udp2raw 版本"
msgid "udp2raw tunnel Project"
msgstr "udp2raw 项目"
msgid "UDPspeeder Version"
msgstr "UDPspeeder 版本"
msgid "UDPspeeder Project"
msgstr "UDPspeeder 项目"
msgid "Appointlist List"
msgstr "加速列表"
msgid "udp2raw tunnel"
msgstr "隧道"
msgid "Enable udp2raw"
msgstr "启用 udp2raw"
msgid "Enable UDPspeeder"
msgstr "启用 UDPspeeder"
msgid "SOCKS5 Proxy"
msgstr "SOCKS5代理"
msgid "SSOCKS5 Proxy"
msgstr "SS SOCKS5代理"
msgid "Global SS Server"
msgstr "SS服务端"
msgid "V2SOCKS5 Proxy"
msgstr "V2ray SOCKS5代理"
msgid "Global V2RAY Server"
msgstr "V2RAY服务端"
msgid "haProxy settings"
msgstr "HaProxy 设置"
msgid "Enabling the Management Console"
msgstr "启用管理控制台"
msgid "Service Port"
msgstr "端口"
msgid "Enable HTTP Proxy"
msgstr "启用HTTP代理"
msgid "HTTP Port"
msgstr "HTTP代理端口"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
91smartyun.pt
adobe.com
amazonaws.com
ampproject.org
apple.news
aws.amazon.com
azureedge.net
backpackers.com.tw
bitfinex.com
buzzfeed.com
clockwise.ee
cloudfront.net
coindesk.com
coinsquare.io
cryptocompare.com
dropboxstatic.com
eurecom.fr
gdax.com
github.com
kknews.cc
nutaq.com
openairinterface.org
skype.com
sublimetext.com
textnow.com
textnow.me
trouter.io
uploaded.net
whatsapp.com
whatsapp.net
wsj.net
google.com
google.com.hk
gstatic.com
googleusercontent.com
googlepages.com
googlevideo.com
googlecode.com
googleapis.com
googlesource.com
googledrive.com
ggpht.com
youtube.com
youtu.be
ytimg.com
twitter.com
facebook.com
fastly.net
akamai.net
akamaiedge.net
akamaihd.net
edgesuite.net
edgekey.net

View File

@ -0,0 +1,53 @@
91smartyun.pt
adobe.com
amazonaws.com
ampproject.org
apple.news
aws.amazon.com
azureedge.net
backpackers.com.tw
bitfinex.com
buzzfeed.com
clockwise.ee
cloudfront.net
coindesk.com
coinsquare.io
cryptocompare.com
dropboxstatic.com
eurecom.fr
gdax.com
github.com
kknews.cc
nutaq.com
openairinterface.org
skype.com
sublimetext.com
textnow.com
textnow.me
trouter.io
uploaded.net
whatsapp.com
whatsapp.net
wsj.net
google.com
google.com.hk
gstatic.com
googleusercontent.com
googlepages.com
googlevideo.com
googlecode.com
googleapis.com
googlesource.com
googledrive.com
ggpht.com
youtube.com
youtu.be
ytimg.com
twitter.com
facebook.com
fastly.net
akamai.net
akamaiedge.net
akamaihd.net
edgesuite.net
edgekey.net

View File

@ -0,0 +1 @@
0xDEADBEEF

View File

@ -1,4 +1,5 @@
config global
option tunnel_forward '8.8.4.4:53'
option tunnel_address '0.0.0.0'
@ -17,6 +18,12 @@ config socks5_proxy
option local_port '1080'
option local_address '0.0.0.0'
config global_haproxy
option admin_enable '1'
option admin_port '1111'
option admin_user 'admin'
option admin_password 'root'
config access_control
option wan_bp_list '/etc/china_ssr.txt'
option lan_ac_mode 'b'
@ -36,4 +43,30 @@ config server_subscribe
option auto_update '1'
config udp2raw
option server '127.0.0.1'
option local_port '400'
option key 'passwd'
option seq_mode '3'
option auth_mode 'simple'
option bt '0'
option raw_mode 'udp'
option cipher_mode 'aes128cbc'
option server_port '600'
option udp2raw_enable '0'
config udpspeeder
option server '127.0.0.1'
option server_port '400'
option local_port '500'
option key 'passwd'
option speeder_mode '0'
option fec '2:4'
option mtu '1250'
option queue_len '1'
option timeout '8'
option udpspeeder_enable '0'

View File

@ -0,0 +1,2 @@
apple.com
microsoft.com

View File

@ -0,0 +1,192 @@
server=/v.youku.com/127.0.0.1#5335
server=/api.youku.com/127.0.0.1#5335
server=/v2.tudou.com/127.0.0.1#5335
server=/www.tudou.com/127.0.0.1#5335
server=/s.plcloud.music.qq.com/127.0.0.1#5335
server=/i.y.qq.com/127.0.0.1#5335
server=/hot.vrs.sohu.com/127.0.0.1#5335
server=/live.tv.sohu.com/127.0.0.1#5335
server=/pad.tv.sohu.com/127.0.0.1#5335
server=/my.tv.sohu.com/127.0.0.1#5335
server=/hot.vrs.letv.com/127.0.0.1#5335
server=/data.video.qiyi.com/127.0.0.1#5335
server=/cache.video.qiyi.com/127.0.0.1#5335
server=/cache.vip.qiyi.com/127.0.0.1#5335
server=/vv.video.qq.com/127.0.0.1#5335
server=/tt.video.qq.com/127.0.0.1#5335
server=/ice.video.qq.com/127.0.0.1#5335
server=/tjsa.video.qq.com/127.0.0.1#5335
server=/a10.video.qq.com/127.0.0.1#5335
server=/xyy.video.qq.com/127.0.0.1#5335
server=/vcq.video.qq.com/127.0.0.1#5335
server=/vsh.video.qq.com/127.0.0.1#5335
server=/vbj.video.qq.com/127.0.0.1#5335
server=/bobo.video.qq.com/127.0.0.1#5335
server=/flvs.video.qq.com/127.0.0.1#5335
server=/bkvv.video.qq.com/127.0.0.1#5335
server=/info.zb.qq.com/127.0.0.1#5335
server=/geo.js.kankan.xunlei.com/127.0.0.1#5335
server=/web-play.pptv.com/127.0.0.1#5335
server=/web-play.pplive.cn/127.0.0.1#5335
server=/dyn.ugc.pps.tv/127.0.0.1#5335
server=/v.pps.tv/127.0.0.1#5335
server=/inner.kandian.com/127.0.0.1#5335
server=/ipservice.163.com/127.0.0.1#5335
server=/so.open.163.com/127.0.0.1#5335
server=/zb.s.qq.com/127.0.0.1#5335
server=/ip.kankan.xunlei.com/127.0.0.1#5335
server=/vxml.56.com/127.0.0.1#5335
server=/music.sina.com.cn/127.0.0.1#5335
server=/play.baidu.com/127.0.0.1#5335
server=/v.iask.com/127.0.0.1#5335
server=/tv.weibo.com/127.0.0.1#5335
server=/wtv.v.iask.com/127.0.0.1#5335
server=/video.sina.com.cn/127.0.0.1#5335
server=/www.yinyuetai.com/127.0.0.1#5335
server=/api.letv.com/127.0.0.1#5335
server=/live.gslb.letv.com/127.0.0.1#5335
server=/static.itv.letv.com/127.0.0.1#5335
server=/ip.apps.cntv.cn/127.0.0.1#5335
server=/vdn.apps.cntv.cn/127.0.0.1#5335
server=/vdn.live.cntv.cn/127.0.0.1#5335
server=/vip.sports.cntv.cn/127.0.0.1#5335
server=/a.play.api.3g.youku.com/127.0.0.1#5335
server=/i.play.api.3g.youku.com/127.0.0.1#5335
server=/api.3g.youku.com/127.0.0.1#5335
server=/tv.api.3g.youku.com/127.0.0.1#5335
server=/play.api.3g.youku.com/127.0.0.1#5335
server=/play.api.3g.tudou.com/127.0.0.1#5335
server=/tv.api.3g.tudou.com/127.0.0.1#5335
server=/api.3g.tudou.com/127.0.0.1#5335
server=/api.tv.sohu.com/127.0.0.1#5335
server=/access.tv.sohu.com/127.0.0.1#5335
server=/iface.iqiyi.com/127.0.0.1#5335
server=/iface2.iqiyi.com/127.0.0.1#5335
server=/cache.m.iqiyi.com/127.0.0.1#5335
server=/dynamic.app.m.letv.com/127.0.0.1#5335
server=/dynamic.meizi.app.m.letv.com/127.0.0.1#5335
server=/dynamic.search.app.m.letv.com/127.0.0.1#5335
server=/dynamic.live.app.m.letv.com/127.0.0.1#5335
server=/listso.m.areainfo.ppstream.com/127.0.0.1#5335
server=/epg.api.pptv.com/127.0.0.1#5335
server=/play.api.pptv.com/127.0.0.1#5335
server=/m.letv.com/127.0.0.1#5335
server=/interface.bilibili.com/127.0.0.1#5335
server=/3g.music.qq.com/127.0.0.1#5335
server=/mqqplayer.3g.qq.com/127.0.0.1#5335
server=/proxy.music.qq.com/127.0.0.1#5335
server=/proxymc.qq.com/127.0.0.1#5335
server=/ip2.kugou.com/127.0.0.1#5335
server=/ip.kugou.com/127.0.0.1#5335
server=/client.api.ttpod.com/127.0.0.1#5335
server=/mobi.kuwo.cn/127.0.0.1#5335
server=/mobilefeedback.kugou.com/127.0.0.1#5335
server=/tingapi.ting.baidu.com/127.0.0.1#5335
server=/music.baidu.com/127.0.0.1#5335
server=/serviceinfo.sdk.duomi.com/127.0.0.1#5335
server=/music.163.com/127.0.0.1#5335
server=/www.xiami.com/127.0.0.1#5335
server=/spark.api.xiami.com/127.0.0.1#5335
server=/iplocation.geo.qiyi.com/127.0.0.1#5335
server=/sns.video.qq.com/127.0.0.1#5335
server=/v5.pc.duomi.com/127.0.0.1#5335
server=/tms.is.ysten.com/127.0.0.1#5335
server=/internal.check.duokanbox.com/127.0.0.1#5335
server=/openapi.youku.com/127.0.0.1#5335
server=/y.qq.com/127.0.0.1#5335
ipset=/v.youku.com/oversea
ipset=/api.youku.com/oversea
ipset=/v2.tudou.com/oversea
ipset=/www.tudou.com/oversea
ipset=/s.plcloud.music.qq.com/oversea
ipset=/i.y.qq.com/oversea
ipset=/hot.vrs.sohu.com/oversea
ipset=/live.tv.sohu.com/oversea
ipset=/pad.tv.sohu.com/oversea
ipset=/my.tv.sohu.com/oversea
ipset=/hot.vrs.letv.com/oversea
ipset=/data.video.qiyi.com/oversea
ipset=/cache.video.qiyi.com/oversea
ipset=/cache.vip.qiyi.com/oversea
ipset=/vv.video.qq.com/oversea
ipset=/tt.video.qq.com/oversea
ipset=/ice.video.qq.com/oversea
ipset=/tjsa.video.qq.com/oversea
ipset=/a10.video.qq.com/oversea
ipset=/xyy.video.qq.com/oversea
ipset=/vcq.video.qq.com/oversea
ipset=/vsh.video.qq.com/oversea
ipset=/vbj.video.qq.com/oversea
ipset=/bobo.video.qq.com/oversea
ipset=/flvs.video.qq.com/oversea
ipset=/bkvv.video.qq.com/oversea
ipset=/info.zb.qq.com/oversea
ipset=/geo.js.kankan.xunlei.com/oversea
ipset=/web-play.pptv.com/oversea
ipset=/web-play.pplive.cn/oversea
ipset=/dyn.ugc.pps.tv/oversea
ipset=/v.pps.tv/oversea
ipset=/inner.kandian.com/oversea
ipset=/ipservice.163.com/oversea
ipset=/so.open.163.com/oversea
ipset=/zb.s.qq.com/oversea
ipset=/ip.kankan.xunlei.com/oversea
ipset=/vxml.56.com/oversea
ipset=/music.sina.com.cn/oversea
ipset=/play.baidu.com/oversea
ipset=/v.iask.com/oversea
ipset=/tv.weibo.com/oversea
ipset=/wtv.v.iask.com/oversea
ipset=/video.sina.com.cn/oversea
ipset=/www.yinyuetai.com/oversea
ipset=/api.letv.com/oversea
ipset=/live.gslb.letv.com/oversea
ipset=/static.itv.letv.com/oversea
ipset=/ip.apps.cntv.cn/oversea
ipset=/vdn.apps.cntv.cn/oversea
ipset=/vdn.live.cntv.cn/oversea
ipset=/vip.sports.cntv.cn/oversea
ipset=/a.play.api.3g.youku.com/oversea
ipset=/i.play.api.3g.youku.com/oversea
ipset=/api.3g.youku.com/oversea
ipset=/tv.api.3g.youku.com/oversea
ipset=/play.api.3g.youku.com/oversea
ipset=/play.api.3g.tudou.com/oversea
ipset=/tv.api.3g.tudou.com/oversea
ipset=/api.3g.tudou.com/oversea
ipset=/api.tv.sohu.com/oversea
ipset=/access.tv.sohu.com/oversea
ipset=/iface.iqiyi.com/oversea
ipset=/iface2.iqiyi.com/oversea
ipset=/cache.m.iqiyi.com/oversea
ipset=/dynamic.app.m.letv.com/oversea
ipset=/dynamic.meizi.app.m.letv.com/oversea
ipset=/dynamic.search.app.m.letv.com/oversea
ipset=/dynamic.live.app.m.letv.com/oversea
ipset=/listso.m.areainfo.ppstream.com/oversea
ipset=/epg.api.pptv.com/oversea
ipset=/play.api.pptv.com/oversea
ipset=/m.letv.com/oversea
ipset=/interface.bilibili.com/oversea
ipset=/3g.music.qq.com/oversea
ipset=/mqqplayer.3g.qq.com/oversea
ipset=/proxy.music.qq.com/oversea
ipset=/proxymc.qq.com/oversea
ipset=/ip2.kugou.com/oversea
ipset=/ip.kugou.com/oversea
ipset=/client.api.ttpod.com/oversea
ipset=/mobi.kuwo.cn/oversea
ipset=/mobilefeedback.kugou.com/oversea
ipset=/tingapi.ting.baidu.com/oversea
ipset=/music.baidu.com/oversea
ipset=/serviceinfo.sdk.duomi.com/oversea
ipset=/music.163.com/oversea
ipset=/www.xiami.com/oversea
ipset=/spark.api.xiami.com/oversea
ipset=/iplocation.geo.qiyi.com/oversea
ipset=/sns.video.qq.com/oversea
ipset=/v5.pc.duomi.com/oversea
ipset=/tms.is.ysten.com/oversea
ipset=/internal.check.duokanbox.com/oversea
ipset=/openapi.youku.com/oversea
ipset=/y.qq.com/oversea

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
server=/.1test.cn/119.29.29.29#53
server=/.360wzb.cn/119.29.29.29#53
server=/.51cdn.com/119.29.29.29#53
server=/.5test.cn/119.29.29.29#53
server=/.aicdn.com/119.29.29.29#53
server=/.alikunlun.com/119.29.29.29#53
server=/.alikunlun.net/119.29.29.29#53
server=/.b2r.com.cn/119.29.29.29#53
server=/.baiduyundns.cn/119.29.29.29#53
server=/.baiduyundns.com/119.29.29.29#53
server=/.baiduyundns.net/119.29.29.29#53
server=/.bcedns.cn/119.29.29.29#53
server=/.bcedns.com/119.29.29.29#53
server=/.bcedns.net/119.29.29.29#53
server=/.bdydns.cn/119.29.29.29#53
server=/.bdydns.com/119.29.29.29#53
server=/.bdydns.net/119.29.29.29#53
server=/.blueit.com/119.29.29.29#53
server=/.blueit.org.cn/119.29.29.29#53
server=/.cachecn.com/119.29.29.29#53
server=/.cachecn.net/119.29.29.29#53
server=/.cc-1.com/119.29.29.29#53
server=/.cc-cps.cn/119.29.29.29#53
server=/.cc-cps.com.cn/119.29.29.29#53
server=/.cc-cps.com/119.29.29.29#53
server=/.cc-cps.mobi/119.29.29.29#53
server=/.cc-cps.net/119.29.29.29#53
server=/.ccbench.com/119.29.29.29#53
server=/.ccgslb.cn/119.29.29.29#53
server=/.ccgslb.com.cn/119.29.29.29#53
server=/.ccgslb.com/119.29.29.29#53
server=/.ccgslb.net.cn/119.29.29.29#53
server=/.ccgslb.net/119.29.29.29#53
server=/.ccindex.cn/119.29.29.29#53
server=/.ccindex.com.cn/119.29.29.29#53
server=/.ccmplus.cn/119.29.29.29#53
server=/.ccmplus.com.cn/119.29.29.29#53
server=/.ccmplus.net/119.29.29.29#53
server=/.cdn2cdn.net/119.29.29.29#53
server=/.cdnetworks.net/119.29.29.29#53
server=/.cdngc.net/119.29.29.29#53
server=/.cdnsvc.cn/119.29.29.29#53
server=/.cdnsvc.com.cn/119.29.29.29#53
server=/.cdnsvc.com/119.29.29.29#53
server=/.cdnsvc.net.cn/119.29.29.29#53
server=/.cdnsvc.net/119.29.29.29#53
server=/.cdntip.com/119.29.29.29#53
server=/.cdnudns.com/119.29.29.29#53
server=/.chinacache.com.cn/119.29.29.29#53
server=/.chinacache.com/119.29.29.29#53
server=/.chinacache.net/119.29.29.29#53
server=/.chinacache.org/119.29.29.29#53
server=/.chinanetcenter.com/119.29.29.29#53
server=/.cloudcdn.cn/119.29.29.29#53
server=/.cloudcdn.net/119.29.29.29#53
server=/.clouddn.com/119.29.29.29#53
server=/.cloudglb.com/119.29.29.29#53
server=/.cloudglb.net/119.29.29.29#53
server=/.cloudtcp.net/119.29.29.29#53
server=/.cloudxns.com/119.29.29.29#53
server=/.cloudxns.net/119.29.29.29#53
server=/.dnspao.com/119.29.29.29#53
server=/.fastcdn.com /119.29.29.29#53
server=/.fastweb.com.cn/119.29.29.29#53
server=/.fastwebcdn.com/119.29.29.29#53
server=/.ffdns.net/119.29.29.29#53
server=/.fsspace.cn/119.29.29.29#53
server=/.fsspace.com.cn/119.29.29.29#53
server=/.fsspace.com/119.29.29.29#53
server=/.fwcdn.com/119.29.29.29#53
server=/.fwcdn.net/119.29.29.29#53
server=/.fwdns.net/119.29.29.29#53
server=/.fwmob.com/119.29.29.29#53
server=/.gccdn.net/119.29.29.29#53
server=/.gslbsvc.cn/119.29.29.29#53
server=/.gslbsvc.com.cn/119.29.29.29#53
server=/.gslbsvc.com/119.29.29.29#53
server=/.gslbsvc.net.cn/119.29.29.29#53
server=/.gslbsvc.net/119.29.29.29#53
server=/.hacdn.com/119.29.29.29#53
server=/.hacdn.net/119.29.29.29#53
server=/.hadns.net/119.29.29.29#53
server=/.hdslb.com/119.29.29.29#53
server=/.hdslb.net/119.29.29.29#53
server=/.hd-cdn.com/119.29.29.29#53
server=/.igslb.net/119.29.29.29#53
server=/.kunlunaq.com/119.29.29.29#53
server=/.kunlunar.com/119.29.29.29#53
server=/.kunlunca.com/119.29.29.29#53
server=/.kunluncan.com/119.29.29.29#53
server=/.kunlunea.com/119.29.29.29#53
server=/.kunlungem.com/119.29.29.29#53
server=/.kunlungr.com/119.29.29.29#53
server=/.kunlunhuf.com/119.29.29.29#53
server=/.kunlunle.com/119.29.29.29#53
server=/.kunlunli.com/119.29.29.29#53
server=/.kunlunno.com/119.29.29.29#53
server=/.kunlunpi.com/119.29.29.29#53
server=/.kunlunra.com/119.29.29.29#53
server=/.kunlunsa.com/119.29.29.29#53
server=/.kunlunsc.com/119.29.29.29#53
server=/.kunlunsl.com/119.29.29.29#53
server=/.kunlunso.com/119.29.29.29#53
server=/.kunlunta.com/119.29.29.29#53
server=/.kunlunvi.com/119.29.29.29#53
server=/.kunlunwe.com/119.29.29.29#53
server=/.lxdns.com/119.29.29.29#53
server=/.lxdns.net/119.29.29.29#53
server=/.lxsvc.cn /119.29.29.29#53
server=/.lxsvc.cn/119.29.29.29#53
server=/.lxsvc.net/119.29.29.29#53
server=/.myqcloud.com/119.29.29.29#53
server=/.myxns.cn/119.29.29.29#53
server=/.myxns.com.cn/119.29.29.29#53
server=/.myxns.net.cn/119.29.29.29#53
server=/.myxns.org/119.29.29.29#53
server=/.netcenter.com.cn/119.29.29.29#53
server=/.newdefend.cn/119.29.29.29#53
server=/.newdefend.com.cn/119.29.29.29#53
server=/.newdefend.com/119.29.29.29#53
server=/.newdefend.net.cn/119.29.29.29#53
server=/.newdefend.net/119.29.29.29#53
server=/.newdefend.org.cn/119.29.29.29#53
server=/.newdefend.org/119.29.29.29#53
server=/.ourglb0.com/119.29.29.29#53
server=/.ourwebat.com/119.29.29.29#53
server=/.ourwebcdn.com/119.29.29.29#53
server=/.qbox.me/119.29.29.29#53
server=/.qcloud.com/119.29.29.29#53
server=/.qingcdn.com/119.29.29.29#53
server=/.qiniudn.com/119.29.29.29#53
server=/.qiniudns.com/119.29.29.29#53
server=/.speedupchina.com/119.29.29.29#53
server=/.speedupchina.net/119.29.29.29#53
server=/.sz-dns.net/119.29.29.29#53
server=/.tcdn.qq.com/119.29.29.29#53
server=/.tlgslb.com /119.29.29.29#53
server=/.wangsu.com/119.29.29.29#53
server=/.webluker.com/119.29.29.29#53
server=/.wscdns.com/119.29.29.29#53
server=/.wsngb.com/119.29.29.29#53
server=/.xgslb.net/119.29.29.29#53
server=/.yunjiasu-cdn.net/119.29.29.29#53

View File

@ -0,0 +1,106 @@
ipset=/.91smartyun.pt/gfwlist
ipset=/.adobe.com/gfwlist
ipset=/.amazonaws.com/gfwlist
ipset=/.ampproject.org/gfwlist
ipset=/.apple.news/gfwlist
ipset=/.aws.amazon.com/gfwlist
ipset=/.azureedge.net/gfwlist
ipset=/.backpackers.com.tw/gfwlist
ipset=/.bitfinex.com/gfwlist
ipset=/.buzzfeed.com/gfwlist
ipset=/.clockwise.ee/gfwlist
ipset=/.cloudfront.net/gfwlist
ipset=/.coindesk.com/gfwlist
ipset=/.coinsquare.io/gfwlist
ipset=/.cryptocompare.com/gfwlist
ipset=/.dropboxstatic.com/gfwlist
ipset=/.eurecom.fr/gfwlist
ipset=/.gdax.com/gfwlist
ipset=/.github.com/gfwlist
ipset=/.kknews.cc/gfwlist
ipset=/.nutaq.com/gfwlist
ipset=/.openairinterface.org/gfwlist
ipset=/.skype.com/gfwlist
ipset=/.sublimetext.com/gfwlist
ipset=/.textnow.com/gfwlist
ipset=/.textnow.me/gfwlist
ipset=/.trouter.io/gfwlist
ipset=/.uploaded.net/gfwlist
ipset=/.whatsapp.com/gfwlist
ipset=/.whatsapp.net/gfwlist
ipset=/.wsj.net/gfwlist
ipset=/.google.com/gfwlist
ipset=/.google.com.hk/gfwlist
ipset=/.gstatic.com/gfwlist
ipset=/.googleusercontent.com/gfwlist
ipset=/.googlepages.com/gfwlist
ipset=/.googlevideo.com/gfwlist
ipset=/.googlecode.com/gfwlist
ipset=/.googleapis.com/gfwlist
ipset=/.googlesource.com/gfwlist
ipset=/.googledrive.com/gfwlist
ipset=/.ggpht.com/gfwlist
ipset=/.youtube.com/gfwlist
ipset=/.youtu.be/gfwlist
ipset=/.ytimg.com/gfwlist
ipset=/.twitter.com/gfwlist
ipset=/.facebook.com/gfwlist
ipset=/.fastly.net/gfwlist
ipset=/.akamai.net/gfwlist
ipset=/.akamaiedge.net/gfwlist
ipset=/.akamaihd.net/gfwlist
ipset=/.edgesuite.net/gfwlist
ipset=/.edgekey.net/gfwlist
server=/.91smartyun.pt/127.0.0.1#5335
server=/.adobe.com/127.0.0.1#5335
server=/.amazonaws.com/127.0.0.1#5335
server=/.ampproject.org/127.0.0.1#5335
server=/.apple.news/127.0.0.1#5335
server=/.aws.amazon.com/127.0.0.1#5335
server=/.azureedge.net/127.0.0.1#5335
server=/.backpackers.com.tw/127.0.0.1#5335
server=/.bitfinex.com/127.0.0.1#5335
server=/.buzzfeed.com/127.0.0.1#5335
server=/.clockwise.ee/127.0.0.1#5335
server=/.cloudfront.net/127.0.0.1#5335
server=/.coindesk.com/127.0.0.1#5335
server=/.coinsquare.io/127.0.0.1#5335
server=/.cryptocompare.com/127.0.0.1#5335
server=/.dropboxstatic.com/127.0.0.1#5335
server=/.eurecom.fr/127.0.0.1#5335
server=/.gdax.com/127.0.0.1#5335
server=/.github.com/127.0.0.1#5335
server=/.kknews.cc/127.0.0.1#5335
server=/.nutaq.com/127.0.0.1#5335
server=/.openairinterface.org/127.0.0.1#5335
server=/.skype.com/127.0.0.1#5335
server=/.sublimetext.com/127.0.0.1#5335
server=/.textnow.com/127.0.0.1#5335
server=/.textnow.me/127.0.0.1#5335
server=/.trouter.io/127.0.0.1#5335
server=/.uploaded.net/127.0.0.1#5335
server=/.whatsapp.com/127.0.0.1#5335
server=/.whatsapp.net/127.0.0.1#5335
server=/.wsj.net/127.0.0.1#5335
server=/.google.com/127.0.0.1#5335
server=/.google.com.hk/127.0.0.1#5335
server=/.gstatic.com/127.0.0.1#5335
server=/.googleusercontent.com/127.0.0.1#5335
server=/.googlepages.com/127.0.0.1#5335
server=/.googlevideo.com/127.0.0.1#5335
server=/.googlecode.com/127.0.0.1#5335
server=/.googleapis.com/127.0.0.1#5335
server=/.googlesource.com/127.0.0.1#5335
server=/.googledrive.com/127.0.0.1#5335
server=/.ggpht.com/127.0.0.1#5335
server=/.youtube.com/127.0.0.1#5335
server=/.youtu.be/127.0.0.1#5335
server=/.ytimg.com/127.0.0.1#5335
server=/.twitter.com/127.0.0.1#5335
server=/.facebook.com/127.0.0.1#5335
server=/.fastly.net/127.0.0.1#5335
server=/.akamai.net/127.0.0.1#5335
server=/.akamaiedge.net/127.0.0.1#5335
server=/.akamaihd.net/127.0.0.1#5335
server=/.edgesuite.net/127.0.0.1#5335
server=/.edgekey.net/127.0.0.1#5335

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,277 @@
#!/bin/sh
#
# Copyright (C) 2017 openwrt-ssr
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
NAME=vssr
logfile="/tmp/vssr.log"
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_get_by_type() {
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
echo ${ret:=$3}
}
server_process_count=$1
redir_tcp_process=$2
redir_udp_process=$3
tunnel_process=$4
kcp_process=$5
local_process=$6
pdnsd_process=$7
dnsforwarder_process=$8
ssserver_process=$10
ssrserver_process=$11
v2rayserver_process=$12
haproxy_process=$13
privoxy_process=$14
chinadns_process=$15
if [ -z "$pdnsd_process" ] ;then
pdnsd_process=0
fi
i=0
GLOBAL_SERVER=$(uci_get_by_type global global_server)
server=$(uci_get_by_name $GLOBAL_SERVER server)
kcp_port=$(uci_get_by_name $GLOBAL_SERVER kcp_port)
server_port=$(uci_get_by_name $GLOBAL_SERVER server_port)
password=$(uci_get_by_name $GLOBAL_SERVER kcp_password)
kcp_param=$(uci_get_by_name $GLOBAL_SERVER kcp_param)
[ "$password" != "" ] && password="--key "${password}
sock5_port=$(uci_get_by_type socks5_proxy local_port 1080)
if [ "$(uci_get_by_type global chinadns_enable)" = "0" ] ;then
dnsstrs="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
else
dnsstrs="0.0.0.0:5337"
fi
if echo $server|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
server=${server}
else
server=`cat /etc/ssr_ip`
fi
while [ "1" = "1" ] #死循环
do
sleep 30
#redir tcp
if [ $redir_tcp_process -gt 0 ] ;then
icount=`ps -w | grep ssr-retcp |grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr redir tcp error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") redir tcp error.restart!" >> ${logfile}
/etc/init.d/vssr restart
exit 0
fi
fi
#redir udp
if [ $redir_udp_process -gt 0 ] ;then
icount=`ps -w | grep ssr-reudp|grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr redir udp error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") redir udp error.restart!" >> ${logfile}
/etc/init.d/vssr restart
exit 0
fi
fi
#tunnel
if [ $tunnel_process -gt 0 ] ;then
icount=`ps -w | grep ssr-tunnel |grep -v grep| wc -l`
if [ $icount = 0 ] ;then
logger -t "$NAME" "ssr tunnel error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") tunnel error.restart!" >> ${logfile}
/etc/init.d/vssr restart
exit 0
fi
fi
#server
#ssr_server
if [ $server_process_count -gt 0 ] ;then
if [ $ssrserver_process -gt 0 ] ;then
icount=`ps -w | grep ssr-server |grep -v grep| wc -l`
if [ $icount -lt $ssrserver_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr server error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr server error.restart!" >> ${logfile}
killall -q -9 ssr-server
for i in `seq $ssrserver_process`
do
/usr/bin/ssr-server -c /var/etc/vssr_$i.json -u -f /var/run/ssr-server$i.pid
done
fi
fi
#ss_server
if [ $ssserver_process -gt 0 ] ;then
icount=`ps -w | grep ss-server |grep -v grep| wc -l`
if [ $icount -lt $ssserver_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ss server error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ss server error.restart!" >> ${logfile}
killall -q -9 ss-server
for i in `seq $ssserver_process`
do
/usr/bin/ss-server -c /var/etc/vssr_$i.json -u -f /var/run/ss-server$i.pid
done
fi
fi
#v2ray_server
if [ v2rayserver_process -gt 0 ] ;then
icount=`ps -w | grep ss-server |grep -v grep| wc -l`
if [ $icount -lt $v2rayserver_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "v2ray server error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray server error.restart!" >> ${logfile}
kill -9 $(ps | grep v2ray-server | grep -v grep | awk '{print $1}') >/dev/null 2>&1
for i in `seq $v2rayserver_process`
do
( /usr/bin/v2ray/v2ray -config /var/etc/v2ray-server-$i.json >/dev/null 2>&1 &)
done
fi
fi
fi
#kcptun
if [ $kcp_process -gt 0 ] ;then
icount=`ps -w | grep kcptun-client |grep -v grep| wc -l`
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr kcptun error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr kcptun error.restart!" >> ${logfile}
killall -q -9 kcptun-client
( /usr/bin/kcptun-client -r $server:$kcp_port -l :$server_port $password $kcp_param &)
fi
fi
#local
if [ $local_process -eq 1 ] ;then
icount=`ps -w | grep ssr-local |grep -v grep| wc -l`
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr local error.restart!" >> ${logfile}
killall -q -9 ssr-local
( /usr/bin/ssr-local -c /var/etc/vssr_s.json -u -l $sock5_port -f /var/run/ssr-local.pid &)
fi
fi
#local
if [ $local_process -eq 2 ] ;then
local_processs=1
icount=`ps -w | grep ss-local |grep -v grep| wc -l`
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ss local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") ss local error.restart!" >> ${logfile}
killall -q -9 ss-local
( /usr/bin/ss-local -c /var/etc/vssr_s.json -u -l $sock5_port -f /var/run/ss-local.pid &)
fi
fi
#local
if [ $local_process -eq 3 ] ;then
local_processs=1
icount=`ps -w | grep v2-ssr-local |grep -v grep| wc -l`
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
then
logger -t "$NAME" "v2ray local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray local error.restart!" >> ${logfile}
kill -9 $(ps | grep v2-ssr-local | grep -v grep | awk '{print $1}') >/dev/null 2>&1
( /usr/bin/v2ray/v2ray -config /var/etc/v2-ssr-local.json >/dev/null 2>&1 &)
fi
fi
#privoxy
if [ $privoxy_process -gt 0 ] ;then
icount=`ps -w | grep privoxy |grep -v grep| wc -l`
if [ $icount -lt $privoxy_process ]; then
logger -t "$NAME" "privoxy http local error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") privoxy http loca error.restart!" >> ${logfile}
kill -9 $(ps | grep privoxy | grep -v grep | awk '{print $1}') >/dev/null 2>&1
/etc/init.d/privoxy restart
fi
fi
#dnsforwarder
if [ $dnsforwarder_process -gt 0 ] ;then
icount=`ps -w | grep dnsparsing |grep -v grep| wc -l`
if [ $icount -lt $dnsforwarder_process ]; then
logger -t "$NAME" "dnsforwarder tunnel error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") dnsforwarder tunnel error.restart!" >> ${logfile}
kill -9 $(ps | grep dnsparsing | grep -v grep | awk '{print $1}') >/dev/null 2>&1
( dnsparsing -f /var/run/dnsparsing/dnsparsing.conf -d &)
fi
fi
#pdnsd
if [ $pdnsd_process -gt 0 ] ;then
icount=`ps -w | grep pdnsd |grep -v grep| wc -l`
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "pdnsd tunnel error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") pdnsd tunnel error.restart!" >> ${logfile}
if [ -f /var/run/pdnsd.pid ] ;then
kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1
else
kill -9 $(ps | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1
fi
( /usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d &)
fi
fi
#chiandns
if [ $chinadns_process -gt 0 ] ;then
icount=`ps -w | grep chinadns |grep -v grep| wc -l`
if [ $icount -lt $chinadns_process ]; then
logger -t "$NAME" "chinadns tunnel error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") chinadns tunnel error.restart!" >> ${logfile}
kill -9 $(ps | grep chinadns | grep -v grep | awk '{print $1}') >/dev/null 2>&1
(nohup /usr/bin/chinadns -p 5335 -c /etc/china_ssr.txt -m -d -s $dnsstrs >/dev/null 2>&1 &)
fi
fi
#haproxy
if [ $haproxy_process -gt 0 ] ;then
icount=`ps -w | grep haproxy |grep -v grep| wc -l`
if [ $icount -lt $haproxy_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "haproxy error.restart!"
echo "$(date "+%Y-%m-%d %H:%M:%S") haproxy error.restart!" >> ${logfile}
/etc/init.d/vssr restart
fi
fi
#udp2raw
if [ $(uci_get_by_type udp2raw udp2raw_enable) = 1 ] ;then
ucount=`ps -w | grep udp2raw |grep -v grep| wc -l`
if [ $ucount = 0 ] ;then
/usr/bin/udp2raw --clear >/dev/null
/usr/bin/udp2raw --conf-file /var/etc/udp2raw.conf >/dev/null 2>&1 &
fi
fi
#udpspeeder
if [ $(uci_get_by_type udpspeeder udpspeeder_enable) = 1 ] ;then
scount=`ps -w | grep udpspeeder |grep -v grep| wc -l`
if [ $scount = 0 ] ;then
/usr/bin/udpspeeder -c -l0.0.0.0:$(uci_get_by_type udpspeeder local_port) \
-r$(uci_get_by_type udpspeeder server):$(uci_get_by_type udpspeeder server_port) \
-k $(uci_get_by_type udpspeeder key) \
--mode $(uci_get_by_type udpspeeder speeder_mode) \
--mtu $(uci_get_by_type udpspeeder mtu) \
-f$(uci_get_by_type udpspeeder fec) \
-q$(uci_get_by_type udpspeeder queue_len) \
--timeout $(uci_get_by_type udpspeeder timeout) \
>/dev/null 2>&1 &
fi
fi
done

View File

@ -0,0 +1,96 @@
local ucursor = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
local server_section = arg[1]
local proto = arg[2]
local local_port = arg[3]
local host = arg[4]
local server = ucursor:get_all("vssr", server_section)
local v2ray = {
log = {
-- error = "/var/ssrplus.log",
loglevel = "warning"
},
-- 传入连接
inbound = {
port = local_port,
protocol = "dokodemo-door",
settings = {
network = proto,
followRedirect = true
},
sniffing = {
enabled = true,
destOverride = { "http", "tls" }
}
},
-- 传出连接
outbound = {
protocol = "vmess",
settings = {
vnext = {
{
address = server.server,
port = tonumber(server.server_port),
users = {
{
id = server.vmess_id,
alterId = tonumber(server.alter_id),
security = server.security
}
}
}
}
},
-- 底层传输配置
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {allowInsecure = (server.insecure == "1") and true or false,serverName=server.ws_host,},
kcpSettings = (server.transport == "kcp") and {
mtu = tonumber(server.mtu),
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
readBufferSize = tonumber(server.read_buffer_size),
writeBufferSize = tonumber(server.write_buffer_size),
header = {
type = server.kcp_guise
}
} or nil,
wsSettings = (server.transport == "ws") and (server.ws_path ~= nil or server.ws_host ~= nil) and {
path = server.ws_path,
headers = (server.ws_host ~= nil) and {
Host = server.ws_host
} or nil,
} or nil,
httpSettings = (server.transport == "h2") and {
path = server.h2_path,
host = server.h2_host,
} or nil,
quicSettings = (server.transport == "quic") and {
security = server.quic_security,
key = server.quic_key,
header = {
type = server.quic_guise
}
} or nil
},
mux = {
enabled = (server.mux == "1") and true or false,
concurrency = tonumber(server.concurrency)
}
},
-- 额外传出连接
outboundDetour = {
{
protocol = "freedom",
tag = "direct",
settings = { keep = "" }
}
}
}
print(json.stringify(v2ray, 1))

View File

@ -0,0 +1,65 @@
local ucursor = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
local server_section = arg[1]
local server = ucursor:get_all("vssr", server_section)
local v2ray = {
log = {
--error = "/var/log/v2ray.log",
loglevel = "warning"
},
-- 传入连接
inbound = {
port = tonumber(server.server_port),
protocol = "vmess",
settings = {
clients = {
{
id = server.vmess_id,
alterId = tonumber(server.alter_id),
level = tonumber(server.VMess_level)
}
}
},
-- 底层传输配置
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
kcpSettings = (server.transport == "kcp") and {
mtu = tonumber(server.mtu),
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
readBufferSize = tonumber(server.read_buffer_size),
writeBufferSize = tonumber(server.write_buffer_size),
header = {
type = server.kcp_guise
}
} or nil,
httpSettings = (server.transport == "h2") and {
path = server.h2_path,
host = server.h2_host,
} or nil,
quicSettings = (server.transport == "quic") and {
security = server.quic_security,
key = server.quic_key,
header = {
type = server.quic_guise
}
} or nil
}
},
-- 传出连接
outbound = {
protocol = "freedom"
},
-- 额外传出连接
outboundDetour = {
{
protocol = "blackhole",
tag = "blocked"
}
}
}
print(json.stringify(v2ray,1))

View File

@ -30,10 +30,5 @@ else
hostip=$(cat /etc/ssr_ip)
fi
fi
$python -c "import maxminddb;
import json;
reader = maxminddb.open_database('/usr/share/vssr/GeoLite2-Country.mmdb');
aa = reader.get('${hostip}');
reader.close();
print(aa['country']['iso_code'].lower())"
$python -c "import maxminddb;import json;reader = maxminddb.open_database('/usr/share/vssr/GeoLite2-Country.mmdb');aa = reader.get('${hostip}');reader.close();print(aa['country']['iso_code'].lower())"
fi

View File

@ -250,7 +250,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
overflow-x: auto;
overflow-y: hidden;
border: 1px solid rgba(0, 0, 0, .05);
border-radius: .375rem;
border-radius: .500rem;
background-color: #fff;
box-shadow: 0 0 2rem 0 rgba(136, 152, 170, .15);
}
@ -310,13 +310,13 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
.cbi-section-table-row {
position: relative;
background: #99CCFF;
background: #CCFFFF;
margin: 10px;
padding: 8px 15px 10px 65px;
padding: 8px 15px 10px 70px;
box-shadow: 0 0 1rem 0 rgba(136,152,170,.75);
border-radius: .5rem;
border: 0;
color: #336699;
color: #003333;
text-align: left;
line-height: 1.7em;
white-space: nowrap;
@ -467,7 +467,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
padding:0.5rem 0.8rem;
float:right;
margin-right:10px;
margin-top:-0.3rem;
margin-top:0rem;
}
@ -507,7 +507,7 @@ footer.mobile-hide{
width:70px !important;
height:70px;
bottom:90px;
right:80px;
right:55px;
font-size:20px;
border-radius:50%;
display:block;

Some files were not shown because too many files have changed in this diff Show More