Changeset 2092


Ignore:
Timestamp:
Jun 7, 2012, 8:43:36 PM (7 years ago)
Author:
matthijs
Message:

luci-ddns: Switch to using ddns-scripts.

Previously, luci generated config for ez-ipupdate, which is no longer
used. This also adds an extra option to switch between sending the
Fonera wan IP and letting the DDNS provider detect the IP itself and
clarifies the interface a bit by using more verbose labels.

Closes: #681, #832

Location:
trunk/luci/applications/luci-ddns
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/applications/luci-ddns/luasrc/i18n/ddns.en.lua

    r653 r2092  
    11ddns = "DDNS"
    22ddns_desc = "Here you can configure your Dynamic DNS. You need to have an account from one of the providers. DDNS does not work if you are behind NAT."
    3 ddns_dns = "DNS"
    4 ddns_dynds = "dyndns.org"
    5 ddns_none = "--NONE--"
     3ddns_domain = "Domain name to update"
     4ddns_ip = "IP address to send"
     5ddns_ip_fonera = "Use Fonera internet IP"
     6ddns_ip_none = "Let Dynamic DNS provider detect IP"
    67ddns_srv = "Service"
    78ddns_title = "Dynamic DNS"
  • trunk/luci/applications/luci-ddns/luasrc/model/cbi/ddns.lua

    r133 r2092  
    11-- Copyright 2008 John Crispin <john@phrozen.org>
     2
     3services_file = "/usr/lib/ddns/services"
    24
    35require("luci.tools.webadmin")
    46local m = Map("ddns",
    57        translate("ddns_title", "Dynamic DNS"),
    6         translate("ddns_desc", "Here you can configure your Dynamic DNS. You need to have an account from one of the providers. DDNS does not work if you are behind NAT."))
     8        translate("ddns_desc", "Here you can configure your Dynamic DNS. You need to have an account from one of the providers. DDNS might not work if you are behind NAT."))
    79
    810m.events = {"RestartDDNS"}
    911
    10 s = m:section(NamedSection, "ddns", "ddns")
     12s = m:section(NamedSection, "ddns_scripts", "service")
    1113s.anonymous = true
    1214
    13 mode = s:option(ListValue, "srv", translate("ddns_srv", "Service"))
    14 mode.override_values = true
    15 mode:value("none", translate("ddns_none", "--NONE--"))
    16 mode:value("dyndns", translate("ddns_dynds", "dyndns.org"))
     15enabled = s:option(ListValue, "enabled", translate("status", "Enable"))
     16enabled.override_values = true
     17enabled:value("0", translate("disable", "Disabled"))
     18enabled:value("1", translate("enable", "Enabled"))
    1719
    18 usr = s:option(Value, "user", translate("username", "Username"))
    19 usr:depends("srv", "dyndns")
     20service = s:option(ListValue, "service_name", translate("ddns_srv", "Service"))
     21service.override_values = true
     22service:depends("enabled", "1")
    2023
    21 pass = s:option(Value, "pass", translate("password", "Password"))
     24for line in io.lines(services_file) do
     25        first, last, name = line:find('^[\t ]*"([^"]*)"')
     26        if first then
     27                service:value(name, name)
     28        end -- Skip other lines, like comments
     29end
     30
     31domain = s:option(Value, "domain", translate("ddns_domain", "Domain name to update"))
     32domain:depends("enabled", "1")
     33
     34ip_source = s:option(ListValue, "ip_source", translate("ddns_ip", "IP address to send"))
     35ip_source.override_values = true
     36ip_source:value("network", translate("ddns_ip_fonera", "Use Fonera internet IP"))
     37ip_source:value("none", translate("ddns_ip_none", "Let Dynamic DNS provider detect IP"))
     38ip_source:depends("enabled", "1")
     39
     40
     41usr = s:option(Value, "username", translate("username", "Username"))
     42usr:depends("enabled", "1")
     43
     44pass = s:option(Value, "password", translate("password", "Password"))
    2245pass.password = true
    23 pass:depends("srv", "dyndns")
    24 
    25 dns = s:option(Value, "dns", translate("ddns_dns", "DNS"))
    26 dns:depends("srv", "dyndns")
     46pass:depends("enabled", "1")
    2747
    2848return m
  • trunk/luci/applications/luci-ddns/root/lib/uci/schema/default/ddns

    r133 r2092  
    55
    66config section
    7         option name 'ddns'
     7        option name 'service'
    88        option package 'ddns'
    99        option unique true
    1010        option required true
    11         list depends 'srv=none'
    12         list depends 'srv=dyndns, user, pass, srv, dns'
    1311
    1412config variable
    15         option name 'user'
    16         option section 'ddns.ddns'
    17         option datatype string
     13        option name 'enabled'
     14        option section 'ddns.service'
     15        option datatype boolean
    1816
    1917config variable
    20         option name 'pass'
    21         option section 'ddns.ddns'
    22         option datatype string 
     18        option name 'username'
     19        option section 'ddns.service'
     20        option datatype string
    2321
    2422config variable
    25         option name 'dns'
    26         option section 'ddns.ddns'
    27         option datatype string 
     23        option name 'password'
     24        option section 'ddns.service'
     25        option datatype string
    2826
    2927config variable
    30         option name 'srv'
    31         option section 'ddns.ddns'
     28        option name 'domain'
     29        option section 'ddns.service'
     30        option datatype string
     31
     32config variable
     33        option name 'service_name'
     34        option section 'ddns.service'
    3235        option type enum
    3336
    34 config enum
    35         option variable 'ddns.ddns.srv'
    36         option value    'none'
    37         option title    '--NONE--'
    38 
    39 config enum
    40         option variable 'ddns.ddns.srv'
    41         option value    'dyndns'
    42         option title    'dyndns.org'
     37config variable
     38        option name 'ip_source'
     39        option section 'ddns.service'
     40        option type enum
Note: See TracChangeset for help on using the changeset viewer.