2 LuCI - Lua Configuration Interface
4 Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
16 require "luci.dispatcher"
17 require "luci.tools.ddns"
19 -- check supported options
20 -- saved to local vars here because doing multiple os calls slow down the system
21 has_ssl = luci.tools.ddns.check_ssl() -- HTTPS support
22 has_proxy = luci.tools.ddns.check_proxy() -- Proxy support
23 has_dnstcp = luci.tools.ddns.check_bind_host() -- DNS TCP support
26 bold_on = [[<strong>]]
27 bold_off = [[</strong>]]
32 m.title = [[<a href="]] .. luci.dispatcher.build_url("admin", "services", "ddns") .. [[">]] ..
33 translate("Dynamic DNS") .. [[</a>]]
35 m.description = translate("Dynamic DNS allows that your router can be reached with " ..
36 "a fixed hostname while having a dynamically changing " ..
39 m.redirect = luci.dispatcher.build_url("admin", "services", "ddns")
41 -- SimpleSection definition
42 -- show Hints to optimize installation and script usage
43 s = m:section( SimpleSection,
45 translate("Below a list of configuration tips for your system to run Dynamic DNS updates without limitations") )
46 -- DDNS Service disabled
47 if not luci.sys.init.enabled("ddns") then
48 local dv = s:option(DummyValue, "_not_enabled")
49 dv.titleref = luci.dispatcher.build_url("admin", "system", "startup")
52 translate("DDNS Autostart disabled") .. bold_off
53 dv.value = translate("Currently DDNS updates are not started at boot or on interface events." .. "<br />" ..
54 "This is the default if you run DDNS scripts by yourself (i.e. via cron with force_interval set to '0')" )
58 if not luci.tools.ddns.check_ipv6() then
59 local dv = s:option(DummyValue, "_no_ipv6")
60 dv.titleref = 'http://www.openwrt.org" target="_blank'
63 translate("IPv6 not supported") .. bold_off
64 dv.value = translate("IPv6 is currently not (fully) supported by this system" .. "<br />" ..
65 "Please follow the instructions on OpenWrt's homepage to enable IPv6 support" .. "<br />" ..
66 "or update your system to the latest OpenWrt Release")
71 local dv = s:option(DummyValue, "_no_https")
72 dv.titleref = luci.dispatcher.build_url("admin", "system", "packages")
75 translate("HTTPS not supported") .. bold_off
76 dv.value = translate("Neither GNU Wget with SSL nor cURL installed to support updates via HTTPS protocol.") ..
78 translate("You should install GNU Wget with SSL (prefered) or cURL package.") ..
80 translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.")
83 -- cURL without proxy support
84 if has_ssl and not has_proxy then
85 local dv = s:option(DummyValue, "_no_proxy")
86 dv.titleref = luci.dispatcher.build_url("admin", "system", "packages")
89 translate("cURL without Proxy Support") .. bold_off
90 dv.value = translate("cURL is installed, but libcurl was compiled without proxy support.") ..
92 translate("You should install GNU Wget with SSL or replace libcurl.") ..
94 translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.")
97 -- "Force IP Version not supported"
98 if not (has_ssl and has_dnstcp) then
99 local dv = s:option(DummyValue, "_no_force_ip")
100 dv.titleref = luci.dispatcher.build_url("admin", "system", "packages")
102 dv.title = bold_on ..
103 translate("Force IP Version not supported") .. bold_off
104 local value = translate("BusyBox's nslookup and Wget do not support to specify " ..
105 "the IP version to use for communication with DDNS Provider.")
107 value = value .. "<br />- " ..
108 translate("You should install GNU Wget with SSL (prefered) or cURL package.")
110 if not has_dnstcp then
111 value = value .. "<br />- " ..
112 translate("You should install BIND host package for DNS requests.")
117 -- "DNS requests via TCP not supported"
118 if not has_dnstcp then
119 local dv = s:option(DummyValue, "_no_dnstcp")
120 dv.titleref = luci.dispatcher.build_url("admin", "system", "packages")
122 dv.title = bold_on ..
123 translate("DNS requests via TCP not supported") .. bold_off
124 dv.value = translate("BusyBox's nslookup does not support to specify to use TCP instead of default UDP when requesting DNS server") ..
126 translate("You should install BIND host package for DNS requests.")