summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-ddns
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-17 21:59:04 +0000
committerSteven Barth <steven@midlink.org>2008-07-17 21:59:04 +0000
commit5c419acf926b7332976c6a5c1586d2badf9664ae (patch)
treeaf589dc9db8c6ad9a21787b8deb2fd075b8edac2 /applications/luci-ddns
parentd9bcb87608c8b2f828454c6318b37aaf0271544c (diff)
Added new applications luci-ddns to luci-full and luci-mini
Diffstat (limited to 'applications/luci-ddns')
-rw-r--r--applications/luci-ddns/Makefile2
-rw-r--r--applications/luci-ddns/luasrc/controller/ddns.lua32
-rw-r--r--applications/luci-ddns/luasrc/i18n/ddns.de.lua8
-rw-r--r--applications/luci-ddns/luasrc/i18n/ddns.en.lua8
-rw-r--r--applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua76
-rw-r--r--applications/luci-ddns/luasrc/model/cbi/ddns/ddnsmini.lua50
6 files changed, 176 insertions, 0 deletions
diff --git a/applications/luci-ddns/Makefile b/applications/luci-ddns/Makefile
new file mode 100644
index 000000000..81a96f6a8
--- /dev/null
+++ b/applications/luci-ddns/Makefile
@@ -0,0 +1,2 @@
+include ../../build/config.mk
+include ../../build/module.mk \ No newline at end of file
diff --git a/applications/luci-ddns/luasrc/controller/ddns.lua b/applications/luci-ddns/luasrc/controller/ddns.lua
new file mode 100644
index 000000000..f98913655
--- /dev/null
+++ b/applications/luci-ddns/luasrc/controller/ddns.lua
@@ -0,0 +1,32 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+module("luci.controller.ddns", package.seeall)
+
+function index()
+ require("luci.i18n")
+ luci.i18n.loadc("ddns")
+ if not luci.fs.isfile("/etc/config/ddns") then
+ return
+ end
+
+ local page = entry({"admin", "services", "ddns"}, cbi("ddns/ddns"), luci.i18n.translate("ddns"), 60)
+ page.i18n = "ddns"
+ page.dependent = true
+
+
+ local page = entry({"mini", "network", "ddns"}, cbi("ddns/ddnsmini"), luci.i18n.translate("ddns"), 60)
+ page.i18n = "ddns"
+ page.dependent = true
+end \ No newline at end of file
diff --git a/applications/luci-ddns/luasrc/i18n/ddns.de.lua b/applications/luci-ddns/luasrc/i18n/ddns.de.lua
new file mode 100644
index 000000000..7827e0acf
--- /dev/null
+++ b/applications/luci-ddns/luasrc/i18n/ddns.de.lua
@@ -0,0 +1,8 @@
+ddns = "Dynamisches DNS"
+ddns_desc = "Dynamisches DNS erlaubt es, den Router bei dynamischer IP-Adresse über einen festen DNS-Namen zu erreichen."
+ddns_service_ipsource = "Quelle der IP-Adresse"
+ddns_service_checkinterval = "Teste auf neue IP alle"
+ddns_service_checkunit = "Test-Zeiteinheit"
+ddns_service_forceinterval = "Erzwinge Aktualisierung alle"
+ddns_service_forceunit = "Erzwinge-Zeiteinheit"
+ddns_service_updateurl = "Eigene Update-URL" \ No newline at end of file
diff --git a/applications/luci-ddns/luasrc/i18n/ddns.en.lua b/applications/luci-ddns/luasrc/i18n/ddns.en.lua
new file mode 100644
index 000000000..32f85b24a
--- /dev/null
+++ b/applications/luci-ddns/luasrc/i18n/ddns.en.lua
@@ -0,0 +1,8 @@
+ddns = "Dynamic DNS"
+ddns_desc = "Dynamic DNS allows that your router can be reached with a fixed hostname while having a dynamically changing IP-Address."
+ddns_service_ipsource = "Source of IP-Address"
+ddns_service_checkinterval = "Check for changed IP every"
+ddns_service_checkunit = "Check-Time unit"
+ddns_service_forceinterval = "Force update every"
+ddns_service_forceunit = "Force-Time unit"
+ddns_service_updateurl = "Custom Update-URL" \ No newline at end of file
diff --git a/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua b/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua
new file mode 100644
index 000000000..1c88579b3
--- /dev/null
+++ b/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua
@@ -0,0 +1,76 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+m = Map("ddns", translate("ddns"), translate("ddns_desc"))
+
+s = m:section(TypedSection, "service", "")
+s.addremove = true
+
+s:option(Flag, "enabled", translate("enable"))
+
+svc = s:option(ListValue, "service_name", translate("service"))
+svc.rmempty = true
+svc:value("")
+svc:value("dyndns.org")
+svc:value("changeip.com")
+svc:value("zoneedit.com")
+svc:value("no-ip.com")
+svc:value("freedns.afraid.org")
+
+s:option(Value, "domain", translate("hostname")).rmempty = true
+s:option(Value, "username", translate("username")).rmempty = true
+s:option(Value, "password", translate("password")).rmempty = true
+
+src = s:option(ListValue, "ip_source")
+src:value("network", translate("network"))
+src:value("interface", translate("interface"))
+src:value("web", "URL")
+
+iface = s:option(ListValue, "ip_network", translate("network"))
+iface:depends("ip_source", "network")
+iface.rmempty = true
+luci.model.uci.foreach("network", "interface",
+ function (section)
+ if section[".name"] ~= "loopback" then
+ iface:value(section[".name"])
+ end
+ end)
+
+iface = s:option(ListValue, "ip_interface", translate("interface"))
+iface:depends("ip_source", "interface")
+iface.rmempty = true
+for k, v in pairs(luci.sys.net.devices()) do
+ iface:value(v)
+end
+
+web = s:option(Value, "ip_url", "URL")
+web:depends("ip_source", "web")
+web.rmempty = true
+
+s:option(Value, "update_url").optional = true
+
+s:option(Value, "check_interval").default = 10
+unit = s:option(ListValue, "check_unit")
+unit.default = "minutes"
+unit:value("minutes", "min")
+unit:value("hours", "h")
+
+s:option(Value, "force_interval").default = 72
+unit = s:option(ListValue, "force_unit")
+unit.default = "hours"
+unit:value("minutes", "min")
+unit:value("hours", "h")
+
+
+return m \ No newline at end of file
diff --git a/applications/luci-ddns/luasrc/model/cbi/ddns/ddnsmini.lua b/applications/luci-ddns/luasrc/model/cbi/ddns/ddnsmini.lua
new file mode 100644
index 000000000..51bebb6e6
--- /dev/null
+++ b/applications/luci-ddns/luasrc/model/cbi/ddns/ddnsmini.lua
@@ -0,0 +1,50 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+m = Map("ddns", translate("ddns"), translate("ddns_desc"))
+
+s = m:section(TypedSection, "service", "")
+s.addremove = true
+
+s:option(Flag, "enabled", translate("enable"))
+
+svc = s:option(ListValue, "service_name", translate("service"))
+svc.rmempty = true
+svc:value("dyndns.org")
+svc:value("changeip.com")
+svc:value("zoneedit.com")
+svc:value("no-ip.com")
+svc:value("freedns.afraid.org")
+
+s:option(Value, "domain", translate("hostname")).rmempty = true
+s:option(Value, "username", translate("username")).rmempty = true
+s:option(Value, "password", translate("password")).rmempty = true
+
+s.defaults.ip_source = "network"
+s.defaults.ip_network = "wan"
+
+s:option(Value, "check_interval").default = 10
+unit = s:option(ListValue, "check_unit")
+unit.default = "minutes"
+unit:value("minutes", "min")
+unit:value("hours", "h")
+
+s:option(Value, "force_interval").default = 72
+unit = s:option(ListValue, "force_unit")
+unit.default = "hours"
+unit:value("minutes", "min")
+unit:value("hours", "h")
+
+
+return m \ No newline at end of file