From: Daniel Dickinson Date: Sat, 10 Dec 2016 11:34:22 +0000 (-0500) Subject: Merge pull request #656 from nlhintz/pull-request X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=a3fc4859dd0d3e9e9fa87ca249b815a4710ed7bd;hp=9fafe8e84946a95aa657a6d3ac333c9257380918 Merge pull request #656 from nlhintz/pull-request luci: broadcom - add n-mode support --- diff --git a/README.md b/README.md index abccff6b7..48863a459 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ To install all its package definitions, run: You can browse the generated API documentation [directly on Github](http://htmlpreview.github.io/?http://raw.githubusercontent.com/openwrt/luci/master/documentation/api/index.html). +## Development + +Documentation for developing and extending LuCI can be found [in the Wiki](https://github.com/openwrt/luci/wiki) + ## License See [LICENSE](LICENSE) file. diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua index a197f5593..2cee30208 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua @@ -12,16 +12,25 @@ o1 = s:option(Flag, "adb_enabled", translate("Enable adblock")) o1.rmempty = false o1.default = 0 -o2 = s:option(Value, "adb_blacklist", translate("Blacklist file"), - translate("File with explicitly blacklisted hosts/domains.")) -o2.rmempty = false -o2.datatype = "file" - o3 = s:option(Value, "adb_whitelist", translate("Whitelist file"), translate("File with whitelisted hosts/domains that are allowed despite being on a blocklist.")) 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"), @@ -35,8 +44,9 @@ bl.template = "cbi/tblsection" name = bl:option(Flag, "enabled", translate("Enabled")) name.rmempty = false -des = bl:option(DummyValue, "adb_srcdesc", translate("Description")) -des.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 @@ -46,52 +56,46 @@ o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup")) o4.rmempty = false o4.default = 0 -o5 = s2:option(Value, "adb_backupdir", translate("Backup directory")) +o5 = s2:option(Value, "adb_dir", translate("Backup directory")) o5.rmempty = false o5.datatype = "directory" -s3 = m:section(NamedSection, "log", "service", translate("Log options")) - -o6 = s3:option(Flag, "enabled", translate("Enable log")) -o6.rmempty = false -o6.default = 0 - -o7 = s3:option(Value, "adb_logfile", translate("Log file")) -o7.rmempty = false -o7.datatype = "string" - -- Extra options e = m:section(NamedSection, "global", "adblock", translate("Extra options"), translate("Options for further tweaking in case the defaults are not suitable for you.")) -a1 = e:option(Value, "adb_port", translate("Port of the adblock uhttpd instance")) +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.rmempty = true -a1.default = 65535 +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.rmempty = true -a2.default = "192.0.2.1" +a2.default = "198.18.0.1" a2.datatype = "ip4addr" a3 = e:option(Value, "adb_nullipv6", translate("IPv6 blackhole ip address")) a3.optional = true -a3.rmempty = true -a3.default = "::ffff:c000:0201" +a3.default = "::ffff:c612:0001" a3.datatype = "ip6addr" -a6 = e:option(Value, "adb_wanif", translate("Name of the logical wan interface")) -a6.optional = true -a6.rmempty = true -a6.default = "wan" -a6.datatype = "network" +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.rmempty = true a7.default = "lan" a7.datatype = "network" diff --git a/applications/luci-app-adblock/po/sv/adblock.po b/applications/luci-app-adblock/po/sv/adblock.po new file mode 100644 index 000000000..9c0ca21f1 --- /dev/null +++ b/applications/luci-app-adblock/po/sv/adblock.po @@ -0,0 +1,114 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "" +"). Note that list URLs and Shallalist category selections are not " +"configurable via Luci." +msgstr "" + +msgid "Adblock" +msgstr "Blockering av annonser" + +msgid "Available blocklist sources (" +msgstr "Tillgängliga källor för blockeringslistor (" + +msgid "Backup directory" +msgstr "Säkerhetskopiera mapp" + +msgid "Backup options" +msgstr "Alternativ för säkerhetskopiering" + +msgid "Blocklist sources" +msgstr "Källor för blockeringslistor" + +msgid "" +"Configuration of the adblock package to block ad/abuse domains by using DNS." +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 "Enabled" +msgstr "Aktiverad" + +msgid "Extra options" +msgstr "Extra alternativ" + +msgid "" +"File with whitelisted hosts/domains that are allowed despite being on a " +"blocklist." +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" +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." +msgstr "" + +msgid "Whitelist file" +msgstr "Vitlista fil" + +msgid "see list details" +msgstr "se listans detaljer" diff --git a/applications/luci-app-adblock/po/templates/adblock.pot b/applications/luci-app-adblock/po/templates/adblock.pot new file mode 100644 index 000000000..eeb0d975b --- /dev/null +++ b/applications/luci-app-adblock/po/templates/adblock.pot @@ -0,0 +1,112 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "" +"). Note that list URLs and Shallalist category selections are not " +"configurable via Luci." +msgstr "" + +msgid "Adblock" +msgstr "" + +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 "" + +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 "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 "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" +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 "" + +msgid "Whitelist file" +msgstr "" + +msgid "see list details" +msgstr "" diff --git a/applications/luci-app-adblock/po/zh-cn/adblock.po b/applications/luci-app-adblock/po/zh-cn/adblock.po new file mode 100644 index 000000000..e57921daa --- /dev/null +++ b/applications/luci-app-adblock/po/zh-cn/adblock.po @@ -0,0 +1,125 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: kuoruan@gmail.com\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.5\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "" +"). Note that list URLs and Shallalist category selections are not " +"configurable via Luci." +msgstr ")。需要注意的是列表URL和列表类别选项无法通过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 "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 "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 "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)" +msgstr "" + +msgid "Port of the adblock uhttpd instance" +msgstr "Adblock uhttpd端口" + +msgid "Port of the adblock uhttpd instance for https links" +msgstr "" + +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服务器。" + +msgid "Whitelist file" +msgstr "白名单文件" + +msgid "see list details" +msgstr "查看列表详情" diff --git a/applications/luci-app-aria2/Makefile b/applications/luci-app-aria2/Makefile new file mode 100644 index 000000000..f5b006c35 --- /dev/null +++ b/applications/luci-app-aria2/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2016 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-aria2 + +# Version == major.minor.patch +# increase "minor" on new functionality and "patch" on patches/optimization +PKG_VERSION:=1.0.1 + +# Release == build +# increase on changes of translation files +PKG_RELEASE:=2 + +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=Hsing-Wang Liao + +# LuCI specific settings +LUCI_TITLE:=LuCI Support for Aria2 +LUCI_DEPENDS:=+aria2 +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 + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/applications/luci-app-aria2/luasrc/controller/aria2.lua b/applications/luci-app-aria2/luasrc/controller/aria2.lua new file mode 100644 index 000000000..17289305d --- /dev/null +++ b/applications/luci-app-aria2/luasrc/controller/aria2.lua @@ -0,0 +1,42 @@ +--[[ +LuCI - Lua Configuration Interface - aria2 support + +Copyright 2014-2015 nanpuyue +Modified by kuoruan + +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 +]]-- + +module("luci.controller.aria2", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/aria2") then + return + end + + local page = entry({"admin", "services", "aria2"}, cbi("aria2"), _("Aria2 Settings")) + page.dependent = true + + entry({"admin", "services", "aria2", "status"}, call("status")).leaf = true + +end + +function status() + local sys = require "luci.sys" + local ipkg = require "luci.model.ipkg" + local http = require "luci.http" + local uci = require "luci.model.uci".cursor() + + local status = { + running = (sys.call("pidof aria2c > /dev/null") == 0), + yaaw = ipkg.installed("yaaw"), + webui = ipkg.installed("webui-aria2") + } + + http.prepare_content("application/json") + http.write_json(status) +end diff --git a/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua b/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua new file mode 100644 index 000000000..3b61f9546 --- /dev/null +++ b/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua @@ -0,0 +1,211 @@ +--[[ +LuCI - Lua Configuration Interface - Aria2 support + +Copyright 2014-2016 nanpuyue +Modified by maz-1 +Modified by kuoruan + +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 +]]-- + +local sys = require "luci.sys" +local util = require "luci.util" +local uci = require "luci.model.uci".cursor() + +local cfgbtn = "" +local sessionbtn = "" +local aria2rpctxt = "" +local use_websocket = "" + +function ipkg_ver(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: ", ""):gsub("-%d", "") + break + end + until not ln + control:close() + end + return version +end + +function ipkg_ver_lined(pkg) + return ipkg_ver(pkg):gsub("%.", "-") +end + +m = Map("aria2", translate("Aria2"), translate("Aria2 is a multi-protocol & multi-source download utility, here you can configure the settings.")) + +m:section(SimpleSection).template = "aria2/overview_status" + +s = m:section(TypedSection, "aria2", translate("Aria2 Settings")) +s.addremove = false +s.anonymous = true + +s:tab("general", translate("General Settings")) +s:tab("file", translate("Files and Locations")) +s:tab("task", translate("Task Settings")) +s:tab("bittorrent", translate("BitTorrent Settings")) + +o = s:taboption("general", Flag, "enabled", translate("Enabled")) +o.rmempty = false + +user = s:taboption("general", ListValue, "user", translate("Run daemon as user")) +local p_user +for _, p_user in util.vspairs(util.split(sys.exec("cat /etc/passwd | cut -f 1 -d :"))) do + user:value(p_user) +end + +o = s:taboption("general", Value, "rpc_listen_port", translate("RPC port")) +o.datatype = "port" +o.placeholder = "6800" + +rpc_auth_method = s:taboption("general", ListValue, "rpc_auth_method", translate("RPC authentication method")) +rpc_auth_method:value("none", translate("No Authentication")) +rpc_auth_method:value("user_pass", translate("Username & Password")) +rpc_auth_method:value("token", translate("Token")) + +o = s:taboption("general", Value, "rpc_user", translate("RPC username")) +o:depends("rpc_auth_method", "user_pass") +o.rmempty = false + +o = s:taboption("general", Value, "rpc_passwd", translate("RPC password")) +o:depends("rpc_auth_method", "user_pass") +o.password = true +o.rmempty = true + +o = s:taboption("general", Value, "rpc_secret", translate("RPC Token"), "
" .. cfgbtn) +o:depends("rpc_auth_method", "token") +o.rmempty = true + +o = s:taboption("file", Value, "config_dir", translate("Config file directory")) +o.placeholder = "/var/etc/aria2" + +o = s:taboption("file", Flag, "enable_log", translate("Enable log"), translate("Log file is in the config file dir.")) +o.enabled = "true" +o.disabled = "false" + +o = s:taboption("file", ListValue, "log_level", translate("Log level")) +o:depends("enable_log", "true") +o:value("debug", translate("Debug")) +o:value("info", translate("Info")) +o:value("notice", translate("Notice")) +o:value("warn", translate("Warn")) +o:value("error", translate("Error")) + +o = s:taboption("file", Value, "dir", translate("Default download directory")) +o.rmempty = false + +o = s:taboption("file", Value, "disk_cache", translate("Disk cache"), translate("in bytes, You can append K or M.")) +o.rmempty = true + +o = s:taboption("file", ListValue, "file_allocation", translate("Preallocation"), translate("\"Falloc\" is not available in all cases.")) +o:value("none", translate("Off")) +o:value("prealloc", translate("Prealloc")) +o:value("trunc", translate("Trunc")) +o:value("falloc", translate("Falloc")) + +overall_speed_limit = s:taboption("task", Flag, "overall_speed_limit", translate("Overall speed limit enabled")) +overall_speed_limit.rmempty = true + +o = s:taboption("task", Value, "max_overall_download_limit", translate("Overall download limit"), translate("in bytes/sec, You can append K or M.")) +o:depends("overall_speed_limit", "1") + +o = s:taboption("task", Value, "max_overall_upload_limit", translate("Overall upload limit"), translate("in bytes/sec, You can append K or M.")) +o:depends("overall_speed_limit", "1") + +task_speed_limit = s:taboption("task", Flag, "task_speed_limit", translate("Per task speed limit enabled")) +task_speed_limit.rmempty = true + +o = s:taboption("task", Value, "max_download_limit", translate("Per task download limit"), translate("in bytes/sec, You can append K or M.")) +o:depends("task_speed_limit", "1") + +o = s:taboption("task", Value, "max_upload_limit", translate("Per task upload limit"), translate("in bytes/sec, You can append K or M.")) +o:depends("task_speed_limit", "1") + +o = s:taboption("task", Value, "max_concurrent_downloads", translate("Max concurrent downloads")) +o.placeholder = "5" + +o = s:taboption("task", Value, "max_connection_per_server", translate("Max connection per server"), "1-16") +o.datetype = "range(1, 16)" +o.placeholder = "1" + +o = s:taboption("task", Value, "min_split_size", translate("Min split size"), "1M-1024M") +o.placeholder = "20M" + +o = s:taboption("task", Value, "split", translate("Max number of split")) +o.placeholder = "5" + +o = s:taboption("task", Value, "save_session_interval", translate("Autosave session interval"), translate("Sec")) +o.default = "30" + +o = s:taboption("task", Value, "user_agent", translate("User agent value")) +o.placeholder = "aria2/" .. ipkg_ver("aria2") + +o = s:taboption("bittorrent", Flag, "enable_dht", translate("DHT enabled")) +o.enabled = "true" +o.disabled = "false" + +o = s:taboption("bittorrent", Flag, "bt_enable_lpd", translate("LPD enabled")) +o.enabled = "true" +o.disabled = "false" + +o = s:taboption("bittorrent", Flag, "follow_torrent", translate("Follow torrent")) +o.enabled = "true" +o.disabled = "false" + +o = s:taboption("bittorrent", Value, "listen_port", translate("BitTorrent listen port")) +o.placeholder = "6881-6999" + +o = s:taboption("bittorrent", Value, "bt_max_peers", translate("Max number of peers per torrent")) +o.placeholder = "55" + +bt_tracker_enable = s:taboption("bittorrent", Flag, "bt_tracker_enable", translate("Additional Bt tracker enabled")) +bt_tracker = s:taboption("bittorrent", DynamicList, "bt_tracker", translate("List of additional Bt tracker")) +bt_tracker:depends("bt_tracker_enable", "1") +bt_tracker.rmempty = true + +function bt_tracker.cfgvalue(self, section) + local rv = {} + local val = Value.cfgvalue(self, section) + if type(val) == "table" then + val = table.concat(val, ",") + elseif not val then + val = "" + end + for v in val:gmatch("[^,%s]+") do + rv[#rv+1] = v + end + return rv +end + +function bt_tracker.write(self, section, value) + local rv = {} + for v in util.imatch(value) do + rv[#rv+1] = v + end + Value.write(self, section, table.concat(rv, ",")) +end + +o = s:taboption("bittorrent", Value, "peer_id_prefix", translate("Prefix of peer ID")) +o.placeholder = "A2-" .. ipkg_ver_lined("aria2") .. "-" + +s = m:section(TypedSection, "aria2", translate("Extra Settings")) +s.addremove = false +s.anonymous = true + +o = s:option(DynamicList, "extra_settings", translate("List of extra settings")) +o.placeholder = "option=value" +o.rmempty = true + +m:section(SimpleSection, nil, sessionbtn .. use_websocket .. aria2rpctxt) + +return m diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm new file mode 100644 index 000000000..b14cca228 --- /dev/null +++ b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm @@ -0,0 +1,77 @@ + + +
+ <%:Aria2 Status%> +

+ <%:Collecting data...%> +

+
diff --git a/applications/luci-app-aria2/po/templates/aria2.pot b/applications/luci-app-aria2/po/templates/aria2.pot new file mode 100644 index 000000000..357c0ae76 --- /dev/null +++ b/applications/luci-app-aria2/po/templates/aria2.pot @@ -0,0 +1,208 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "\"Falloc\" is not available in all cases." +msgstr "" + +msgid "DHT enabled" +msgstr "" + +msgid "LPD enabled" +msgstr "" + +msgid "Additional Bt tracker enabled" +msgstr "" + +msgid "Aria2" +msgstr "" + +msgid "Aria2 Settings" +msgstr "" + +msgid "Aria2 Status" +msgstr "" + +msgid "" +"Aria2 is a multi-protocol & multi-source download utility, here you can " +"configure the settings." +msgstr "" + +msgid "Autosave session interval" +msgstr "" + +msgid "BitTorrent Settings" +msgstr "" + +msgid "BitTorrent listen port" +msgstr "" + +msgid "Collecting data..." +msgstr "" + +msgid "Config file directory" +msgstr "" + +msgid "Debug" +msgstr "" + +msgid "Default download directory" +msgstr "" + +msgid "Disk cache" +msgstr "" + +msgid "Enable log" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "Error" +msgstr "" + +msgid "Extra Settings" +msgstr "" + +msgid "Falloc" +msgstr "" + +msgid "Files and Locations" +msgstr "" + +msgid "Follow torrent" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "Generate Randomly" +msgstr "" + +msgid "Info" +msgstr "" + +msgid "List of additional Bt tracker" +msgstr "" + +msgid "List of extra settings" +msgstr "" + +msgid "Log file is in the config file dir." +msgstr "" + +msgid "Log level" +msgstr "" + +msgid "Max concurrent downloads" +msgstr "" + +msgid "Max connection per server" +msgstr "" + +msgid "Max number of peers per torrent" +msgstr "" + +msgid "Max number of split" +msgstr "" + +msgid "Min split size" +msgstr "" + +msgid "No Authentication" +msgstr "" + +msgid "Notice" +msgstr "" + +msgid "Off" +msgstr "" + +msgid "Open WebUI-Aria2" +msgstr "" + +msgid "Open YAAW" +msgstr "" + +msgid "Overall download limit" +msgstr "" + +msgid "Overall speed limit enabled" +msgstr "" + +msgid "Overall upload limit" +msgstr "" + +msgid "Per task download limit" +msgstr "" + +msgid "Per task speed limit enabled" +msgstr "" + +msgid "Per task upload limit" +msgstr "" + +msgid "Prealloc" +msgstr "" + +msgid "Preallocation" +msgstr "" + +msgid "Prefix of peer ID" +msgstr "" + +msgid "RPC Token" +msgstr "" + +msgid "RPC authentication method" +msgstr "" + +msgid "RPC password" +msgstr "" + +msgid "RPC port" +msgstr "" + +msgid "RPC username" +msgstr "" + +msgid "Run daemon as user" +msgstr "" + +msgid "Sec" +msgstr "" + +msgid "Task Settings" +msgstr "" + +msgid "The Aria2 service is not running." +msgstr "" + +msgid "The Aria2 service is running." +msgstr "" + +msgid "Token" +msgstr "" + +msgid "Trunc" +msgstr "" + +msgid "Use WebSocket" +msgstr "" + +msgid "User agent value" +msgstr "" + +msgid "Username & Password" +msgstr "" + +msgid "View Json-RPC URL" +msgstr "" + +msgid "Warn" +msgstr "" + +msgid "in bytes, You can append K or M." +msgstr "" + +msgid "in bytes/sec, You can append K or M." +msgstr "" diff --git a/applications/luci-app-aria2/po/zh-cn/aria2.po b/applications/luci-app-aria2/po/zh-cn/aria2.po new file mode 100644 index 000000000..823699d7b --- /dev/null +++ b/applications/luci-app-aria2/po/zh-cn/aria2.po @@ -0,0 +1,200 @@ +msgid "Aria2" +msgstr "" + +msgid "Aria2 is a multi-protocol & multi-source download utility, here you can configure the settings." +msgstr "Aria2 是一个支持多协议多线程的下载器, 你可以在这里对其进行配置" + +msgid "Aria2 Status" +msgstr "Aria2 状态" + +msgid "Open YAAW" +msgstr "打开YAAW" + +msgid "Open WebUI-Aria2" +msgstr "打开WebUI-Aria2" + +msgid "The Aria2 service is running." +msgstr "Aria2 正在运行" + +msgid "The Aria2 service is not running." +msgstr "Aria2 未运行" + +msgid "Aria2 Settings" +msgstr "Aria2 配置" + +msgid "General settings" +msgstr "一般设置" + +msgid "Files and Locations" +msgstr "文件和目录" + +msgid "Enabled" +msgstr "启用" + +msgid "Task Settings" +msgstr "任务设置" + +msgid "BitTorrent Settings" +msgstr "BT设置" + +msgid "Run daemon as user" +msgstr "以此用户权限运行" + +msgid "RPC port" +msgstr "RPC端口" + +msgid "RPC authentication method" +msgstr "RPC认证方式" + +msgid "No Authentication" +msgstr "无认证" + +msgid "Username & Password" +msgstr "用户名与密码" + +msgid "Token" +msgstr "令牌" + +msgid "RPC username" +msgstr "RPC用户名" + +msgid "RPC password" +msgstr "RPC密码" + +msgid "RPC Token" +msgstr "RPC令牌" + +msgid "Generate Randomly" +msgstr "随机生成" + +msgid "Enable log" +msgstr "启用日志" + +msgid "Log file is in the config file dir." +msgstr "日志文件在配置文件目录下" + +msgid "Log level" +msgstr "日志记录等级" + +msgid "Debug" +msgstr "调试" + +msgid "Info" +msgstr "信息" + +msgid "Notice" +msgstr "注意" + +msgid "Warn" +msgstr "警告" + +msgid "Error" +msgstr "错误" + +msgid "Config file directory" +msgstr "配置文件目录" + +msgid "Default download directory" +msgstr "默认下载目录" + +msgid "Disk cache" +msgstr "磁盘缓存" + +msgid "in bytes, You can append K or M." +msgstr "单位 B, 你可以在数字后跟上 K 或 M" + +msgid "Preallocation" +msgstr "磁盘预分配" + +msgid "Off" +msgstr "关闭" + +msgid "Prealloc" +msgstr "" + +msgid "Trunc" +msgstr "" + +msgid "Falloc" +msgstr "" + +msgid "\"Falloc\" is not available in all cases." +msgstr "\"Falloc\" 并不是在所有情况下都可用" + +msgid "Overall speed limit enabled" +msgstr "启用全局限速" + +msgid "Overall download limit" +msgstr "全局下载限速" + +msgid "in bytes/sec, You can append K or M." +msgstr "单位 B/s, 你可以在数字后跟上 K 或 M" + +msgid "Overall upload limit" +msgstr "全局上传限速" + +msgid "Per task speed limit enabled" +msgstr "启用单任务限速" + +msgid "Per task download limit" +msgstr "单任务下载限速" + +msgid "Per task upload limit" +msgstr "单任务上传限速" + +msgid "Max concurrent downloads" +msgstr "最大同时下载任务数" + +msgid "Max connection per server" +msgstr "单服务器最大连接数" + +msgid "Min split size" +msgstr "最小文件分片大小" + +msgid "Max number of split" +msgstr "单文件最大线程数" + +msgid "Autosave session interval" +msgstr "定时保存会话间隔" + +msgid "Sec" +msgstr "秒" + +msgid "User agent value" +msgstr "用户代理(UA)" + +msgid "DHT enabled" +msgstr "启用DHT" + +msgid "LPD enabled" +msgstr "启用LPD" + +msgid "Follow torrent" +msgstr "自动添加下载的种子" + +msgid "BitTorrent listen port" +msgstr "BT监听端口" + +msgid "Max number of peers per torrent" +msgstr "单个种子最大连接数" + +msgid "Additional Bt tracker enabled" +msgstr "添加额外的Tracker" + +msgid "List of additional Bt tracker" +msgstr "附加Tracker列表" + +msgid "Prefix of peer ID" +msgstr "Peer ID前缀" + +msgid "Extra Settings" +msgstr "附加选项" + +msgid "List of extra settings" +msgstr "附加选项列表" + +msgid "View Json-RPC URL" +msgstr "查看 Json-RPC URL" + +msgid "Use WebSocket" +msgstr "使用WebSocket" diff --git a/applications/luci-app-aria2/root/etc/uci-defaults/40_luci-aria2 b/applications/luci-app-aria2/root/etc/uci-defaults/40_luci-aria2 new file mode 100755 index 000000000..3a9ba5b29 --- /dev/null +++ b/applications/luci-app-aria2/root/etc/uci-defaults/40_luci-aria2 @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@aria2[-1] + add ucitrack aria2 + set ucitrack.@aria2[-1].init=aria2 + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-app.lua b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-app.lua index 0a0a2d512..72685b011 100644 --- a/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-app.lua +++ b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-app.lua @@ -15,7 +15,7 @@ app_authenticate:value("no", "Do Not Load") app_authenticate:value("auto", "Load as Required") app_authenticate.rmempty = true -app_cdr = module:option(ListValue, "app_cdr", "Make sure asterisk doesnt save CDR", "") +app_cdr = module:option(ListValue, "app_cdr", "Make sure asterisk doesn't save CDR", "") app_cdr:value("yes", "Load") app_cdr:value("no", "Do Not Load") app_cdr:value("auto", "Load as Required") @@ -117,7 +117,7 @@ app_externalivr:value("no", "Do Not Load") app_externalivr:value("auto", "Load as Required") app_externalivr.rmempty = true -app_forkcdr = module:option(ListValue, "app_forkcdr", "Fork The CDR into 2 seperate entities", "") +app_forkcdr = module:option(ListValue, "app_forkcdr", "Fork The CDR into 2 separate entities", "") app_forkcdr:value("yes", "Load") app_forkcdr:value("no", "Do Not Load") app_forkcdr:value("auto", "Load as Required") diff --git a/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua index 783aab2b7..7c818760d 100644 --- a/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua +++ b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua @@ -84,7 +84,7 @@ pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "") pickupexten.rmempty = true pickupexten:depends({ parkenabled = "1" }) -transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait bewteen digits when transferring", "") +transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait between digits when transferring", "") transferdigittimeout.rmempty = true transferdigittimeout:depends({ parkenabled = "1" }) diff --git a/applications/luci-app-asterisk/po/ca/asterisk.po b/applications/luci-app-asterisk/po/ca/asterisk.po index 9775758e4..aa534432e 100644 --- a/applications/luci-app-asterisk/po/ca/asterisk.po +++ b/applications/luci-app-asterisk/po/ca/asterisk.po @@ -187,7 +187,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Connector de recol·lecció" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Segons a esperar entre dígits quan es transfereix" #~ msgid "sound when attended transfer is complete" @@ -247,7 +247,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Aplicació d'autenticació" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Assegura't que asterisk no desa CDR" #~ msgid "Check if channel is available" @@ -298,7 +298,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "Interfície d'aplicació IVR externa" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "Bifurca el CDR en 2 entitats separades" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/en/asterisk.po b/applications/luci-app-asterisk/po/en/asterisk.po index e462f56b8..fc095087e 100644 --- a/applications/luci-app-asterisk/po/en/asterisk.po +++ b/applications/luci-app-asterisk/po/en/asterisk.po @@ -187,8 +187,8 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Pickup extension" -#~ msgid "Seconds to wait bewteen digits when transferring" -#~ msgstr "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" +#~ msgstr "Seconds to wait between digits when transferring" #~ msgid "sound when attended transfer is complete" #~ msgstr "sound when attended transfer is complete" @@ -247,8 +247,8 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Authentication Application" -#~ msgid "Make sure asterisk doesnt save CDR" -#~ msgstr "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" +#~ msgstr "Make sure asterisk doesn't save CDR" #~ msgid "Check if channel is available" #~ msgstr "Check if channel is available" @@ -298,8 +298,8 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "External IVR application interface" -#~ msgid "Fork The CDR into 2 seperate entities" -#~ msgstr "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" +#~ msgstr "Fork The CDR into 2 separate entities" #~ msgid "Get ADSI CPE ID" #~ msgstr "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/es/asterisk.po b/applications/luci-app-asterisk/po/es/asterisk.po index 8e2fe1e30..f42ddb4fd 100644 --- a/applications/luci-app-asterisk/po/es/asterisk.po +++ b/applications/luci-app-asterisk/po/es/asterisk.po @@ -188,7 +188,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Extensión de Pickup" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Segundos de espera entre digitos mientras se transfiere" #~ msgid "sound when attended transfer is complete" @@ -248,7 +248,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Aplicación de autenticación" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Asegúrate que asterisk no graba CDR" #~ msgid "Check if channel is available" @@ -296,7 +296,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "Interfaz de aplicación IVR externa" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "Bifurcar el CDR en 2 entidades separadas" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/fr/asterisk.po b/applications/luci-app-asterisk/po/fr/asterisk.po index 75c1d38e4..63d085a1a 100644 --- a/applications/luci-app-asterisk/po/fr/asterisk.po +++ b/applications/luci-app-asterisk/po/fr/asterisk.po @@ -158,7 +158,7 @@ msgstr "" #~ msgid "Parking time (secs)" #~ msgstr "Durée de mise en parking (secondes)" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Attente en secondes entre les chiffres Lors d'un transfert" #~ msgid "sound when attended transfer is complete" @@ -218,7 +218,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Application d'authentification" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "S'assure qu'Asterisk ne sauve pas le CDR" #~ msgid "Check if channel is available" @@ -254,7 +254,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "Interface d'application SVI externe" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "Dupliquer le CDR en deux entités séparées" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/it/asterisk.po b/applications/luci-app-asterisk/po/it/asterisk.po index 9eb24da5d..f2aa51e96 100644 --- a/applications/luci-app-asterisk/po/it/asterisk.po +++ b/applications/luci-app-asterisk/po/it/asterisk.po @@ -125,7 +125,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Estensione Pickup" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Secondi di attesa tra le cifre per il trasferimento" #~ msgid "Sound when attended transfer fails" diff --git a/applications/luci-app-asterisk/po/ms/asterisk.po b/applications/luci-app-asterisk/po/ms/asterisk.po index e1260e1ba..d4b6baac9 100644 --- a/applications/luci-app-asterisk/po/ms/asterisk.po +++ b/applications/luci-app-asterisk/po/ms/asterisk.po @@ -196,7 +196,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Angkat sambungan" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Detik untuk menunggu antara nombor ketika memindahkan" #~ msgid "sound when attended transfer is complete" @@ -256,7 +256,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Pengesahan Aplikasi" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Membuat asterisk yakin tidak menyimpan CDR" #~ msgid "Check if channel is available" @@ -307,7 +307,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "IVR aplikasi antara muka luaran" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "CDR garpu menjadi 2 entiti yang berasingan" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/pt-br/asterisk.po b/applications/luci-app-asterisk/po/pt-br/asterisk.po index 07d705280..00a0bb643 100644 --- a/applications/luci-app-asterisk/po/pt-br/asterisk.po +++ b/applications/luci-app-asterisk/po/pt-br/asterisk.po @@ -194,7 +194,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Extensão de captura" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Segundos para esperar entre os dígitos quando transferindo" #~ msgid "sound when attended transfer is complete" @@ -254,7 +254,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Aplicativo de Autenticação" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Garanta que o asterisk não salva o CDR" #~ msgid "Check if channel is available" @@ -305,7 +305,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "Interface de aplicativo IVR externo" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "Bifurcar o CDR em duas entidades separadas" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-asterisk/po/ru/asterisk.po b/applications/luci-app-asterisk/po/ru/asterisk.po index acedb82e6..d27ba33d7 100644 --- a/applications/luci-app-asterisk/po/ru/asterisk.po +++ b/applications/luci-app-asterisk/po/ru/asterisk.po @@ -197,7 +197,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Приложение аутентификации" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Убедитесь что Asterisk не сохраняет CDR" #~ msgid "Check if channel is available" diff --git a/applications/luci-app-asterisk/po/vi/asterisk.po b/applications/luci-app-asterisk/po/vi/asterisk.po index d1cc6b255..133f864ab 100644 --- a/applications/luci-app-asterisk/po/vi/asterisk.po +++ b/applications/luci-app-asterisk/po/vi/asterisk.po @@ -187,7 +187,7 @@ msgstr "" #~ msgid "Pickup extension" #~ msgstr "Pickup extension" -#~ msgid "Seconds to wait bewteen digits when transferring" +#~ msgid "Seconds to wait between digits when transferring" #~ msgstr "Thời gian chờ giữa những chữ số khi chuyển đổi" #~ msgid "sound when attended transfer is complete" @@ -247,7 +247,7 @@ msgstr "" #~ msgid "Authentication Application" #~ msgstr "Ứng dụng xác thực" -#~ msgid "Make sure asterisk doesnt save CDR" +#~ msgid "Make sure asterisk doesn't save CDR" #~ msgstr "Bảo đảm asterisk không lưu CDR" #~ msgid "Check if channel is available" @@ -298,7 +298,7 @@ msgstr "" #~ msgid "External IVR application interface" #~ msgstr "Ứng dụng giao diện bên ngoài IVR" -#~ msgid "Fork The CDR into 2 seperate entities" +#~ msgid "Fork The CDR into 2 separate entities" #~ msgstr "Fork The CDR into 2 nhân riêng biệt" #~ msgid "Get ADSI CPE ID" diff --git a/applications/luci-app-coovachilli/po/ca/coovachilli.po b/applications/luci-app-coovachilli/po/ca/coovachilli.po index 085d9917d..4970a1270 100644 --- a/applications/luci-app-coovachilli/po/ca/coovachilli.po +++ b/applications/luci-app-coovachilli/po/ca/coovachilli.po @@ -449,7 +449,7 @@ msgstr "Autenticació UAM i MAC" #~ msgstr "Fitxers d'usuaris local" #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "" #~ "Un fitxer contenint usuaris i contrasenyes separats per punts d'usuaris " @@ -604,7 +604,7 @@ msgstr "Autenticació UAM i MAC" #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "" #~ "Executable per executar com un programa de tipus CGI (com el haserl) per " #~ "URLs amb extensió .chi" diff --git a/applications/luci-app-coovachilli/po/cs/coovachilli.po b/applications/luci-app-coovachilli/po/cs/coovachilli.po index 0dc5fc0cd..bc7ef7a58 100644 --- a/applications/luci-app-coovachilli/po/cs/coovachilli.po +++ b/applications/luci-app-coovachilli/po/cs/coovachilli.po @@ -225,7 +225,7 @@ msgstr "UAM a MAC ověřování" #~ msgstr "Soubor s místními uživateli" #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "" #~ "Soubor, obsahující uživatelská jména a hesla místně ověřovaných " diff --git a/applications/luci-app-coovachilli/po/de/coovachilli.po b/applications/luci-app-coovachilli/po/de/coovachilli.po index d8322db3e..79955d7ba 100644 --- a/applications/luci-app-coovachilli/po/de/coovachilli.po +++ b/applications/luci-app-coovachilli/po/de/coovachilli.po @@ -454,7 +454,7 @@ msgstr "UAM- und MAC-Authentifizierung" #, fuzzy #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "Netzwerk/TUN Konfiguration" @@ -598,7 +598,7 @@ msgstr "UAM- und MAC-Authentifizierung" #, fuzzy #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "Netzwerk/TUN Konfiguration" #, fuzzy diff --git a/applications/luci-app-coovachilli/po/en/coovachilli.po b/applications/luci-app-coovachilli/po/en/coovachilli.po index ebaa3452b..6d7c747a5 100644 --- a/applications/luci-app-coovachilli/po/en/coovachilli.po +++ b/applications/luci-app-coovachilli/po/en/coovachilli.po @@ -436,10 +436,10 @@ msgstr "" #~ msgstr "Local users file" #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgid "Location name" @@ -588,10 +588,10 @@ msgstr "" #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgid "Web content directory" #~ msgstr "Web content directory" diff --git a/applications/luci-app-coovachilli/po/pt-br/coovachilli.po b/applications/luci-app-coovachilli/po/pt-br/coovachilli.po index 9c219812f..46ed3581b 100644 --- a/applications/luci-app-coovachilli/po/pt-br/coovachilli.po +++ b/applications/luci-app-coovachilli/po/pt-br/coovachilli.po @@ -445,7 +445,7 @@ msgstr "Autenticação UAM e MAC" #~ msgstr "Arquivo de usuários locais" #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "" #~ "Um arquivo separado por dois pontos (:) contendo o nome de usuário e " @@ -602,7 +602,7 @@ msgstr "Autenticação UAM e MAC" #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "" #~ "Executável para rodar como um programa do tipo CGI (como o haserl) para " #~ "URLs com a extensão .chi" diff --git a/applications/luci-app-coovachilli/po/pt/coovachilli.po b/applications/luci-app-coovachilli/po/pt/coovachilli.po index 115ae03ae..c2cccc31a 100644 --- a/applications/luci-app-coovachilli/po/pt/coovachilli.po +++ b/applications/luci-app-coovachilli/po/pt/coovachilli.po @@ -350,7 +350,7 @@ msgstr "Autenticação UAM e MAC" #, fuzzy #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "" #~ "Usado para informar o cliente sobre o dominio a utilizar para pedidos DNS" diff --git a/applications/luci-app-coovachilli/po/ru/coovachilli.po b/applications/luci-app-coovachilli/po/ru/coovachilli.po index 379ff7eaa..3420e24f7 100644 --- a/applications/luci-app-coovachilli/po/ru/coovachilli.po +++ b/applications/luci-app-coovachilli/po/ru/coovachilli.po @@ -387,7 +387,7 @@ msgstr "Аутентификация с помощью UAM и MAC" #~ msgstr "Локальный файл пользователей" #~ msgid "" -#~ "A colon seperated file containing usernames and passwords of locally " +#~ "A colon separated file containing usernames and passwords of locally " #~ "authenticated users" #~ msgstr "" #~ "Файл, содержащий логины и пароли локально авторизованных пользователей " diff --git a/applications/luci-app-coovachilli/po/vi/coovachilli.po b/applications/luci-app-coovachilli/po/vi/coovachilli.po index 66abf0dc6..dc27f8b7a 100644 --- a/applications/luci-app-coovachilli/po/vi/coovachilli.po +++ b/applications/luci-app-coovachilli/po/vi/coovachilli.po @@ -551,7 +551,7 @@ msgstr "" #, fuzzy #~ msgid "" #~ "Executable to run as a CGI type program (like haserl) for URLs with " -#~ "extention .chi" +#~ "extension .chi" #~ msgstr "Thống nhất cấu hình phương pháp cài đặt" #, fuzzy diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index 146560efa..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.1 +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 7cfbc56a0..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.6.0" -- 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.1-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() @@ -190,9 +192,15 @@ local function _get_status() 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 ]] .. lookup_host .. [[ ]] .. use_ipv6 .. - [[ ]] .. force_ipversion .. [[ ]] .. force_dnstcp .. [[ ]] .. dnsserver + local is_glue = tonumber(s["is_glue"] or 0) + 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_" @@ -219,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 @@ -287,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 c924e845c..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", @@ -335,7 +336,7 @@ function svc4.validate(self, value) if usev6:formvalue(section) ~= "1" then -- do only on IPv4 return value else - return "" -- supress validate error + return "" -- suppress validate error end end function svc4.write(self, section, value) @@ -376,7 +377,7 @@ function svc6.validate(self, value) if DDNS.has_ipv6 then return value end return nil, err_tab_basic(self) .. err_ipv6_plain else - return "" -- supress validate error + return "" -- suppress validate error end end function svc6.write(self, section, value) @@ -626,7 +627,7 @@ if DDNS.has_ssl then cert.forcewrite = true function cert.validate(self, value) if https:formvalue(section) ~= "1" then - return "" -- supress validate error if NOT https + return "" -- suppress validate error if NOT https end if value then -- otherwise errors in datatype check if DTYP.directory(value) @@ -1086,7 +1087,7 @@ function eif6.parse(self, section, novld) end -- IPv4/IPv6 - bind_network -- ################################################ -if DDNS.has_bindnet or ( ( m:get(section, "bind_network") ) ~= "" ) then +if DDNS.has_bindnet or ( ( m:get(section, "bind_network") or "" ) ~= "" ) then bnet = ns:taboption("advanced", ListValue, "bind_network", translate("Bind Network") ) bnet:depends("ipv4_source", "web") @@ -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 335bb01b2..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") @@ -66,9 +66,9 @@ if not DDNS.has_ssl then sl.rawhtml = true sl.title = bold_on .. translate("HTTPS not supported") .. bold_off - sl.value = translate("Neither GNU Wget with SSL nor cURL installed to support updates via HTTPS protocol.") .. + sl.value = translate("Neither GNU Wget with SSL nor cURL installed to support secure updates via HTTPS protocol.") .. "
- " .. - translate("You should install GNU Wget with SSL (prefered) or cURL package.") .. + translate("You should install 'wget' or 'curl' or 'uclient-fetch' with 'libustream-*ssl' package.") .. "
- " .. translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.") end @@ -82,7 +82,7 @@ if not DDNS.has_bindnet then translate("Binding to a specific network not supported") .. bold_off bn.value = translate("Neither GNU Wget with SSL nor cURL installed to select a network to use for communication.") .. "
- " .. - translate("You should install GNU Wget with SSL or cURL package.") .. + translate("You should install 'wget' or 'curl' package.") .. "
- " .. translate("GNU Wget will use the IP of given network, cURL will use the physical interface.") .. "
- " .. @@ -98,7 +98,7 @@ if not DDNS.has_proxy then translate("cURL without Proxy Support") .. bold_off px.value = translate("cURL is installed, but libcurl was compiled without proxy support.") .. "
- " .. - translate("You should install GNU Wget with SSL or replace libcurl.") .. + translate("You should install 'wget' or 'uclient-fetch' package or replace libcurl.") .. "
- " .. translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.") end @@ -112,13 +112,13 @@ if not DDNS.has_forceip then translate("Force IP Version not supported") .. bold_off local value = translate("BusyBox's nslookup and Wget do not support to specify " .. "the IP version to use for communication with DDNS Provider!") - if not (DDNS.has_wgetssl or DDNS.has_curl) then + if not (DDNS.has_wgetssl or DDNS.has_curl or DDNS.has_fetch) then value = value .. "
- " .. - translate("You should install GNU Wget with SSL (prefered) or cURL package.") + translate("You should install 'wget' or 'curl' or 'uclient-fetch' package.") end - if not (DDNS.has_bindhost or DDNS.has_hostip) then + if not DDNS.has_bindhost then value = value .. "
- " .. - translate("You should install BIND host or hostip package for DNS requests.") + translate("You should install 'bind-host' or 'knot-host' or 'drill' package for DNS requests.") end fi.value = value end @@ -133,7 +133,7 @@ if not DDNS.has_bindhost then dt.value = translate("BusyBox's nslookup and hostip do not support to specify to use TCP " .. "instead of default UDP when requesting DNS server!") .. "
- " .. - translate("You should install BIND host package for DNS requests.") + translate("You should install 'bind-host' or 'knot-host' or 'drill' package for DNS requests.") end -- nslookup compiled with musl produce problems when using @@ -146,7 +146,7 @@ if not DDNS.has_dnsserver then ds.value = translate("BusyBox's nslookup in the current compiled version " .. "does not handle given DNS Servers correctly!") .. "
- " .. - translate("You should install BIND host or hostip package, " .. + translate("You should install 'bind-host' or 'knot-host' or 'drill' or 'hostip' package, " .. "if you need to specify a DNS server to detect your registered IP.") end @@ -159,7 +159,7 @@ if DDNS.has_ssl and not DDNS.has_cacerts then translate("No certificates found") .. bold_off ca.value = translate("If using secure communication you should verify server certificates!") .. "
- " .. - translate("Install ca-certificates package or needed certificates " .. + translate("Install 'ca-certificates' package or needed certificates " .. "by hand into /etc/ssl/certs default directory") end 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 e6da7cc18..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,15 +33,18 @@ 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 --- SimpleSection definiton -- ################################################## +-- SimpleSection definition -- ################################################## -- with all the JavaScripts we need for "a good Show" a = m:section( SimpleSection ) a.template = "ddns/overview_status" @@ -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 54791432b..209d9c3a4 100755 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -24,12 +24,14 @@ has_fetch = (SYS.call( [[which uclient-fetch >/dev/null 2>&1]] ) == 0) has_fetchssl = NXFS.access("/lib/libustream-ssl.so") has_bbwget = (SYS.call( [[$(which wget) -V 2>&1 | grep -iqF "busybox"]] ) == 0) has_bindhost = (SYS.call( [[which host >/dev/null 2>&1]] ) == 0) + or (SYS.call( [[which khost >/dev/null 2>&1]] ) == 0) + or (SYS.call( [[which drill >/dev/null 2>&1]] ) == 0) has_hostip = (SYS.call( [[which hostip >/dev/null 2>&1]] ) == 0) has_nslookup = (SYS.call( [[$(which nslookup) localhost 2>&1 | grep -qF "(null)"]] ) ~= 0) has_ipv6 = (NXFS.access("/proc/net/ipv6_route") and NXFS.access("/usr/sbin/ip6tables")) has_ssl = (has_wgetssl or has_curlssl or (has_fetch and has_fetchssl)) has_proxy = (has_wgetssl or has_curlpxy or has_fetch or has_bbwget) -has_forceip = ((has_wgetssl or has_curl) and (has_bindhost or has_hostip)) +has_forceip = (has_wgetssl or has_curl or has_fetch) -- only really needed for transfer has_dnsserver = (has_bindhost or has_hostip or has_nslookup) has_bindnet = (has_wgetssl or has_curl) has_cacerts = _check_certs() @@ -55,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 @@ -65,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/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 @@ @@ -63,7 +67,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
-
+
<% if has_ping6 then %>
+
<% if has_traceroute6 then %>
+
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm index f7787dd1e..b4baedff2 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm @@ -27,14 +27,12 @@ { var timestr; - if (st[0][i].expires <= 0) - { + if (st[0][i].expires === false) + timestr = '<%:unlimited%>'; + else if (st[0][i].expires <= 0) timestr = '<%:expired%>'; - } else - { timestr = String.format('%t', st[0][i].expires); - } var tr = tb.insertRow(-1); tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); @@ -69,14 +67,12 @@ { var timestr; - if (st[1][i].expires <= 0) - { + if (st[1][i].expires === false) + timestr = '<%:unlimited%>'; + else if (st[1][i].expires <= 0) timestr = '<%:expired%>'; - } else - { timestr = String.format('%t', st[1][i].expires); - } var tr = tb6.insertRow(-1); tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm index 53c35ae59..96fbffdb0 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm @@ -15,7 +15,10 @@ for (var j = 0; j < ports.length; j++) { - var th = th0.parentNode.parentNode.childNodes[j+1]; + var th = document.getElementById('portstatus-' + switches[i] + '-' + j); + + if (!th) + continue; if (ports[j].link) { diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm index 1df6b2884..9c351d393 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -427,7 +427,7 @@ - + <% end %> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm index 8bfc61b99..8976e30cb 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -276,20 +276,56 @@ var s = String.format( '<%:Status%>: %s
' + '<%:Line State%>: %s [0x%x]
' + - '<%:Line Speed%>: %s/s / %s/s
' + - '<%:Line Attenuation%>: %s dB / %s dB
' + - '<%:Noise Margin%>: %s dB / %s dB
', + '<%:Line Mode%>: %s
' + + '<%:Annex%>: %s
' + + '<%:Profile%>: %s
' + + '<%:Data Rate%>: %s/s / %s/s
' + + '<%:Max. Attainable Data Rate (ATTNDR)%>: %s/s / %s/s
' + + '<%:Latency%>: %s / %s
' + + '<%:Line Attenuation (LATN)%>: %s dB / %s dB
' + + '<%:Signal Attenuation (SATN)%>: %s dB / %s dB
' + + '<%:Noise Margin (SNR)%>: %s dB / %s dB
' + + '<%:Aggregate Transmit Power(ACTATP)%>: %s dB / %s dB
' + + '<%:Forward Error Correction Seconds (FECS)%>: %s / %s
' + + '<%:Errored seconds (ES)%>: %s / %s
' + + '<%:Severely Errored Seconds (SES)%>: %s / %s
' + + '<%:Loss of Signal Seconds (LOSS)%>: %s / %s
' + + '<%:Unavailable Seconds (UAS)%>: %s / %s
' + + '<%:Header Error Code Errors (HEC)%>: %s / %s
' + + '<%:Non Pre-emtive CRC errors (CRC_P)%>: %s / %s
' + + '<%:Pre-emtive CRC errors (CRCP_P)%>: %s / %s
' + + '<%:Line Uptime%>: %s
' + + '<%:ATU-C System Vendor ID%>: %s
' + + '<%:Power Management Mode%>: %s
', info.dsl.line_state, info.dsl.line_state_detail, info.dsl.line_state_num, + info.dsl.line_mode_s, + info.dsl.annex_s, + info.dsl.profile_s, info.dsl.data_rate_down_s, info.dsl.data_rate_up_s, + info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s, + info.dsl.latency_num_down, info.dsl.latency_num_up, info.dsl.line_attenuation_down, info.dsl.line_attenuation_up, - info.dsl.noise_margin_down, info.dsl.noise_margin_up + info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up, + info.dsl.noise_margin_down, info.dsl.noise_margin_up, + info.dsl.actatp_down, info.dsl.actatp_up, + info.dsl.errors_fec_near, info.dsl.errors_fec_far, + info.dsl.errors_es_near, info.dsl.errors_es_far, + info.dsl.errors_ses_near, info.dsl.errors_ses_far, + info.dsl.errors_loss_near, info.dsl.errors_loss_far, + info.dsl.errors_uas_near, info.dsl.errors_uas_far, + info.dsl.errors_hec_near, info.dsl.errors_hec_far, + info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far, + info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far, + info.dsl.line_uptime_s, + info.dsl.atuc_vendor_id, + info.dsl.power_mode_s ); dsl_s.innerHTML = String.format('%s', s); dsl_i.innerHTML = String.format( '' + - '
ADSL' + '
DSL' ); <% end %> @@ -305,7 +341,9 @@ { var timestr; - if (info.leases[i].expires <= 0) + if (info.leases[i].expires === false) + timestr = '<%:unlimited%>'; + else if (info.leases[i].expires <= 0) timestr = '<%:expired%>'; else timestr = String.format('%t', info.leases[i].expires); @@ -343,7 +381,9 @@ { var timestr; - if (info.leases6[i].expires <= 0) + if (info.leases6[i].expires === false) + timestr = '<%:unlimited%>'; + else if (info.leases6[i].expires <= 0) timestr = '<%:expired%>'; else timestr = String.format('%t', info.leases6[i].expires); @@ -435,7 +475,7 @@ '<%:Bitrate%>: %s <%:Mbit/s%>
', icon, net.signal, net.noise, net.quality, - net.link, net.ssid, + net.link, net.ssid || '?', net.mode, net.channel, net.frequency, net.bitrate || '?' @@ -446,7 +486,7 @@ s += String.format( '<%:BSSID%>: %s
' + '<%:Encryption%>: %s', - net.bssid, + net.bssid || '?', net.encryption ); } @@ -707,9 +747,9 @@ <% if has_dsl then %>
- <%:ADSL%> + <%:DSL%> -
<%:ADSL Status%> +
<%:DSL Status%> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm index f49469a59..3f4b83b80 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm @@ -9,6 +9,7 @@ require "luci.sys.iptparser" local wba = require "luci.tools.webadmin" local fs = require "nixio.fs" + local io = require "io" local has_ip6tables = fs.access("/usr/sbin/ip6tables") local mode = 4 @@ -47,6 +48,15 @@ local tables = { "Filter", "NAT", "Mangle", "Raw" } if mode == 6 then tables = { "Filter", "Mangle", "Raw" } + local ok, lines = pcall(io.lines, "/proc/net/ip6_tables_names") + if ok and lines then + local line + for line in lines do + if line == "nat" then + tables = { "Filter", "NAT", "Mangle", "Raw" } + end + end + end end -%> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm index 5ca0398e1..7175248db 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm @@ -24,7 +24,9 @@
    -
  • <%:Checksum%>: <%=checksum%>
  • +
  • <%:Checksum%>
    + <%:MD5%>: <%=checksum%>
    + <%:SHA256%>: <%=sha256ch%>
  • <%:Size%>: <% local w = require "luci.tools.webadmin" write(w.byte_format(size)) diff --git a/modules/luci-mod-admin-full/root/etc/uci-defaults/50_luci-mod-admin-full b/modules/luci-mod-admin-full/root/etc/uci-defaults/50_luci-mod-admin-full new file mode 100755 index 000000000..372eb1512 --- /dev/null +++ b/modules/luci-mod-admin-full/root/etc/uci-defaults/50_luci-mod-admin-full @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ "$(uci -q get luci.diag)" != "internal" ]; then + host="" + + if [ -s /etc/os-release ]; then + . /etc/os-release + host="${HOME_URL:-${BUG_URL:-$LEDE_DEVICE_MANUFACTURER_URL}}" + host="${host#*://}" + host="${host%%/*}" + fi + + uci -q batch <<-EOF >/dev/null + set luci.diag=internal + set luci.diag.dns='${host:-openwrt.org}' + set luci.diag.ping='${host:-openwrt.org}' + set luci.diag.route='${host:-openwrt.org}' + commit luci + EOF +fi + +exit 0 diff --git a/modules/luci-mod-admin-mini/luasrc/controller/mini/network.lua b/modules/luci-mod-admin-mini/luasrc/controller/mini/network.lua index 0b74c41ec..92506e54f 100644 --- a/modules/luci-mod-admin-mini/luasrc/controller/mini/network.lua +++ b/modules/luci-mod-admin-mini/luasrc/controller/mini/network.lua @@ -7,6 +7,6 @@ module("luci.controller.mini.network", package.seeall) function index() entry({"mini", "network"}, alias("mini", "network", "index"), _("Network"), 20).index = true entry({"mini", "network", "index"}, cbi("mini/network", {autoapply=true}), _("General"), 1) - entry({"mini", "network", "wifi"}, cbi("mini/wifi", {autoapply=true}), _("Wifi"), 10) + entry({"mini", "network", "wifi"}, cbi("mini/wifi", {autoapply=true}), _("Wireless"), 10) entry({"mini", "network", "dhcp"}, cbi("mini/dhcp", {autoapply=true}), _("DHCP"), 20) end diff --git a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua index 0729c4439..19952cd5d 100644 --- a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua +++ b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua @@ -33,7 +33,7 @@ wlcursor:foreach("wireless", "wifi-device", -- Main Map -- -m = Map("wireless", translate("Wifi"), translate("Here you can configure installed wifi devices.")) +m = Map("wireless", translate("Wireless"), translate("Here you can configure installed wifi devices.")) m:chain("network") diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua index 0d3d971c3..b08366de6 100644 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua +++ b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua @@ -16,7 +16,7 @@ community.rmempty = false local profile for profile in fs.glob(profiles) do local name = uci:get_first(profile, "community", "name") or "?" - community:value(profile, name) + community:value(string.gsub(profile, "/etc/config/profile_", ""), name) end diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm index fc3948ecc..1dc1d8b0d 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm @@ -264,7 +264,7 @@ end netlist[#netlist+1] = net:ifname() netdevs[net:ifname()] = dev:name() - if net.iwdata.device then + if net.iwinfo.signal and net.iwinfo.bssid then local signal = net.iwinfo.signal or "N/A" local noise = net.iwinfo.noise or "N/A" local q = net.iwinfo.quality or "0" diff --git a/protocols/luci-proto-ipip/Makefile b/protocols/luci-proto-ipip/Makefile new file mode 100644 index 000000000..6af85647e --- /dev/null +++ b/protocols/luci-proto-ipip/Makefile @@ -0,0 +1,16 @@ +# +# Copyright 2016 Roger Pueyo Centelles +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Support for IPIP tunnels (IPv4-in-IPv4 RFC2003) +LUCI_DEPENDS:=+ipip + +PKG_MAINTAINER:=Roger Pueyo Centelles + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-ipip/luasrc/model/cbi/admin_network/proto_ipip.lua b/protocols/luci-proto-ipip/luasrc/model/cbi/admin_network/proto_ipip.lua new file mode 100644 index 000000000..8817f18d6 --- /dev/null +++ b/protocols/luci-proto-ipip/luasrc/model/cbi/admin_network/proto_ipip.lua @@ -0,0 +1,34 @@ +-- Copyright 2016 Roger Pueyo Centelles +-- Licensed to the public under the Apache License 2.0. + +local map, section, net = ... + +local peeraddr, ipaddr, ttl, tos, df, mtu, tunlink + +peeraddr = section:taboption("general", Value, "peeraddr", translate("Remote IPv4 address or FQDN"), translate("The IPv4 address or the fully-qualified domain name of the remote tunnel end.")) +peeraddr.optional = false +peeraddr.datatype = "or(hostname,ip4addr)" + +ipaddr = section:taboption("general", Value, "ipaddr", translate("Local IPv4 address"), translate("The local IPv4 address over which the tunnel is created (optional).")) +ipaddr.optional = true +ipaddr.datatype = "ip4addr" + +tunlink = section:taboption("general", Value, "tunlink", translate("Bind interface"), translate("Bind the tunnel to this interface (optional).")) +ipaddr.optional = true + + +mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"), translate("Specify an MTU (Maximum Transmission Unit) other than the default (1280 bytes).")) +mtu.optional = true +mtu.placeholder = 1280 +mtu.datatype = "range(68, 9200)" + +ttl = section:taboption("advanced", Value, "ttl", translate("Override TTL"), translate("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64).")) +ttl.optional = true +ttl.placeholder = 64 +ttl.datatype = "min(1)" + +tos = section:taboption("advanced", Value, "tos", translate("Override TOS"), translate("Specify a TOS (Type of Service).")) +tos.optional = true +tos.datatype = "range(0, 255)" + +df = section:taboption("advanced", Flag, "df", translate("Don't Fragment"), translate("Enable the DF (Don't Fragment) flag of the encapsulating packets.")) diff --git a/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua new file mode 100644 index 000000000..5c3761c9c --- /dev/null +++ b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua @@ -0,0 +1,40 @@ +-- Copyright 2016 Roger Pueyo Centelles +-- Licensed to the public under the Apache License 2.0. + +local netmod = luci.model.network +local interface = luci.model.network.interface +local proto = netmod:register_protocol("ipip") + +function proto.get_i18n(self) + return luci.i18n.translate("IPv4-in-IPv4 (RFC2003)") +end + +function proto.ifname(self) + return "ipip-" .. self.sid +end + +function proto.opkg_package(self) + return "ipip" +end + +function proto.is_installed(self) + return nixio.fs.access("/lib/netifd/proto/ipip.sh") +end + +function proto.is_floating(self) + return true +end + +function proto.is_virtual(self) + return true +end + +function proto.get_interfaces(self) + return nil +end + +function proto.contains_interface(self, ifc) + return (netmod:ifnameof(ifc) == self:ifname()) +end + +netmod:register_pattern_virtual("^ipip-%w") diff --git a/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua b/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua index e450470eb..a47ce1588 100644 --- a/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua +++ b/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua @@ -26,21 +26,19 @@ port.datatype = "port" ifname = section:taboption("general", Value, "interface", translate("Output Interface")) ifname.template = "cbi/network_netlist" -mtu = section.taboption("general", Value, "mtu", translate("MTU")) +mtu = section:taboption("general", Value, "mtu", translate("MTU")) mtu.datatype = "uinteger" -section:taboption("general", Value, "authgroup", translate("AuthGroup")) - username = section:taboption("general", Value, "username", translate("Username")) password = section:taboption("general", Value, "password", translate("Password")) -hexpassword = section:taboption("general", Value, "hexpassword", translate("Obfuscated Password")) password.password = true +hexpassword = section:taboption("general", Value, "hexpassword", translate("Obfuscated Password")) hexpassword.password = true authroup = section:taboption("general", Value, "authgroup", translate("Auth Group")) passgroup = section:taboption("general", Value, "passgroup", translate("Group Password")) +passgroup.password = true hexpassgroup = section:taboption("general", Value, "hexpassgroup", translate("Obfuscated Group Password")) -password.passgroup = true -hexpassword.passgroup= true +hexpassword.password= true domain = section:taboption("general", Value, "domain", translate("NT Domain")) vendor = section:taboption("general", Value, "vendor", translate("Vendor")) @@ -50,17 +48,17 @@ dh_group:value("dh1") dh_group:value("dh5") pfs = section:taboption("general", ListValue, "pfs", translate("Perfect Forward Secrecy")) -dh_group:value("server") -dh_group:value("nopfs") -dh_group:value("dh1") -dh_group:value("dh2") -dh_group:value("dh5") +pfs:value("server") +pfs:value("nopfs") +pfs:value("dh1") +pfs:value("dh2") +pfs:value("dh5") -natt_mode = section:taboption("general", ListValue, "natt_mode", translate("NAT-T Mode") +natt_mode = section:taboption("general", ListValue, "natt_mode", translate("NAT-T Mode")) natt_mode:value("natt", translate("RFC3947 NAT-T mode")) natt_mode:value("none", translate("No NAT-T")) -natt_mode:value("force-natt", translate("Force use of NAT-T") -natt_mode:value("cisco-udp", translate("Cisco UDP encapsulation") +natt_mode:value("force-natt", translate("Force use of NAT-T")) +natt_mode:value("cisco-udp", translate("Cisco UDP encapsulation")) enable_no_enc = section:taboption("general", Flag, "enable_no_enc", translate("Disable Encryption"), @@ -72,11 +70,10 @@ enable_single_des = section:taboption("general", Flag, "enable_single_des", translate("If checked, 1DES is enaled")) enable_no_enc.default = enable_single_des.disabled -dpd_idle = section.taboption("general", Value, "dpd_idle", translate("DPD Idle Timeout")) +dpd_idle = section:taboption("general", Value, "dpd_idle", translate("DPD Idle Timeout")) dpd_idle.datatype = "uinteger" -dpd.placeholder = "600" +dpd_idle.placeholder = "600" ifname = section:taboption("general", Value, "target_network", translate("Target network")) port.placeholder = "0.0.0.0/0" port.datatype = "network" - diff --git a/protocols/luci-proto-wireguard/Makefile b/protocols/luci-proto-wireguard/Makefile new file mode 100644 index 000000000..ed94a557b --- /dev/null +++ b/protocols/luci-proto-wireguard/Makefile @@ -0,0 +1,16 @@ +# +# Copyright (C) 2016 Dan Luedtke +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Support for WireGuard VPN +LUCI_DEPENDS:=+kmod-wireguard +wireguard-tools + +PKG_MAINTAINER:=Dan Luedtke + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua new file mode 100644 index 000000000..774c6db22 --- /dev/null +++ b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua @@ -0,0 +1,148 @@ +-- Copyright 2016 Dan Luedtke +-- Licensed to the public under the Apache License 2.0. + + +local map, section, net = ... +local ifname = net:get_interface():name() +local private_key, listen_port +local metric, mtu, preshared_key +local peers, public_key, allowed_ips, endpoint, persistent_keepalive + + +-- general --------------------------------------------------------------------- + +private_key = section:taboption( + "general", + Value, + "private_key", + translate("Private Key"), + translate("Required. Base64-encoded private key for this interface.") +) +private_key.password = true +private_key.datatype = "rangelength(44, 44)" +private_key.optional = false + + +listen_port = section:taboption( + "general", + Value, + "listen_port", + translate("Listen Port"), + translate("Optional. UDP port used for outgoing and incoming packets.") +) +listen_port.datatype = "port" +listen_port.placeholder = "51820" +listen_port.optional = true + + +-- advanced -------------------------------------------------------------------- + +metric = section:taboption( + "advanced", + Value, + "metric", + translate("Metric"), + translate("Optional.") +) +metric.datatype = "uinteger" +metric.placeholder = "0" +metric.optional = true + + +mtu = section:taboption( + "advanced", + Value, + "mtu", + translate("MTU"), + translate("Optional. Maximum Transmission Unit of tunnel interface.") +) +mtu.datatype = "range(1280,1423)" +mtu.placeholder = "1423" +mtu.optional = true + + +preshared_key = section:taboption( + "advanced", + Value, + "preshared_key", + translate("Preshared Key"), + translate("Optional. Adds in an additional layer of symmetric-key " .. + "cryptography for post-quantum resistance.") +) +preshared_key.password = true +preshared_key.datatype = "rangelength(44, 44)" +preshared_key.optional = true + + +-- peers ----------------------------------------------------------------------- + +peers = map:section( + TypedSection, + "wireguard_" .. ifname, + translate("Peers"), + translate("Further information about WireGuard interfaces and peers " .. + "at wireguard.io.") +) +peers.template = "cbi/tsection" +peers.anonymous = true +peers.addremove = true + + +public_key = peers:option( + Value, + "public_key", + translate("Public Key"), + translate("Required. Public key of peer.") +) +public_key.datatype = "rangelength(44, 44)" +public_key.optional = false + + +allowed_ips = peers:option( + DynamicList, + "allowed_ips", + translate("Allowed IPs"), + translate("Required. IP addresses and prefixes that this peer is allowed " .. + "to use inside the tunnel. Usually the peer's tunnel IP " .. + "addresses and the networks the peer routes through the tunnel.") +) +allowed_ips.datatype = "ipaddr" +allowed_ips.optional = false + + +route_allowed_ips = peers:option( + Flag, + "route_allowed_ips", + translate("Route Allowed IPs"), + translate("Optional. Create routes for Allowed IPs for this peer.") +) + + +endpoint_host = peers:option( + Value, + "endpoint_host", + translate("Endpoint Host"), + translate("Optional. Host of peer. Names are resolved " .. + "prior to bringing up the interface.")) +endpoint_host.placeholder = "vpn.example.com" +endpoint_host.datatype = "host" + + +endpoint_port = peers:option( + Value, + "endpoint_port", + translate("Endpoint Port"), + translate("Optional. Port of peer.")) +endpoint_port.placeholder = "51820" +endpoint_port.datatype = "port" + + +persistent_keepalive = peers:option( + Value, + "persistent_keepalive", + translate("Persistent Keep Alive"), + translate("Optional. Seconds between keep alive messages. " .. + "Default is 0 (disabled). Recommended value if " .. + "this device is behind a NAT is 25.")) +persistent_keepalive.datatype = "range(0, 65535)" +persistent_keepalive.placeholder = "0" diff --git a/protocols/luci-proto-wireguard/luasrc/model/network/proto_wireguard.lua b/protocols/luci-proto-wireguard/luasrc/model/network/proto_wireguard.lua new file mode 100644 index 000000000..d6937618a --- /dev/null +++ b/protocols/luci-proto-wireguard/luasrc/model/network/proto_wireguard.lua @@ -0,0 +1,42 @@ +-- Copyright 2016 Dan Luedtke +-- Licensed to the public under the Apache License 2.0. + +local netmod = luci.model.network +local interface = luci.model.network.interface +local proto = netmod:register_protocol("wireguard") + +function proto.get_i18n(self) + return luci.i18n.translate("WireGuard VPN") +end + +function proto.ifname(self) + return self.sid +end + +function proto.get_interface(self) + return interface(self:ifname(), self) +end + +function proto.opkg_package(self) + return "wireguard-tools" +end + +function proto.is_installed(self) + return nixio.fs.access("/lib/netifd/proto/wireguard.sh") +end + +function proto.is_floating(self) + return true +end + +function proto.is_virtual(self) + return true +end + +function proto.get_interfaces(self) + return nil +end + +function proto.contains_interface(self, ifc) + return (netmod:ifnameof(ifc) == self:ifname()) +end diff --git a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css index 1d2374805..ef19e7c11 100644 --- a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css +++ b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css @@ -803,7 +803,7 @@ header .fill { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); - background-image: linear-gradient(top, #333333, #222222); + background-image: linear-gradient(to bottom, #333333, #222222); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); @@ -918,7 +918,7 @@ header div > ul .dropdown-menu li a:hover, background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #191919)); background-image: -webkit-linear-gradient(top, #292929, #191919); background-image: -o-linear-gradient(top, #292929, #191919); - background-image: linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#191919', GradientType=0); color: #ffffff; } @@ -1029,7 +1029,7 @@ header .dropdown-menu a.hover, background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd)); background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); background-image: -o-linear-gradient(top, #eeeeee, #dddddd); - background-image: linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(to bottom, #eeeeee, #dddddd); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#dddddd', GradientType=0); color: #404040; text-decoration: none; @@ -1195,7 +1195,7 @@ header .dropdown-menu a.hover, background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5)); background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); - background-image: linear-gradient(top, #ffffff, #f5f5f5); + background-image: linear-gradient(to bottom, #ffffff, #f5f5f5); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); border: 1px solid #ddd; -webkit-border-radius: 3px; @@ -1262,7 +1262,7 @@ footer { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); - background-image: linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); border-color: #c43c35 #c43c35 #882a25; @@ -1278,7 +1278,7 @@ footer { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); - background-image: linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); border-color: #57a957 #57a957 #3d773d; @@ -1294,7 +1294,7 @@ footer { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); - background-image: linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); border-color: #339bb9 #339bb9 #22697d; @@ -1354,7 +1354,7 @@ footer { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); background-image: -o-linear-gradient(top, #049cdb, #0064cd); - background-image: linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(to bottom, #049cdb, #0064cd); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); border-color: #0064cd #0064cd #003f81; @@ -1614,7 +1614,7 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { opacity: 0.4; } -.alert-message { +.alert-message, .errorbox { position: relative; padding: 7px 15px; margin-bottom: 18px; @@ -1627,7 +1627,7 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94)); background-image: -webkit-linear-gradient(top, #fceec1, #eedc94); background-image: -o-linear-gradient(top, #fceec1, #eedc94); - background-image: linear-gradient(top, #fceec1, #eedc94); + background-image: linear-gradient(to bottom, #fceec1, #eedc94); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); border-color: #eedc94 #eedc94 #e4c652; diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm index d4d0a2b12..6f09bfcdf 100644 --- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm +++ b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm @@ -172,7 +172,6 @@ <% end -%> - diff --git a/themes/luci-theme-material/luasrc/view/themes/material/header.htm b/themes/luci-theme-material/luasrc/view/themes/material/header.htm index 0dc24aa5f..8419ade76 100755 --- a/themes/luci-theme-material/luasrc/view/themes/material/header.htm +++ b/themes/luci-theme-material/luasrc/view/themes/material/header.htm @@ -210,7 +210,7 @@ %>
  • <%=pcdata(striptags(translate(nnode.title)))%> - <%- submenu("/" .. category .. "/" .. r .. "/", nnode) %> + <%- submenu(category .. "/" .. r .. "/", nnode) %>
  • <% else %>

?
<%:Collecting data...%>