adblock.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. -- Copyright 2016 Hannu Nyman
  2. -- Licensed to the public under the Apache License 2.0.
  3. m = Map("adblock", translate("Adblock"),
  4. translate("Configuration of the adblock package to block ad/abuse domains by using DNS."))
  5. -- General options
  6. s = m:section(NamedSection, "global", "adblock", translate("Global options"))
  7. o1 = s:option(Flag, "adb_enabled", translate("Enable adblock"))
  8. o1.rmempty = false
  9. o1.default = 0
  10. o3 = s:option(Value, "adb_whitelist", translate("Whitelist file"),
  11. translate("File with whitelisted hosts/domains that are allowed despite being on a blocklist."))
  12. o3.rmempty = false
  13. o3.datatype = "file"
  14. -- Blocklist options
  15. bl = m:section(TypedSection, "source", translate("Blocklist sources"),
  16. translate("Available blocklist sources (")
  17. .. [[<a href="https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md" target="_blank">]]
  18. .. translate("see list details")
  19. .. [[</a>]]
  20. .. translate("). Note that list URLs and Shallalist category selections are not configurable via Luci."))
  21. bl.template = "cbi/tblsection"
  22. name = bl:option(Flag, "enabled", translate("Enabled"))
  23. name.rmempty = false
  24. des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
  25. -- Additional options
  26. s2 = m:section(NamedSection, "backup", "service", translate("Backup options"))
  27. o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup"))
  28. o4.rmempty = false
  29. o4.default = 0
  30. o5 = s2:option(Value, "adb_dir", translate("Backup directory"))
  31. o5.rmempty = false
  32. o5.datatype = "directory"
  33. -- Extra options
  34. e = m:section(NamedSection, "global", "adblock", translate("Extra options"),
  35. translate("Options for further tweaking in case the defaults are not suitable for you."))
  36. a = e:option(Flag, "adb_debug", translate("Enable verbose debug logging"))
  37. a.default = a.disabled
  38. a.rmempty = false
  39. a = e:option(Value, "adb_iface", translate("Restrict reload trigger to certain interface(s)"),
  40. translate("Space separated list of wan interfaces that trigger reload action. " ..
  41. "To disable reload trigger set it to 'false'. Default: empty"))
  42. a.datatype = "network"
  43. a.rmempty = true
  44. return m