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

1 year ago
--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local searxng_model = require "luci.model.searxng"
local m, s, o
m = taskd.docker_map("searxng", "searxng", "/usr/libexec/apps/searxng/searxng.sh",
translate("searxng"),
translate("Searx is a free and open-source metasearch engine, available under the GNU Affero General Public License version 3, with the aim of protecting the privacy of its users. To this end, Searx does not share users' IP addresses or search history with the search engines from which it gathers results.")
.. translate("Official website:") .. ' <a href=\"https://searx.github.io/searx/\" target=\"_blank\">https://searx.github.io/searx/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("searxng status:"))
s:append(Template("searxng/status"))
s = m:section(TypedSection, "searxng", 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 = "8123"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("paulgoio/searxng:production", "paulgoio/searxng:production")
o.default = "paulgoio/searxng:production"
local blocks = searxng_model.blocks()
local home = searxng_model.home()
o = s:option(Value, "config_path", translate("Config path").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/searxng", "/opt/docker2/compose/searxng")
o.default = "/opt/docker2/compose/searxng"
1 year ago
local paths, default_path = searxng_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m