diff --git a/package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua b/package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua index 381b1951bc..f18122439e 100644 --- a/package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua +++ b/package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua @@ -41,7 +41,7 @@ s=m:section(TypedSection,"main_server","" .. translate("Main Server List") .. o=s:option(Flag,"validate",translate("validate")) o=s:option(Value,"server_ip",translate("Proxy Server IP")) - o.datatype="ip4addr" + o=s:option(Value,"server_port",translate("Proxy Server Port")) o.datatype="uinteger" o=s:option(Value,"server_weight",translate("Weight")) @@ -56,7 +56,7 @@ s=m:section(TypedSection,"backup_server","" .. translate("Backup Server List" o=s:option(Flag,"validate",translate("validate")) o=s:option(Value,"server_ip",translate("Proxy Server IP")) - o.datatype="ip4addr" + o=s:option(Value,"server_port",translate("Proxy Server Port")) o.datatype="uinteger" -- --------------------------------------------------- diff --git a/package/lean/luci-app-haproxy-tcp/po/zh_Hans/haproxy-tcp.po b/package/lean/luci-app-haproxy-tcp/po/zh_Hans/haproxy-tcp.po deleted file mode 100644 index 19a187d9d9..0000000000 --- a/package/lean/luci-app-haproxy-tcp/po/zh_Hans/haproxy-tcp.po +++ /dev/null @@ -1,34 +0,0 @@ -msgid "Running" -msgstr "运行中" - -msgid "Not running" -msgstr "未运行" - -msgid "Main Server List" -msgstr "主服务器列表" - -msgid "Display Name" -msgstr "服务器名称" - -msgid "Only English Characters,No spaces" -msgstr "仅限英文字母,不要有空格" - -msgid "Proxy Server IP" -msgstr "代理服务器IP" - -msgid "Proxy Server Port" -msgstr "代理服务器端口" - -msgid "Weight" -msgstr "分流权重" - -msgid "Backup Server List" -msgstr "备用服务器列表" - -msgid "validate" -msgstr "生效" - - - - - diff --git a/package/lean/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po b/package/lean/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po index 2f953f7293..da223e8920 100644 --- a/package/lean/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po +++ b/package/lean/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po @@ -50,7 +50,7 @@ msgstr "仅限英文字母,不要有空格" #: luasrc/model/cbi/haproxy.lua:43 luasrc/model/cbi/haproxy.lua:58 msgid "Proxy Server IP" -msgstr "代理服务器IP" +msgstr "代理服务器IP或域名" #: luasrc/model/cbi/haproxy.lua:45 luasrc/model/cbi/haproxy.lua:60 msgid "Proxy Server Port" diff --git a/package/lean/luci-app-haproxy-tcp/root/etc/haproxy_init.sh b/package/lean/luci-app-haproxy-tcp/root/etc/haproxy_init.sh index cab4d1f826..c3a01dc2d8 100755 --- a/package/lean/luci-app-haproxy-tcp/root/etc/haproxy_init.sh +++ b/package/lean/luci-app-haproxy-tcp/root/etc/haproxy_init.sh @@ -50,6 +50,10 @@ listen admin_stats stats realm Haproxy #统计页面密码框上提示文本 stats auth admin:root #设置监控页面的用户和密码:admin,可以设置多个用户名 stats admin if TRUE #设置手工启动/禁用,后端服务器(haproxy-1.4.9以后版本) +resolvers mydns + nameserver dns1 114.114.114.114:53 + nameserver dns2 223.5.5.5:53 + frontend ss-in bind 127.0.0.1:2222 default_backend ss-out @@ -77,7 +81,7 @@ EOF fi echo the main server $COUNTER $server_ip $server_name $server_port $server_weight [ "$validate" = 1 ] && { - echo server $server_name $server_ip:$server_port weight $server_weight maxconn 1024 check inter 1500 rise 3 fall 3 >> $CFG_FILE + echo server $server_name $server_ip:$server_port weight $server_weight maxconn 1024 check resolvers mydns inter 1500 rise 3 fall 3 >> $CFG_FILE } iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT COUNTER=$(($COUNTER+1)) @@ -96,7 +100,7 @@ EOF fi echo the backup server $COUNTER $server_ip $server_name $server_port [ "$validate" = 1 ] && { - echo server $server_name $server_ip:$server_port weight 10 check backup inter 1500 rise 3 fall 3 >> $CFG_FILE + echo server $server_name $server_ip:$server_port weight 10 check resolvers mydns backup inter 1500 rise 3 fall 3 >> $CFG_FILE } iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT COUNTER=$(($COUNTER+1)) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 6de1192b1d..abf95d6255 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus -PKG_VERSION:=146 +PKG_VERSION:=147 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua index 4d11547a2c..a48aa43a19 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua @@ -116,7 +116,7 @@ end o = s:option(DummyValue, "switch_enable", translate("Auto Switch")) function o.cfgvalue(...) - return Value.cfgvalue(...) or "0" + return Value.cfgvalue(...) or "1" end o = s:option(DummyValue, "server_port", translate("Socket Connected")) diff --git a/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index 4dcff12ef5..2aac82e0e6 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -211,16 +211,16 @@ } else { url0 = ssu[1] } - var sstr = b64decsafe(url0); + var sstr = url0; document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "trojan"; document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event); var team = sstr.split('@'); - console.log(param); - var part1 = team[0].split(':'); - var part2 = team[1].split(':'); - document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0]; - document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1]; - document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1]; + var password = team[0] + var serverPart = team[1].split(':'); + var port = serverPart[1].split('?')[0]; + document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = serverPart[0]; + document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = port; + document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = password; if (param != undefined) { document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param); } diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 9309d668f9..2c7834881f 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -365,7 +365,7 @@ start_redir() { 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 [ "$(uci_get_by_name $GLOBAL_SERVER switch_enable 1)" == "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) diff --git a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua index 5661de3b6a..93fa2b8fb0 100644 --- a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua +++ b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua @@ -96,7 +96,7 @@ end local function processData(szType, content) local result = { -- auth_enable = '0', - switch_enable = '1', +-- switch_enable = '1', type = szType, local_port = 1234, -- timeout = 60, -- 不太确定 好像是死的 @@ -228,8 +228,11 @@ local function processData(szType, content) -- alias 不参与 hashkey 计算 local alias = result.alias result.alias = nil + local switch_enable = result.switch_enable + result.switch_enable = nil result.hashkey = md5(jsonStringify(result)) result.alias = alias + result.switch_enable = switch_enable return result end -- wget @@ -333,7 +336,15 @@ local execute = function() else log('忽略手动添加的节点: ' .. old.alias) end + + -- 保留原有节点的自动切换设置 + + if(old.switch_enable) + then + nodeResult.switch_enable = old.switch_enable + end end) + for k, v in ipairs(nodeResult) do for kk, vv in ipairs(v) do if not vv._ignore then