* luci/app/ddns: obfuscate password fields
[project/luci.git] / applications / luci-ddns / luasrc / model / cbi / ddns / ddns.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15 require("luci.tools.webadmin")
16 m = Map("ddns", translate("ddns"), translate("ddns_desc"))
17
18 s = m:section(TypedSection, "service", "")
19 s.addremove = true
20
21 s:option(Flag, "enabled", translate("enable"))
22
23 svc = s:option(ListValue, "service_name", translate("service"))
24 svc.rmempty = true
25 svc:value("")
26 svc:value("dyndns.org")
27 svc:value("changeip.com")
28 svc:value("zoneedit.com")
29 svc:value("no-ip.com")
30 svc:value("freedns.afraid.org")
31
32 s:option(Value, "domain", translate("hostname")).rmempty = true
33 s:option(Value, "username", translate("username")).rmempty = true
34 pw = s:option(Value, "password", translate("password"))
35 pw.rmempty = true
36 pw.password = true
37
38 src = s:option(ListValue, "ip_source")
39 src:value("network", translate("network"))
40 src:value("interface", translate("interface"))
41 src:value("web", "URL")
42
43 iface = s:option(ListValue, "ip_network", translate("network"))
44 iface:depends("ip_source", "network")
45 iface.rmempty = true
46 luci.tools.webadmin.cbi_add_networks(iface)
47
48 iface = s:option(ListValue, "ip_interface", translate("interface"))
49 iface:depends("ip_source", "interface")
50 iface.rmempty = true
51 for k, v in pairs(luci.sys.net.devices()) do
52         iface:value(v)
53 end
54
55 web = s:option(Value, "ip_url", "URL")
56 web:depends("ip_source", "web")
57 web.rmempty = true
58
59 s:option(Value, "update_url").optional = true
60
61 s:option(Value, "check_interval").default = 10
62 unit = s:option(ListValue, "check_unit")
63 unit.default = "minutes"
64 unit:value("minutes", "min")
65 unit:value("hours", "h")
66
67 s:option(Value, "force_interval").default = 72
68 unit = s:option(ListValue, "force_unit")
69 unit.default = "hours"
70 unit:value("minutes", "min")
71 unit:value("hours", "h")
72
73
74 return m