mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 08:45:13 +08:00
Update ssr-plus.patch
This commit is contained in:
1 parent
06a1f58918
commit
6708a1d2e8
1 file changed
+27
-23
@@ -1,6 +1,6 @@
|
||||
--- a/luci-app-ssr-plus/Makefile
|
||||
+++ b/luci-app-ssr-plus/Makefile
|
||||
@@ -118,7 +118,7 @@ endchoice
|
||||
@@ -99,7 +99,7 @@ endchoice
|
||||
|
||||
choice
|
||||
prompt "V2ray-core Selection"
|
||||
@@ -9,27 +9,16 @@
|
||||
default PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY
|
||||
@@ -169,7 +169,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 y if aarch64||i386||x86_64
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria
|
||||
bool "Include Hysteria"
|
||||
|
||||
--- a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
||||
+++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
||||
@@ -76,10 +76,66 @@ function index()
|
||||
entry({"admin", "services", "shadowsocksr", "remove_node"}, call("act_remove"))
|
||||
entry({"admin", "services", "shadowsocksr", "save_node_order"}, call("act_save_order")).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "get_now_use_node"}, call("act_get_now_use_node")).leaf = true
|
||||
+ entry({'admin', 'services', "shadowsocksr", 'ip'}, call('check_ip')) -- 获取ip情况
|
||||
@@ -663,6 +663,62 @@ function index()
|
||||
entry({"admin", "services", "shadowsocksr", "clash_client_rule_clear"}, call("clash_client_rule_clear")).leaf = true
|
||||
--[[Backup]]
|
||||
entry({"admin", "services", "shadowsocksr", "backup"}, call("create_backup")).leaf = true
|
||||
end
|
||||
|
||||
+ entry({'admin', 'services', "shadowsocksr", 'ip'}, call('check_ip')) -- 获取ip情况
|
||||
+end
|
||||
+
|
||||
+function check_site(host, port)
|
||||
+ local nixio = require "nixio"
|
||||
+ local socket = nixio.socket("inet", "stream")
|
||||
@@ -83,19 +72,21 @@
|
||||
+ e.youtube = check_site('www.youtube.com', port)
|
||||
+ luci.http.prepare_content('application/json')
|
||||
+ luci.http.write_json(e)
|
||||
+end
|
||||
+
|
||||
end
|
||||
|
||||
function subscribe()
|
||||
luci.sys.call("/usr/bin/lua /usr/share/shadowsocksr/subscribe.lua >>/var/log/ssrplus.log")
|
||||
luci.http.prepare_content("application/json")
|
||||
|
||||
--- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
||||
+++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
||||
@@ -293,4 +293,5 @@ if is_finded("chinadns-ng") then
|
||||
@@ -227,7 +227,7 @@ if is_finded("chinadns-ng") then
|
||||
end
|
||||
end
|
||||
|
||||
+m:section(SimpleSection).template = "shadowsocksr/status_bottom"
|
||||
-local dns_defaults_section = m:section(SimpleSection)
|
||||
-dns_defaults_section.template = "shadowsocksr/client_dns_defaults"
|
||||
+m:append(Template("shadowsocksr/client_dns_defaults"))
|
||||
+m:append(Template("shadowsocksr/status_bottom"))
|
||||
|
||||
return m
|
||||
|
||||
new file mode 100644
|
||||
@@ -234,6 +225,19 @@ index 000000000000..a00fff9c79b3
|
||||
|
||||
--- a/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus
|
||||
+++ b/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus
|
||||
@@ -29,6 +29,12 @@ touch /etc/ssrplus/ad.conf
|
||||
touch /etc/config/shadowsocksr
|
||||
|
||||
if [ -s "/etc/config/shadowsocksr" ]; then
|
||||
+ if ! uci -q get shadowsocksr.@server_subscribe_item[0] > /dev/null; then
|
||||
+ sid_output="$(uci add shadowsocksr server_subscribe_item)"
|
||||
+ uci -q set shadowsocksr.$sid_output.enabled=1
|
||||
+ uci -q set shadowsocksr.$sid_output.alias="Subscribe default"
|
||||
+ fi
|
||||
+
|
||||
if uci -q get shadowsocksr.@server_subscribe[0].auto_update_time > /dev/null; then
|
||||
uci -q delete shadowsocksr.@server_subscribe[0].auto_update_time
|
||||
fi
|
||||
@@ -43,5 +43,8 @@ if [ -s "/etc/uwsgi/vassals/luci-webui.ini" ];then
|
||||
/etc/init.d/uwsgi restart
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user