mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
Merge Lean's source
This commit is contained in:
parent
fe88b4d212
commit
84438f6031
@ -41,7 +41,7 @@ s=m:section(TypedSection,"main_server","<b>" .. 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","<b>" .. 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"
|
||||
-- ---------------------------------------------------
|
||||
|
@ -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 "生效"
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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"))
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user