mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
luci-app-vssr-coexist: sync with upstream source
This commit is contained in:
parent
28ab2be021
commit
d2fdf181d6
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-vssr-coexist
|
||||
PKG_VERSION:=1.06
|
||||
PKG_RELEASE:=20200115-4
|
||||
PKG_VERSION:=1.07
|
||||
PKG_RELEASE:=20200217-4
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
|
||||
@ -10,7 +10,13 @@ PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
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_ShadowsocksR_Socks
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-client\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-server\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -43,6 +49,30 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
||||
bool "Include ShadowsocksR Socks and Tunnel"
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks
|
||||
bool "Include ipt2socks"
|
||||
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
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-client
|
||||
bool "Include GoQuiet-client"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_GoQuiet-server
|
||||
bool "Include GoQuiet-server"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin
|
||||
bool "Include v2ray-plugin"
|
||||
default y
|
||||
endef
|
||||
|
||||
define Package/luci-app-vssr-coexist
|
||||
@ -55,6 +85,12 @@ define Package/luci-app-vssr-coexist
|
||||
+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_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 \
|
||||
|
@ -41,7 +41,7 @@ local protocol = {
|
||||
"auth_chain_d", "auth_chain_e", "auth_chain_f"
|
||||
}
|
||||
|
||||
obfs = {
|
||||
local obfs = {
|
||||
"plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth"
|
||||
}
|
||||
|
||||
@ -115,6 +115,27 @@ for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
|
||||
o.rmempty = true
|
||||
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-local") then
|
||||
o:value("/usr/bin/obfs-local", "obfs-local")
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/goquiet-client") then
|
||||
o:value("/usr/bin/goquiet-client", "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-local")
|
||||
o:depends("plugin", "/usr/bin/goquiet-client")
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocol) do o:value(v) end
|
||||
o.rmempty = true
|
||||
@ -128,27 +149,6 @@ for _, v in ipairs(obfs) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Flag, "v2ray_plugin", translate("V2ray-plugin"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(Value, "obfs_transport", translate("V2ray-plugin-transport"))
|
||||
o.rmempty = true
|
||||
o.default = "ws"
|
||||
o:depends("v2ray_plugin", "1")
|
||||
|
||||
o = s:option(Value, "obfs_host", translate("V2ray-plugin-host"))
|
||||
o.rmempty = true
|
||||
o:depends("v2ray_plugin", "1")
|
||||
|
||||
o = s:option(Value, "obfs_path", translate("V2ray-plugin-path"))
|
||||
o.rmempty = true
|
||||
o:depends("v2ray_plugin", "1")
|
||||
|
||||
o = s:option(Flag, "obfs_opts", translate("TLS"))
|
||||
o.rmempty = false
|
||||
o:depends("v2ray_plugin", "1")
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
|
@ -90,7 +90,9 @@ gen_config_file() {
|
||||
fi
|
||||
|
||||
local stype=$(uci_get_by_name $1 type)
|
||||
if [ "$stype" == "ss" ] ;then
|
||||
local plugin=$(uci_get_by_name $1 plugin)
|
||||
if [ "$stype" == "ss" ] ;then
|
||||
if [ "$plugin" == "none" ] ;then
|
||||
cat <<-EOF >$config_file
|
||||
{
|
||||
"server": "$hostip",
|
||||
@ -104,7 +106,24 @@ if [ "$stype" == "ss" ] ;then
|
||||
"fast_open": $fastopen
|
||||
}
|
||||
EOF
|
||||
elif [ "$stype" == "ssr" ] ;then
|
||||
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
|
||||
{
|
||||
|
||||
@ -565,7 +584,12 @@ stop() {
|
||||
killall -q -9 vssr-monitor
|
||||
killall -q -9 ss-redir
|
||||
killall -q -9 ssr-redir
|
||||
killall -q -9 ssr-local
|
||||
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
|
||||
|
@ -13,6 +13,8 @@ uci -q batch <<-EOF >/dev/null
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
killall -q -9 v2ray-plugin
|
||||
|
||||
/usr/share/vssr/gfw2ipset.sh
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user