summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-nextdns/luasrc/model
diff options
context:
space:
mode:
authorOlivier Poitrey <rs@nextdns.io>2019-11-05 12:57:29 -0800
committerOlivier Poitrey <rs@nextdns.io>2019-11-12 18:19:27 -0800
commit4d702a1cf2277288e87ca02ca976a9a437585501 (patch)
treed7de0378bbc6da0c77851294c3b2e47a3a4b4685 /applications/luci-app-nextdns/luasrc/model
parent2ff7d246d669ecdf3536a9b3512b0b30030b3988 (diff)
luci-app-nextdns: add luci integration for nextdns package
Signed-off-by: Olivier Poitrey <rs@nextdns.io>
Diffstat (limited to 'applications/luci-app-nextdns/luasrc/model')
-rw-r--r--applications/luci-app-nextdns/luasrc/model/cbi/overview.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua b/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua
new file mode 100644
index 0000000000..a932a85f89
--- /dev/null
+++ b/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua
@@ -0,0 +1,41 @@
+local uci = require("luci.model.uci").cursor()
+
+nextdns = Map("nextdns", translate("NextDNS"),
+ translate("NextDNS Configuration.")
+ .. "<br>"
+ .. translatef("For further information, go to "
+ .. "<a href=\"https://nextdns.io\" target=\"_blank\">nextdns.io</a>"))
+
+
+function nextdns.on_after_commit(self)
+ luci.sys.call("env -i /etc/init.d/nextdns restart >/dev/null 2>&1")
+end
+
+s = nextdns:section(TypedSection, "nextdns", translate("General"))
+s.anonymous = true
+
+enabled = s:option(Flag, "enabled", translate("Enabled"),
+ translate("Enable NextDNS."))
+enabled.rmempty = false
+
+conf = s:option(Value, "config", translate("Configuration ID"),
+ translate("The ID of your NextDNS configuration.")
+ .. "<br>"
+ .. translate("Go to nextdns.io to create a configuration."))
+conf.rmempty = false
+
+report_client_info = s:option(Flag, "report_client_info", translate("Report Client Info"),
+ translate("Expose LAN clients information in NextDNS analytics."))
+report_client_info.rmempty = false
+
+hardened_privacy = s:option(Flag, "hardened_privacy", translate("Hardened Privacy"),
+ translate("When enabled, use DNS servers located in jurisdictions with strong privacy laws.")
+ .. "<br>"
+ .. translate("Available locations are: Switzerland, Iceland, Finland, Panama and Hong Kong."))
+hardened_privacy.rmempty = false
+
+log_query = s:option(Flag, "log_query", translate("Log Queries"),
+ translate("Log individual queries to system log."))
+log_query.rmempty = false
+
+return nextdns