--[[ LuCI - Lua Configuration Interface ]]-- local taskd = require "luci.model.tasks" local libreddit_model = require "luci.model.libreddit" local m, s, o m = taskd.docker_map("libreddit", "libreddit", "/usr/libexec/apps/libreddit/libreddit.sh", translate("libreddit"), translate(" Libreddit is a portmanteau of libre (meaning freedom) and Reddit. It is a private frontend like Invidious but for Reddit. Browse the coldest takes of unpopularopinion without being tracked.") .. translate("Official website:") .. ' https://github.com/libreddit/libreddit/') s = m:section(SimpleSection, translate("Service Status"), translate("libreddit status:")) s:append(Template("libreddit/status")) s = m:section(TypedSection, "libreddit", translate("Setup"), translate("Refresh to update settings.")) s.addremove=false s.anonymous=true o = s:option(Value, "port", translate("Port").."*") o.rmempty = false o.default = "5741" o.datatype = "port" o = s:option(Value, "image_name", translate("Image").."*") o.rmempty = false o.datatype = "string" o:value("spikecodes/libreddit", "spikecodes/libreddit") o.default = "spikecodes/libreddit" local blocks = libreddit_model.blocks() local home = libreddit_model.home() o = s:option(Value, "config_path", translate("Config path").."*") o.rmempty = false o.datatype = "string" o:value("/opt/docker2/compose/libreddit", "/opt/docker2/compose/libreddit") o.default = "/opt/docker2/compose/libreddit" local paths, default_path = libreddit_model.find_paths(blocks, home, "Configs") for _, val in pairs(paths) do o:value(val, val) end o.default = default_path return m