From: Daniel Dickinson Date: Mon, 16 Jan 2017 06:49:21 +0000 (-0500) Subject: Merge pull request #861 from ynezz/master X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=2cb780c8cc9dce4a3867f6ecb8611be0954d71ef;hp=b064c5c209e99d97c825ecfab42bc8b2e3bced54 Merge pull request #861 from ynezz/master luci-mod-admin-full: Store system time into RTC also --- diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua index 2cee30208..d80cb486e 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua @@ -1,4 +1,4 @@ --- Copyright 2016 Openwrt.org +-- Copyright 2016 Hannu Nyman -- Licensed to the public under the Apache License 2.0. m = Map("adblock", translate("Adblock"), @@ -17,20 +17,6 @@ o3 = s:option(Value, "adb_whitelist", translate("Whitelist file"), o3.rmempty = false o3.datatype = "file" -fdns = s:option(Flag, "adb_forcedns", translate("Redirect all DNS queries to the local resolver"), - translate("When adblock is active, all DNS queries are redirected to the local resolver " .. - "in this server by default. You can disable that to allow queries to external DNS servers.")) -fdns.rmempty = false -fdns.default = fdns.enabled - --- Statistics - -t = m:section(NamedSection, "global", "adblock", translate("Statistics")) - -dat = t:option(DummyValue, "adb_lastrun", translate("Last update of the blocklists")) -tot = t:option(DummyValue, "adb_overall_count", translate("Total count of blocked domains")) -prc = t:option(DummyValue, "adb_percentage", translate("Percentage of blocked packets (before last update, IPv4/IPv6)")) - -- Blocklist options bl = m:section(TypedSection, "source", translate("Blocklist sources"), @@ -45,8 +31,6 @@ name = bl:option(Flag, "enabled", translate("Enabled")) name.rmempty = false des = bl:option(DummyValue, "adb_src_desc", translate("Description")) -cou = bl:option(DummyValue, "adb_src_count", translate("Count")) -upd = bl:option(DummyValue, "adb_src_timestamp", translate("List date/state")) -- Additional options @@ -65,39 +49,15 @@ o5.datatype = "directory" e = m:section(NamedSection, "global", "adblock", translate("Extra options"), translate("Options for further tweaking in case the defaults are not suitable for you.")) -a0 = e:option(Flag, "adb_restricted", translate("Do not write status info to flash"), - translate("Skip writing update status information to the config file. Status fields on this page will not be updated.")) -a0.default = 0 - -a1 = e:option(Value, "adb_nullport", translate("Port of the adblock uhttpd instance")) -a1.optional = true -a1.default = 65534 -a1.datatype = "port" - -a5 = e:option(Value, "adb_nullportssl", translate("Port of the adblock uhttpd instance for https links")) -a5.optional = true -a5.default = 65535 -a5.datatype = "port" - -a2 = e:option(Value, "adb_nullipv4", translate("IPv4 blackhole ip address")) -a2.optional = true -a2.default = "198.18.0.1" -a2.datatype = "ip4addr" - -a3 = e:option(Value, "adb_nullipv6", translate("IPv6 blackhole ip address")) -a3.optional = true -a3.default = "::ffff:c612:0001" -a3.datatype = "ip6addr" - -a4 = e:option(Value, "adb_fetchttl", translate("Timeout for blocklist fetch (seconds)")) -a4.optional = true -a4.default = 5 -a4.datatype = "range(2,60)" - -a7 = e:option(Value, "adb_lanif", translate("Name of the logical lan interface")) -a7.optional = true -a7.default = "lan" -a7.datatype = "network" +a = e:option(Flag, "adb_debug", translate("Enable verbose debug logging")) +a.default = a.disabled +a.rmempty = false + +a = e:option(Value, "adb_iface", translate("Restrict reload trigger to certain interface(s)"), + translate("Space separated list of wan interfaces that trigger reload action. " .. + "To disable reload trigger set it to 'false'. Default: empty")) +a.datatype = "network" +a.rmempty = true return m diff --git a/applications/luci-app-adblock/po/ja/adblock.po b/applications/luci-app-adblock/po/ja/adblock.po new file mode 100644 index 000000000..a3c982f3d --- /dev/null +++ b/applications/luci-app-adblock/po/ja/adblock.po @@ -0,0 +1,139 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: INAGAKI Hiroshi \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Language: ja\n" + +msgid "" +"). Note that list URLs and Shallalist category selections are not " +"configurable via Luci." +msgstr "" +")。これらのリストのURLおよびshallaリストのカテゴリー選択は、Luciによって設定" +"できないことに注意します。" + +msgid "Adblock" +msgstr "Adblock" + +msgid "Available blocklist sources (" +msgstr "利用可能なブロックリスト提供元です(" + +msgid "Backup directory" +msgstr "バックアップ ディレクトリ" + +msgid "Backup options" +msgstr "バックアップ オプション" + +msgid "Blocklist sources" +msgstr "ブロックリスト提供元" + +msgid "" +"Configuration of the adblock package to block ad/abuse domains by using DNS." +msgstr "" +"広告/不正ドメインをDNSを利用してブロックする、adblock パッケージの設定です。" + +msgid "Description" +msgstr "説明" + +msgid "Enable adblock" +msgstr "adblockの有効化" + +msgid "Enable blocklist backup" +msgstr "ブロックリスト バックアップの有効化" + +msgid "Enable verbose debug logging" +msgstr "詳細なデバッグ ログの有効化" + +msgid "Enabled" +msgstr "有効" + +msgid "Extra options" +msgstr "拡張設定" + +msgid "" +"File with whitelisted hosts/domains that are allowed despite being on a " +"blocklist." +msgstr "" +"ファイルのホワイトリスト ホスト/ドメインは、ブロックリストに登録されていても" +"許可されます。" + +msgid "Global options" +msgstr "一般設定" + +msgid "" +"Options for further tweaking in case the defaults are not suitable for you." +msgstr "デフォルト設定が適切でない場合、追加で設定するためのオプションです。" + +msgid "Restrict reload trigger to certain interface(s)" +msgstr "リロードトリガを特定のインターフェースに限定する" + +msgid "" +"Space separated list of wan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" +msgstr "" +"リロード実行のトリガとなる、スペースで区切られたWANインターフェースのリストで" +"す。リロードトリガを無効にするには、 false を設定します。デフォルト:(空)" + +msgid "Whitelist file" +msgstr "ホワイトリスト ファイル" + +msgid "see list details" +msgstr "リストの詳細を見る" + +#~ msgid "Count" +#~ msgstr "カウント" + +#~ msgid "Do not write status info to flash" +#~ msgstr "ステータス情報をフラッシュに書き込まない" + +#~ msgid "Last update of the blocklists" +#~ msgstr "ブロックリストの最終更新日時" + +#~ msgid "List date/state" +#~ msgstr "リスト日時/状態" + +#~ msgid "Name of the logical lan interface" +#~ msgstr "論理LANインターフェース名" + +#~ msgid "Percentage of blocked packets (before last update, IPv4/IPv6)" +#~ msgstr "ブロック済みパケットの割合(最終更新以前、IPv4/IPv6)" + +#~ msgid "Port of the adblock uhttpd instance" +#~ msgstr "adblock uhttpdインスタンスのポート" + +#~ msgid "Port of the adblock uhttpd instance for https links" +#~ msgstr "httpsリンク用adblock uhttpdインスタンスのポート" + +#~ msgid "Redirect all DNS queries to the local resolver" +#~ msgstr "全てのDNSクエリをローカルリゾルバにリダイレクト" + +#~ msgid "" +#~ "Skip writing update status information to the config file. Status fields " +#~ "on this page will not be updated." +#~ msgstr "" +#~ "更新ステータス情報をコンフィグファイルに書き込まず、スキップします。この" +#~ "ページのステータス画面は更新されなくなります。" + +#~ msgid "Statistics" +#~ msgstr "ステータス" + +#~ msgid "Timeout for blocklist fetch (seconds)" +#~ msgstr "ブロックリスト取得の制限時間(秒)" + +#~ msgid "Total count of blocked domains" +#~ msgstr "ブロック済みドメインの合計" + +#~ msgid "" +#~ "When adblock is active, all DNS queries are redirected to the local " +#~ "resolver in this server by default. You can disable that to allow queries " +#~ "to external DNS servers." +#~ msgstr "" +#~ "adblockがアクティブである時、全てのDNSクエリは既定でこのサーバー上のリゾル" +#~ "バにリダイレクトされます。外部DNSサーバーへのクエリを許可する場合、この設" +#~ "定を無効にすることもできます。" diff --git a/applications/luci-app-adblock/po/sv/adblock.po b/applications/luci-app-adblock/po/sv/adblock.po index 9c0ca21f1..22a30e9a1 100644 --- a/applications/luci-app-adblock/po/sv/adblock.po +++ b/applications/luci-app-adblock/po/sv/adblock.po @@ -27,21 +27,18 @@ msgstr "" "Konfiguration av paket adblock för att blockera annons/otillåtna domäner " "genom att användning DNS." -msgid "Count" -msgstr "Räkna" - msgid "Description" msgstr "Beskrivning" -msgid "Do not write status info to flash" -msgstr "Skriv inte status info till flash" - msgid "Enable adblock" msgstr "Aktivera abblock" msgid "Enable blocklist backup" msgstr "Aktivera säkerhetskopiering av blockeringslistan" +msgid "Enable verbose debug logging" +msgstr "" + msgid "Enabled" msgstr "Aktiverad" @@ -56,55 +53,16 @@ msgstr "" msgid "Global options" msgstr "Globala alternativ" -msgid "IPv4 blackhole ip address" -msgstr "" - -msgid "IPv6 blackhole ip address" -msgstr "" - -msgid "Last update of the blocklists" -msgstr "" - -msgid "List date/state" -msgstr "" - -msgid "Name of the logical lan interface" -msgstr "" - msgid "" "Options for further tweaking in case the defaults are not suitable for you." msgstr "" -msgid "Percentage of blocked packets (before last update, IPv4/IPv6)" -msgstr "" - -msgid "Port of the adblock uhttpd instance" +msgid "Restrict reload trigger to certain interface(s)" msgstr "" -msgid "Port of the adblock uhttpd instance for https links" -msgstr "" - -msgid "Redirect all DNS queries to the local resolver" -msgstr "Dirigera om alla DNS-förfrågning till den lokala resolvern" - msgid "" -"Skip writing update status information to the config file. Status fields on " -"this page will not be updated." -msgstr "" - -msgid "Statistics" -msgstr "" - -msgid "Timeout for blocklist fetch (seconds)" -msgstr "" - -msgid "Total count of blocked domains" -msgstr "" - -msgid "" -"When adblock is active, all DNS queries are redirected to the local resolver " -"in this server by default. You can disable that to allow queries to external " -"DNS servers." +"Space separated list of wan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" msgstr "" msgid "Whitelist file" @@ -112,3 +70,12 @@ msgstr "Vitlista fil" msgid "see list details" msgstr "se listans detaljer" + +#~ msgid "Count" +#~ msgstr "Räkna" + +#~ msgid "Do not write status info to flash" +#~ msgstr "Skriv inte status info till flash" + +#~ msgid "Redirect all DNS queries to the local resolver" +#~ msgstr "Dirigera om alla DNS-förfrågning till den lokala resolvern" diff --git a/applications/luci-app-adblock/po/templates/adblock.pot b/applications/luci-app-adblock/po/templates/adblock.pot index eeb0d975b..6b2dbd13b 100644 --- a/applications/luci-app-adblock/po/templates/adblock.pot +++ b/applications/luci-app-adblock/po/templates/adblock.pot @@ -25,21 +25,18 @@ msgid "" "Configuration of the adblock package to block ad/abuse domains by using DNS." msgstr "" -msgid "Count" -msgstr "" - msgid "Description" msgstr "" -msgid "Do not write status info to flash" -msgstr "" - msgid "Enable adblock" msgstr "" msgid "Enable blocklist backup" msgstr "" +msgid "Enable verbose debug logging" +msgstr "" + msgid "Enabled" msgstr "" @@ -54,55 +51,16 @@ msgstr "" msgid "Global options" msgstr "" -msgid "IPv4 blackhole ip address" -msgstr "" - -msgid "IPv6 blackhole ip address" -msgstr "" - -msgid "Last update of the blocklists" -msgstr "" - -msgid "List date/state" -msgstr "" - -msgid "Name of the logical lan interface" -msgstr "" - msgid "" "Options for further tweaking in case the defaults are not suitable for you." msgstr "" -msgid "Percentage of blocked packets (before last update, IPv4/IPv6)" -msgstr "" - -msgid "Port of the adblock uhttpd instance" -msgstr "" - -msgid "Port of the adblock uhttpd instance for https links" -msgstr "" - -msgid "Redirect all DNS queries to the local resolver" -msgstr "" - -msgid "" -"Skip writing update status information to the config file. Status fields on " -"this page will not be updated." -msgstr "" - -msgid "Statistics" -msgstr "" - -msgid "Timeout for blocklist fetch (seconds)" -msgstr "" - -msgid "Total count of blocked domains" +msgid "Restrict reload trigger to certain interface(s)" msgstr "" msgid "" -"When adblock is active, all DNS queries are redirected to the local resolver " -"in this server by default. You can disable that to allow queries to external " -"DNS servers." +"Space separated list of wan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" msgstr "" msgid "Whitelist file" diff --git a/applications/luci-app-adblock/po/zh-cn/adblock.po b/applications/luci-app-adblock/po/zh-cn/adblock.po index e57921daa..2878d8afa 100644 --- a/applications/luci-app-adblock/po/zh-cn/adblock.po +++ b/applications/luci-app-adblock/po/zh-cn/adblock.po @@ -36,21 +36,18 @@ msgid "" "Configuration of the adblock package to block ad/abuse domains by using DNS." msgstr "Adblock 配置工具,通过 DNS 来拦截广告和阻止域名。" -msgid "Count" -msgstr "数量" - msgid "Description" msgstr "描述" -msgid "Do not write status info to flash" -msgstr "" - msgid "Enable adblock" msgstr "启用Adblock" msgid "Enable blocklist backup" msgstr "启用拦截规则备份" +msgid "Enable verbose debug logging" +msgstr "" + msgid "Enabled" msgstr "启用" @@ -65,61 +62,55 @@ msgstr "允许的主机/域名列表" msgid "Global options" msgstr "全局选项" -msgid "IPv4 blackhole ip address" -msgstr "IPv4禁止列表" - -msgid "IPv6 blackhole ip address" -msgstr "IPv6禁止列表" - -msgid "Last update of the blocklists" -msgstr "" - -msgid "List date/state" -msgstr "列表日期/状态" - -msgid "Name of the logical lan interface" -msgstr "LAN接口名称" - msgid "" "Options for further tweaking in case the defaults are not suitable for you." msgstr "在默认设置并不适合你时的额外选项。" -msgid "Percentage of blocked packets (before last update, IPv4/IPv6)" +msgid "Restrict reload trigger to certain interface(s)" msgstr "" -msgid "Port of the adblock uhttpd instance" -msgstr "Adblock uhttpd端口" - -msgid "Port of the adblock uhttpd instance for https links" +msgid "" +"Space separated list of wan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" msgstr "" -msgid "Redirect all DNS queries to the local resolver" -msgstr "将所有DNS查询都重定向到本地解析器" +msgid "Whitelist file" +msgstr "白名单文件" + +msgid "see list details" +msgstr "查看列表详情" -msgid "" -"Skip writing update status information to the config file. Status fields on " -"this page will not be updated." -msgstr "" +#~ msgid "Count" +#~ msgstr "数量" -msgid "Statistics" -msgstr "" +#~ msgid "IPv4 blackhole ip address" +#~ msgstr "IPv4禁止列表" -msgid "Timeout for blocklist fetch (seconds)" -msgstr "列表查询超时时间(秒)" +#~ msgid "IPv6 blackhole ip address" +#~ msgstr "IPv6禁止列表" -msgid "Total count of blocked domains" -msgstr "阻止域名总数" +#~ msgid "List date/state" +#~ msgstr "列表日期/状态" -msgid "" -"When adblock is active, all DNS queries are redirected to the local resolver " -"in this server by default. You can disable that to allow queries to external " -"DNS servers." -msgstr "" -"当Adblock处于活动状态时,默认情况下会将所有的DNS查询重定向到此服务器的本地解" -"析器。您可以禁用以允许查询外部DNS服务器。" +#~ msgid "Name of the logical lan interface" +#~ msgstr "LAN接口名称" -msgid "Whitelist file" -msgstr "白名单文件" +#~ msgid "Port of the adblock uhttpd instance" +#~ msgstr "Adblock uhttpd端口" -msgid "see list details" -msgstr "查看列表详情" +#~ msgid "Redirect all DNS queries to the local resolver" +#~ msgstr "将所有DNS查询都重定向到本地解析器" + +#~ msgid "Timeout for blocklist fetch (seconds)" +#~ msgstr "列表查询超时时间(秒)" + +#~ msgid "Total count of blocked domains" +#~ msgstr "阻止域名总数" + +#~ msgid "" +#~ "When adblock is active, all DNS queries are redirected to the local " +#~ "resolver in this server by default. You can disable that to allow queries " +#~ "to external DNS servers." +#~ msgstr "" +#~ "当Adblock处于活动状态时,默认情况下会将所有的DNS查询重定向到此服务器的本地" +#~ "解析器。您可以禁用以允许查询外部DNS服务器。" diff --git a/applications/luci-app-commands/po/ja/commands.po b/applications/luci-app-commands/po/ja/commands.po index 3b01a35cf..99b5a452e 100644 --- a/applications/luci-app-commands/po/ja/commands.po +++ b/applications/luci-app-commands/po/ja/commands.po @@ -1,26 +1,27 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2013-10-05 17:15+0200\n" -"Last-Translator: Kentaro \n" +"Project-Id-Version: \n" +"PO-Revision-Date: 2016-12-21 11:59+0900\n" +"Last-Translator: INAGAKI Hiroshi \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"POT-Creation-Date: \n" msgid "A short textual description of the configured command" msgstr "設定したコマンドの簡単な説明文を記載します" msgid "Access command with" -msgstr "" +msgstr "コマンドへのアクセス" msgid "" "Allow executing the command and downloading its output without prior " "authentication" -msgstr "" +msgstr "事前認証無しでのコマンドの実行と、結果出力のダウンロードを許可します。" msgid "Allow the user to provide additional command line arguments" msgstr "コマンドラインに対する引数の追記を許可するか設定します" @@ -88,7 +89,9 @@ msgstr "実行" msgid "" "This page allows you to configure custom shell commands which can be easily " "invoked from the web interface." -msgstr "このページでは、ウェブインターフェースから簡単にシェル・コマンドを実行することができます。" +msgstr "" +"このページでは、ウェブインターフェースから簡単にシェル・コマンドを実行するこ" +"とができます。" msgid "Waiting for command to complete..." msgstr "コマンド実行中です..." diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index 55ce1cb3e..88c905a41 100644 --- a/applications/luci-app-ddns/Makefile +++ b/applications/luci-app-ddns/Makefile @@ -1,16 +1,18 @@ # -# Copyright (C) 2008-2016 The LuCI Team -# -# This is free software, licensed under the Apache License, Version 2.0 . +# Copyright 2008 Steven Barth +# Copyright 2008 Jo-Philipp Wich +# Copyright 2013 Manuel Munz +# Copyright 2014-2016 Christian Schoenebeck # +# This is free software, licensed under the Apache License, Version 2.0 include $(TOPDIR)/rules.mk -PKG_NAME:=luci-app-ddns +# PKG_NAME:=luci-app-ddns # Version == major.minor.patch # increase on new functionality (minor) or patches (patch) -PKG_VERSION:=2.4.7 +PKG_VERSION:=2.4.8 # Release == build # increase on changes of translation files @@ -22,15 +24,13 @@ PKG_MAINTAINER:=Christian Schoenebeck # LuCI specific settings LUCI_TITLE:=LuCI Support for Dynamic DNS Client (ddns-scripts) LUCI_DEPENDS:=+luci-mod-admin-full +ddns-scripts -LUCI_PKGARCH:=all +# LUCI_PKGARCH:=all define Package/$(PKG_NAME)/config # shown in make menuconfig help $(LUCI_TITLE) - . Version: $(PKG_VERSION)-$(PKG_RELEASE) - $(PKG_MAINTAINER) endef include ../../luci.mk diff --git a/applications/luci-app-ddns/luasrc/controller/ddns.lua b/applications/luci-app-ddns/luasrc/controller/ddns.lua index 9f5411b06..63bb8bf4b 100755 --- a/applications/luci-app-ddns/luasrc/controller/ddns.lua +++ b/applications/luci-app-ddns/luasrc/controller/ddns.lua @@ -17,12 +17,14 @@ local UCI = require "luci.model.uci" local UTIL = require "luci.util" local DDNS = require "luci.tools.ddns" -- ddns multiused functions +luci_helper = "/usr/lib/ddns/dynamic_dns_lucihelper.sh" + local srv_name = "ddns-scripts" -local srv_ver_min = "2.7.5" -- minimum version of service required -local srv_ver_cmd = [[/usr/lib/ddns/dynamic_dns_updater.sh --version | awk {'print $2'}]] +local srv_ver_min = "2.7.6" -- minimum version of service required +local srv_ver_cmd = luci_helper .. [[ -V | awk {'print $2'}]] local app_name = "luci-app-ddns" local app_title = "Dynamic DNS" -local app_version = "2.4.7-1" +local app_version = "2.4.8-1" function index() local nxfs = require "nixio.fs" -- global definitions not available @@ -96,14 +98,14 @@ function app_title_main() end function service_version() local ver = nil + + ver = UTIL.exec(srv_ver_cmd) + if #ver > 0 then return ver end + IPKG.list_installed(srv_name, function(n, v, d) if v and (#v > 0) then ver = v end end ) - if not ver or (#ver == 0) then - ver = UTIL.exec(srv_ver_cmd) - if #ver == 0 then ver = nil end - end return ver end function service_ok() @@ -191,10 +193,14 @@ local function _get_status() local force_ipversion = tonumber(s["force_ipversion"] or 0) local force_dnstcp = tonumber(s["force_dnstcp"] or 0) local is_glue = tonumber(s["is_glue"] or 0) - local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh]] - command = command .. [[ get_registered_ip ]] .. lookup_host .. [[ ]] .. use_ipv6 .. - [[ ]] .. force_ipversion .. [[ ]] .. force_dnstcp .. - [[ ]] .. is_glue .. [[ ]] .. dnsserver + local command = luci_helper .. [[ -]] + if (use_ipv6 == 1) then command = command .. [[6]] end + if (force_ipversion == 1) then command = command .. [[f]] end + if (force_dnstcp == 1) then command = command .. [[t]] end + if (is_glue == 1) then command = command .. [[g]] end + command = command .. [[l ]] .. lookup_host + if (#dnsserver > 0) then command = command .. [[ -d ]] .. dnsserver end + command = command .. [[ -- get_registered_ip]] local reg_ip = SYS.exec(command) if reg_ip == "" then reg_ip = "_nodata_" @@ -221,8 +227,8 @@ end function logread(section) -- read application settings local uci = UCI.cursor() - local log_dir = uci:get("ddns", "global", "log_dir") or "/var/log/ddns" - local lfile = log_dir .. "/" .. section .. ".log" + local ldir = uci:get("ddns", "global", "ddns_logdir") or "/var/log/ddns" + local lfile = ldir .. "/" .. section .. ".log" local ldata = NXFS.readfile(lfile) if not ldata or #ldata == 0 then @@ -289,8 +295,9 @@ function startstop(section, enabled) uci:commit("ddns") uci:unload("ddns") - -- start dynamic_dns_updater.sh script - os.execute ([[/usr/lib/ddns/dynamic_dns_updater.sh %s 0 > /dev/null 2>&1 &]] % section) + -- start ddns-updater for section + local command = luci_helper .. [[ -S ]] .. section .. [[ -- start]] + os.execute(command) NX.nanosleep(3) -- 3 seconds "show time" -- status changed so return full status 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 131cbfdea..a8f4cbf7a 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua @@ -58,7 +58,7 @@ end -- read services/services_ipv6 files -- ######################################## local services4 = { } -- IPv4 -- -local fd4 = io.open("/usr/lib/ddns/services", "r") +local fd4 = io.open("/etc/ddns/services", "r") if fd4 then local ln, s, t repeat @@ -72,7 +72,7 @@ if fd4 then end local services6 = { } -- IPv6 -- -local fd6 = io.open("/usr/lib/ddns/services_ipv6", "r") +local fd6 = io.open("/etc/ddns/services_ipv6", "r") if fd6 then local ln, s, t repeat @@ -91,35 +91,38 @@ end -- local IP can be read local function _verify_ip_source() -- section is globally defined here be calling agrument (see above) - local _network = "-" - local _url = "-" - local _interface = "-" - local _script = "-" - local _proxy = "" + local _arg local _ipv6 = usev6:formvalue(section) local _source = (_ipv6 == "1") and src6:formvalue(section) or src4:formvalue(section) + + local command = CTRL.luci_helper .. [[ -]] + if (_ipv6 == "1") then command = command .. [[6]] end + if _source == "network" then - _network = (_ipv6 == "1") + _arg = (_ipv6 == "1") and ipn6:formvalue(section) or ipn4:formvalue(section) + command = command .. [[n ]] .. _arg elseif _source == "web" then - _url = (_ipv6 == "1") + _arg = (_ipv6 == "1") and iurl6:formvalue(section) or iurl4:formvalue(section) + command = command .. [[u ]] .. _arg + -- proxy only needed for checking url - _proxy = (pxy) and pxy:formvalue(section) or "" + _arg = (pxy) and pxy:formvalue(section) or "" + if (_arg and #_arg > 0) then + command = command .. [[ -p ]] .. _arg + end elseif _source == "interface" then - _interface = ipi:formvalue(section) + command = command .. [[i ]] .. ipi:formvalue(section) elseif _source == "script" then - _script = ips:formvalue(section) + command = command .. [[s ]] .. ips:formvalue(section) end - - local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh get_local_ip ]] .. - _ipv6 .. [[ ]] .. _source .. [[ ]] .. _network .. [[ ]] .. - _url .. [[ ]] .. _interface .. [[ ']] .. _script.. [[' ]] .. _proxy + command = command .. [[ -- get_local_ip]] return (SYS.call(command) == 0) end @@ -248,10 +251,8 @@ if m:formvalue("cbid.ddns.%s._switch" % section) then -- section == arg[1] end -- read application settings -- ################################################ --- date format; if not set use ISO format -local date_format = m.uci:get(m.config, "global", "date_format") or "%F %R" -- log directory -local log_dir = m.uci:get(m.config, "global", "log_dir") or "/var/log/ddns" +local logdir = m.uci:get(m.config, "global", "ddns_logdir") or "/var/log/ddns" -- cbi-section definition -- ################################################### local ns = m:section( NamedSection, section, "service", @@ -1158,8 +1159,11 @@ if DDNS.has_dnsserver or ( ( m:get(section, "dns_server") or "" ) ~= "" ) then else local ipv6 = usev6:formvalue(section) or "0" local force = fipv:formvalue(section) or "0" - local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh verify_dns ]] .. - value .. [[ ]] .. ipv6 .. [[ ]] .. force + local command = CTRL.luci_helper .. [[ -]] + if (ipv6 == 1) then command = command .. [[6]] end + if (force == 1) then command = command .. [[f]] end + command = command .. [[d ]] .. value .. [[ -- verify_dns]] + local ret = SYS.call(command) if ret == 0 then return value -- everything OK elseif ret == 2 then return nil, err_tab_adv(self) .. translate("nslookup can not resolve host") @@ -1225,8 +1229,10 @@ if DDNS.has_proxy or ( ( m:get(section, "proxy") or "" ) ~= "" ) then elseif DDNS.has_proxy then local ipv6 = usev6:formvalue(section) or "0" local force = fipv:formvalue(section) or "0" - local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh verify_proxy ]] .. - value .. [[ ]] .. ipv6 .. [[ ]] .. force + local command = CRTL.luci_helper .. [[ -]] + if (ipv6 == 1) then command = command .. [[6]] end + if (force == 1) then command = command .. [[f]] end + command = command .. [[p ]] .. value .. [[ -- verify_proxy]] local ret = SYS.call(command) if ret == 0 then return value elseif ret == 2 then return nil, err_tab_adv(self) .. translate("nslookup can not resolve host") @@ -1262,7 +1268,7 @@ end logf = ns:taboption("advanced", Flag, "use_logfile", translate("Log to file"), translate("Writes detailed messages to log file. File will be truncated automatically.") .. "
" .. - translate("File") .. [[: "]] .. log_dir .. [[/]] .. section .. [[.log"]] ) + translate("File") .. [[: "]] .. logdir .. [[/]] .. section .. [[.log"]] ) logf.orientation = "horizontal" logf.default = "1" -- if not defined write to log by default @@ -1464,7 +1470,7 @@ lv.template = "ddns/detail_logview" lv.inputtitle = translate("Read / Reread log file") lv.rows = 50 function lv.cfgvalue(self, section) - local lfile=log_dir .. "/" .. section .. ".log" + local lfile=logdir .. "/" .. section .. ".log" if NXFS.access(lfile) then return lfile .. "\n" .. translate("Please press [Read] button") end 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 23ce4f13f..9dc085750 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/global.lua @@ -16,7 +16,8 @@ m.redirect = DISP.build_url("admin", "services", "ddns") function m.commit_handler(self) if self.changed then -- changes ? - os.execute("/etc/init.d/ddns reload &") -- reload configuration + local command = CTRL.luci_helper .. " -- reload" + os.execute(command) -- reload configuration end end @@ -40,8 +41,8 @@ function ns.cfgvalue(self, section) return self.map:get(section) end --- allow_local_ip -- ########################################################## -local ali = ns:option(Flag, "allow_local_ip") +-- upd_privateip -- ########################################################### +local ali = ns:option(Flag, "upd_privateip") ali.title = translate("Allow non-public IP's") ali.description = translate("Non-public and by default blocked IP's") .. ":" .. [[
IPv4: ]] @@ -50,8 +51,8 @@ ali.description = translate("Non-public and by default blocked IP's") .. ":" .. "::/32, f000::/4" ali.default = "0" --- date_format -- ############################################################# -local df = ns:option(Value, "date_format") +-- ddns_dateformat -- ######################################################### +local df = ns:option(Value, "ddns_dateformat") df.title = translate("Date format") df.description = [[]] .. translate("For supported codes look here") @@ -69,8 +70,8 @@ function df.parse(self, section, novld) DDNS.value_parse(self, section, novld) end --- run_dir -- ################################################################# -local rd = ns:option(Value, "run_dir") +-- ddns_rundir -- ############################################################# +local rd = ns:option(Value, "ddns_rundir") rd.title = translate("Status directory") rd.description = translate("Directory contains PID and other status information for each running section") rd.default = "/var/run/ddns" @@ -79,8 +80,8 @@ function rd.parse(self, section, novld) DDNS.value_parse(self, section, novld) end --- log_dir -- ################################################################# -local ld = ns:option(Value, "log_dir") +-- ddns_logdir -- ############################################################# +local ld = ns:option(Value, "ddns_logdir") ld.title = translate("Log directory") ld.description = translate("Directory contains Log files for each running section") ld.default = "/var/log/ddns" @@ -89,8 +90,8 @@ function ld.parse(self, section, novld) DDNS.value_parse(self, section, novld) end --- log_lines -- ############################################################### -local ll = ns:option(Value, "log_lines") +-- ddns_loglines -- ########################################################### +local ll = ns:option(Value, "ddns_loglines") ll.title = translate("Log length") ll.description = translate("Number of last lines stored in log files") ll.default = "250" 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 21827b765..df39a3a7e 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/hints.lua @@ -24,7 +24,7 @@ s = m:section( SimpleSection, translate("Hints"), 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 +-- ddns-scripts needs to be updated for full functionality if not CTRL.service_ok() then local so = s:option(DummyValue, "_update_needed") so.titleref = DISP.build_url("admin", "system", "packages") 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 9a989bae4..6ba3ea0dd 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/overview.lua @@ -33,10 +33,13 @@ m.description = CTRL.app_description() m.on_after_commit = function(self) if self.changed then -- changes ? + local command = CTRL.luci_helper if SYS.init.enabled("ddns") then -- ddns service enabled, restart all - os.execute("/etc/init.d/ddns restart") + command = command .. " -- restart" + os.execute(command) else -- ddns service disabled, send SIGHUP to running - os.execute("killall -1 dynamic_dns_updater.sh") + command = command .. " -- reload" + os.execute(command) end end end @@ -52,7 +55,7 @@ if show_hints or need_update or not_enabled then s = m:section( SimpleSection, translate("Hints") ) - -- ddns_scripts needs to be updated for full functionality + -- ddns-scripts needs to be updated for full functionality if need_update then local dv = s:option(DummyValue, "_update_needed") dv.titleref = DISP.build_url("admin", "system", "packages") @@ -119,18 +122,21 @@ function dom.set_one(self, section) end end function dom.set_two(self, section) - local lookup = self.map:get(section, "lookup_host") or "" - if lookup == "" then return "" end + local lookup_host = self.map:get(section, "lookup_host") or "" + if lookup_host == "" 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) local force_dnstcp = tonumber(self.map:get(section, "force_dnstcp") or 0) - local command = [[/usr/lib/ddns/dynamic_dns_lucihelper.sh]] - if not NXFS.access(command, "rwx", "rx", "rx") then - NXFS.chmod(command, 755) - end - command = command .. [[ get_registered_ip ]] .. lookup .. [[ ]] .. use_ipv6 .. - [[ ]] .. force_ipversion .. [[ ]] .. force_dnstcp .. [[ ]] .. dnsserver + local is_glue = tonumber(self.map:get(section, "is_glue") or 0) + local command = CTRL.luci_helper .. [[ -]] + if (use_ipv6 == 1) then command = command .. [[6]] end + if (force_ipversion == 1) then command = command .. [[f]] end + if (force_dnstcp == 1) then command = command .. [[t]] end + if (is_glue == 1) then command = command .. [[g]] end + command = command .. [[l ]] .. lookup_host + if (#dnsserver > 0) then command = command .. [[ -d ]] .. dnsserver end + command = command .. [[ -- get_registered_ip]] local ip = SYS.exec(command) if ip == "" then ip = translate("no data") end return ip diff --git a/applications/luci-app-ddns/luasrc/tools/ddns.lua b/applications/luci-app-ddns/luasrc/tools/ddns.lua index e55c67362..209d9c3a4 100755 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -57,7 +57,7 @@ end function epoch2date(epoch, format) if not format or #format < 2 then local uci = UCI.cursor() - format = uci:get("ddns", "global", "date_format") or "%F %R" + format = uci:get("ddns", "global", "ddns_dateformat") or "%F %R" uci:unload("ddns") end format = format:gsub("%%n", "
") -- replace newline @@ -67,18 +67,18 @@ end -- read lastupdate from [section].update file function get_lastupd(section) - local uci = UCI.cursor() - local run_dir = uci:get("ddns", "global", "run_dir") or "/var/run/ddns" - local etime = tonumber(NXFS.readfile("%s/%s.update" % { run_dir, section } ) or 0 ) + local uci = UCI.cursor() + local rdir = uci:get("ddns", "global", "ddns_rundir") or "/var/run/ddns" + local etime = tonumber(NXFS.readfile("%s/%s.update" % { rdir, section } ) or 0 ) uci:unload("ddns") return etime end -- read PID from run file and verify if still running function get_pid(section) - local uci = UCI.cursor() - local run_dir = uci:get("ddns", "global", "run_dir") or "/var/run/ddns" - local pid = tonumber(NXFS.readfile("%s/%s.pid" % { run_dir, section } ) or 0 ) + local uci = UCI.cursor() + local rdir = uci:get("ddns", "global", "ddns_rundir") or "/var/run/ddns" + local pid = tonumber(NXFS.readfile("%s/%s.pid" % { rdir, section } ) or 0 ) if pid > 0 and not NX.kill(pid, 0) then pid = 0 end diff --git a/applications/luci-app-ddns/luasrc/view/ddns/detail_lvalue.htm b/applications/luci-app-ddns/luasrc/view/ddns/detail_lvalue.htm index 0bcfd4428..b69d780ea 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/detail_lvalue.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/detail_lvalue.htm @@ -14,6 +14,7 @@ c = c + 1 %> /> + > ><%=self.vallist[i]%> <% if c == self.size then c = 0 %><% if self.orientation == "horizontal" then %> <% else %>
<% end %> <% end end %> diff --git a/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm b/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm index 159cb6014..23ec05917 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/global_value.htm @@ -4,7 +4,7 @@