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 whoogle_model = require "luci.model.whoogle"
local m, s, o
m = taskd.docker_map("whoogle", "whoogle", "/usr/libexec/apps/whoogle/whoogle.sh",
translate("Whoogle"),
translate("Whoogle is a free open-source self-hosted metasearch engine that allows you to search and get your Google results without ads, JavaScript trackers, or AMP links. It also ignores cookies, and does not perform any IP address tracking.")
.. translate("Official website:") .. ' <a href=\"https://hub.docker.com/r/benbusby/whoogle-search/\" target=\"_blank\">https://hub.docker.com/r/benbusby/whoogle-search/</a>')
s = m:section(SimpleSection, translate("Service Status"))
s:append(Template("whoogle/status"))
s = m:section(TypedSection, "whoogle", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:"))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.rmempty = false
o.default = "5000"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("benbusby/whoogle-search", "benbusby/whoogle-search")
o.default = "benbusby/whoogle-search"
local blocks = whoogle_model.blocks()
local home = whoogle_model.home()
o = s:option(Value, "config_path", translate("Config path").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/whoogle-app", "/opt/docker2/compose/whoogle-app")
o.default = "/opt/docker2/compose/whoogle-app"
local paths, default_path = whoogle_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m