1 -- Copyright 2016 Openwrt.org
2 -- Licensed to the public under the Apache License 2.0.
4 m = Map("adblock", translate("Adblock"),
5 translate("Configuration of the adblock package to block ad/abuse domains by using DNS."))
9 s = m:section(NamedSection, "global", "adblock", translate("Global options"))
11 o1 = s:option(Flag, "adb_enabled", translate("Enable adblock"))
15 o3 = s:option(Value, "adb_whitelist", translate("Whitelist file"),
16 translate("File with whitelisted hosts/domains that are allowed despite being on a blocklist."))
20 fdns = s:option(Flag, "adb_forcedns", translate("Redirect all DNS queries to the local resolver"),
21 translate("When adblock is active, all DNS queries are redirected to the local resolver " ..
22 "in this server by default. You can disable that to allow queries to external DNS servers."))
24 fdns.default = fdns.enabled
26 tot = s:option(DummyValue, "adb_overall_count", translate("Total count of blocked domains"))
30 bl = m:section(TypedSection, "source", translate("Blocklist sources"),
31 translate("Available blocklist sources (")
32 .. [[<a href="https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md" target="_blank">]]
33 .. translate("see list details")
35 .. translate("). Note that list URLs and Shallalist category selections are not configurable via Luci."))
36 bl.template = "cbi/tblsection"
38 name = bl:option(Flag, "enabled", translate("Enabled"))
41 des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
42 cou = bl:option(DummyValue, "adb_src_count", translate("Count"))
43 upd = bl:option(DummyValue, "adb_src_timestamp", translate("List date/state"))
47 s2 = m:section(NamedSection, "backup", "service", translate("Backup options"))
49 o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup"))
53 o5 = s2:option(Value, "adb_dir", translate("Backup directory"))
55 o5.datatype = "directory"
59 e = m:section(NamedSection, "global", "adblock", translate("Extra options"),
60 translate("Options for further tweaking in case the defaults are not suitable for you."))
62 a1 = e:option(Value, "adb_port", translate("Port of the adblock uhttpd instance"))
67 a2 = e:option(Value, "adb_nullipv4", translate("IPv4 blackhole ip address"))
69 a2.default = "192.0.2.1"
70 a2.datatype = "ip4addr"
72 a3 = e:option(Value, "adb_nullipv6", translate("IPv6 blackhole ip address"))
74 a3.default = "::ffff:c000:0201"
75 a3.datatype = "ip6addr"
77 a7 = e:option(Value, "adb_lanif", translate("Name of the logical lan interface"))
80 a7.datatype = "network"