X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-ddns%2Fluasrc%2Fmodel%2Fcbi%2Fddns%2Fhints.lua;h=21827b76594f48743ce2bed6954cbdb17001e7ec;hp=031bf513cf3c22f1bb52d6e09dce638ecfa77696;hb=1e1a706db5040d94ec5fd98a1fbf3563637b6c67;hpb=23df4ffaf7060fd10e6b3f41ada903d52a55ad03 diff --git a/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua b/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua index 031bf513c..21827b765 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua @@ -1,4 +1,4 @@ --- Copyright 2014 Christian Schoenebeck +-- Copyright 2014-2016 Christian Schoenebeck -- Licensed to the public under the Apache License 2.0. local DISP = require "luci.dispatcher" @@ -6,12 +6,6 @@ local SYS = require "luci.sys" local CTRL = require "luci.controller.ddns" -- this application's controller local DDNS = require "luci.tools.ddns" -- ddns multiused functions --- check supported options -- ################################################## --- saved to local vars here because doing multiple os calls slow down the system -has_ssl = DDNS.check_ssl() -- HTTPS support and --bind-network / --interface -has_proxy = DDNS.check_proxy() -- Proxy support -has_dnstcp = DDNS.check_bind_host() -- DNS TCP support - -- html constants font_red = [[]] font_off = [[]] @@ -32,113 +26,141 @@ s = m:section( SimpleSection, -- ddns_scripts needs to be updated for full functionality if not CTRL.service_ok() then - local dv = s:option(DummyValue, "_update_needed") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = font_red .. bold_on .. + local so = s:option(DummyValue, "_update_needed") + so.titleref = DISP.build_url("admin", "system", "packages") + so.rawhtml = true + so.title = font_red .. bold_on .. translate("Software update required") .. bold_off .. font_off - dv.value = translate("The currently installed 'ddns-scripts' package did not support all available settings.") .. + so.value = translate("The currently installed 'ddns-scripts' package did not support all available settings.") .. "
" .. translate("Please update to the current version!") end -- DDNS Service disabled if not SYS.init.enabled("ddns") then - local dv = s:option(DummyValue, "_not_enabled") - dv.titleref = DISP.build_url("admin", "system", "startup") - dv.rawhtml = true - dv.title = bold_on .. + local se = s:option(DummyValue, "_not_enabled") + se.titleref = DISP.build_url("admin", "system", "startup") + se.rawhtml = true + se.title = bold_on .. translate("DDNS Autostart disabled") .. bold_off - dv.value = translate("Currently DDNS updates are not started at boot or on interface events." .. "
" .. + se.value = translate("Currently DDNS updates are not started at boot or on interface events." .. "
" .. "This is the default if you run DDNS scripts by yourself (i.e. via cron with force_interval set to '0')" ) end -- No IPv6 support -if not DDNS.check_ipv6() then - local dv = s:option(DummyValue, "_no_ipv6") - dv.titleref = 'http://www.openwrt.org" target="_blank' - dv.rawhtml = true - dv.title = bold_on .. +if not DDNS.has_ipv6 then + local v6 = s:option(DummyValue, "_no_ipv6") + v6.titleref = 'http://www.openwrt.org" target="_blank' + v6.rawhtml = true + v6.title = bold_on .. translate("IPv6 not supported") .. bold_off - dv.value = translate("IPv6 is currently not (fully) supported by this system" .. "
" .. + v6.value = translate("IPv6 is currently not (fully) supported by this system" .. "
" .. "Please follow the instructions on OpenWrt's homepage to enable IPv6 support" .. "
" .. "or update your system to the latest OpenWrt Release") end -- No HTTPS support -if not has_ssl then - local dv = s:option(DummyValue, "_no_https") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = bold_on .. +if not DDNS.has_ssl then + local sl = s:option(DummyValue, "_no_https") + sl.titleref = DISP.build_url("admin", "system", "packages") + sl.rawhtml = true + sl.title = bold_on .. translate("HTTPS not supported") .. bold_off - dv.value = translate("Neither GNU Wget with SSL nor cURL installed to support updates via HTTPS protocol.") .. + sl.value = translate("Neither GNU Wget with SSL nor cURL installed to support secure updates via HTTPS protocol.") .. "
- " .. - translate("You should install GNU Wget with SSL (prefered) or cURL package.") .. + translate("You should install 'wget' or 'curl' or 'uclient-fetch' with 'libustream-*ssl' package.") .. "
- " .. translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.") end -- No bind_network -if not has_ssl then - local dv = s:option(DummyValue, "_no_bind_network") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = bold_on .. +if not DDNS.has_bindnet then + local bn = s:option(DummyValue, "_no_bind_network") + bn.titleref = DISP.build_url("admin", "system", "packages") + bn.rawhtml = true + bn.title = bold_on .. translate("Binding to a specific network not supported") .. bold_off - dv.value = translate("Neither GNU Wget with SSL nor cURL installed to select a network to use for communication.") .. + bn.value = translate("Neither GNU Wget with SSL nor cURL installed to select a network to use for communication.") .. "
- " .. - translate("You should install GNU Wget with SSL or cURL package.") .. + translate("You should install 'wget' or 'curl' package.") .. "
- " .. translate("GNU Wget will use the IP of given network, cURL will use the physical interface.") .. "
- " .. translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.") end --- cURL without proxy support -if has_ssl and not has_proxy then - local dv = s:option(DummyValue, "_no_proxy") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = bold_on .. +-- currently only cURL possibly without proxy support +if not DDNS.has_proxy then + local px = s:option(DummyValue, "_no_proxy") + px.titleref = DISP.build_url("admin", "system", "packages") + px.rawhtml = true + px.title = bold_on .. translate("cURL without Proxy Support") .. bold_off - dv.value = translate("cURL is installed, but libcurl was compiled without proxy support.") .. + px.value = translate("cURL is installed, but libcurl was compiled without proxy support.") .. "
- " .. - translate("You should install GNU Wget with SSL or replace libcurl.") .. + translate("You should install 'wget' or 'uclient-fetch' package or replace libcurl.") .. "
- " .. translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.") end -- "Force IP Version not supported" -if not (has_ssl and has_dnstcp) then - local dv = s:option(DummyValue, "_no_force_ip") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = bold_on .. +if not DDNS.has_forceip then + local fi = s:option(DummyValue, "_no_force_ip") + fi.titleref = DISP.build_url("admin", "system", "packages") + fi.rawhtml = true + fi.title = bold_on .. translate("Force IP Version not supported") .. bold_off local value = translate("BusyBox's nslookup and Wget do not support to specify " .. - "the IP version to use for communication with DDNS Provider.") - if not has_ssl then + "the IP version to use for communication with DDNS Provider!") + if not (DDNS.has_wgetssl or DDNS.has_curl or DDNS.has_fetch) then value = value .. "
- " .. - translate("You should install GNU Wget with SSL (prefered) or cURL package.") + translate("You should install 'wget' or 'curl' or 'uclient-fetch' package.") end - if not has_dnstcp then + if not DDNS.has_bindhost then value = value .. "
- " .. - translate("You should install BIND host package for DNS requests.") + translate("You should install 'bind-host' or 'knot-host' or 'drill' package for DNS requests.") end - dv.value = value + fi.value = value end -- "DNS requests via TCP not supported" -if not has_dnstcp then - local dv = s:option(DummyValue, "_no_dnstcp") - dv.titleref = DISP.build_url("admin", "system", "packages") - dv.rawhtml = true - dv.title = bold_on .. +if not DDNS.has_bindhost then + local dt = s:option(DummyValue, "_no_dnstcp") + dt.titleref = DISP.build_url("admin", "system", "packages") + dt.rawhtml = true + dt.title = bold_on .. translate("DNS requests via TCP not supported") .. bold_off - dv.value = translate("BusyBox's nslookup does not support to specify to use TCP instead of default UDP when requesting DNS server") .. + dt.value = translate("BusyBox's nslookup and hostip do not support to specify to use TCP " .. + "instead of default UDP when requesting DNS server!") .. + "
- " .. + translate("You should install 'bind-host' or 'knot-host' or 'drill' package for DNS requests.") +end + +-- nslookup compiled with musl produce problems when using +if not DDNS.has_dnsserver then + local ds = s:option(DummyValue, "_no_dnsserver") + ds.titleref = DISP.build_url("admin", "system", "packages") + ds.rawhtml = true + ds.title = bold_on .. + translate("Using specific DNS Server not supported") .. bold_off + ds.value = translate("BusyBox's nslookup in the current compiled version " .. + "does not handle given DNS Servers correctly!") .. + "
- " .. + translate("You should install 'bind-host' or 'knot-host' or 'drill' or 'hostip' package, " .. + "if you need to specify a DNS server to detect your registered IP.") +end + +-- certificates installed +if DDNS.has_ssl and not DDNS.has_cacerts then + local ca = s:option(DummyValue, "_no_certs") + ca.titleref = DISP.build_url("admin", "system", "packages") + ca.rawhtml = true + ca.title = bold_on .. + translate("No certificates found") .. bold_off + ca.value = translate("If using secure communication you should verify server certificates!") .. "
- " .. - translate("You should install BIND host package for DNS requests.") + translate("Install 'ca-certificates' package or needed certificates " .. + "by hand into /etc/ssl/certs default directory") end return m