mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add basic IPv6 support and replace haproxy by nginx for VPS failover
This commit is contained in:
parent
2f4e19176c
commit
715d53300d
23 changed files with 1419 additions and 9 deletions
7
luci-app-nginx-ha/luasrc/controller/nginx-ha.lua
Normal file
7
luci-app-nginx-ha/luasrc/controller/nginx-ha.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
module("luci.controller.nginx-ha", package.seeall)
|
||||
|
||||
function index()
|
||||
entry(
|
||||
{"admin", "services", "nginx-ha"},
|
||||
cbi("nginx-ha"), _("Nginx High Availability"), 55)
|
||||
end
|
46
luci-app-nginx-ha/luasrc/model/cbi/nginx-ha.lua
Normal file
46
luci-app-nginx-ha/luasrc/model/cbi/nginx-ha.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
local m, s, o
|
||||
|
||||
if luci.sys.call("pgrep nginx >/dev/null") == 0 then
|
||||
m = Map("nginx-ha", translate("Nginx High Availability"), "%s - %s" %{translate("Nginx High Availability"), translate("RUNNING")})
|
||||
else
|
||||
m = Map("nginx-ha", translate("Nginx High Availability"), "%s - %s" %{translate("Nginx High Availability"), translate("NOT RUNNING")})
|
||||
end
|
||||
|
||||
s = m:section(TypedSection, "general", translate("General Setting"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enable", translate("Enable"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "startup_delay", translate("Startup Delay"))
|
||||
o:value(0, translate("Not enabled"))
|
||||
for _, v in ipairs({5, 10, 15, 25, 40}) do
|
||||
o:value(v, translate("%u seconds") %{v})
|
||||
end
|
||||
o.datatype = "uinteger"
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "listen", translate("Listen Address:Port"))
|
||||
o.placeholder = "0.0.0.0:6666"
|
||||
o.default = "0.0.0.0:6666"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "timeout", translate("Timeout Connect (ms)"))
|
||||
o.placeholder = "666"
|
||||
o.default = "666"
|
||||
o.datatype = "range(33, 10000)"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "retries", translate("Retries"))
|
||||
o.placeholder = "1"
|
||||
o.default = "1"
|
||||
o.datatype = "range(1, 10)"
|
||||
o.rmempty = false
|
||||
|
||||
|
||||
o = s:option(DynamicList, "upstreams", translate("UpStream Server"), translate("e.g. [123.123.123.123:65101 weight=1 max_fails=3 fail_timeout=30s]"))
|
||||
o.placeholder = "123.123.123.123:65101 weight=1 max_fails=3 fail_timeout=30s"
|
||||
o.rmempty = false
|
||||
|
||||
return m
|
Loading…
Add table
Add a link
Reference in a new issue