🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 97c049ed0a
commit 0acff03804
14253 files changed
+3893239

No files matched your search

@@ -0,0 +1,11 @@
module("luci.controller.mproxy", package.seeall)
function index()
if not nixio.fs.access("/etc/config/mproxy") then
return
end
local page
page = entry({"admin", "services", "mproxy"}, cbi("mproxy"), _("Mproxy Server"), 100)
page.i18n = "mproxy"
page.dependent = true
end
@@ -0,0 +1,37 @@
local m,s,o
local SYS = require "luci.sys"
if SYS.call("pidof mproxy >/dev/null") == 0 then
Status = translate("<strong><font color=\"green\">Mproxy is Running</font></strong>")
else
Status = translate("<strong><font color=\"red\">Mproxy is Not Running</font></strong>")
end
m = Map("mproxy")
m.title = translate("Mproxy Server")
m.description = translate("A mini HTTP/HTTPS Proxy Server for Something")
s = m:section(TypedSection, "mproxy", "")
s.addremove = false
s.anonymous = true
s.description = translate(string.format("%s<br /><br />", Status))
enable = s:option(Flag, "enabled", translate("Enable"))
enable.default = 0
enable.rmempty = false
port = s:option(Value, "port", translate("Port"))
port.datatype = "range(1,65535)"
redir = s:option(Value, "redir", translate("Redirect to Local Port"))
redir.datatype = "range(1,65535)"
redir.rmempty = false
redir.description = translate("Redirecting traffic incoming to the specified local port")
function m.on_after_commit(self)
os.execute("uci set firewall.mproxy.dest_port=$(uci get mproxy.config.port) && uci commit firewall && /etc/init.d/firewall restart")
os.execute("/etc/init.d/mproxy restart")
end
return m