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
28 t = m:section(NamedSection, "global", "adblock", translate("Statistics"))
30 dat = t:option(DummyValue, "adb_lastrun", translate("Last update of the blocklists"))
31 tot = t:option(DummyValue, "adb_overall_count", translate("Total count of blocked domains"))
32 prc = t:option(DummyValue, "adb_percentage", translate("Percentage of blocked packets (before last update, IPv4/IPv6)"))
36 bl = m:section(TypedSection, "source", translate("Blocklist sources"),
37 translate("Available blocklist sources (")
38 .. [[<a href="https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md" target="_blank">]]
39 .. translate("see list details")
41 .. translate("). Note that list URLs and Shallalist category selections are not configurable via Luci."))
42 bl.template = "cbi/tblsection"
44 name = bl:option(Flag, "enabled", translate("Enabled"))
47 des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
48 cou = bl:option(DummyValue, "adb_src_count", translate("Count"))
49 upd = bl:option(DummyValue, "adb_src_timestamp", translate("List date/state"))
53 s2 = m:section(NamedSection, "backup", "service", translate("Backup options"))
55 o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup"))
59 o5 = s2:option(Value, "adb_dir", translate("Backup directory"))
61 o5.datatype = "directory"
65 e = m:section(NamedSection, "global", "adblock", translate("Extra options"),
66 translate("Options for further tweaking in case the defaults are not suitable for you."))
68 a0 = e:option(Flag, "adb_restricted", translate("Do not write status info to flash"),
69 translate("Skip writing update status information to the config file. Status fields on this page will not be updated."))
72 a1 = e:option(Value, "adb_nullport", translate("Port of the adblock uhttpd instance"))
77 a5 = e:option(Value, "adb_nullportssl", translate("Port of the adblock uhttpd instance for https links"))
82 a2 = e:option(Value, "adb_nullipv4", translate("IPv4 blackhole ip address"))
84 a2.default = "198.18.0.1"
85 a2.datatype = "ip4addr"
87 a3 = e:option(Value, "adb_nullipv6", translate("IPv6 blackhole ip address"))
89 a3.default = "::ffff:c612:0001"
90 a3.datatype = "ip6addr"
92 a4 = e:option(Value, "adb_fetchttl", translate("Timeout for blocklist fetch (seconds)"))
95 a4.datatype = "range(2,60)"
97 a7 = e:option(Value, "adb_lanif", translate("Name of the logical lan interface"))
100 a7.datatype = "network"