luci-app-adblock: User interface for the 'adblock' package
[project/luci.git] / applications / luci-app-adblock / luasrc / model / cbi / adblock.lua
1 -- Copyright 2016 Openwrt.org
2 -- Licensed to the public under the Apache License 2.0.
3
4 m = Map("adblock", translate("Adblock"),
5         translate("Configuration of the adblock package to block ad/abuse domains by using DNS."))
6
7 -- General options
8
9 s = m:section(NamedSection, "global", "adblock", translate("Global options"))
10
11 o1 = s:option(Flag, "adb_enabled", translate("Enable"))
12 o1.rmempty = false
13 o1.default = 0
14
15 o2 = s:option(Value, "adb_blacklist", translate("Blacklist file"),
16      translate("File with explicitly blacklisted hosts/domains."))
17 o2.rmempty = false
18 o2.datatype = "file"
19
20 o3 = s:option(Value, "adb_whitelist", translate("Whitelist file"),
21      translate("File with whitelisted hosts/domains that are allowed despite being on a blocklist."))
22 o3.rmempty = false
23 o3.datatype = "file"
24
25 s2 = m:section(NamedSection, "backup", "service", translate("Backup options"))
26
27 o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup"))
28 o4.rmempty = false
29 o4.default = 0
30
31 o5 = s2:option(Value, "adb_backupdir", translate("Backup directory"))
32 o5.rmempty = false
33 o5.datatype = "directory"
34
35 s3 = m:section(NamedSection, "debuglog", "service", translate("Debug log options"),
36         translate("Verbose log for debuging purposes."))
37
38 o6 = s3:option(Flag, "enabled", translate("Enable debug log"))
39 o6.rmempty = false
40 o6.default = 0
41
42 o7 = s3:option(Value, "adb_logfile", translate("Debug log file"))
43 o7.rmempty = false
44 o7.datatype = "string"
45
46 -- Blocklist options
47
48 s3 = m:section(TypedSection, "source", translate("Blocklist sources"),
49         translate("Available blocklist sources (")
50         .. [[<a href="https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md#main-features" target="_blank">]]
51         .. translate("see list details")
52         .. [[</a>]]
53         .. translate("). Note that list URLs and Shallalist category selections are not configurable via Luci."))
54
55 name = s3:option(Flag, "enabled", translate("Enabled"))
56 name.rmempty  = false
57
58
59 return m
60