From d652ed3dc1034e2dd347ccaa82ffd52037b5af26 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 1 Mar 2020 15:59:36 +0800 Subject: [PATCH] Merge Lean's source --- .../luasrc/model/cbi/adbyby.lua | 2 +- .../luci-app-adbyby-plus/po/zh_Hans/adbyby.po | 12 + .../po/zh_Hans/luci-app-adbyby-plus.po | 208 ------------------ package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luasrc/view/shadowsocksr/ssrurl.htm | 19 +- .../root/etc/init.d/shadowsocksr | 2 +- .../share/shadowsocksr/gentrojanconfig.lua | 4 +- .../root/usr/share/shadowsocksr/subscribe.lua | 37 ++-- tools/upx/Makefile | 4 +- 9 files changed, 57 insertions(+), 233 deletions(-) delete mode 100644 package/lean/luci-app-adbyby-plus/po/zh_Hans/luci-app-adbyby-plus.po diff --git a/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua b/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua index 386c480855..037ae3e87d 100644 --- a/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua +++ b/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua @@ -38,7 +38,7 @@ o.rmempty = false o = s:taboption("basic", Button, "restart") o.title = translate("Adbyby and Rule state") o.inputtitle = translate("Restart Adbyby") -o.description = string.format("Last Update Checked: %s
Lazy Rule:%s
Video Rule:%s", UD, DL, DV) +o.description = string.format(""..translate("Last Update Checked")..": %s
"..translate("Lazy Rule")..":%s
"..translate("Video Rule")..":%s", UD, DL, DV) o.inputstyle = "reload" o.write = function() SYS.call("rm -rf /tmp/adbyby.updated && /usr/share/adbyby/admem.sh > /tmp/adupdate.log 2>&1 &") diff --git a/package/lean/luci-app-adbyby-plus/po/zh_Hans/adbyby.po b/package/lean/luci-app-adbyby-plus/po/zh_Hans/adbyby.po index b0842860c6..e1274dc543 100644 --- a/package/lean/luci-app-adbyby-plus/po/zh_Hans/adbyby.po +++ b/package/lean/luci-app-adbyby-plus/po/zh_Hans/adbyby.po @@ -123,3 +123,15 @@ msgstr "全局过滤" msgid "Update adbyby rules form official website first" msgstr "优先从官方网站更新规则" +msgid "Last Update Checked" +msgstr "上一次检查规则更新" + +msgid "Lazy Rule" +msgstr "普通规则版本" + +msgid "Video Rule" +msgstr "视频规则版本" + +msgid "Adblock Plus Host List" +msgstr "广告屏蔽大师 Plus 规则列表" + diff --git a/package/lean/luci-app-adbyby-plus/po/zh_Hans/luci-app-adbyby-plus.po b/package/lean/luci-app-adbyby-plus/po/zh_Hans/luci-app-adbyby-plus.po deleted file mode 100644 index 4606d4c32d..0000000000 --- a/package/lean/luci-app-adbyby-plus/po/zh_Hans/luci-app-adbyby-plus.po +++ /dev/null @@ -1,208 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: zh-Hans\n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" - -#: luasrc/model/cbi/adbyby.lua:150 -msgid "Client Filter Mode Settings" -msgstr "客户端过滤模式设置" - -#: luasrc/controller/adbyby.lua:9 -msgid "ADBYBY Plus +" -msgstr "广告屏蔽大师 Plus+" - -#: luasrc/model/cbi/adbyby.lua:15 -msgid "Adbyby Plus +" -msgstr "广告屏蔽大师 Plus+" - -#: luasrc/model/cbi/adbyby.lua:16 -msgid "" -"Adbyby Plus + can filter all kinds of banners, popups, video ads, and " -"prevent tracking, privacy theft and a variety of malicious websites
Plus + version combination mode can operation with " -"Adblock Plus Host,filtering ads without losing bandwidth" -msgstr "" -"广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私" -"窃取及各种恶意网站
Plus + 版本可以和 Adblock Plus " -"Host 结合方式运行,过滤广告不损失带宽" - -#: luasrc/model/cbi/adbyby.lua:46 -msgid "Adbyby and Rule state" -msgstr "规则状态" - -#: luasrc/model/cbi/adbyby.lua:56 -msgid "Advance Setting" -msgstr "高级设置" - -#: luasrc/model/cbi/adbyby.lua:23 -msgid "Base Setting" -msgstr "基本设置" - -#: luasrc/model/cbi/adbyby.lua:106 -msgid "Black Domain List" -msgstr "域名黑名单" - -#: luasrc/model/cbi/adbyby.lua:121 -msgid "Black IP List" -msgstr "IP黑名单" - -#: luasrc/model/cbi/adbyby.lua:72 -msgid "Block Apple iOS OTA update" -msgstr "拦截 Apple iOS 的OTA更新" - -#: luasrc/model/cbi/adbyby.lua:91 -msgid "Bypass Domain List" -msgstr "域名白名单" - -#: luasrc/view/adbyby/adbyby_status.htm:20 -msgid "Collecting data..." -msgstr "" - -#: luasrc/model/cbi/adbyby.lua:140 -msgid "" -"Each line of the beginning exclamation mark is considered an annotation." -msgstr "每行一条规则,感叹号开头的被认为是注释" - -#: luasrc/model/cbi/adbyby.lua:26 -msgid "Enable" -msgstr "" - -#: luasrc/model/cbi/adbyby.lua:167 -msgid "Filter Mode" -msgstr "过滤模式" - -#: luasrc/model/cbi/adbyby.lua:151 -msgid "" -"Filter mode settings can be set to specific LAN clients ( " -"No filter , Global filter ) . Does not need to be set by default." -msgstr "" -"可以为局域网客户端分别设置不同的过滤模式 ( 不过滤 , 全局过" -"滤 ) 。默认无需设置" - -#: luasrc/model/cbi/adbyby.lua:32 -msgid "Global Mode(The slowest, the best effects)" -msgstr "全局模式(最慢, 效果最好)" - -#: luasrc/model/cbi/adbyby.lua:172 -msgid "Global filter" -msgstr "全局过滤" - -#: luasrc/model/cbi/adbyby.lua:157 -msgid "IP Address" -msgstr "IP地址" - -#: luasrc/model/cbi/adbyby.lua:65 -msgid "Manually force update" -msgstr "手动强制更新" - -#: luasrc/model/cbi/adbyby.lua:64 -msgid "Manually force update
Adblock Plus Host List" -msgstr "手动强制更新
Adblock Plus Host List" - -#: luasrc/view/adbyby/adbyby_status.htm:10 -msgid "NOT RUNNING" -msgstr "" - -#: luasrc/model/cbi/adbyby.lua:171 -msgid "No filter" -msgstr "不过滤" - -#: luasrc/model/cbi/adbyby.lua:34 -msgid "No filter Mode (Must set in Client Filter Mode Settings manually)" -msgstr "手动代理模式(必须手动设置浏览器代理,或者客户端过滤模式设置)" - -#: luasrc/model/cbi/adbyby.lua:64 -msgid "" -"Note: It needs to download and convert the rules. The background process may " -"takes 60-120 seconds to run.
After completed it would automatically " -"refresh, please do not duplicate click!" -msgstr "" -"注意:需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新,请" -"不要重复点击!" - -#: luasrc/model/cbi/adbyby.lua:33 -msgid "" -"Plus + Mode(Filter domain name list and blacklist website.Recommended)" -msgstr "Plus + 模式(只过滤列表内域名结合ABP名单。推荐!)" - -#: luasrc/model/cbi/adbyby.lua:76 -msgid "Plus+ Domain List" -msgstr "Plus+ 模式过滤的域名" - -#: luasrc/model/cbi/adbyby.lua:39 -msgid "RAM Running Mode" -msgstr "内存运行模式" - -#: luasrc/view/adbyby/adbyby_status.htm:7 -msgid "RUNNING" -msgstr "" - -#: luasrc/model/cbi/adbyby.lua:47 -msgid "Restart Adbyby" -msgstr "重启Adbyby" - -#: luasrc/model/cbi/adbyby.lua:42 -msgid "Running Adbyby in RAM.More speed,less disk consumption" -msgstr "在内存中运行Adbyby。更快的速度,更少的存储空间损耗" - -#: luasrc/model/cbi/adbyby.lua:31 -msgid "Running Mode" -msgstr "运行模式" - -#: luasrc/model/cbi/adbyby.lua:59 -msgid "Update the rule at 6 a.m. every morning and restart adbyby" -msgstr "每天凌晨6点更新规则并重启" - -#: luasrc/model/cbi/adbyby.lua:136 -msgid "User-defined Rule" -msgstr "用户自定义规则" - -#: luasrc/model/cbi/adbyby.lua:80 -msgid "" -"(!)Note that you should fill to the domain name ONLY. For example, http://" -"www.baidu.com only needs to write to baidu.com. One line for each" -msgstr "" -"这些域名在 Plus 模式中会被过滤。你需要要填写域名即可,例如 http://www.baidu." -"com,你写 baidu.com 即可。每行一个域名" - -#: luasrc/model/cbi/adbyby.lua:110 -msgid "(!)Will Always block these Domain" -msgstr "拦截黑名单内的域名(所有模式中生效)" - -#: luasrc/model/cbi/adbyby.lua:125 -msgid "(!)Will Always block these IP" -msgstr "拦截黑名单内的IP地址(所有模式中生效)" - -#: luasrc/model/cbi/adbyby.lua:95 -msgid "(!)Will Never filter these Domain" -msgstr "永不过滤白名单内的域名(所有模式中生效)" - -#~ msgid "" -#~ "Adbyby Plus + is Running" -#~ msgstr "" -#~ "广告屏蔽大师 Plus + 正在运行" - -#~ msgid "" -#~ "Adbyby Plus + is Not Running" -#~ msgstr "" -#~ "广告屏蔽大师 Plus + 没有运行" - -#~ msgid "Transparent proxy" -#~ msgstr "透明代理" - -#~ msgid "Click to disable" -#~ msgstr "点击关闭" - -#~ msgid "Click to enable" -#~ msgstr "点击开启" - -#~ msgid "Adblock Plus Host List:" -#~ msgstr "Adblock Plus Host 列表:" - -#~ msgid "Update adbyby rules form official website first" -#~ msgstr "优先从官方网站更新规则" diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 6fc7385cc4..8f887bc622 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=154 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 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 2aac82e0e6..67aad5f534 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 @@ -212,15 +212,32 @@ url0 = ssu[1] } var sstr = url0; + document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "trojan"; document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event); var team = sstr.split('@'); var password = team[0] var serverPart = team[1].split(':'); - var port = serverPart[1].split('?')[0]; + var others = serverPart[1].split('?'); + var port = others[0] + var queryParam = {} + if(others.length > 0) { + var queryParams = others[1] + var queryArray = queryParams.split('&') + for (i = 0; i < queryArray.length; i++) { + var params = queryArray[i].split('='); + queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || ''); + } + } + 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; + document.getElementById('cbid.shadowsocksr.' + sid + '.tls').checked = true; + document.getElementById('cbid.shadowsocksr.' + sid + '.tls').dispatchEvent(event); + document.getElementById('cbid.shadowsocksr.' + sid + '.tls_host').value = queryParam.peer || ''; + document.getElementById('cbid.shadowsocksr.' + sid + '.insecure').checked = queryParam.allowInsecure === '1'; + 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 7d866a9b10..4694d4684e 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 @@ -45,7 +45,7 @@ add_cron() { sed -i '/shadowsocksr/d' $CRON_FILE sed -i '/ssrplus.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/ssrplus.log' >>$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/bin/lua /usr/share/shadowsocksr/subscribe.lua" >>$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/bin/lua /usr/share/shadowsocksr/update.lua" >>$CRON_FILE + [ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 5 * * * /usr/bin/lua /usr/share/shadowsocksr/update.lua" >>$CRON_FILE crontab $CRON_FILE } diff --git a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gentrojanconfig.lua b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gentrojanconfig.lua index 719e3fbbcf..8cb979bef8 100644 --- a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gentrojanconfig.lua +++ b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gentrojanconfig.lua @@ -18,8 +18,8 @@ local trojan = { password = {server.password}, -- 传出连接 ssl = { - verify = false, - verify_hostname = (server.tls == "1") and false or true, + verify = (server.insecure == "0") and true or false, + verify_hostname = (server.tls == "1") and true or false, cert = "", cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA", cipher_tls13 = "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384", 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 131919ad8b..26e225f817 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,14 +96,8 @@ end -- 处理数据 local function processData(szType, content) local result = { - -- auth_enable = '0', - -- switch_enable = '1', type = szType, local_port = 1234, - -- timeout = 60, -- 不太确定 好像是死的 - -- fast_open = 0, - -- kcp_enable = 0, - -- kcp_port = 0, kcp_param = '--nocomp' } if szType == 'ssr' then @@ -238,6 +232,9 @@ local function processData(szType, content) result.alias = UrlDecode(alias) result.type = "trojan" result.server = host[1] + -- 按照官方的建议 默认验证ssl证书 + result.insecure = "0" + result.tls = "1" if host[2]:find("?") then local query = split(host[2], "?") result.server_port = query[1] @@ -246,10 +243,17 @@ local function processData(szType, content) local t = split(v, '=') params[t[1]] = t[2] end + if params.peer then - result.tls = "1" + -- 未指定peer(sni)默认使用remote addr result.tls_host = params.peer end + + if params.allowInsecure == "1" then + result.insecure = "1" + else + result.insecure = "0" + end else result.server_port = host[2] end @@ -296,10 +300,10 @@ local execute = function() nodes = base64Decode(raw:sub(nEnd + 1, #raw)) nodes = jsonParse(nodes) local extra = { - airport = nodes.airport, - port = nodes.port, - encryption = nodes.encryption, - password = nodes.password + airport = nodes.airport, + port = nodes.port, + encryption = nodes.encryption, + password = nodes.password } local servers = {} -- SS里面包着 干脆直接这样 @@ -336,8 +340,9 @@ local execute = function() result.alias:find("QQ群") or result.alias:find("官网") or result.alias:find("防失联地址") or - not result.server - then + not result.server or + result.server:match("[^0-9a-zA-Z%-%.%s]") -- 中文做地址的 也没有人拿中文域名搞,就算中文域也有Puny Code SB 机场 + then log('丢弃无效节点: ' .. result.type ..' 节点, ' .. result.alias) else log('成功解析: ' .. result.type ..' 节点, ' .. result.alias) @@ -374,11 +379,11 @@ local execute = function() end else if not old.alias then - old.alias = old.server .. ':' .. old.server_port - end + old.alias = old.server .. ':' .. old.server_port + end log('忽略手动添加的节点: ' .. old.alias) end - + end) for k, v in ipairs(nodeResult) do for kk, vv in ipairs(v) do diff --git a/tools/upx/Makefile b/tools/upx/Makefile index 127acd0dab..fbf1dfbd2e 100644 --- a/tools/upx/Makefile +++ b/tools/upx/Makefile @@ -17,10 +17,8 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)-src include $(INCLUDE_DIR)/host-build.mk -UPX_UCLDIR := $(BUILD_DIR_HOST)/ucl-1.03 - define Host/Compile - UPX_UCLDIR=$(UPX_UCLDIR) \ + UPX_UCLDIR=$(STAGING_DIR_HOST) \ $(MAKE) -C $(HOST_BUILD_DIR)/src \ CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS)" \ CXX="$(HOSTCXX)"