344 lines
14 KiB
Diff
344 lines
14 KiB
Diff
diff --git a/luci-app-ssr-plus/Makefile b/luci-app-ssr-plus/Makefile
|
|
index 697d594..ce23c14 100644
|
|
--- a/luci-app-ssr-plus/Makefile
|
|
+++ b/luci-app-ssr-plus/Makefile
|
|
@@ -29,6 +29,7 @@ PKG_CONFIG_DEPENDS:= \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Simple_Obfs \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2ray_Plugin \
|
|
+ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Xray_Plugin \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Server \
|
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
|
|
@@ -62,6 +63,7 @@ LUCI_DEPENDS:= \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server:shadowsocks-rust-ssserver \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Simple_Obfs:simple-obfs \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2ray_Plugin:v2ray-plugin \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Xray_Plugin:xray-plugin \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client:shadowsocksr-libev-ssr-local \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client:shadowsocksr-libev-ssr-redir \
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Server:shadowsocksr-libev-ssr-server \
|
|
@@ -73,7 +75,7 @@ select PACKAGE_luci-lib-ipkg if PACKAGE_$(PKG_NAME)
|
|
|
|
choice
|
|
prompt "Shadowsocks Client Selection"
|
|
- default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client if aarch64 || x86_64
|
|
+ default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client if aarch64||arm||i386||mips||mipsel||x86_64
|
|
default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Client
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_NONE_Client
|
|
@@ -90,8 +92,8 @@ endchoice
|
|
|
|
choice
|
|
prompt "Shadowsocks Server Selection"
|
|
- default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server if aarch64
|
|
- default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Server if i386||x86_64||arm
|
|
+ default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server if aarch64||arm||i386||mips||mipsel||x86_64
|
|
+ default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Server
|
|
default PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_NONE_Server
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_NONE_Server
|
|
@@ -139,7 +141,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_DNSPROXY
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_MosDNS
|
|
bool "Include MosDNS"
|
|
- default y if aarch64||arm||i386||x86_64
|
|
+ default n
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria
|
|
bool "Include Hysteria"
|
|
@@ -187,6 +189,10 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2ray_Plugin
|
|
bool "Include Shadowsocks V2ray Plugin"
|
|
default n
|
|
|
|
+config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Xray_Plugin
|
|
+ bool "Include Shadowsocks Xray Plugin"
|
|
+ default n
|
|
+
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client
|
|
bool "Include ShadowsocksR Libev Client"
|
|
default y
|
|
diff --git a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
|
index 4ba5d06..636566c 100644
|
|
--- a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
|
+++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
|
@@ -7,7 +7,7 @@ function index()
|
|
call("act_reset")
|
|
end
|
|
local page
|
|
- page = entry({"admin", "services", "shadowsocksr"}, alias("admin", "services", "shadowsocksr", "client"), _("ShadowSocksR Plus+"), 10)
|
|
+ page = entry({"admin", "services", "shadowsocksr"}, alias("admin", "services", "shadowsocksr", "client"), _("ShadowSocksR Plus+"), 1)
|
|
page.dependent = true
|
|
page.acl_depends = { "luci-app-ssr-plus" }
|
|
entry({"admin", "services", "shadowsocksr", "client"}, cbi("shadowsocksr/client"), _("SSR Client"), 10).leaf = true
|
|
diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
|
index 0bf9474..c6194fa 100644
|
|
--- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
|
+++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
|
@@ -27,7 +27,7 @@ local function is_finded(e)
|
|
return luci.sys.exec(string.format('type -t -p "%s" 2>/dev/null', e)) ~= ""
|
|
end
|
|
|
|
-m = Map("shadowsocksr", translate("ShadowSocksR Plus+ Settings"), translate("<h3>Support SS/SSR/V2RAY/XRAY/TROJAN/NAIVEPROXY/SOCKS5/TUN etc.</h3>"))
|
|
+m = Map("shadowsocksr", translate("ShadowSocksR Plus+ Settings"))
|
|
m:section(SimpleSection).template = "shadowsocksr/status"
|
|
|
|
local server_table = {}
|
|
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm
|
|
index 4a16adc..5f6a673 100644
|
|
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm
|
|
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm
|
|
@@ -13,9 +13,9 @@
|
|
if (s)
|
|
{
|
|
if (rv.ret=="0")
|
|
- s.innerHTML ="<font style=\'color:green\'>"+"<%:Connect OK%>"+"</font>";
|
|
+ s.innerHTML ="<font color='green'>"+"<%:Connect OK%>"+"</font>";
|
|
else
|
|
- s.innerHTML ="<font style=\'color:red\'>"+"<%:Connect Error%>"+"</font>";
|
|
+ s.innerHTML ="<font color='red'>"+"<%:Connect Error%>"+"</font>";
|
|
}
|
|
btn.disabled = false;
|
|
btn.value = '<%:Check Connect%>';
|
|
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm
|
|
index ea4113d..da89fd5 100644
|
|
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm
|
|
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm
|
|
@@ -15,13 +15,13 @@
|
|
switch (rv.ret)
|
|
{
|
|
case 0:
|
|
- s.innerHTML ="<font style=\'color:green\'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+"</font>";
|
|
+ s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+"</font>";
|
|
break;
|
|
case 1:
|
|
- s.innerHTML ="<font style=\'color:green\'>"+"<%:No new data!%> "+"</font>";
|
|
+ s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
|
|
break;
|
|
default:
|
|
- s.innerHTML ="<font style=\'color:red\'>"+"<%:Refresh Error!%> "+"</font>";
|
|
+ s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
|
|
break;
|
|
}
|
|
}
|
|
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm
|
|
index ff0c486..1882ac5 100644
|
|
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm
|
|
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm
|
|
@@ -7,7 +7,7 @@
|
|
return false;
|
|
}
|
|
if (reset != "reset") {
|
|
- s.innerHTML = "<font style=\'color:red\'><%:The content entered is incorrect!%></font>";
|
|
+ s.innerHTML = "<font color='red'><%:The content entered is incorrect!%></font>";
|
|
return false;
|
|
}
|
|
btn.disabled = true;
|
|
@@ -15,7 +15,7 @@
|
|
murl=dataname;
|
|
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","reset")%>', { set:murl }, function(x,rv) {
|
|
btn.value = '<%:Reset complete%>';
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Reset complete%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Reset complete%></font>";
|
|
});
|
|
return false;
|
|
}
|
|
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm
|
|
index 2ba1be9..ed7148f 100644
|
|
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm
|
|
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm
|
|
@@ -18,7 +18,7 @@
|
|
const wsPath = wsPaths[index];
|
|
const tls = tlss[index];
|
|
if (!dom) res();
|
|
- port.innerHTML = '<font style=\"color:#0072c3\">connect</font>';
|
|
+ port.innerHTML = '<font color="#0072c3">connect</font>';
|
|
XHR.get('<%=luci.dispatcher.build_url("admin/services/shadowsocksr/ping")%>', {
|
|
index,
|
|
domain: dom.getAttribute("hint"),
|
|
@@ -34,11 +34,11 @@
|
|
if (result.ping < 200) col = '#ff7700';
|
|
if (result.ping < 100) col = '#249400';
|
|
}
|
|
- dom.innerHTML = `<font style=\"color:${col}\">${(result.ping ? result.ping : "--") + " ms"}</font>`;
|
|
+ dom.innerHTML = `<font color="${col}">${(result.ping ? result.ping : "--") + " ms"}</font>`;
|
|
if (result.socket) {
|
|
- port.innerHTML = '<font style=\"color:#249400\">ok</font>';
|
|
+ port.innerHTML = '<font color="#249400">ok</font>';
|
|
} else {
|
|
- port.innerHTML = '<font style=\"color:#ff0000\">fail</font>';
|
|
+ port.innerHTML = '<font color="#ff0000">fail</font>';
|
|
}
|
|
res();
|
|
});
|
|
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
|
|
index cf4ca1f..04f2896 100644
|
|
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
|
|
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
|
|
@@ -75,9 +75,9 @@ function export_ssr_url(btn, urlname, sid) {
|
|
textarea.select();
|
|
try {
|
|
document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Copy SSR to clipboard successfully.%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
|
|
} catch (ex) {
|
|
- s.innerHTML = "<font style=\'color:red\'><%:Unable to copy SSR to clipboard.%></font>";
|
|
+ s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
|
|
} finally {
|
|
document.body.removeChild(textarea);
|
|
}
|
|
@@ -89,7 +89,7 @@ function import_ssr_url(btn, urlname, sid) {
|
|
if (!s) return false;
|
|
var ssrurl = prompt("<%:Paste sharing link here%>", "");
|
|
if (ssrurl == null || ssrurl == "") {
|
|
- s.innerHTML = "<font style=\'color:red\'><%:User cancelled.%></font>";
|
|
+ s.innerHTML = "<font color='red'><%:User cancelled.%></font>";
|
|
return false;
|
|
}
|
|
s.innerHTML = "";
|
|
@@ -274,7 +274,7 @@ function import_ssr_url(btn, urlname, sid) {
|
|
document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
|
|
var rem = pdict['remarks'];
|
|
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = b64decutf8safe(rem);
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Import configuration information successfully.%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
|
return false;
|
|
case "trojan":
|
|
try {
|
|
@@ -367,7 +367,7 @@ function import_ssr_url(btn, urlname, sid) {
|
|
break;
|
|
}
|
|
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Import configuration information successfully.%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
|
return false;
|
|
case "vmess":
|
|
var sstr = b64DecodeUnicode(ssu[1]);
|
|
@@ -450,7 +450,7 @@ function import_ssr_url(btn, urlname, sid) {
|
|
document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].checked = true;
|
|
document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].dispatchEvent(event);
|
|
}
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Import configuration information successfully.%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
|
return false;
|
|
case "vless":
|
|
try {
|
|
@@ -568,10 +568,10 @@ function import_ssr_url(btn, urlname, sid) {
|
|
}
|
|
break;
|
|
}
|
|
- s.innerHTML = "<font style=\'color:green\'><%:Import configuration information successfully.%></font>";
|
|
+ s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
|
return false;
|
|
default:
|
|
- s.innerHTML = "<font style=\'color:red\'><%:Invalid format.%></font>";
|
|
+ s.innerHTML = "<font color='red'><%:Invalid format.%></font>";
|
|
return false;
|
|
}
|
|
}
|
|
diff --git a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
|
|
index 22b6c7c..f086636 100755
|
|
--- a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
|
|
+++ b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
|
|
@@ -1287,8 +1287,18 @@ start_server() {
|
|
echolog "Server:Socks5 Server$server_count Started!"
|
|
;;
|
|
esac
|
|
- iptables -t filter -A SSR-SERVER-RULE -p tcp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
|
|
- iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
|
|
+ ssr_server_port=$(uci show shadowsocksr | grep 'server_config.*server_port' | awk -F"'" '{print $2}' | tr "\n" " ")
|
|
+ if [ -n "$ssr_server_port" ]; then
|
|
+ uci -q delete firewall.shadowsocksr_server
|
|
+ uci set firewall.shadowsocksr_server=rule
|
|
+ uci set firewall.shadowsocksr_server.name="shadowsocksr_server"
|
|
+ uci set firewall.shadowsocksr_server.target="ACCEPT"
|
|
+ uci set firewall.shadowsocksr_server.src="wan"
|
|
+ uci set firewall.shadowsocksr_server.dest_port="$ssr_server_port"
|
|
+ uci set firewall.shadowsocksr_server.enabled="1"
|
|
+ uci commit firewall
|
|
+ /etc/init.d/firewall reload >/dev/null 2>&1
|
|
+ fi
|
|
return 0
|
|
}
|
|
gen_serv_include() {
|
|
@@ -1445,12 +1455,6 @@ stop() {
|
|
unlock
|
|
set_lock
|
|
/usr/bin/ssr-rules -f
|
|
- local srulecount=$(iptables -L | grep SSR-SERVER-RULE | wc -l)
|
|
- if [ $srulecount -gt 0 ]; then
|
|
- iptables -F SSR-SERVER-RULE
|
|
- iptables -t filter -D INPUT -j SSR-SERVER-RULE
|
|
- iptables -X SSR-SERVER-RULE 2>/dev/null
|
|
- fi
|
|
if [ -z "$switch_server" ]; then
|
|
$PS -w | grep -v "grep" | grep ssr-switch | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
|
|
rm -f /var/lock/ssr-switch.lock
|
|
@@ -1461,7 +1465,7 @@ stop() {
|
|
( \
|
|
# Graceful kill first, so programs have the chance to stop its subprocesses
|
|
$PS -w | grep -v "grep" | grep "$TMP_PATH" | awk '{print $1}' | xargs kill >/dev/null 2>&1 ; \
|
|
- sleep 3s; \
|
|
+ sleep 1s; \
|
|
# Force kill hanged programs
|
|
$PS -w | grep -v "grep" | grep "$TMP_PATH" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 ; \
|
|
)
|
|
@@ -1484,6 +1488,9 @@ stop() {
|
|
|
|
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
|
fi
|
|
+ uci -q delete firewall.shadowsocksr_server
|
|
+ uci commit firewall
|
|
+ /etc/init.d/firewall reload >/dev/null 2>&1
|
|
del_cron
|
|
unset_lock
|
|
}
|
|
diff --git a/luci-app-ssr-plus/root/etc/ssrplus/white.list b/luci-app-ssr-plus/root/etc/ssrplus/white.list
|
|
index 9055fcb..8c3ca2b 100644
|
|
--- a/luci-app-ssr-plus/root/etc/ssrplus/white.list
|
|
+++ b/luci-app-ssr-plus/root/etc/ssrplus/white.list
|
|
@@ -1,7 +1,37 @@
|
|
-bilibili.com
|
|
-bilibili.cn
|
|
-bilivideo.com
|
|
-bilivideo.cn
|
|
+aaplimg.com
|
|
+account.synology.com
|
|
+apple-cloudkit.com
|
|
+apple.co
|
|
+apple.com
|
|
+apple.com.cn
|
|
+appstore.com
|
|
biliapi.com
|
|
biliapi.net
|
|
-apple.com
|
|
\ No newline at end of file
|
|
+bilibili.cn
|
|
+bilibili.com
|
|
+bilivideo.cn
|
|
+bilivideo.com
|
|
+bing.com
|
|
+cdn-apple.com
|
|
+checkip.dyndns.org
|
|
+checkip.synology.com
|
|
+checkipv6.synology.com
|
|
+checkport.synology.com
|
|
+crashlytics.com
|
|
+ddns.synology.com
|
|
+gitmirror.com
|
|
+icloud-content.com
|
|
+icloud.com
|
|
+icloud.com.cn
|
|
+images-cn.ssl-images-amazon.com
|
|
+mirrorlist.centos.org
|
|
+mzstatic.com
|
|
+office365.com
|
|
+officecdn-microsoft-com.akamaized.net
|
|
+teamviewer.com
|
|
+whatismyip.akamai.com
|
|
+windows.com
|
|
+windowsupdate.com
|
|
+worldbank.org
|
|
+worldscientific.com
|
|
+www-cdn.icloud.com.akadns.net
|