mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-04 06:43:56 +08:00
Update ssr-plus.patch
This commit is contained in:
1 parent
59e843f42b
commit
92e723802b
1 file changed
+27
-23
@@ -1,6 +1,6 @@
|
|||||||
--- a/luci-app-ssr-plus/Makefile
|
--- a/luci-app-ssr-plus/Makefile
|
||||||
+++ b/luci-app-ssr-plus/Makefile
|
+++ b/luci-app-ssr-plus/Makefile
|
||||||
@@ -118,7 +118,7 @@ endchoice
|
@@ -99,7 +99,7 @@ endchoice
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "V2ray-core Selection"
|
prompt "V2ray-core Selection"
|
||||||
@@ -9,27 +9,16 @@
|
|||||||
default PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY
|
default PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY
|
||||||
|
|
||||||
config 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
|
--- a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
||||||
+++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
+++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua
|
||||||
@@ -76,10 +76,66 @@ function index()
|
@@ -663,6 +663,62 @@ function index()
|
||||||
entry({"admin", "services", "shadowsocksr", "remove_node"}, call("act_remove"))
|
entry({"admin", "services", "shadowsocksr", "clash_client_rule_clear"}, call("clash_client_rule_clear")).leaf = true
|
||||||
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情况
|
|
||||||
--[[Backup]]
|
--[[Backup]]
|
||||||
entry({"admin", "services", "shadowsocksr", "backup"}, call("create_backup")).leaf = true
|
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)
|
+function check_site(host, port)
|
||||||
+ local nixio = require "nixio"
|
+ local nixio = require "nixio"
|
||||||
+ local socket = nixio.socket("inet", "stream")
|
+ local socket = nixio.socket("inet", "stream")
|
||||||
@@ -83,19 +72,21 @@
|
|||||||
+ e.youtube = check_site('www.youtube.com', port)
|
+ e.youtube = check_site('www.youtube.com', port)
|
||||||
+ luci.http.prepare_content('application/json')
|
+ luci.http.prepare_content('application/json')
|
||||||
+ luci.http.write_json(e)
|
+ luci.http.write_json(e)
|
||||||
+end
|
end
|
||||||
+
|
|
||||||
function subscribe()
|
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
|
--- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua
|
||||||
+++ b/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
|
||||||
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
|
return m
|
||||||
|
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
@@ -234,6 +225,19 @@ index 000000000000..a00fff9c79b3
|
|||||||
|
|
||||||
--- a/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus
|
--- a/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus
|
||||||
+++ b/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
|
@@ -43,5 +43,8 @@ if [ -s "/etc/uwsgi/vassals/luci-webui.ini" ];then
|
||||||
/etc/init.d/uwsgi restart
|
/etc/init.d/uwsgi restart
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user