You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB
Lua

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local simplex_model = require "luci.model.simplex"
local m, s, o
m = taskd.docker_map("simplex", "simplex", "/usr/libexec/apps/simplex/simplex.sh",
translate("simplex"),
translate("The first messaging platform that has no user identifiers of any kind - 100% private by design.")
.. translate("Official website:") .. ' <a href=\"https://github.com/simplex-chat/\" target=\"_blank\">https://github.com/simplex-chat/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("simplex status:"))
s:append(Template("simplex/status"))
s = m:section(TypedSection, "simplex", translate("Setup"), translate("Requires Wireguard with internal and external ports 5223 port forward."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.rmempty = false
o.default = "5223"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Wireguard IP Address").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("1.2.3.4", "1.2.3.4")
o.default = "1.2.3.4"
local blocks = simplex_model.blocks()
local home = simplex_model.home()
o = s:option(Value, "config_path", translate("Simplex config path").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/", "/opt/docker2/compose/")
o.default = "/opt/docker2/compose/"
local paths, default_path = simplex_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m