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.7 KiB
Lua

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local discourse_model = require "luci.model.discourse"
local m, s, o
m = taskd.docker_map("discourse", "discourse", "/usr/libexec/apps/discourse/discourse.sh",
translate("discourse"),
translate("Discourse is an open source discussion platform with built-in moderation and governance systems that let discussion communities protect themselves from bad actors even without official moderators.")
.. translate("Official website:") .. ' <a href=\"https://hub.docker.com/r/bitnami/discourse/\" target=\"_blank\">https://hub.docker.com/r/bitnami/discourse/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("discourse status:"))
s:append(Template("discourse/status"))
s = m:section(TypedSection, "discourse", translate("Setup"), translate("Refresh to update settings."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.rmempty = false
o.default = "8787"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("docker.io/bitnami/discourse", "docker.io/bitnami/discourse")
o.default = "docker.io/bitnami/discourse"
local blocks = discourse_model.blocks()
local home = discourse_model.home()
o = s:option(Value, "config_path", translate("Enter router IP or domain name").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("192.168.70.1", "192.168.70.1")
o.default = "192.168.70.1"
local paths, default_path = discourse_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m