--[[ 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:") .. ' https://github.com/simplex-chat/') 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").."*") o.rmempty = false o.default = "5223" o.datatype = "port" o = s:option(Value, "image_name", translate("Wireguard IP Address").."*") 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").."*") 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