diff options
Diffstat (limited to 'applications/luci-app-ddns')
35 files changed, 905 insertions, 445 deletions
diff --git a/applications/luci-app-ddns/luasrc/controller/ddns.lua b/applications/luci-app-ddns/luasrc/controller/ddns.lua index 946dfefbc8..29598ea8ad 100644 --- a/applications/luci-app-ddns/luasrc/controller/ddns.lua +++ b/applications/luci-app-ddns/luasrc/controller/ddns.lua @@ -10,39 +10,107 @@ local NX = require "nixio" local NXFS = require "nixio.fs" local DISP = require "luci.dispatcher" local HTTP = require "luci.http" -local UCI = require "luci.model.uci" +local I18N = require "luci.i18n" -- not globally avalible here +local IPKG = require "luci.model.ipkg" local SYS = require "luci.sys" -local DDNS = require "luci.tools.ddns" -- ddns multiused functions +local UCI = require "luci.model.uci" local UTIL = require "luci.util" +local DDNS = require "luci.tools.ddns" -- ddns multiused functions -DDNS_MIN = "2.4.2-1" -- minimum version of service required +local srv_name = "ddns-scripts" +local srv_ver_min = "2.5.0" -- minimum version of service required +local srv_ver_cmd = [[/usr/lib/ddns/dynamic_dns_updater.sh --version | awk {'print $2'}]] +local app_name = "luci-app-ddns" +local app_title = "Dynamic DNS" +local app_version = "2.3.0-1" function index() local nxfs = require "nixio.fs" -- global definitions not available local sys = require "luci.sys" -- in function index() local ddns = require "luci.tools.ddns" -- ddns multiused functions - local verinst = ddns.ipkg_ver_installed("ddns-scripts") - local verok = ddns.ipkg_ver_compare(verinst, ">=", "2.0.0-0") - -- do NOT start it not ddns-scripts version 2.x - if not verok then - return - end + local muci = require "luci.model.uci" + -- no config create an empty one if not nxfs.access("/etc/config/ddns") then nxfs.writefile("/etc/config/ddns", "") end + -- preset new option "lookup_host" if not already defined + local uci = muci.cursor() + local commit = false + uci:foreach("ddns", "service", function (s) + if not s["lookup_host"] and s["domain"] then + uci:set("ddns", s[".name"], "lookup_host", s["domain"]) + commit = true + end + end) + if commit then uci:commit("ddns") end + uci:unload("ddns") + entry( {"admin", "services", "ddns"}, cbi("ddns/overview"), _("Dynamic DNS"), 59) entry( {"admin", "services", "ddns", "detail"}, cbi("ddns/detail"), nil ).leaf = true entry( {"admin", "services", "ddns", "hints"}, cbi("ddns/hints", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}), nil ).leaf = true entry( {"admin", "services", "ddns", "global"}, cbi("ddns/global"), nil ).leaf = true entry( {"admin", "services", "ddns", "logview"}, call("logread") ).leaf = true - entry( {"admin", "services", "ddns", "startstop"}, call("startstop") ).leaf = true + entry( {"admin", "services", "ddns", "startstop"}, post("startstop") ).leaf = true entry( {"admin", "services", "ddns", "status"}, call("status") ).leaf = true end --- function to read all sections status and return data array +-- Application specific information functions +function app_description() + return I18N.translate("Dynamic DNS allows that your router can be reached with " .. + "a fixed hostname while having a dynamically changing IP address.") + .. [[<br />]] + .. I18N.translate("OpenWrt Wiki") .. ": " + .. [[<a href="http://wiki.openwrt.org/doc/howto/ddns.client" target="_blank">]] + .. I18N.translate("DDNS Client Documentation") .. [[</a>]] + .. " --- " + .. [[<a href="http://wiki.openwrt.org/doc/uci/ddns" target="_blank">]] + .. I18N.translate("DDNS Client Configuration") .. [[</a>]] +end +function app_title_back() + return [[<a href="]] + .. DISP.build_url("admin", "services", "ddns") + .. [[">]] + .. I18N.translate(app_title) + .. [[</a>]] +end + +-- Standardized application/service functions +function app_title_main() + return [[<a href="javascript:alert(']] + .. I18N.translate("Version Information") + .. [[\n\n]] .. app_name + .. [[\n\t]] .. I18N.translate("Version") .. [[:\t]] .. app_version + .. [[\n\n]] .. srv_name .. [[ ]] .. I18N.translate("required") .. [[:]] + .. [[\n\t]] .. I18N.translate("Version") .. [[:\t]] + .. srv_ver_min .. [[ ]] .. I18N.translate("or higher") + .. [[\n\n]] .. srv_name .. [[ ]] .. I18N.translate("installed") .. [[:]] + .. [[\n\t]] .. I18N.translate("Version") .. [[:\t]] + .. (service_version() or I18N.translate("NOT installed")) + .. [[\n\n]] + .. [[')">]] + .. I18N.translate(app_title) + .. [[</a>]] +end +function service_version() + local ver = nil + IPKG.list_installed(srv_name, function(n, ver, d) + -- nothing to do + end + ) + if not ver then + ver = UTIL.exec(srv_ver_cmd) + if #ver == 0 then ver = nil end + end + return ver +end +function service_ok() + return IPKG.compare_versions((service_version() or "0"), ">=", srv_ver_min) +end + +-- internal function to read all sections status and return data array local function _get_status() local uci = UCI.cursor() local service = SYS.init.enabled("ddns") and 1 or 0 @@ -118,12 +186,12 @@ local function _get_status() end -- try to get registered IP - local domain = s["domain"] or "_nodomain_" + local lookup_host = s["lookup_host"] or "_nolookup_" local dnsserver = s["dns_server"] or "" local force_ipversion = tonumber(s["force_ipversion"] or 0) local force_dnstcp = tonumber(s["force_dnstcp"] or 0) local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh]] - command = command .. [[ get_registered_ip ]] .. domain .. [[ ]] .. use_ipv6 .. + command = command .. [[ get_registered_ip ]] .. lookup_host .. [[ ]] .. use_ipv6 .. [[ ]] .. force_ipversion .. [[ ]] .. force_dnstcp .. [[ ]] .. dnsserver local reg_ip = SYS.exec(command) if reg_ip == "" then @@ -135,7 +203,7 @@ local function _get_status() section = section, enabled = enabled, iface = iface, - domain = domain, + lookup = lookup_host, reg_ip = reg_ip, pid = pid, datelast = datelast, @@ -235,3 +303,4 @@ function status() HTTP.prepare_content("application/json") HTTP.write_json(data) end + diff --git a/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua b/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua index 27f9a9f264..88429fd12c 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua @@ -8,13 +8,15 @@ local NX = require "nixio" local NXFS = require "nixio.fs" local SYS = require "luci.sys" local UTIL = require "luci.util" +local HTTP = require "luci.http" local DISP = require "luci.dispatcher" local WADM = require "luci.tools.webadmin" local DTYP = require "luci.cbi.datatypes" +local CTRL = require "luci.controller.ddns" -- this application's controller local DDNS = require "luci.tools.ddns" -- ddns multiused functions -- takeover arguments -- ####################################################### -local section = arg[1] +local section = arg[1] -- check supported options -- ################################################## -- saved to local vars here because doing multiple os calls slow down the system @@ -31,15 +33,15 @@ local bold_on = "<strong>" local bold_off = "</strong>" -- error text constants -- ##################################################### -err_ipv6_plain = translate("IPv6 not supported") .. " - " .. +local err_ipv6_plain = translate("IPv6 not supported") .. " - " .. translate("please select 'IPv4' address version") -err_ipv6_basic = bold_on .. +local err_ipv6_basic = bold_on .. font_red .. translate("IPv6 not supported") .. font_off .. "<br />" .. translate("please select 'IPv4' address version") .. bold_off -err_ipv6_other = bold_on .. +local err_ipv6_other = bold_on .. font_red .. translate("IPv6 not supported") .. font_off .. @@ -52,16 +54,46 @@ err_ipv6_other = bold_on .. [[</a>]] .. bold_off -function err_tab_basic(self) +local function err_tab_basic(self) return translate("Basic Settings") .. " - " .. self.title .. ": " end -function err_tab_adv(self) +local function err_tab_adv(self) return translate("Advanced Settings") .. " - " .. self.title .. ": " end -function err_tab_timer(self) +local function err_tab_timer(self) return translate("Timer Settings") .. " - " .. self.title .. ": " end +-- read services/services_ipv6 files -- ######################################## +local services4 = { } -- IPv4 -- +local fd4 = io.open("/usr/lib/ddns/services", "r") +if fd4 then + local ln, s, t + repeat + ln = fd4:read("*l") + s = ln and ln:match('^%s*".*') -- only handle lines beginning with " + s = s and s:gsub('"','') -- remove " + t = s and UTIL.split(s,"(%s+)",nil,true) -- split on whitespaces + if t then services4[t[1]]=t[2] end + until not ln + fd4:close() +end + +local services6 = { } -- IPv6 -- +local fd6 = io.open("/usr/lib/ddns/services_ipv6", "r") +if fd6 then + local ln, s, t + repeat + ln = fd6:read("*l") + s = ln and ln:match('^%s*".*') -- only handle lines beginning with " + s = s and s:gsub('"','') -- remove " + t = s and UTIL.split(s,"(%s+)",nil,true) -- split on whitespaces + if t then services6[t[1]]=t[2] end + until not ln + fd6:close() +end + +-- multi-used functions -- #################################################### -- function to verify settings around ip_source -- will use dynamic_dns_lucihelper to check if -- local IP can be read @@ -105,18 +137,94 @@ local function _verify_ip_source() end end --- cbi-map definition -- ####################################################### -m = Map("ddns") +-- function to check if option is used inside url or script +-- return -1 on error, 0 NOT required, 1 required +local function _option_used(option, urlscript) + local surl -- search string for url + local ssh -- search string for script + local required -- option used inside url or script --- first need to close <a> from cbi map template our <a> closed by template -m.title = [[</a><a href="]] .. DISP.build_url("admin", "services", "ddns") .. [[">]] .. - translate("Dynamic DNS") + if option == "domain" then surl, ssh = '%[DOMAIN%]', '%$domain' + elseif option == "username" then surl, ssh = '%[USERNAME%]', '%$username' + elseif option == "password" then surl, ssh = '%[PASSWORD%]', '%$password' + elseif option == "param_enc" then surl, ssh = '%[PARAMENC%]', '%$param_enc' + elseif option == "param_opt" then surl, ssh = '%[PARAMOPT%]', '%$param_opt' + else + error("undefined option") + return -1 -- return on error + end -m.description = translate("Dynamic DNS allows that your router can be reached with " .. - "a fixed hostname while having a dynamically changing " .. - "IP address.") + local required = false + -- handle url + if urlscript:find('http') then + required = ( urlscript:find(surl) ) + -- handle script + else + if not urlscript:find("/") then + -- might be inside ddns-scripts directory + urlscript = "/usr/lib/ddns/" .. urlscript + end + -- problem with script exit here + if not NXFS.access(urlscript) then return -1 end + + local f = io.input(urlscript) + -- still problem with script exit here + if not f then return -1 end + for l in f:lines() do + repeat + if l:find('^#') then break end -- continue on comment lines + required = ( l:find(surl) or l:find(ssh) ) + until true + if required then break end + end + f:close() + end + return (required and 1 or 0) +end -m.redirect = DISP.build_url("admin", "services", "ddns") +-- function to verify if option is valid +local function _option_validate(self, value) + -- section is globally defined here be calling agrument (see above) + local fusev6 = usev6:formvalue(section) + local fsvc4 = svc4:formvalue(section) + local fsvc6 = svc6:formvalue(section) + local urlsh, used + + -- IP-Version dependent custom service selected + if (fusev6 == "0" and fsvc4 == "-") or + (fusev6 == "1" and fsvc6 == "-") then + -- read custom url + urlsh = uurl:formvalue(section) + -- no url then read custom script + if not urlsh or (#urlsh == 0) then + urlsh = ush:formvalue(section) + end + -- IPv4 read from services4 table + elseif (fusev6 == "0") then + urlsh = services4[fsvc4] + -- IPv6 read from services6 table + else + urlsh = services6[fsvc6] + end + -- problem with url or script exit here + -- error handled somewhere else + if not urlsh or (#urlsh == 0) then return "" end + + used = _option_used(self.option, urlsh) + -- on error or not used return empty sting + if used < 1 then return "" end + -- needed but no data then return error + if not value or (#value == 0) then + return nil, err_tab_basic(self) .. translate("missing / required") + end + return value +end + +-- cbi-map definition -- ####################################################### +local m = Map("ddns") +m.title = CTRL.app_title_back() +m.description = CTRL.app_description() +m.redirect = DISP.build_url("admin", "services", "ddns") m.on_after_commit = function(self) if self.changed then -- changes ? @@ -127,19 +235,42 @@ m.on_after_commit = function(self) end end +-- provider switch was requested, save and reload page +if m:formvalue("cbid.ddns.%s._switch" % section) then -- section == arg[1] + local fsvc + local fusev6 = m:formvalue("cbid.ddns.%s.use_ipv6" % section) + if fusev6 == "1" then + fsvc = m:formvalue("cbid.ddns.%s.ipv6_service_name" % section) + else + fsvc = m:formvalue("cbid.ddns.%s.ipv4_service_name" % section) + end + + if fusev6 ~= (m:get(section, "use_ipv6") or "0") then -- IPv6 was changed + m:set(section, "use_ipv6", fusev6) -- save it + end + + if fsvc ~= "-" then -- NOT "custom" + m:set(section, "service_name", fsvc) -- save it + else -- else + m:del(section, "service_name") -- delete it + end + m.uci:save(m.config) + + -- reload page + HTTP.redirect( DISP.build_url("admin", "services", "ddns", "detail", section) ) + return +end + -- read application settings -- ################################################ -- date format; if not set use ISO format -date_format = m.uci:get(m.config, "global", "date_format") or "%F %R" +local date_format = m.uci:get(m.config, "global", "date_format") or "%F %R" -- log directory -log_dir = m.uci:get(m.config, "global", "log_dir") or "/var/log/ddns" +local log_dir = m.uci:get(m.config, "global", "log_dir") or "/var/log/ddns" -- cbi-section definition -- ################################################### -ns = m:section( NamedSection, section, "service", +local ns = m:section( NamedSection, section, "service", translate("Details for") .. ([[: <strong>%s</strong>]] % section), - translate("Configure here the details for selected Dynamic DNS service.") - .. [[<br /><a href="http://wiki.openwrt.org/doc/uci/ddns#version_1x" target="_blank">]] - .. translate("For detailed information about parameter settings look here.") - .. [[</a>]] ) + translate("Configure here the details for selected Dynamic DNS service.") ) ns.instance = section -- arg [1] ns:tab("basic", translate("Basic Settings"), nil ) ns:tab("advanced", translate("Advanced Settings"), nil ) @@ -147,17 +278,33 @@ ns:tab("timer", translate("Timer Settings"), nil ) ns:tab("logview", translate("Log File Viewer"), nil ) -- TAB: Basic ##################################################################################### --- enabled -- ################################################################# +-- enabled -- ################################################################# en = ns:taboption("basic", Flag, "enabled", translate("Enabled"), translate("If this service section is disabled it could not be started." .. "<br />" .. "Neither from LuCI interface nor from console") ) en.orientation = "horizontal" -function en.parse(self, section) - DDNS.flag_parse(self, section) + +-- IPv4/IPv6 - lookup_host -- ################################################# +luh = ns:taboption("basic", Value, "lookup_host", + translate("Lookup Hostname"), + translate("Hostname/FQDN to validate, if IP update happen or necessary") ) +luh.rmempty = false +luh.placeholder = "myhost.example.com" +function luh.validate(self, value) + if not value + or not (#value > 0) + or not DTYP.hostname(value) then + return nil, err_tab_basic(self) .. translate("invalid FQDN / required - Sample") .. ": 'myhost.example.com'" + else + return UTIL.trim(value) + end +end +function luh.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end --- use_ipv6 (NEW) -- ########################################################## +-- use_ipv6 -- ################################################################ usev6 = ns:taboption("basic", ListValue, "use_ipv6", translate("IP address version"), translate("Defines which IP address 'IPv4/IPv6' is send to the DDNS provider") ) @@ -180,36 +327,15 @@ function usev6.validate(self, value) end return nil, err_tab_basic(self) .. err_ipv6_plain end -function usev6.write(self, section, value) - if value == "0" then -- force rmempty - return self.map:del(section, self.option) - else - return self.map:set(section, self.option, value) - end +function usev6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end --- IPv4 - service_name -- ###################################################### +-- IPv4 - service_name -- ##################################################### svc4 = ns:taboption("basic", ListValue, "ipv4_service_name", translate("DDNS Service provider") .. " [IPv4]" ) svc4.default = "-" svc4:depends("use_ipv6", "0") -- only show on IPv4 - -local services4 = { } -local fd4 = io.open("/usr/lib/ddns/services", "r") - -if fd4 then - local ln - repeat - ln = fd4:read("*l") - local s = ln and ln:match('^%s*"([^"]+)"') - if s then services4[#services4+1] = s end - until not ln - fd4:close() -end - -for _, v in UTIL.vspairs(services4) do svc4:value(v) end -svc4:value("-", translate("-- custom --") ) - function svc4.cfgvalue(self, section) local v = DDNS.read_value(self, section, "service_name") if not v or #v == 0 then @@ -230,14 +356,18 @@ function svc4.write(self, section, value) self.map:del(section, self.option) -- to be shure if value ~= "-" then -- and write "service_name self.map:del(section, "update_url") -- delete update_url + self.map:del(section, "update_script") -- delete update_script return self.map:set(section, "service_name", value) else return self.map:del(section, "service_name") end end end +function svc4.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv6 - service_name -- ###################################################### +-- IPv6 - service_name -- ##################################################### svc6 = ns:taboption("basic", ListValue, "ipv6_service_name", translate("DDNS Service provider") .. " [IPv6]" ) svc6.default = "-" @@ -245,23 +375,6 @@ svc6:depends("use_ipv6", "1") -- only show on IPv6 if not has_ipv6 then svc6.description = err_ipv6_basic end - -local services6 = { } -local fd6 = io.open("/usr/lib/ddns/services_ipv6", "r") - -if fd6 then - local ln - repeat - ln = fd6:read("*l") - local s = ln and ln:match('^%s*"([^"]+)"') - if s then services6[#services6+1] = s end - until not ln - fd6:close() -end - -for _, v in UTIL.vspairs(services6) do svc6:value(v) end -svc6:value("-", translate("-- custom --") ) - function svc6.cfgvalue(self, section) local v = DDNS.read_value(self, section, "service_name") if not v or #v == 0 then @@ -283,33 +396,42 @@ function svc6.write(self, section, value) self.map:del(section, self.option) -- delete "ipv6_service_name" helper if value ~= "-" then -- and write "service_name self.map:del(section, "update_url") -- delete update_url + self.map:del(section, "update_script") -- delete update_script return self.map:set(section, "service_name", value) else return self.map:del(section, "service_name") end end end +function svc6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end + +-- IPv4/IPv6 - change Provider -- ############################################# +svs = ns:taboption("basic", Button, "_switch") +svs.title = translate("Really change DDNS provider?") +svs.inputtitle = translate("Change provider") +svs.inputstyle = "apply" --- IPv4/IPv6 - update_url -- ################################################### +-- IPv4/IPv6 - update_url -- ################################################## uurl = ns:taboption("basic", Value, "update_url", translate("Custom update-URL"), translate("Update URL to be used for updating your DDNS Provider." .. "<br />" .. "Follow instructions you will find on their WEB page.") ) -uurl:depends("ipv4_service_name", "-") -uurl:depends("ipv6_service_name", "-") function uurl.validate(self, value) - local script = ush:formvalue(section) + local fush = ush:formvalue(section) + local fusev6 = usev6:formvalue(section) - if (usev6:formvalue(section) == "0" and svc4:formvalue(section) ~= "-") or - (usev6:formvalue(section) == "1" and svc6:formvalue(section) ~= "-") then + if (fusev6 == "0" and svc4:formvalue(section) ~= "-") or + (fusev6 == "1" and svc6:formvalue(section) ~= "-") then return "" -- suppress validate error elseif not value then - if not script or not (#script > 0) then + if not fush or (#fush == 0) then return nil, err_tab_basic(self) .. translate("missing / required") else return "" -- suppress validate error / update_script is given end - elseif (#script > 0) then + elseif (#fush > 0) then return nil, err_tab_basic(self) .. translate("either url or script could be set") end @@ -326,80 +448,159 @@ function uurl.validate(self, value) return value end +function uurl.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4/IPv6 - update_script -- ################################################ +-- IPv4/IPv6 - update_script -- ############################################### ush = ns:taboption("basic", Value, "update_script", translate("Custom update-script"), translate("Custom update script to be used for updating your DDNS Provider.") ) -ush:depends("ipv4_service_name", "-") -ush:depends("ipv6_service_name", "-") function ush.validate(self, value) - local url = uurl:formvalue(section) + local fuurl = uurl:formvalue(section) + local fusev6 = usev6:formvalue(section) - if (usev6:formvalue(section) == "0" and svc4:formvalue(section) ~= "-") or - (usev6:formvalue(section) == "1" and svc6:formvalue(section) ~= "-") then + if (fusev6 == "0" and svc4:formvalue(section) ~= "-") or + (fusev6 == "1" and svc6:formvalue(section) ~= "-") then return "" -- suppress validate error elseif not value then - if not url or not (#url > 0) then + if not fuurl or (#fuurl == 0) then return nil, err_tab_basic(self) .. translate("missing / required") else return "" -- suppress validate error / update_url is given end - elseif (#url > 0) then + elseif (#fuurl > 0) then return nil, err_tab_basic(self) .. translate("either url or script could be set") elseif not NXFS.access(value) then return nil, err_tab_basic(self) .. translate("File not found") end return value end +function ush.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4/IPv6 - domain -- ####################################################### +-- IPv4/IPv6 - domain -- ###################################################### dom = ns:taboption("basic", Value, "domain", - translate("Hostname/Domain"), + translate("Domain"), translate("Replaces [DOMAIN] in Update-URL") ) -dom.rmempty = false -dom.placeholder = "mypersonaldomain.dyndns.org" +dom.placeholder = "myhost.example.com" function dom.validate(self, value) - if not value - or not (#value > 0) - or not DTYP.hostname(value) then - return nil, err_tab_basic(self) .. translate("invalid - Sample") .. ": 'mypersonaldomain.dyndns.org'" - else - return value - end + return _option_validate(self, value) +end +function dom.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end --- IPv4/IPv6 - username -- ##################################################### +-- IPv4/IPv6 - username -- #################################################### user = ns:taboption("basic", Value, "username", translate("Username"), - translate("Replaces [USERNAME] in Update-URL") ) -user.rmempty = false + translate("Replaces [USERNAME] in Update-URL (URL-encoded)") ) function user.validate(self, value) - if not value then - return nil, err_tab_basic(self) .. translate("missing / required") - end - return value + return _option_validate(self, value) +end +function user.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end --- IPv4/IPv6 - password -- ##################################################### +-- IPv4/IPv6 - password -- #################################################### pw = ns:taboption("basic", Value, "password", translate("Password"), - translate("Replaces [PASSWORD] in Update-URL") ) -pw.rmempty = false + translate("Replaces [PASSWORD] in Update-URL (URL-encoded)") ) pw.password = true function pw.validate(self, value) - if not value then - return nil, err_tab_basic(self) .. translate("missing / required") + return _option_validate(self, value) +end +function pw.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end + +-- IPv4/IPv6 - param_enc -- ################################################### +pe = ns:taboption("basic", Value, "param_enc", + translate("Optional Encoded Parameter"), + translate("Optional: Replaces [PARAMENC] in Update-URL (URL-encoded)") ) +function pe.validate(self, value) + return _option_validate(self, value) +end +function pe.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end + +-- IPv4/IPv6 - param_enc -- ################################################### +po = ns:taboption("basic", Value, "param_opt", + translate("Optional Parameter"), + translate("Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)") ) +function po.validate(self, value) + return _option_validate(self, value) +end +function po.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end + +-- handled service dependent show/display -- ################################## +-- IPv4 -- +local cv4 = svc4:cfgvalue(section) +if cv4 ~= "-" then + svs:depends ("ipv4_service_name", "-" ) -- show only if "-" + ush:depends ("ipv4_service_name", "?") + uurl:depends("ipv4_service_name", "?") +else + uurl:depends("ipv4_service_name", "-") + ush:depends ("ipv4_service_name", "-") + dom:depends("ipv4_service_name", "-" ) + user:depends("ipv4_service_name", "-" ) + pw:depends("ipv4_service_name", "-" ) + pe:depends("ipv4_service_name", "-" ) + po:depends("ipv4_service_name", "-" ) +end +for s, u in UTIL.kspairs(services4) do + svc4:value(s) -- fill DropDown-List + if cv4 ~= s then + svs:depends("ipv4_service_name", s ) + else + dom:depends ("ipv4_service_name", ((_option_used(dom.option, u) == 1) and s or "?") ) + user:depends("ipv4_service_name", ((_option_used(user.option, u) == 1) and s or "?") ) + pw:depends ("ipv4_service_name", ((_option_used(pw.option, u) == 1) and s or "?") ) + pe:depends ("ipv4_service_name", ((_option_used(pe.option, u) == 1) and s or "?") ) + po:depends ("ipv4_service_name", ((_option_used(po.option, u) == 1) and s or "?") ) end - return value end +svc4:value("-", translate("-- custom --") ) + +-- IPv6 -- +local cv6 = svc6:cfgvalue(section) +if cv6 ~= "-" then + svs:depends ("ipv6_service_name", "-" ) + uurl:depends("ipv6_service_name", "?") + ush:depends ("ipv6_service_name", "?") +else + uurl:depends("ipv6_service_name", "-") + ush:depends ("ipv6_service_name", "-") + dom:depends("ipv6_service_name", "-" ) + user:depends("ipv6_service_name", "-" ) + pw:depends("ipv6_service_name", "-" ) + pe:depends("ipv6_service_name", "-" ) + po:depends("ipv6_service_name", "-" ) +end +for s, u in UTIL.kspairs(services6) do + svc6:value(s) -- fill DropDown-List + if cv6 ~= s then + svs:depends("ipv6_service_name", s ) + else + dom:depends ("ipv6_service_name", ((_option_used(dom.option, u) == 1) and s or "?") ) + user:depends("ipv6_service_name", ((_option_used(user.option, u) == 1) and s or "?") ) + pw:depends ("ipv6_service_name", ((_option_used(pw.option, u) == 1) and s or "?") ) + pe:depends ("ipv6_service_name", ((_option_used(pe.option, u) == 1) and s or "?") ) + po:depends ("ipv6_service_name", ((_option_used(po.option, u) == 1) and s or "?") ) + end +end +svc6:value("-", translate("-- custom --") ) --- IPv4/IPv6 - use_https (NEW) -- ############################################## +-- IPv4/IPv6 - use_https -- ################################################### if has_ssl or ( ( m:get(section, "use_https") or "0" ) == "1" ) then https = ns:taboption("basic", Flag, "use_https", translate("Use HTTP Secure") ) https.orientation = "horizontal" - https.rmempty = false -- force validate function function https.cfgvalue(self, section) local value = AbstractValue.cfgvalue(self, section) if not has_ssl and value == "1" then @@ -411,9 +612,6 @@ if has_ssl or ( ( m:get(section, "use_https") or "0" ) == "1" ) then end return value end - function https.parse(self, section) - DDNS.flag_parse(self, section) - end function https.validate(self, value) if (value == "1" and has_ssl ) or value == "0" then return value end return nil, err_tab_basic(self) .. translate("HTTPS not supported") .. " !" @@ -428,7 +626,7 @@ if has_ssl or ( ( m:get(section, "use_https") or "0" ) == "1" ) then end end --- IPv4/IPv6 - cacert (NEW) -- ################################################# +-- IPv4/IPv6 - cacert -- ###################################################### if has_ssl then cert = ns:taboption("basic", Value, "cacert", translate("Path to CA-Certificate"), @@ -436,8 +634,8 @@ if has_ssl then translate("or") .. bold_on .. " IGNORE " .. bold_off .. translate("to run HTTPS without verification of server certificates (insecure)") ) cert:depends("use_https", "1") - cert.rmempty = false -- force validate function cert.default = "/etc/ssl/certs" + cert.forcewrite = true function cert.validate(self, value) if https:formvalue(section) == "0" then return "" -- supress validate error if NOT https @@ -452,10 +650,13 @@ if has_ssl then return nil, err_tab_basic(self) .. translate("file or directory not found or not 'IGNORE'") .. " !" end + function cert.parse(self, section, novld) + DDNS.value_parse(self, section, novld) + end end --- TAB: Advanced ################################################################################## --- IPv4 - ip_source -- ######################################################### +-- TAB: Advanced ################################################################################# +-- IPv4 - ip_source -- ######################################################## src4 = ns:taboption("advanced", ListValue, "ipv4_source", translate("IP address source") .. " [IPv4]", translate("Defines the source to read systems IPv4-Address from, that will be send to the DDNS provider") ) @@ -501,8 +702,11 @@ function src4.write(self, section, value) self.map:del(section, self.option) -- delete "ipv4_source" helper return self.map:set(section, "ip_source", value) -- and write "ip_source end +function src4.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv6 - ip_source -- ######################################################### +-- IPv6 - ip_source -- ######################################################## src6 = ns:taboption("advanced", ListValue, "ipv6_source", translate("IP address source") .. " [IPv6]", translate("Defines the source to read systems IPv6-Address from, that will be send to the DDNS provider") ) @@ -553,8 +757,11 @@ function src6.write(self, section, value) self.map:del(section, self.option) -- delete "ipv4_source" helper return self.map:set(section, "ip_source", value) -- and write "ip_source end +function src6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 - ip_network (default "wan") -- ######################################## +-- IPv4 - ip_network (default "wan") -- ####################################### ipn4 = ns:taboption("advanced", ListValue, "ipv4_network", translate("Network") .. " [IPv4]", translate("Defines the network to read systems IPv4-Address from") ) @@ -587,8 +794,11 @@ function ipn4.write(self, section, value) return self.map:set(section, "ip_network", value) -- and write "ip_network" end end +function ipn4.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv6 - ip_network (default "wan6") -- ####################################### +-- IPv6 - ip_network (default "wan6") -- ###################################### ipn6 = ns:taboption("advanced", ListValue, "ipv6_network", translate("Network") .. " [IPv6]" ) ipn6:depends("ipv6_source", "network") @@ -627,8 +837,11 @@ function ipn6.write(self, section, value) return self.map:set(section, "ip_network", value) -- and write "ip_network" end end +function ipn6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 - ip_url (default "checkip.dyndns.com") -- ############################# +-- IPv4 - ip_url (default "checkip.dyndns.com") -- ############################ iurl4 = ns:taboption("advanced", Value, "ipv4_url", translate("URL to detect") .. " [IPv4]", translate("Defines the Web page to read systems IPv4-Address from") ) @@ -669,8 +882,11 @@ function iurl4.write(self, section, value) return self.map:set(section, "ip_url", value) -- and write "ip_url" end end +function iurl4.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv6 - ip_url (default "checkipv6.dyndns.com") -- ########################### +-- IPv6 - ip_url (default "checkipv6.dyndns.com") -- ########################## iurl6 = ns:taboption("advanced", Value, "ipv6_url", translate("URL to detect") .. " [IPv6]" ) iurl6:depends("ipv6_source", "web") @@ -717,8 +933,11 @@ function iurl6.write(self, section, value) return self.map:set(section, "ip_url", value) -- and write "ip_url" end end +function iurl6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 + IPv6 - ip_interface -- ############################################### +-- IPv4 + IPv6 - ip_interface -- ############################################## ipi = ns:taboption("advanced", ListValue, "ip_interface", translate("Interface"), translate("Defines the interface to read systems IP-Address from") ) @@ -733,16 +952,18 @@ for _, v in pairs(SYS.net.devices()) do end end function ipi.validate(self, value) - if (usev6:formvalue(section) == "0" and src4:formvalue(section) ~= "interface") - or (usev6:formvalue(section) == "1" and src6:formvalue(section) ~= "interface") then + local fusev6 = usev6:formvalue(section) + if (fusev6 == "0" and src4:formvalue(section) ~= "interface") + or (fusev6 == "1" and src6:formvalue(section) ~= "interface") then return "" else return value end end function ipi.write(self, section, value) - if (usev6:formvalue(section) == "0" and src4:formvalue(section) ~= "interface") - or (usev6:formvalue(section) == "1" and src6:formvalue(section) ~= "interface") then + local fusev6 = usev6:formvalue(section) + if (fusev6 == "0" and src4:formvalue(section) ~= "interface") + or (fusev6 == "1" and src6:formvalue(section) ~= "interface") then return true else -- get network from device to @@ -752,21 +973,24 @@ function ipi.write(self, section, value) return self.map:set(section, self.option, value) end end +function ipi.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 + IPv6 - ip_script (NEW) -- ############################################ +-- IPv4 + IPv6 - ip_script -- ################################################# ips = ns:taboption("advanced", Value, "ip_script", translate("Script"), translate("User defined script to read systems IP-Address") ) ips:depends("ipv4_source", "script") -- IPv4 ips:depends("ipv6_source", "script") -- or IPv6 -ips.rmempty = false ips.placeholder = "/path/to/script.sh" function ips.validate(self, value) + local fusev6 = usev6:formvalue(section) local split if value then split = UTIL.split(value, " ") end - if (usev6:formvalue(section) == "0" and src4:formvalue(section) ~= "script") - or (usev6:formvalue(section) == "1" and src6:formvalue(section) ~= "script") then + if (fusev6 == "0" and src4:formvalue(section) ~= "script") + or (fusev6 == "1" and src6:formvalue(section) ~= "script") then return "" elseif not value or not (#value > 0) or not NXFS.access(split[1], "x") then return nil, err_tab_adv(self) .. @@ -776,15 +1000,19 @@ function ips.validate(self, value) end end function ips.write(self, section, value) - if (usev6:formvalue(section) == "0" and src4:formvalue(section) ~= "script") - or (usev6:formvalue(section) == "1" and src6:formvalue(section) ~= "script") then + local fusev6 = usev6:formvalue(section) + if (fusev6 == "0" and src4:formvalue(section) ~= "script") + or (fusev6 == "1" and src6:formvalue(section) ~= "script") then return true else return self.map:set(section, self.option, value) end end +function ips.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 - interface - default "wan" -- ######################################### +-- IPv4 - interface - default "wan" -- ######################################## -- event network to monitor changes/hotplug/dynamic_dns_updater.sh -- only needs to be set if "ip_source"="web" or "script" -- if "ip_source"="network" or "interface" we use their network @@ -799,27 +1027,32 @@ function eif4.cfgvalue(self, section) return DDNS.read_value(self, section, "interface") end function eif4.validate(self, value) + local fsrc4 = src4:formvalue(section) if usev6:formvalue(section) == "1" - or src4:formvalue(section) == "network" - or src4:formvalue(section) == "interface" then + or fsrc4 == "network" + or fsrc4 == "interface" then return "" -- ignore IPv6, network, interface else return value end end function eif4.write(self, section, value) + local fsrc4 = src4:formvalue(section) if usev6:formvalue(section) == "1" - or src4:formvalue(section) == "network" - or src4:formvalue(section) == "interface" then + or fsrc4 == "network" + or fsrc4 == "interface" then return true -- ignore IPv6, network, interface else self.map:del(section, self.option) -- delete "ipv4_interface" helper return self.map:set(section, "interface", value) -- and write "interface" end end +function eif4.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv6 - interface (NEW) - default "wan6" -- ################################## --- event network to monitor changes/hotplug (NEW) +-- IPv6 - interface - default "wan6" -- ####################################### +-- event network to monitor changes/hotplug -- only needs to be set if "ip_source"="web" or "script" -- if "ip_source"="network" or "interface" we use their network eif6 = ns:taboption("advanced", ListValue, "ipv6_interface", @@ -837,9 +1070,10 @@ function eif6.cfgvalue(self, section) return DDNS.read_value(self, section, "interface") end function eif6.validate(self, value) + local fsrc6 = src6:formvalue(section) if usev6:formvalue(section) == "0" - or src4:formvalue(section) == "network" - or src4:formvalue(section) == "interface" then + or fsrc6 == "network" + or fsrc6 == "interface" then return "" -- ignore IPv4, network, interface elseif not has_ipv6 then return nil, err_tab_adv(self) .. err_ipv6_plain @@ -848,23 +1082,26 @@ function eif6.validate(self, value) end end function eif6.write(self, section, value) + local fsrc6 = src6:formvalue(section) if usev6:formvalue(section) == "0" - or src4:formvalue(section) == "network" - or src4:formvalue(section) == "interface" then + or fsrc6 == "network" + or fsrc6 == "interface" then return true -- ignore IPv4, network, interface else self.map:del(section, self.option) -- delete "ipv6_interface" helper return self.map:set(section, "interface", value) -- and write "interface" end end +function eif6.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4/IPv6 - bind_network -- ################################################# +-- IPv4/IPv6 - bind_network -- ################################################ if has_ssl or ( ( m:get(section, "bind_network") or "" ) ~= "" ) then bnet = ns:taboption("advanced", ListValue, "bind_network", translate("Bind Network") ) bnet:depends("ipv4_source", "web") bnet:depends("ipv6_source", "web") - bnet.rmempty = true bnet.default = "" bnet:value("", translate("-- default --")) WADM.cbi_add_networks(bnet) @@ -884,9 +1121,12 @@ if has_ssl or ( ( m:get(section, "bind_network") or "" ) ~= "" ) then if (value ~= "" and has_ssl ) or value == "" then return value end return nil, err_tab_adv(self) .. translate("Binding to a specific network not supported") .. " !" end + function bnet.parse(self, section, novld) + DDNS.value_parse(self, section, novld) + end end --- IPv4 + IPv6 - force_ipversion (NEW) -- ###################################### +-- IPv4 + IPv6 - force_ipversion -- ########################################### -- optional to force wget/curl and host to use only selected IP version -- command parameter "-4" or "-6" if has_force or ( ( m:get(section, "force_ipversion") or "0" ) ~= "0" ) then @@ -908,19 +1148,9 @@ if has_force or ( ( m:get(section, "force_ipversion") or "0" ) ~= "0" ) then if (value == "1" and has_force) or value == "0" then return value end return nil, err_tab_adv(self) .. translate("Force IP Version not supported") end - function fipv.parse(self, section) - DDNS.flag_parse(self, section) - end - function fipv.write(self, section, value) - if value == "1" then - return self.map:set(section, self.option, value) - else - return self.map:del(section, self.option) - end - end end --- IPv4 + IPv6 - dns_server (NEW) -- ########################################### +-- IPv4 + IPv6 - dns_server -- ################################################ -- optional DNS Server to use resolving my IP if "ip_source"="web" dns = ns:taboption("advanced", Value, "dns_server", translate("DNS-Server"), @@ -929,7 +1159,7 @@ dns = ns:taboption("advanced", Value, "dns_server", dns.placeholder = "mydns.lan" function dns.validate(self, value) -- if .datatype is set, then it is checked before calling this function - if not value then + if not value or (#value == 0) then return "" -- ignore on empty elseif not DTYP.host(value) then return nil, err_tab_adv(self) .. translate("use hostname, FQDN, IPv4- or IPv6-Address") @@ -947,8 +1177,11 @@ function dns.validate(self, value) end end end +function dns.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- IPv4 + IPv6 - force_dnstcp (NEW) -- ######################################### +-- IPv4 + IPv6 - force_dnstcp -- ############################################## if has_dnstcp or ( ( m:get(section, "force_dnstcp") or "0" ) ~= "0" ) then tcp = ns:taboption("advanced", Flag, "force_dnstcp", translate("Force TCP on DNS") ) @@ -970,12 +1203,9 @@ if has_dnstcp or ( ( m:get(section, "force_dnstcp") or "0" ) ~= "0" ) then end return nil, err_tab_adv(self) .. translate("DNS requests via TCP not supported") end - function tcp.parse(self, section) - DDNS.flag_parse(self, section) - end end --- IPv4 + IPv6 - proxy (NEW) -- ################################################ +-- IPv4 + IPv6 - proxy -- ##################################################### -- optional Proxy to use for http/https requests [user:password@]proxyhost[:port] if has_proxy or ( ( m:get(section, "proxy") or "" ) ~= "" ) then pxy = ns:taboption("advanced", Value, "proxy", @@ -997,7 +1227,7 @@ if has_proxy or ( ( m:get(section, "proxy") or "" ) ~= "" ) then end function pxy.validate(self, value) -- if .datatype is set, then it is checked before calling this function - if not value then + if not value or (#value == 0) then return "" -- ignore on empty elseif has_proxy then local ipv6 = usev6:formvalue(section) or "0" @@ -1016,9 +1246,12 @@ if has_proxy or ( ( m:get(section, "proxy") or "" ) ~= "" ) then return nil, err_tab_adv(self) .. translate("PROXY-Server not supported") end end + function pxy.parse(self, section, novld) + DDNS.value_parse(self, section, novld) + end end --- use_syslog -- ############################################################### +-- use_syslog -- ############################################################## slog = ns:taboption("advanced", ListValue, "use_syslog", translate("Log to syslog"), translate("Writes log messages to syslog. Critical Errors will always be written to syslog.") ) @@ -1028,26 +1261,24 @@ slog:value("1", translate("Info")) slog:value("2", translate("Notice")) slog:value("3", translate("Warning")) slog:value("4", translate("Error")) +function slog.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- use_logfile (NEW) -- ######################################################## +-- use_logfile -- ############################################################# logf = ns:taboption("advanced", Flag, "use_logfile", translate("Log to file"), translate("Writes detailed messages to log file. File will be truncated automatically.") .. "<br />" .. translate("File") .. [[: "]] .. log_dir .. [[/]] .. section .. [[.log"]] ) logf.orientation = "horizontal" -logf.rmempty = false -- we want to save in /etc/config/ddns file on "0" because -logf.default = "1" -- if not defined write to log by default -function logf.parse(self, section) - DDNS.flag_parse(self, section) -end +logf.default = "1" -- if not defined write to log by default --- TAB: Timer ##################################################################################### --- check_interval -- ########################################################### +-- TAB: Timer #################################################################################### +-- check_interval -- ########################################################## ci = ns:taboption("timer", Value, "check_interval", translate("Check Interval") ) ci.template = "ddns/detail_value" -ci.default = 10 -ci.rmempty = false -- validate ourselves for translatable error messages +ci.default = "10" function ci.validate(self, value) if not DTYP.uinteger(value) or tonumber(value) < 1 then @@ -1062,7 +1293,7 @@ function ci.validate(self, value) end end function ci.write(self, section, value) - -- simulate rmempty=true remove default + -- remove when default local secs = DDNS.calc_seconds(value, cu:formvalue(section)) if secs ~= 600 then --default 10 minutes return self.map:set(section, self.option, value) @@ -1071,20 +1302,22 @@ function ci.write(self, section, value) return self.map:del(section, self.option) end end +function ci.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- check_unit -- ############################################################### +-- check_unit -- ############################################################## cu = ns:taboption("timer", ListValue, "check_unit", "not displayed, but needed otherwise error", translate("Interval to check for changed IP" .. "<br />" .. "Values below 5 minutes == 300 seconds are not supported") ) cu.template = "ddns/detail_lvalue" cu.default = "minutes" -cu.rmempty = false -- want to control write process cu:value("seconds", translate("seconds")) cu:value("minutes", translate("minutes")) cu:value("hours", translate("hours")) --cu:value("days", translate("days")) function cu.write(self, section, value) - -- simulate rmempty=true remove default + -- remove when default local secs = DDNS.calc_seconds(ci:formvalue(section), value) if secs ~= 600 then --default 10 minutes return self.map:set(section, self.option, value) @@ -1092,13 +1325,16 @@ function cu.write(self, section, value) return true end end +function cu.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- force_interval (modified) -- ################################################ +-- force_interval (modified) -- ############################################### fi = ns:taboption("timer", Value, "force_interval", translate("Force Interval") ) fi.template = "ddns/detail_value" -fi.default = 72 -- see dynamic_dns_updater.sh script -fi.rmempty = false -- validate ourselves for translatable error messages +fi.default = "72" -- see dynamic_dns_updater.sh script +--fi.rmempty = false -- validate ourselves for translatable error messages function fi.validate(self, value) if not DTYP.uinteger(value) or tonumber(value) < 0 then @@ -1132,15 +1368,18 @@ function fi.write(self, section, value) return self.map:del(section, self.option) end end +function fi.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- force_unit -- ############################################################### +-- force_unit -- ############################################################## fu = ns:taboption("timer", ListValue, "force_unit", "not displayed, but needed otherwise error", translate("Interval to force updates send to DDNS Provider" .. "<br />" .. "Setting this parameter to 0 will force the script to only run once" .. "<br />" .. "Values lower 'Check Interval' except '0' are not supported") ) fu.template = "ddns/detail_lvalue" fu.default = "hours" -fu.rmempty = false -- want to control write process +--fu.rmempty = false -- want to control write process --fu:value("seconds", translate("seconds")) fu:value("minutes", translate("minutes")) fu:value("hours", translate("hours")) @@ -1154,15 +1393,17 @@ function fu.write(self, section, value) return true end end +function fu.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- retry_count (NEW) -- ######################################################## +-- retry_count -- ############################################################# rc = ns:taboption("timer", Value, "retry_count") rc.title = translate("Error Retry Counter") rc.description = translate("On Error the script will stop execution after given number of retrys") .. "<br />" .. translate("The default setting of '0' will retry infinite.") -rc.default = 0 -rc.rmempty = false -- validate ourselves for translatable error messages +rc.default = "0" function rc.validate(self, value) if not DTYP.uinteger(value) then return nil, err_tab_timer(self) .. translate("minimum value '0'") @@ -1170,21 +1411,15 @@ function rc.validate(self, value) return value end end -function rc.write(self, section, value) - -- simulate rmempty=true remove default - if tonumber(value) ~= self.default then - return self.map:set(section, self.option, value) - else - return self.map:del(section, self.option) - end +function rc.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end --- retry_interval -- ########################################################### +-- retry_interval -- ########################################################## ri = ns:taboption("timer", Value, "retry_interval", translate("Error Retry Interval") ) ri.template = "ddns/detail_value" -ri.default = 60 -ri.rmempty = false -- validate ourselves for translatable error messages +ri.default = "60" function ri.validate(self, value) if not DTYP.uinteger(value) or tonumber(value) < 1 then @@ -1203,13 +1438,16 @@ function ri.write(self, section, value) return self.map:del(section, self.option) end end +function ri.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- retry_unit -- ############################################################### +-- retry_unit -- ############################################################## ru = ns:taboption("timer", ListValue, "retry_unit", "not displayed, but needed otherwise error", translate("On Error the script will retry the failed action after given time") ) ru.template = "ddns/detail_lvalue" ru.default = "seconds" -ru.rmempty = false -- want to control write process +--ru.rmempty = false -- want to control write process ru:value("seconds", translate("seconds")) ru:value("minutes", translate("minutes")) --ru:value("hours", translate("hours")) @@ -1223,8 +1461,11 @@ function ru.write(self, section, value) return true -- will be deleted by retry_interval end end +function ru.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end --- TAB: LogView (NEW) ############################################################################# +-- TAB: LogView ################################################################################## lv = ns:taboption("logview", DummyValue, "_logview") lv.template = "ddns/detail_logview" lv.inputtitle = translate("Read / Reread log file") diff --git a/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua b/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua index fbd3cb3377..23ce4f13f7 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua @@ -5,19 +5,14 @@ local NX = require "nixio" local NXFS = require "nixio.fs" local DISP = require "luci.dispatcher" local SYS = require "luci.sys" +local CTRL = require "luci.controller.ddns" -- this application's controller local DDNS = require "luci.tools.ddns" -- ddns multiused functions -- cbi-map definition -- ####################################################### local m = Map("ddns") - --- first need to close <a> from cbi map template our <a> closed by template -m.title = [[</a><a href="]] .. DISP.build_url("admin", "services", "ddns") .. [[">]] - .. translate("Dynamic DNS") - -m.description = translate("Dynamic DNS allows that your router can be reached with " .. - "a fixed hostname while having a dynamically changing IP address.") - -m.redirect = DISP.build_url("admin", "services", "ddns") +m.title = CTRL.app_title_back() +m.description = CTRL.app_description() +m.redirect = DISP.build_url("admin", "services", "ddns") function m.commit_handler(self) if self.changed then -- changes ? @@ -53,17 +48,7 @@ ali.description = translate("Non-public and by default blocked IP's") .. ":" .. "0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.168/16" .. [[<br /><strong>IPv6: </strong>]] .. "::/32, f000::/4" -ali.reempty = true ali.default = "0" -function ali.parse(self, section) - DDNS.flag_parse(self, section) -end -function ali.validate(self, value) - if value == self.default then - return "" -- default = empty - end - return value -end -- date_format -- ############################################################# local df = ns:option(Value, "date_format") @@ -72,7 +57,6 @@ df.description = [[<a href="http://www.cplusplus.com/reference/ctime/strftime/" .. translate("For supported codes look here") .. [[</a>]] df.template = "ddns/global_value" -df.rmempty = true df.default = "%F %R" df.date_string = "" function df.cfgvalue(self, section) @@ -81,55 +65,45 @@ function df.cfgvalue(self, section) self.date_string = DDNS.epoch2date(epoch, value) return value end -function df.validate(self, value) - if value == self.default then - return "" -- default = empty - end - return value +function df.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end -- run_dir -- ################################################################# local rd = ns:option(Value, "run_dir") rd.title = translate("Status directory") rd.description = translate("Directory contains PID and other status information for each running section") -rd.rmempty = true rd.default = "/var/run/ddns" -function rd.validate(self, value) - if value == self.default then - return "" -- default = empty - end - return value +-- no need to validate. if empty default is used everything else created by dns-scripts +function rd.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end -- log_dir -- ################################################################# local ld = ns:option(Value, "log_dir") ld.title = translate("Log directory") ld.description = translate("Directory contains Log files for each running section") -ld.rmempty = true ld.default = "/var/log/ddns" -function ld.validate(self, value) - if value == self.default then - return "" -- default = empty - end - return value +-- no need to validate. if empty default is used everything else created by dns-scripts +function ld.parse(self, section, novld) + DDNS.value_parse(self, section, novld) end -- log_lines -- ############################################################### local ll = ns:option(Value, "log_lines") ll.title = translate("Log length") ll.description = translate("Number of last lines stored in log files") -ll.rmempty = true ll.default = "250" function ll.validate(self, value) local n = tonumber(value) if not n or math.floor(n) ~= n or n < 1 then return nil, self.title .. ": " .. translate("minimum value '1'") end - if value == self.default then - return "" -- default = empty - end return value end +function ll.parse(self, section, novld) + DDNS.value_parse(self, section, novld) +end -- use_curl -- ################################################################ if (SYS.call([[ grep -i "\+ssl" /usr/bin/wget >/dev/null 2>&1 ]]) == 0) @@ -140,17 +114,7 @@ and NXFS.access("/usr/bin/curl") then .. [[<br />]] .. translate("To use cURL activate this option.") pc.orientation = "horizontal" - pc.rmempty = true pc.default = "0" - function pc.parse(self, section) - DDNS.flag_parse(self, section) - end - function pc.validate(self, value) - if value == self.default then - return "" -- default = empty - end - return value - end end return m 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 ff7aa7a41c..031bf513cf 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua @@ -1,9 +1,9 @@ -- Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com> -- Licensed to the public under the Apache License 2.0. -local CTRL = require "luci.controller.ddns" -- this application's controller local DISP = require "luci.dispatcher" 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 -- ################################################## @@ -11,8 +11,6 @@ local DDNS = require "luci.tools.ddns" -- ddns multiused functions 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 --- correct ddns-scripts version -need_update = DDNS.ipkg_ver_compare(DDNS.ipkg_ver_installed("ddns-scripts"), "<<", CTRL.DDNS_MIN) -- html constants font_red = [[<font color="red">]] @@ -22,16 +20,9 @@ bold_off = [[</strong>]] -- cbi-map definition -- ####################################################### m = Map("ddns") - --- first need to close <a> from cbi map template our <a> closed by template -m.title = [[</a><a href="]] .. DISP.build_url("admin", "services", "ddns") .. [[">]] .. - translate("Dynamic DNS") - -m.description = translate("Dynamic DNS allows that your router can be reached with " .. - "a fixed hostname while having a dynamically changing " .. - "IP address.") - -m.redirect = DISP.build_url("admin", "services", "ddns") +m.title = CTRL.app_title_back() +m.description = CTRL.app_description() +m.redirect = DISP.build_url("admin", "services", "ddns") -- SimpleSection definition -- ################################################# -- show Hints to optimize installation and script usage @@ -40,7 +31,7 @@ s = m:section( SimpleSection, translate("Below a list of configuration tips for your system to run Dynamic DNS updates without limitations") ) -- ddns_scripts needs to be updated for full functionality -if need_update then +if not CTRL.service_ok() then local dv = s:option(DummyValue, "_update_needed") dv.titleref = DISP.build_url("admin", "system", "packages") dv.rawhtml = true diff --git a/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua b/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua index 9e8df2d089..46fc0a4a29 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua @@ -2,10 +2,10 @@ -- Licensed to the public under the Apache License 2.0. local NXFS = require "nixio.fs" -local CTRL = require "luci.controller.ddns" -- this application's controller local DISP = require "luci.dispatcher" local HTTP = require "luci.http" local SYS = require "luci.sys" +local CTRL = require "luci.controller.ddns" -- this application's controller local DDNS = require "luci.tools.ddns" -- ddns multiused functions -- show hints ? @@ -15,7 +15,7 @@ show_hints = not (DDNS.check_ipv6() -- IPv6 support and DDNS.check_bind_host() -- DNS TCP support ) -- correct ddns-scripts version -need_update = DDNS.ipkg_ver_compare(DDNS.ipkg_ver_installed("ddns-scripts"), "<<", CTRL.DDNS_MIN) +need_update = not CTRL.service_ok() -- html constants font_red = [[<font color="red">]] @@ -25,23 +25,8 @@ bold_off = [[</strong>]] -- cbi-map definition -- ####################################################### m = Map("ddns") - --- first need to close <a> from cbi map template our <a> closed by template -m.title = [[</a><a href="javascript:alert(']] - .. translate("Version Information") - .. [[\n\nluci-app-ddns]] - .. [[\n\t]] .. translate("Version") .. [[:\t]] .. DDNS.ipkg_ver_installed("luci-app-ddns") - .. [[\n\nddns-scripts ]] .. translate("required") .. [[:]] - .. [[\n\t]] .. translate("Version") .. [[:\t]] .. CTRL.DDNS_MIN .. [[ ]] .. translate("or higher") - .. [[\n\nddns-scripts ]] .. translate("installed") .. [[:]] - .. [[\n\t]] .. translate("Version") .. [[:\t]] .. DDNS.ipkg_ver_installed("ddns-scripts") - .. [[\n\n]] - .. [[')">]] - .. translate("Dynamic DNS") - -m.description = translate("Dynamic DNS allows that your router can be reached with " .. - "a fixed hostname while having a dynamically changing " .. - "IP address.") +m.title = CTRL.app_title_main() +m.description = CTRL.app_description() m.on_after_commit = function(self) if self.changed then -- changes ? @@ -123,21 +108,21 @@ function ts.create(self, name) HTTP.redirect( self.extedit:format(name) ) end --- Domain and registered IP -- ################################################# -dom = ts:option(DummyValue, "_domainIP", - translate("Hostname/Domain") .. "<br />" .. translate("Registered IP") ) +-- Lookup_Host and registered IP -- ################################################# +dom = ts:option(DummyValue, "_lookupIP", + translate("Lookup Hostname") .. "<br />" .. translate("Registered IP") ) dom.template = "ddns/overview_doubleline" function dom.set_one(self, section) - local domain = self.map:get(section, "domain") or "" - if domain ~= "" then - return domain + local lookup = self.map:get(section, "lookup_host") or "" + if lookup ~= "" then + return lookup else return [[<em>]] .. translate("config error") .. [[</em>]] end end function dom.set_two(self, section) - local domain = self.map:get(section, "domain") or "" - if domain == "" then return "" end + local lookup = self.map:get(section, "lookup_host") or "" + if lookup == "" then return "" end local dnsserver = self.map:get(section, "dnsserver") or "" local use_ipv6 = tonumber(self.map:get(section, "use_ipv6") or 0) local force_ipversion = tonumber(self.map:get(section, "force_ipversion") or 0) @@ -146,7 +131,7 @@ function dom.set_two(self, section) if not NXFS.access(command, "rwx", "rx", "rx") then NXFS.chmod(command, 755) end - command = command .. [[ get_registered_ip ]] .. domain .. [[ ]] .. use_ipv6 .. + command = command .. [[ get_registered_ip ]] .. lookup .. [[ ]] .. use_ipv6 .. [[ ]] .. force_ipversion .. [[ ]] .. force_dnstcp .. [[ ]] .. dnsserver local ip = SYS.exec(command) if ip == "" then ip = translate("no data") end @@ -158,9 +143,6 @@ ena = ts:option( Flag, "enabled", translate("Enabled")) ena.template = "ddns/overview_enabled" ena.rmempty = false -function ena.parse(self, section) - DDNS.flag_parse(self, section) -end -- show PID and next update upd = ts:option( DummyValue, "_update", diff --git a/applications/luci-app-ddns/luasrc/tools/ddns.lua b/applications/luci-app-ddns/luasrc/tools/ddns.lua index 4466063cb3..ecc4131364 100644 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -96,58 +96,6 @@ function get_pid(section) return pid end --- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" -function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not ver2 - or not comp or not (#comp > 0) then return nil end - -- correct compare string - if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" - elseif comp == "<=" or comp == "<" or comp == "=<" then comp = "<=" - elseif comp == ">=" or comp == ">" or comp == "=>" then comp = ">=" - elseif comp == "=" or comp == "==" then comp = "==" - elseif comp == "<<" then comp = "<" - elseif comp == ">>" then comp = ">" - else return nil end - - local av1 = UTIL.split(ver1, "[%.%-]", nil, true) - local av2 = UTIL.split(ver2, "[%.%-]", nil, true) - - for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do - local s1 = av1[i] or "" - local s2 = av2[i] or "" - - -- first "not equal" found return true - if comp == "~=" and (s1 ~= s2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - -- not equal then return false - if (s1 ~= s2) then return false end - end - - -- all equal and not compare greater or lower then true - return not (comp == "<" or comp == ">") -end - --- read version information for given package if installed -function ipkg_ver_installed(pkg) - local version = nil - local control = io.open("/usr/lib/opkg/info/%s.control" % pkg, "r") - if control then - local ln - repeat - ln = control:read("*l") - if ln and ln:match("^Version: ") then - version = ln:gsub("^Version: ", "") - break - end - until not ln - control:close() - end - return version -end - -- replacement of build-in read of UCI option -- modified AbstractValue.cfgvalue(self, section) from cbi.lua -- needed to read from other option then current value definition @@ -172,24 +120,77 @@ function read_value(self, section, option) end end --- replacement of build-in Flag.parse of cbi.lua --- modified to mark section as changed if value changes --- current parse did not do this, but it is done AbstaractValue.parse() -function flag_parse(self, section) - local fexists = self.map:formvalue( - luci.cbi.FEXIST_PREFIX .. self.config .. "." .. section .. "." .. self.option) +-- replacement of build-in parse of "Value" +-- modified AbstractValue.parse(self, section, novld) from cbi.lua +-- validate is called if rmempty/optional true or false +-- before write check if forcewrite, value eq default, and more +function value_parse(self, section, novld) + local fvalue = self:formvalue(section) + local fexist = ( fvalue and (#fvalue > 0) ) -- not "nil" and "not empty" + local cvalue = self:cfgvalue(section) + local rm_opt = ( self.rmempty or self.optional ) + local eq_cfg -- flag: equal cfgvalue - if fexists then - local fvalue = self:formvalue(section) and self.enabled or self.disabled - local cvalue = self:cfgvalue(section) - if fvalue ~= self.default or (not self.optional and not self.rmempty) then - self:write(section, fvalue) - else - self:remove(section) + -- If favlue and cvalue are both tables and have the same content + -- make them identical + if type(fvalue) == "table" and type(cvalue) == "table" then + eq_cfg = (#fvalue == #cvalue) + if eq_cfg then + for i=1, #fvalue do + if cvalue[i] ~= fvalue[i] then + eq_cfg = false + end + end end - if (fvalue ~= cvalue) then self.section.changed = true end - else - self:remove(section) + if eq_cfg then + fvalue = cvalue + end + end + + -- removed parameter "section" from function call because used/accepted nowhere + -- also removed call to function "transfer" + local vvalue, errtxt = self:validate(fvalue) + + -- error handling; validate return "nil" + if not vvalue then + if novld then -- and "novld" set + return -- then exit without raising an error + end + + if fexist then -- and there is a formvalue + self:add_error(section, "invalid", errtxt) + return -- so data are invalid + + elseif not rm_opt then -- and empty formvalue but NOT (rmempty or optional) set + self:add_error(section, "missing", errtxt) + return -- so data is missing + end + end + -- for whatever reason errtxt set and not handled above + assert( not (errtxt and (#errtxt > 0)), "unhandled validate error" ) + + -- lets continue with value returned from validate + eq_cfg = ( vvalue == cvalue ) -- update equal_config flag + local vexist = ( vvalue and (#vvalue > 0) ) -- not "nil" and "not empty" + local eq_def = ( vvalue == self.default ) -- equal_default flag + + -- not forcewrite and (rmempty or optional) + -- and (no data or equal_default) + if not self.forcewrite and rm_opt + and (not vexist or eq_def) then + if self:remove(section) then -- remove data from UCI + self.section.changed = true -- and push events + end + return + end + + -- not forcewrite and no changes, so nothing to write + if not self.forcewrite and eq_cfg then + return + end + + -- write data to UCI; raise event only on changes + if self:write(section, vvalue) and not eq_cfg then self.section.changed = true end end diff --git a/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm b/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm index 494b7435cd..fd1d5be268 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm @@ -6,7 +6,7 @@ var txt = document.getElementById("cbid.ddns." + section + "._logview.txt"); // TextArea if ( !txt ) { return; } // security check - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "logview")%>/' + section, null, + XHR.get('<%=url([[admin]], [[services]], [[ddns]], [[logview]])%>/' + section, null, function(x) { if (x.responseText == "_nodata_") txt.value = "<%:File not found or empty%>"; diff --git a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm index ea8e4a1e31..b409ed0728 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm @@ -19,7 +19,7 @@ var section = data[i].section // Section to handle var cbx = document.getElementById("cbid.ddns." + section + ".enabled"); // Enabled var btn = document.getElementById("cbid.ddns." + section + "._startstop"); // Start/Stop button - var rip = document.getElementById("cbid.ddns." + section + "._domainIP.two"); // Registered IP + var rip = document.getElementById("cbid.ddns." + section + "._lookupIP.two"); // Registered IP var lup = document.getElementById("cbid.ddns." + section + "._update.one"); // Last Update var nup = document.getElementById("cbid.ddns." + section + "._update.two"); // Next Update if ( !(cbx && btn && rip && lup && nup) ) { return; } // security check @@ -76,12 +76,12 @@ break; } - // domain - // (data[i].domain ignored here + // lookup + // (data[i].lookup ignored here // registered IP // rip.innerHTML = "Registered IP"; - if (data[i].domain == "_nodomain_") + if (data[i].lookup == "_nolookup_") rip.innerHTML = ''; else if (data[i].reg_ip == "_nodata_") rip.innerHTML = '<em><%:No data%></em>'; @@ -136,7 +136,7 @@ // do start/stop var btnXHR = new XHR(); - btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "startstop")%>/' + section + '/' + cbx.checked, null, + btnXHR.post('<%=url([[admin]], [[services]], [[ddns]], [[startstop]])%>/' + section + '/' + cbx.checked, { token: '<%=token%>' }, function(x, data) { if (x.responseText == "_uncommitted_") { // we need a trick to display Ampersand "&" in stead of "&" or "&" @@ -155,7 +155,7 @@ } // force to immediate show status on page load (not waiting for XHR.poll) - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.get('<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { if (data) { _data2elements(data); } } @@ -164,7 +164,7 @@ // define only ONE XHR.poll in a page because if one is running it blocks the other one // optimum is to define on Map or Section Level from here you can reach all elements // we need update every 15 seconds only - XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.poll(5, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { if (data) { _data2elements(data); } } diff --git a/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm b/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm index 4ca0abb0e5..5bdcb03e73 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm @@ -69,15 +69,15 @@ break; } - // domain - if (data[j].domain == "_nodomain_") + // lookup + if (data[j].lookup == "_nolookup_") tr.insertCell(-1).innerHTML = '<em><%:config error%></em>'; else - tr.insertCell(-1).innerHTML = data[j].domain; + tr.insertCell(-1).innerHTML = data[j].lookup; // registered IP switch (data[j].reg_ip) { - case "_nodomain_": + case "_nolookup_": tr.insertCell(-1).innerHTML = '<em><%:Config error%></em>'; break; case "_nodata_": @@ -111,13 +111,13 @@ } // force to immediate show status (not waiting for XHR.poll) - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.get('<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { if (data) { _data2elements(x, data); } } ); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.poll(15, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { if (data) { _data2elements(x, data); } } @@ -126,13 +126,13 @@ //]]></script> <fieldset class="cbi-section" id="ddns_status_section"> - <legend><a href="<%=luci.dispatcher.build_url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend> + <legend><a href="<%=url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend> <table class="cbi-section-table" id="ddns_status_table"> <tr class="cbi-section-table-titles"> <th class="cbi-section-table-cell"><%:Configuration%></th> <th class="cbi-section-table-cell"><%:Next Update%></th> - <th class="cbi-section-table-cell"><%:Hostname/Domain%></th> + <th class="cbi-section-table-cell"><%:Lookup Hostname%></th> <th class="cbi-section-table-cell"><%:Registered IP%></th> <th class="cbi-section-table-cell"><%:Network%></th> </tr> diff --git a/applications/luci-app-ddns/po/ca/ddns.po b/applications/luci-app-ddns/po/ca/ddns.po index 35f13eba5d..c57b68938f 100644 --- a/applications/luci-app-ddns/po/ca/ddns.po +++ b/applications/luci-app-ddns/po/ca/ddns.po @@ -462,6 +462,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/cs/ddns.po b/applications/luci-app-ddns/po/cs/ddns.po index 455c72a6aa..e957d58abb 100644 --- a/applications/luci-app-ddns/po/cs/ddns.po +++ b/applications/luci-app-ddns/po/cs/ddns.po @@ -460,6 +460,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/de/ddns.po b/applications/luci-app-ddns/po/de/ddns.po index 6ffde5d547..e662adc780 100644 --- a/applications/luci-app-ddns/po/de/ddns.po +++ b/applications/luci-app-ddns/po/de/ddns.po @@ -1,15 +1,15 @@ msgid "" msgstr "" "Project-Id-Version: luci-app-ddns\n" -"POT-Creation-Date: 2015-05-08 21:29+0100\n" -"PO-Revision-Date: 2015-05-08 21:47+0100\n" +"POT-Creation-Date: 2015-11-04 19:10-0100\n" +"PO-Revision-Date: 2015-11-14 18:31+0100\n" "Last-Translator: Christian Schoenebeck <christian.schoenebeck@gmail.com>\n" "Language-Team: \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.5\n" +"X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-Basepath: .\n" @@ -70,6 +70,9 @@ msgstr "" msgid "Casual users should not change this setting" msgstr "Standard Benutzer sollten diese Einstellung nicht ändern." +msgid "Change provider" +msgstr "Anbieter wechseln" + msgid "Check Interval" msgstr "Prüfinterval" @@ -125,6 +128,12 @@ msgstr "Eigenes Update-Skript" msgid "DDNS Autostart disabled" msgstr "DDNS Autostart deaktiviert" +msgid "DDNS Client Configuration" +msgstr "DDNS Client Konfiguration" + +msgid "DDNS Client Documentation" +msgstr "DDNS Client Dokumentation" + msgid "DDNS Service provider" msgstr "DDNS-Dienstanbieter" @@ -196,6 +205,9 @@ msgstr "" msgid "Disabled" msgstr "Deaktiviert" +msgid "Domain" +msgstr "Domäne" + msgid "Dynamic DNS" msgstr "Dynamisches DNS" @@ -284,8 +296,10 @@ msgstr "HTTPS nicht unterstützt" msgid "Hints" msgstr "Hinweise" -msgid "Hostname/Domain" -msgstr "Rechnername/Domäne" +msgid "Hostname/FQDN to validate, if IP update happen or necessary" +msgstr "" +"Hostname/FQDN um zu überprüfen, ob eine Aktualisierung stattgefunden hat " +"oder notwendig ist" msgid "IP address source" msgstr "IP-Adressquelle" @@ -385,6 +399,12 @@ msgstr "Protokoll in Datei schreiben" msgid "Log to syslog" msgstr "Systemprotokoll verwenden" +msgid "Lookup Hostname" +msgstr "Nachschlage-Hostname" + +msgid "NOT installed" +msgstr "NICHT installiert" + msgid "" "Neither GNU Wget with SSL nor cURL installed to select a network to use for " "communication." @@ -454,6 +474,21 @@ msgstr "" msgid "On Error the script will stop execution after given number of retrys" msgstr "Das Skript wird nach der gegebenen Anzahl von Fehlversuchen beendet." +msgid "OpenWrt Wiki" +msgstr "OpenWrt Wiki" + +msgid "Optional Encoded Parameter" +msgstr "Optionaler codierten Parameter" + +msgid "Optional Parameter" +msgstr "Optionaler Parameter" + +msgid "Optional: Replaces [PARAMENC] in Update-URL (URL-encoded)" +msgstr "Optional: Ersetzt [PARAMENC] in der Update-URL (URL-codiert)" + +msgid "Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)" +msgstr "Optional: Ersetzt [PARAMENC] in der Update-URL (NICHT URL-codiert)" + msgid "Overview" msgstr "Übersicht" @@ -484,17 +519,20 @@ msgstr "Prozess ID" msgid "Read / Reread log file" msgstr "Protokolldatei (neu) einlesen" +msgid "Really change DDNS provider?" +msgstr "Wirklich DDNS-Anbieter wechseln?" + msgid "Registered IP" msgstr "Registrierte IP" msgid "Replaces [DOMAIN] in Update-URL" msgstr "Ersetzt [DOMAIN] in der Update-URL" -msgid "Replaces [PASSWORD] in Update-URL" -msgstr "Ersetzt [PASSWORD] in der Update-URL" +msgid "Replaces [PASSWORD] in Update-URL (URL-encoded)" +msgstr "Ersetzt [PASSWORD] in der Update-URL (URL-codiert)" -msgid "Replaces [USERNAME] in Update-URL" -msgstr "Ersetzt [USERNAME] in der Update-URL" +msgid "Replaces [USERNAME] in Update-URL (URL-encoded)" +msgstr "Ersetzt [USERNAME] in der Update-URL (URL-codiert)" msgid "Run once" msgstr "Einmalig ausführen" @@ -528,7 +566,7 @@ msgstr "" "Optionen." msgid "The default setting of '0' will retry infinite." -msgstr "Der Standard-Wert von '0' wird es endlosen erneut versuchen." +msgstr "Beim Standard-Wert von '0' wird es endlos erneut versucht." msgid "There is no service configured." msgstr "Kein Dienst konfiguriert" @@ -661,8 +699,8 @@ msgstr "Stunden" msgid "installed" msgstr "installiert" -msgid "invalid - Sample" -msgstr "ungültig - Beispiel" +msgid "invalid FQDN / required - Sample" +msgstr "ungültige FQDN / Pflichtfeld - Beispiel" msgid "minimum value '0'" msgstr "Minimum Wert '0'" diff --git a/applications/luci-app-ddns/po/el/ddns.po b/applications/luci-app-ddns/po/el/ddns.po index edbe19d146..821e17e655 100644 --- a/applications/luci-app-ddns/po/el/ddns.po +++ b/applications/luci-app-ddns/po/el/ddns.po @@ -459,6 +459,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/en/ddns.po b/applications/luci-app-ddns/po/en/ddns.po index b706fa29e9..a6ba0bb127 100644 --- a/applications/luci-app-ddns/po/en/ddns.po +++ b/applications/luci-app-ddns/po/en/ddns.po @@ -457,6 +457,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/es/ddns.po b/applications/luci-app-ddns/po/es/ddns.po index 1948155d28..ebee43d74f 100644 --- a/applications/luci-app-ddns/po/es/ddns.po +++ b/applications/luci-app-ddns/po/es/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/fr/ddns.po b/applications/luci-app-ddns/po/fr/ddns.po index 94b61b6954..84e86a9646 100644 --- a/applications/luci-app-ddns/po/fr/ddns.po +++ b/applications/luci-app-ddns/po/fr/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/he/ddns.po b/applications/luci-app-ddns/po/he/ddns.po index a6d20303bc..45f5a6db9c 100644 --- a/applications/luci-app-ddns/po/he/ddns.po +++ b/applications/luci-app-ddns/po/he/ddns.po @@ -461,6 +461,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/hu/ddns.po b/applications/luci-app-ddns/po/hu/ddns.po index fdd9a17a86..20388d3ea6 100644 --- a/applications/luci-app-ddns/po/hu/ddns.po +++ b/applications/luci-app-ddns/po/hu/ddns.po @@ -460,6 +460,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/it/ddns.po b/applications/luci-app-ddns/po/it/ddns.po index 48e6809120..77ebfb727f 100644 --- a/applications/luci-app-ddns/po/it/ddns.po +++ b/applications/luci-app-ddns/po/it/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/ja/ddns.po b/applications/luci-app-ddns/po/ja/ddns.po index 488bac9906..1b608aa222 100644 --- a/applications/luci-app-ddns/po/ja/ddns.po +++ b/applications/luci-app-ddns/po/ja/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/ms/ddns.po b/applications/luci-app-ddns/po/ms/ddns.po index 5b7f0dea6b..ea11b9e354 100644 --- a/applications/luci-app-ddns/po/ms/ddns.po +++ b/applications/luci-app-ddns/po/ms/ddns.po @@ -456,6 +456,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/no/ddns.po b/applications/luci-app-ddns/po/no/ddns.po index b805aa4f80..80374ee7cf 100644 --- a/applications/luci-app-ddns/po/no/ddns.po +++ b/applications/luci-app-ddns/po/no/ddns.po @@ -449,6 +449,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/pl/ddns.po b/applications/luci-app-ddns/po/pl/ddns.po index e016cc4a43..9907b1e644 100644 --- a/applications/luci-app-ddns/po/pl/ddns.po +++ b/applications/luci-app-ddns/po/pl/ddns.po @@ -459,6 +459,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/pt-br/ddns.po b/applications/luci-app-ddns/po/pt-br/ddns.po index df2fff538e..5dd243fe66 100644 --- a/applications/luci-app-ddns/po/pt-br/ddns.po +++ b/applications/luci-app-ddns/po/pt-br/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/pt/ddns.po b/applications/luci-app-ddns/po/pt/ddns.po index 57654928d8..a788ad257b 100644 --- a/applications/luci-app-ddns/po/pt/ddns.po +++ b/applications/luci-app-ddns/po/pt/ddns.po @@ -460,6 +460,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/ro/ddns.po b/applications/luci-app-ddns/po/ro/ddns.po index 78c39d5e94..f32c6e98cf 100644 --- a/applications/luci-app-ddns/po/ro/ddns.po +++ b/applications/luci-app-ddns/po/ro/ddns.po @@ -461,6 +461,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/ru/ddns.po b/applications/luci-app-ddns/po/ru/ddns.po index d4c0eb4a88..e76cda60c5 100644 --- a/applications/luci-app-ddns/po/ru/ddns.po +++ b/applications/luci-app-ddns/po/ru/ddns.po @@ -460,6 +460,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/sk/ddns.po b/applications/luci-app-ddns/po/sk/ddns.po index 3cd0f4c2c6..45e6632f0a 100644 --- a/applications/luci-app-ddns/po/sk/ddns.po +++ b/applications/luci-app-ddns/po/sk/ddns.po @@ -451,6 +451,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/sv/ddns.po b/applications/luci-app-ddns/po/sv/ddns.po index cee36e7254..c3b7c56e24 100644 --- a/applications/luci-app-ddns/po/sv/ddns.po +++ b/applications/luci-app-ddns/po/sv/ddns.po @@ -452,6 +452,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/templates/ddns.pot b/applications/luci-app-ddns/po/templates/ddns.pot index 35386802bf..7ab51dd93a 100644 --- a/applications/luci-app-ddns/po/templates/ddns.pot +++ b/applications/luci-app-ddns/po/templates/ddns.pot @@ -50,6 +50,9 @@ msgstr "" msgid "Casual users should not change this setting" msgstr "" +msgid "Change provider" +msgstr "" + msgid "Check Interval" msgstr "" @@ -96,6 +99,12 @@ msgstr "" msgid "DDNS Autostart disabled" msgstr "" +msgid "DDNS Client Configuration" +msgstr "" + +msgid "DDNS Client Documentation" +msgstr "" + msgid "DDNS Service provider" msgstr "" @@ -149,6 +158,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Domain" +msgstr "" + msgid "Dynamic DNS" msgstr "" @@ -230,7 +242,7 @@ msgstr "" msgid "Hints" msgstr "" -msgid "Hostname/Domain" +msgid "Hostname/FQDN to validate, if IP update happen or necessary" msgstr "" msgid "IP address source" @@ -315,6 +327,12 @@ msgstr "" msgid "Log to syslog" msgstr "" +msgid "Lookup Hostname" +msgstr "" + +msgid "NOT installed" +msgstr "" + msgid "" "Neither GNU Wget with SSL nor cURL installed to select a network to use for " "communication." @@ -373,6 +391,21 @@ msgstr "" msgid "On Error the script will stop execution after given number of retrys" msgstr "" +msgid "OpenWrt Wiki" +msgstr "" + +msgid "Optional Encoded Parameter" +msgstr "" + +msgid "Optional Parameter" +msgstr "" + +msgid "Optional: Replaces [PARAMENC] in Update-URL (URL-encoded)" +msgstr "" + +msgid "Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)" +msgstr "" + msgid "Overview" msgstr "" @@ -403,16 +436,19 @@ msgstr "" msgid "Read / Reread log file" msgstr "" +msgid "Really change DDNS provider?" +msgstr "" + msgid "Registered IP" msgstr "" msgid "Replaces [DOMAIN] in Update-URL" msgstr "" -msgid "Replaces [PASSWORD] in Update-URL" +msgid "Replaces [PASSWORD] in Update-URL (URL-encoded)" msgstr "" -msgid "Replaces [USERNAME] in Update-URL" +msgid "Replaces [USERNAME] in Update-URL (URL-encoded)" msgstr "" msgid "Run once" @@ -563,7 +599,7 @@ msgstr "" msgid "installed" msgstr "" -msgid "invalid - Sample" +msgid "invalid FQDN / required - Sample" msgstr "" msgid "minimum value '0'" diff --git a/applications/luci-app-ddns/po/tr/ddns.po b/applications/luci-app-ddns/po/tr/ddns.po index 10492bccc6..74be14ab20 100644 --- a/applications/luci-app-ddns/po/tr/ddns.po +++ b/applications/luci-app-ddns/po/tr/ddns.po @@ -458,6 +458,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/uk/ddns.po b/applications/luci-app-ddns/po/uk/ddns.po index 0e2c5804a0..58ded215e6 100644 --- a/applications/luci-app-ddns/po/uk/ddns.po +++ b/applications/luci-app-ddns/po/uk/ddns.po @@ -461,6 +461,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/vi/ddns.po b/applications/luci-app-ddns/po/vi/ddns.po index 5d5a7ede70..4b0cc91fd9 100644 --- a/applications/luci-app-ddns/po/vi/ddns.po +++ b/applications/luci-app-ddns/po/vi/ddns.po @@ -461,6 +461,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" diff --git a/applications/luci-app-ddns/po/zh-cn/ddns.po b/applications/luci-app-ddns/po/zh-cn/ddns.po index 862c2a052a..381e6684e8 100644 --- a/applications/luci-app-ddns/po/zh-cn/ddns.po +++ b/applications/luci-app-ddns/po/zh-cn/ddns.po @@ -12,6 +12,9 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 1.7.5\n" +msgid "&" +msgstr "" + msgid "-- custom --" msgstr "-- 自定义 --" @@ -30,10 +33,13 @@ msgstr "正在应用更改" msgid "Basic Settings" msgstr "基础设置" -msgid "Below a list of configuration tips for your system to run Dynamic DNS updates without limitations" +msgid "" +"Below a list of configuration tips for your system to run Dynamic DNS " +"updates without limitations" msgstr "以下是一个能够让你的系统不受限制地进行动态DNS更新的设置贴士." -msgid "Below is a list of configured DDNS configurations and their current state." +msgid "" +"Below is a list of configured DDNS configurations and their current state." msgstr "一下是当前已经配置好的DDNS设置项列表以及它们的当前状态." msgid "Bind Network" @@ -42,10 +48,14 @@ msgstr "使用的接口" msgid "Binding to a specific network not supported" msgstr "不支持绑定到一个指定的网络" -msgid "BusyBox's nslookup and Wget do not support to specify the IP version to use for communication with DDNS Provider." +msgid "" +"BusyBox's nslookup and Wget do not support to specify the IP version to use " +"for communication with DDNS Provider." msgstr "与DDNS供应商通讯时BusyBox的nslookup和Wget不支持设置特定的IP协议版本." -msgid "BusyBox's nslookup does not support to specify to use TCP instead of default UDP when requesting DNS server" +msgid "" +"BusyBox's nslookup does not support to specify to use TCP instead of default " +"UDP when requesting DNS server" msgstr "BusyBox的nslookup不支持使用TCP协议代替UDP协议请求DNS记录" msgid "Casual users should not change this setting" @@ -63,7 +73,9 @@ msgstr "配置错误" msgid "Configuration" msgstr "设置" -msgid "Configure here the details for all Dynamic DNS services including this LuCI application." +msgid "" +"Configure here the details for all Dynamic DNS services including this LuCI " +"application." msgstr "在这里修改动态DNS服务的详细配置" msgid "Configure here the details for selected Dynamic DNS service." @@ -72,11 +84,20 @@ msgstr "在这里修改选择的DDNS服务的详细配置" msgid "Current setting" msgstr "当前设置" -msgid "Currently DDNS updates are not started at boot or on interface events.<br />This is the default if you run DDNS scripts by yourself (i.e. via cron with force_interval set to '0')" -msgstr "现在,DDNS更新在开机或者接口动作时不会被触发<br />如果你手工运行DDNS脚本的话(例如使用cron时把force_interval设置为0),这是默认设置." +msgid "" +"Currently DDNS updates are not started at boot or on interface events.<br /" +">This is the default if you run DDNS scripts by yourself (i.e. via cron with " +"force_interval set to '0')" +msgstr "" +"现在,DDNS更新在开机或者接口动作时不会被触发<br />如果你手工运行DDNS脚本的话" +"(例如使用cron时把force_interval设置为0),这是默认设置." -msgid "Currently DDNS updates are not started at boot or on interface events.<br />You can start/stop each configuration here. It will run until next reboot." -msgstr "现在,DDNS更新在开机或者接口动作时不会被触发<br />你可以在这里开始/停止每一个设置的条目.它在下次重启之前一直有效." +msgid "" +"Currently DDNS updates are not started at boot or on interface events.<br /" +">You can start/stop each configuration here. It will run until next reboot." +msgstr "" +"现在,DDNS更新在开机或者接口动作时不会被触发<br />你可以在这里开始/停止每一个" +"设置的条目.它在下次重启之前一直有效." msgid "Custom update script to be used for updating your DDNS Provider." msgstr "用来更新动态DNS的自定义脚本" @@ -117,10 +138,14 @@ msgstr "设定用来读取系统IPv4地址的网络" msgid "Defines the network to read systems IPv6-Address from" msgstr "设定用来读取系统IPv6地址的网络" -msgid "Defines the source to read systems IPv4-Address from, that will be send to the DDNS provider" +msgid "" +"Defines the source to read systems IPv4-Address from, that will be send to " +"the DDNS provider" msgstr "设定IPv4地址的来源.这将会被发送给DDNS提供商" -msgid "Defines the source to read systems IPv6-Address from, that will be send to the DDNS provider" +msgid "" +"Defines the source to read systems IPv6-Address from, that will be send to " +"the DDNS provider" msgstr "设定IPv6地址的来源.这将会被发送给DDNS提供商" msgid "Defines which IP address 'IPv4/IPv6' is send to the DDNS provider" @@ -132,7 +157,8 @@ msgstr "详情:" msgid "Directory contains Log files for each running section" msgstr "保存每一个运行中的设置的运行日志的目录" -msgid "Directory contains PID and other status information for each running section" +msgid "" +"Directory contains PID and other status information for each running section" msgstr "保存每个运行中的设置的PID以及其它状态信息的目录" msgid "Disabled" @@ -141,7 +167,9 @@ msgstr "已禁用" msgid "Dynamic DNS" msgstr "动态DNS" -msgid "Dynamic DNS allows that your router can be reached with a fixed hostname while having a dynamically changing IP address." +msgid "" +"Dynamic DNS allows that your router can be reached with a fixed hostname " +"while having a dynamically changing IP address." msgstr "动态DNS允许为拥有动态IP的主机配置一个固定的可访问域名." msgid "Enable secure communication with DDNS provider" @@ -171,8 +199,12 @@ msgstr "文件未找到" msgid "File not found or empty" msgstr "文件未找到或为空" -msgid "Follow this link<br />You will find more hints to optimize your system to run DDNS scripts with all options" -msgstr "打开这个链接<br />你将会得到更多关于如何通过所有设置项优化你的系统以运行DDNS脚本的提示." +msgid "" +"Follow this link<br />You will find more hints to optimize your system to " +"run DDNS scripts with all options" +msgstr "" +"打开这个链接<br />你将会得到更多关于如何通过所有设置项优化你的系统以运行DDNS" +"脚本的提示." msgid "For detailed information about parameter settings look here." msgstr "请看这里获得关于参数设置的详细信息" @@ -201,7 +233,9 @@ msgstr "格式" msgid "Format: IP or FQDN" msgstr "格式:IP或者FQDN" -msgid "GNU Wget will use the IP of given network, cURL will use the physical interface." +msgid "" +"GNU Wget will use the IP of given network, cURL will use the physical " +"interface." msgstr "GNU Wget将会使用给定的网络的IP地址,而cURL将会使用物理接口" msgid "Global Settings" @@ -228,8 +262,13 @@ msgstr "IPv4地址" msgid "IPv6 address must be given in square brackets" msgstr "IPv6地址必须填写在中括号(\"[ ]\")内" -msgid "IPv6 is currently not (fully) supported by this system<br />Please follow the instructions on OpenWrt's homepage to enable IPv6 support<br />or update your system to the latest OpenWrt Release" -msgstr "当前系统暂时不能(完整地)支持IPv6<br />请查看OpenWrt首页的介绍以启用IPv6支持<br />或者更新你的系统到最新OpenWrt版本" +msgid "" +"IPv6 is currently not (fully) supported by this system<br />Please follow " +"the instructions on OpenWrt's homepage to enable IPv6 support<br />or update " +"your system to the latest OpenWrt Release" +msgstr "" +"当前系统暂时不能(完整地)支持IPv6<br />请查看OpenWrt首页的介绍以启用IPv6支持" +"<br />或者更新你的系统到最新OpenWrt版本" msgid "IPv6 not supported" msgstr "IPv6不被支持" @@ -240,13 +279,21 @@ msgstr "IPv6地址" msgid "If both cURL and GNU Wget are installed, Wget is used by default." msgstr "如果cURL和GNU Wget同时被安装,那么Wget将会被优先使用." -msgid "If this service section is disabled it could not be started.<br />Neither from LuCI interface nor from console" -msgstr "如果服务配置被禁用那么它将不能被启动.<br />无论是通过LuCI页面或者是通过终端." +msgid "" +"If this service section is disabled it could not be started.<br />Neither " +"from LuCI interface nor from console" +msgstr "" +"如果服务配置被禁用那么它将不能被启动.<br />无论是通过LuCI页面或者是通过终端." -msgid "If you want to send updates for IPv4 and IPv6 you need to define two separate Configurations i.e. 'myddns_ipv4' and 'myddns_ipv6'" -msgstr "如果你需要同时更新IPv4和IPv6地址,你需要单独添加两个配置项(例如'myddns_ipv4'和'myddns_ipv6')" +msgid "" +"If you want to send updates for IPv4 and IPv6 you need to define two " +"separate Configurations i.e. 'myddns_ipv4' and 'myddns_ipv6'" +msgstr "" +"如果你需要同时更新IPv4和IPv6地址,你需要单独添加两个配置项(例" +"如'myddns_ipv4'和'myddns_ipv6')" -msgid "In some versions cURL/libcurl in OpenWrt is compiled without proxy support." +msgid "" +"In some versions cURL/libcurl in OpenWrt is compiled without proxy support." msgstr "OpenWrt中,cURL/libcurl的某些版本编译时没有启用代理服务器支持" msgid "Info" @@ -255,11 +302,18 @@ msgstr "信息" msgid "Interface" msgstr "接口" -msgid "Interval to check for changed IP<br />Values below 5 minutes == 300 seconds are not supported" +msgid "" +"Interval to check for changed IP<br />Values below 5 minutes == 300 seconds " +"are not supported" msgstr "检查IP是否改变的时间隔<br />不支持低于5分钟(300秒)的数值." -msgid "Interval to force updates send to DDNS Provider<br />Setting this parameter to 0 will force the script to only run once<br />Values lower 'Check Interval' except '0' are not supported" -msgstr "强制向提供商更新DDNS的时间周期<br />把这个参数设置为0将会让脚本仅执行一次<br />不支持低于\"检查时间周期\"的数值(除了0)." +msgid "" +"Interval to force updates send to DDNS Provider<br />Setting this parameter " +"to 0 will force the script to only run once<br />Values lower 'Check " +"Interval' except '0' are not supported" +msgstr "" +"强制向提供商更新DDNS的时间周期<br />把这个参数设置为0将会让脚本仅执行一次" +"<br />不支持低于\"检查时间周期\"的数值(除了0)." msgid "It is NOT recommended for casual users to change settings on this page." msgstr "强烈不建议初次使用的用户修改本页设定." @@ -285,10 +339,14 @@ msgstr "把日志记录到文件" msgid "Log to syslog" msgstr "把日志记录到系统日志" -msgid "Neither GNU Wget with SSL nor cURL installed to select a network to use for communication." +msgid "" +"Neither GNU Wget with SSL nor cURL installed to select a network to use for " +"communication." msgstr "包含SSL支持的GNU Wget或者cURL均未被安装.无法选择一个网络用于通信." -msgid "Neither GNU Wget with SSL nor cURL installed to support updates via HTTPS protocol." +msgid "" +"Neither GNU Wget with SSL nor cURL installed to support updates via HTTPS " +"protocol." msgstr "包含SSL支持的GNU Wget或者cURL均未被安装.无法使用HTTPS更新DDNS" msgid "Network" @@ -405,9 +463,14 @@ msgstr "状态目录" msgid "Stopped" msgstr "已停止" -msgid "The currently installed 'ddns-scripts' package did not support all available settings." +msgid "" +"The currently installed 'ddns-scripts' package did not support all available " +"settings." msgstr "当前已安装的'ddns-scripts'软件包暂不支持所有可用设置项" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "没有已经配置好的服务项" @@ -429,8 +492,11 @@ msgstr "用于检测的URL" msgid "Unknown error" msgstr "未知错误" -msgid "Update URL to be used for updating your DDNS Provider.<br />Follow instructions you will find on their WEB page." -msgstr "DDNS提供商用于更新DDNS的URL<br />跟随教程你将会在它们的网站上提供这个URL." +msgid "" +"Update URL to be used for updating your DDNS Provider.<br />Follow " +"instructions you will find on their WEB page." +msgstr "" +"DDNS提供商用于更新DDNS的URL<br />跟随教程你将会在它们的网站上提供这个URL." msgid "Update error" msgstr "更新错误" @@ -462,10 +528,13 @@ msgstr "正在应用更改..." msgid "Warning" msgstr "等待" -msgid "Writes detailed messages to log file. File will be truncated automatically." +msgid "" +"Writes detailed messages to log file. File will be truncated automatically." msgstr "向日志中写入详细信息.文件将会被自动减小." -msgid "Writes log messages to syslog. Critical Errors will always be written to syslog." +msgid "" +"Writes log messages to syslog. Critical Errors will always be written to " +"syslog." msgstr "把日志写入系统日志.无论是否启用这项,错误信息总是会被写入系统日志" msgid "You should install BIND host package for DNS requests." diff --git a/applications/luci-app-ddns/po/zh-tw/ddns.po b/applications/luci-app-ddns/po/zh-tw/ddns.po index ec930f432a..ec1fe779eb 100644 --- a/applications/luci-app-ddns/po/zh-tw/ddns.po +++ b/applications/luci-app-ddns/po/zh-tw/ddns.po @@ -455,6 +455,9 @@ msgid "" "settings." msgstr "" +msgid "The default setting of '0' will retry infinite." +msgstr "" + msgid "There is no service configured." msgstr "" |