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

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local mastodon_model = require "luci.model.mastodon"
local m, s, o
m = taskd.docker_map("mastodon", "mastodon", "/usr/libexec/apps/mastodon/mastodon.sh",
translate("mastodon"),
translate("Mastodon is a decentralized social network made up of independent servers organized around specific themes, topics, or interests. People can join servers, follow each other, engage in conversations, and otherwise do all sorts of things they'd expect to do on a social network like Twitter.")
.. translate("Official website:") .. ' <a href=\"https://joinmastodon.org/\" target=\"_blank\">https://joinmastodon.org/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("mastodon status:"))
s:append(Template("mastodon/status"))
s = m:section(TypedSection, "mastodon", translate("Setup"), translate("Enter domain name instead of router ip if self hosting via domain."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.rmempty = false
o.default = "8660"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("lscr.io/linuxserver/mastodon:latest", "lscr.io/linuxserver/mastodon:latest")
o.default = "lscr.io/linuxserver/mastodon:latest"
local blocks = mastodon_model.blocks()
local home = mastodon_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 = mastodon_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m