revert luci ssr plus due to exceed 8M rom size

This commit is contained in:
coolsnowwolf 2018-10-06 18:23:57 +08:00
parent 8ff2b22498
commit 00209c9bb8
7 changed files with 13 additions and 62 deletions

View File

@ -6,10 +6,10 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for SSR Plus
LUCI_DEPENDS:=+shadowsocksr-libev +shadowsocks-libev-ss-local +shadowsocks-libev-ss-redir +shadowsocks-libev-ss-tunnel +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget
LUCI_DEPENDS:=+shadowsocksr-libev +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=11
PKG_RELEASE:=9
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -31,10 +31,7 @@ local encrypt_methods = {
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
@ -47,8 +44,6 @@ local encrypt_methods = {
"salsa20",
"chacha20",
"chacha20-ietf",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
}
local protocol = {
@ -85,10 +80,6 @@ s = m:section(NamedSection, sid, "servers")
s.anonymous = true
s.addremove = false
o = s:option(ListValue, "tool", translate("Proxy Tool"))
o:value("0", translate("ShadowsocksR"))
o:value("1", translate("Shadowsocks"))
o = s:option(Value, "alias", translate("Alias(optional)"))
o = s:option(Flag, "auth_enable", translate("Onetime Authentication"))
@ -126,18 +117,14 @@ o.rmempty = false
o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = false
o:depends("tool","0")
o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))
o:depends("tool","0")
o = s:option(ListValue, "obfs", translate("Obfs"))
for _, v in ipairs(obfs) do o:value(v) end
o.rmempty = false
o:depends("tool","0")
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
o:depends("tool","0")
o = s:option(Flag, "fast_open", translate("TCP Fast Open"))
o.rmempty = false

View File

@ -10,10 +10,6 @@ m = Map(shadowsocksr, translate("Servers subscription and manage"))
s = m:section(TypedSection, "server_subscribe")
s.anonymous = true
o = s:option(ListValue, "tool", translate("Proxy Tool"))
o:value("0", translate("ShadowsocksR"))
o:value("1", translate("Shadowsocks"))
o = s:option(Flag, "auto_update", translate("Auto Update"))
o.rmempty = false
o.description = translate("Auto Update Server subscription, GFW list and CHN route")

View File

@ -22,7 +22,6 @@ config server_global
option enable_server '0'
config server_subscribe
option tool '0'
option proxy '0'
option auto_update_time '2'
option auto_update '1'

View File

@ -87,7 +87,6 @@ gen_config_file() {
else
fastopen="false";
fi
if [ $(uci_get_by_name $1 tool) = "0" ] ;then
cat <<-EOF >$config_file
{
@ -105,32 +104,8 @@ gen_config_file() {
"fast_open": $fastopen
}
EOF
ln -sf /usr/bin/ssr-redir /usr/sbin/ssr-redir
ln -sf /usr/bin/ssr-local /usr/sbin/ssr-local
ln -sf /usr/bin/ssr-tunnel /usr/sbin/ssr-tunnel
elif [ $(uci_get_by_name $1 tool) = "1" ] ;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)",
"fast_open": $fastopen
}
EOF
ln -sf /usr/bin/ss-redir /usr/sbin/ssr-redir
ln -sf /usr/bin/ss-local /usr/sbin/ssr-local
ln -sf /usr/bin/ss-tunnel /usr/sbin/ssr-tunnel
fi
}
get_arg_out() {
case "$(uci_get_by_type access_control router_proxy 1)" in
1) echo "-o";;
@ -268,7 +243,7 @@ start_tunnel() {
local_dns_port=5353
fi
/usr/sbin/ssr-tunnel \
/usr/bin/ssr-tunnel \
-c $tunnel_config_file $ARG_OTA -u \
-l $local_dns_port \
-b $(uci_get_by_type global tunnel_address 0.0.0.0) \
@ -309,7 +284,7 @@ start_redir() {
local pid_file="/var/run/ssr-retcp.pid"
if [ "$ARG_UDP" = "-U" ]; then
/usr/sbin/ssr-redir \
/usr/bin/ssr-redir \
-c $CONFIG_FILE $ARG_OTA \
-f /var/run/ssr-retcp.pid
@ -323,7 +298,7 @@ start_redir() {
redir_udp=1
fi
/usr/sbin/ssr-redir \
/usr/bin/ssr-redir \
-c $last_config_file $ARG_OTA $ARG_UDP \
-f $pid_file
@ -428,7 +403,7 @@ start_local() {
[ "$local_server" = "nil" ] && return 1
mkdir -p /var/run /var/etc
gen_config_file $local_server 2
/usr/sbin/ssr-local -c $CONFIG_SOCK5_FILE -u \
/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

View File

@ -49,7 +49,7 @@ if echo $server|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/
server=`cat /etc/ssr_ip`
fi
while [ "1" = "1" ] #死循环
while [ "1" = "1" ] #死循环
do
sleep 30
#redir tcp
@ -82,7 +82,7 @@ do
#server
if [ $server_process_count -gt 0 ] ;then
icount=`ps -w | grep ssr-server |grep -v grep| wc -l`
if [ $icount -lt $server_process_count ] #如果进程挂掉就重启它
if [ $icount -lt $server_process_count ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr server error.restart!"
killall -q -9 ssr-server
@ -95,7 +95,7 @@ do
#kcptun
if [ $kcp_process -gt 0 ] ;then
icount=`ps -w | grep ssr-kcptun |grep -v grep| wc -l`
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr kcptun error.restart!"
killall -q -9 ssr-kcptun
@ -106,18 +106,18 @@ do
#local
if [ $local_process -gt 0 ] ;then
icount=`ps -w | grep ssr-local |grep -v grep| wc -l`
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr local error.restart!"
killall -q -9 ssr-local
( /usr/sbin/ssr-local -c /var/etc/shadowsocksr_s.json -u -l $sock5_port -f /var/run/ssr-local.pid &)
( /usr/bin/ssr-local -c /var/etc/shadowsocksr_s.json -u -l $sock5_port -f /var/run/ssr-local.pid &)
fi
fi
#pdnsd
if [ $pdnsd_process -gt 0 ] ;then
icount=`ps -w | grep pdnsd |grep -v grep| wc -l`
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "pdnsd tunnel error.restart!"
killall -q -9 pdnsd

View File

@ -21,13 +21,7 @@ CheckIPAddr() {
}
Server_Update() {
tool=($(uci get $name.@server_subscribe[0].tool))
local uci_set="uci -q set $name.$1."
if [ $tool = "0" ] ;then
${uci_set}tool="0"
elif [ $tool = "1" ] ;then
${uci_set}tool="1"
fi
${uci_set}alias="[$ssr_group] $ssr_remarks"
${uci_set}auth_enable="0"
${uci_set}switch_enable="1"