mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 12:05:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
0d155c70be
commit
32600acc60
14258 files changed
+3954570
No files matched your search
@@ -0,0 +1,18 @@
|
||||
module("luci.controller.ssrs", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/ssrs") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "ssrs"}, cbi("ssrs"), _("SSR Python Server"), 4).dependent = true
|
||||
entry({"admin", "vpn", "ssrs", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("ps -w | grep ssrs.json |grep -v grep >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -0,0 +1,81 @@
|
||||
local a, t, e
|
||||
local m, s
|
||||
local o = require"nixio.fs"
|
||||
local n = {
|
||||
"none",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"rc4",
|
||||
"rc4-md5",
|
||||
"rc4-md5-6",
|
||||
"chacha20",
|
||||
"chacha20-ietf-poly1305",
|
||||
}
|
||||
|
||||
local s = {
|
||||
"origin",
|
||||
"verify_deflate",
|
||||
"auth_sha1_v4",
|
||||
"auth_aes128_md5",
|
||||
"auth_aes128_sha1",
|
||||
"auth_chain_a",
|
||||
"auth_chain_b",
|
||||
"auth_chain_c",
|
||||
"auth_chain_d",
|
||||
"auth_chain_e",
|
||||
"auth_chain_f",
|
||||
}
|
||||
|
||||
local i = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
"random_head",
|
||||
"tls1.2_ticket_auth",
|
||||
"tls1.2_ticket_fastauth",
|
||||
}
|
||||
|
||||
local o = {
|
||||
"false",
|
||||
"true",
|
||||
}
|
||||
|
||||
a = Map("ssrs")
|
||||
a.title = translate("ShadowSocksR Server Config")
|
||||
a.description = translate("ShadowsocksR Python Server is a fork of the Shadowsocks project, claimed to be superior in terms of security and stability")
|
||||
|
||||
a:section(SimpleSection).template = "ssrs/ssrs_status"
|
||||
|
||||
t = a:section(TypedSection, "server")
|
||||
t.anonymous = true
|
||||
t.addremove = false
|
||||
|
||||
e = t:option(Flag, "enable", translate("Enable"))
|
||||
e.rmempty = false
|
||||
|
||||
e = t:option(Value, "server_port", translate("Server Port"))
|
||||
e.datatype = "port"
|
||||
e.rmempty = false
|
||||
e.default = 139
|
||||
|
||||
e = t:option(Value, "password", translate("Password"))
|
||||
e.password = true
|
||||
e.rmempty = false
|
||||
|
||||
e = t:option(ListValue, "encrypt_method", translate("Encrypt Method"))
|
||||
for a, t in ipairs(n)do e:value(t)end
|
||||
e.rmempty = false
|
||||
|
||||
e = t:option(ListValue, "protocol", translate("Protocol"))
|
||||
for a, t in ipairs(s)do e:value(t)end
|
||||
e.rmempty = false
|
||||
|
||||
e = t:option(ListValue, "obfs", translate("Obfs"))
|
||||
for a, t in ipairs(i)do e:value(t)end
|
||||
e.rmempty = false
|
||||
|
||||
return a
|
||||
@@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[ssrs]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('ssrs_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>ShadowsocksR Python <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>ShadowsocksR Python <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="ssrs_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
Reference in new issue
Block a user