diff options
Diffstat (limited to 'applications')
73 files changed, 908 insertions, 992 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index 700f187b35..10110666c3 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -15,9 +15,9 @@ function index() entry({"admin", "services", "adblock", "tab_from_cbi"}, cbi("adblock/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "adblock", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true entry({"admin", "services", "adblock", "advanced"}, firstchild(), _("Advanced"), 100) - entry({"admin", "services", "adblock", "advanced", "blacklist"}, cbi("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true - entry({"admin", "services", "adblock", "advanced", "whitelist"}, cbi("adblock/whitelist_tab"), _("Edit Whitelist"), 120).leaf = true - entry({"admin", "services", "adblock", "advanced", "configuration"}, cbi("adblock/configuration_tab"), _("Edit Configuration"), 130).leaf = true + entry({"admin", "services", "adblock", "advanced", "blacklist"}, form("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true + entry({"admin", "services", "adblock", "advanced", "whitelist"}, form("adblock/whitelist_tab"), _("Edit Whitelist"), 120).leaf = true + entry({"admin", "services", "adblock", "advanced", "configuration"}, form("adblock/configuration_tab"), _("Edit Configuration"), 130).leaf = true entry({"admin", "services", "adblock", "advanced", "query"}, template("adblock/query"), _("Query domains"), 140).leaf = true entry({"admin", "services", "adblock", "advanced", "result"}, call("queryData"), nil, 150).leaf = true end @@ -36,8 +36,8 @@ end function queryData(domain) if domain then luci.http.prepare_content("text/plain") - local cmd = "/etc/init.d/adblock query %q 2>&1" - local util = io.popen(cmd % domain) + local cmd = "/etc/init.d/adblock query %s 2>&1" + local util = io.popen(cmd % util.shellquote(domain)) if util then while true do local line = util:read("*l") diff --git a/applications/luci-app-adblock/po/it/adblock.po b/applications/luci-app-adblock/po/it/adblock.po index 88adcc8922..0a1b65ac36 100644 --- a/applications/luci-app-adblock/po/it/adblock.po +++ b/applications/luci-app-adblock/po/it/adblock.po @@ -275,8 +275,8 @@ msgid "" msgstr "" msgid "" -"Size of the download queue to handle downloads & list processing in parallel " -"(default '4').<br />" +"Size of the download queue to handle downloads & list processing in " +"parallel (default '4').<br />" msgstr "" msgid "Startup Trigger" diff --git a/applications/luci-app-adblock/po/ja/adblock.po b/applications/luci-app-adblock/po/ja/adblock.po index 60c5a9a547..dfd72cbf6c 100644 --- a/applications/luci-app-adblock/po/ja/adblock.po +++ b/applications/luci-app-adblock/po/ja/adblock.po @@ -301,8 +301,8 @@ msgstr "" "処理エラーまたはドメイン カウントが0以下の場合、メールを送信します。<br />" msgid "" -"Size of the download queue to handle downloads & list processing in parallel " -"(default '4').<br />" +"Size of the download queue to handle downloads & list processing in " +"parallel (default '4').<br />" msgstr "" "ダウンロードの制御とリストの処理を同時並行的に行うダウンロード キューのサイズ" "です(既定値: '4')。<br />" diff --git a/applications/luci-app-adblock/po/pt-br/adblock.po b/applications/luci-app-adblock/po/pt-br/adblock.po index 7eb6e3ebc8..c0d9d816db 100644 --- a/applications/luci-app-adblock/po/pt-br/adblock.po +++ b/applications/luci-app-adblock/po/pt-br/adblock.po @@ -267,8 +267,8 @@ msgid "" msgstr "" msgid "" -"Size of the download queue to handle downloads & list processing in parallel " -"(default '4').<br />" +"Size of the download queue to handle downloads & list processing in " +"parallel (default '4').<br />" msgstr "" msgid "Startup Trigger" diff --git a/applications/luci-app-adblock/po/ru/adblock.po b/applications/luci-app-adblock/po/ru/adblock.po index 6e80e80b3a..17f39fdd87 100644 --- a/applications/luci-app-adblock/po/ru/adblock.po +++ b/applications/luci-app-adblock/po/ru/adblock.po @@ -303,8 +303,8 @@ msgstr "" "≤ 0.<br />" msgid "" -"Size of the download queue to handle downloads & list processing in parallel " -"(default '4').<br />" +"Size of the download queue to handle downloads & list processing in " +"parallel (default '4').<br />" msgstr "" "Значение очереди загрузки для выполнения параллельных загрузок (по умолчанию " "'4').<br />" diff --git a/applications/luci-app-adblock/po/templates/adblock.pot b/applications/luci-app-adblock/po/templates/adblock.pot index 5a93f8f070..6fbaa652ae 100644 --- a/applications/luci-app-adblock/po/templates/adblock.pot +++ b/applications/luci-app-adblock/po/templates/adblock.pot @@ -248,8 +248,8 @@ msgid "" msgstr "" msgid "" -"Size of the download queue to handle downloads & list processing in parallel " -"(default '4').<br />" +"Size of the download queue to handle downloads & list processing in " +"parallel (default '4').<br />" msgstr "" msgid "Startup Trigger" diff --git a/applications/luci-app-adblock/po/zh-cn/adblock.po b/applications/luci-app-adblock/po/zh-cn/adblock.po index 1d7dc2b193..e26c44c4da 100644 --- a/applications/luci-app-adblock/po/zh-cn/adblock.po +++ b/applications/luci-app-adblock/po/zh-cn/adblock.po @@ -369,152 +369,3 @@ msgstr "已暂停" msgid "running" msgstr "" -#~ msgid "" -#~ "For SSL protected blocklist sources you need a suitable SSL library, e.g. " -#~ "'libustream-ssl' or the wget 'built-in'." -#~ msgstr "" -#~ "对于 SSL 保护的 blocklist 源,您需要一个合适的 SSL 库,例如'libustream-" -#~ "ssl'或 wget'built-in'。" - -#~ msgid "" -#~ "Caution: Please don't select big lists or many lists at once on low " -#~ "memory devices to prevent OOM exceptions!" -#~ msgstr "" -#~ "注意:请勿在内存较小的设备上选择过长的列表或同时选择多个列表,以防止 OOM " -#~ "异常!" - -#~ msgid "" -#~ "Create compressed blocklist backups, they will be used in case of " -#~ "download errors or during startup in manual mode." -#~ msgstr "创建压缩的 blocklist 备份,它们将在下载错误或手动模式下启动时使用。" - -#~ msgid "" -#~ "Enable memory intense overall sort / duplicate removal on low memory " -#~ "devices (< 64 MB RAM)" -#~ msgstr "在低内存设备上启用耗用内存的整体排序/重复规则删除(<64 MB RAM)" - -#~ msgid "" -#~ "For further information <a href=\"%s\" target=\"_blank\">see online " -#~ "documentation</a>" -#~ msgstr "有关更多信息,请<a href=\"%s\" target=\"_blank\">参阅在线文档</a>" - -#~ msgid "" -#~ "In OPKG use the '--force-maintainer' option to overwrite the pre-existing " -#~ "config file or download a fresh default config from <a href=\"%s\" target=" -#~ "\"_blank\">here</a>" -#~ msgstr "" -#~ "在 OPKG 中,使用“--force-maintainer”选项覆盖预先存在的配置文件,或从<a " -#~ "href=\"%s\" target=\"_blank\">此处</a>下载新的默认配置" - -#~ msgid "" -#~ "List of available network interfaces. By default the startup will be " -#~ "triggered by the 'wan' interface.<br />" -#~ msgstr "可用网络接口列表。默认情况下,将由“wan”界面触发启动。<br />" - -#~ msgid "Manual / Backup mode" -#~ msgstr "手动/备份模式" - -#~ msgid "Overall Blocked Domains" -#~ msgstr "整体封锁域名" - -#~ msgid "Please update your adblock config file to use this package." -#~ msgstr "请更新您的 adblock 配置文件以使用此软件包。" - -#~ msgid "" -#~ "Target directory for adblock backups. Please use only non-volatile disks, " -#~ "no ram/tmpfs drives." -#~ msgstr "" -#~ "adblock 备份的目标目录。请仅使用非易失性磁盘,不使用 ram/tmpfs 驱动器。" - -#~ msgid "DNS backend" -#~ msgstr "DNS 后端" - -#~ msgid "Enable verbose debug logging" -#~ msgstr "启用详细调试输出" - -#~ msgid "Resume adblock" -#~ msgstr "恢复 Adblock" - -#~ msgid "Status" -#~ msgstr "状态" - -#~ msgid "Suspend adblock" -#~ msgstr "暂停 Adblock" - -#~ msgid "active" -#~ msgstr "已启用" - -#~ msgid "no domains blocked" -#~ msgstr "没有被拦截的域名" - -#~ msgid "suspended" -#~ msgstr "已暂停" - -#~ msgid "." -#~ msgstr "." - -#~ msgid "For further information" -#~ msgstr "更多信息" - -#~ msgid "see online documentation" -#~ msgstr "查看在线文档" - -#~ msgid "Backup options" -#~ msgstr "备份选项" - -#~ msgid "" -#~ "). Note that list URLs and Shallalist category selections are not " -#~ "configurable via Luci." -#~ msgstr ")。需要注意的是列表URL和列表类别选项无法通过Luci设置。" - -#~ msgid "Available blocklist sources (" -#~ msgstr "可用拦截列表来源(" - -#~ msgid "" -#~ "File with whitelisted hosts/domains that are allowed despite being on a " -#~ "blocklist." -#~ msgstr "允许的主机/域名列表" - -#~ msgid "Global options" -#~ msgstr "全局选项" - -#~ msgid "Whitelist file" -#~ msgstr "白名单文件" - -#~ msgid "see list details" -#~ msgstr "查看列表详情" - -#~ msgid "Count" -#~ msgstr "数量" - -#~ msgid "IPv4 blackhole ip address" -#~ msgstr "IPv4禁止列表" - -#~ msgid "IPv6 blackhole ip address" -#~ msgstr "IPv6禁止列表" - -#~ msgid "List date/state" -#~ msgstr "列表日期/状态" - -#~ msgid "Name of the logical lan interface" -#~ msgstr "LAN接口名称" - -#~ msgid "Port of the adblock uhttpd instance" -#~ msgstr "Adblock uhttpd端口" - -#~ msgid "Redirect all DNS queries to the local resolver" -#~ msgstr "将所有DNS查询都重定向到本地解析器" - -#~ msgid "Timeout for blocklist fetch (seconds)" -#~ msgstr "列表查询超时时间(秒)" - -#~ msgid "Total count of blocked domains" -#~ msgstr "阻止域名总数" - -#~ msgid "" -#~ "When adblock is active, all DNS queries are redirected to the local " -#~ "resolver in this server by default. You can disable that to allow queries " -#~ "to external DNS servers." -#~ msgstr "" -#~ "当Adblock处于活动状态时,默认情况下会将所有的DNS查询重定向到此服务器的本地" -#~ "解析器。您可以禁用以允许查询外部DNS服务器。" diff --git a/applications/luci-app-adblock/po/zh-tw/adblock.po b/applications/luci-app-adblock/po/zh-tw/adblock.po index da00842d53..417fc6bcc3 100644 --- a/applications/luci-app-adblock/po/zh-tw/adblock.po +++ b/applications/luci-app-adblock/po/zh-tw/adblock.po @@ -369,153 +369,3 @@ msgstr "已暫停" msgid "running" msgstr "" -#~ msgid "" -#~ "For SSL protected blocklist sources you need a suitable SSL library, e.g. " -#~ "'libustream-ssl' or the wget 'built-in'." -#~ msgstr "" -#~ "對於 SSL 保護的 blocklist 源,您需要一個合適的 SSL 庫,例如'libustream-" -#~ "ssl'或 wget'built-in'。" - -#~ msgid "" -#~ "Caution: Please don't select big lists or many lists at once on low " -#~ "memory devices to prevent OOM exceptions!" -#~ msgstr "" -#~ "注意:請勿在記憶體較小的裝置上選擇過長的列表或同時選擇多個列表,以防止 " -#~ "OOM 異常!" - -#~ msgid "" -#~ "Create compressed blocklist backups, they will be used in case of " -#~ "download errors or during startup in manual mode." -#~ msgstr "建立壓縮的 blocklist 備份,它們將在下載錯誤或手動模式下啟動時使用。" - -#~ msgid "" -#~ "Enable memory intense overall sort / duplicate removal on low memory " -#~ "devices (< 64 MB RAM)" -#~ msgstr "" -#~ "在低記憶體裝置上啟用耗用記憶體的整體排序/重複規則刪除(<64 MB RAM)" - -#~ msgid "" -#~ "For further information <a href=\"%s\" target=\"_blank\">see online " -#~ "documentation</a>" -#~ msgstr "有關更多資訊,請<a href=\"%s\" target=\"_blank\">參閱線上文件</a>" - -#~ msgid "" -#~ "In OPKG use the '--force-maintainer' option to overwrite the pre-existing " -#~ "config file or download a fresh default config from <a href=\"%s\" target=" -#~ "\"_blank\">here</a>" -#~ msgstr "" -#~ "在 OPKG 中,使用“--force-maintainer”選項覆蓋預先存在的配置檔案,或從<a " -#~ "href=\"%s\" target=\"_blank\">此處</a>下載新的預設配置" - -#~ msgid "" -#~ "List of available network interfaces. By default the startup will be " -#~ "triggered by the 'wan' interface.<br />" -#~ msgstr "可用網路介面列表。預設情況下,將由“wan”介面觸發啟動。<br />" - -#~ msgid "Manual / Backup mode" -#~ msgstr "手動/備份模式" - -#~ msgid "Overall Blocked Domains" -#~ msgstr "整體封鎖域名" - -#~ msgid "Please update your adblock config file to use this package." -#~ msgstr "請更新您的 adblock 配置檔案以使用此軟體包。" - -#~ msgid "" -#~ "Target directory for adblock backups. Please use only non-volatile disks, " -#~ "no ram/tmpfs drives." -#~ msgstr "" -#~ "adblock 備份的目標目錄。請僅使用非易失性磁碟,不使用 ram/tmpfs 驅動器。" - -#~ msgid "DNS backend" -#~ msgstr "DNS 後端" - -#~ msgid "Enable verbose debug logging" -#~ msgstr "啟用詳細除錯輸出" - -#~ msgid "Resume adblock" -#~ msgstr "恢復 Adblock" - -#~ msgid "Status" -#~ msgstr "狀態" - -#~ msgid "Suspend adblock" -#~ msgstr "暫停 Adblock" - -#~ msgid "active" -#~ msgstr "已啟用" - -#~ msgid "no domains blocked" -#~ msgstr "沒有被攔截的域名" - -#~ msgid "suspended" -#~ msgstr "已暫停" - -#~ msgid "." -#~ msgstr "." - -#~ msgid "For further information" -#~ msgstr "更多資訊" - -#~ msgid "see online documentation" -#~ msgstr "檢視線上文件" - -#~ msgid "Backup options" -#~ msgstr "備份選項" - -#~ msgid "" -#~ "). Note that list URLs and Shallalist category selections are not " -#~ "configurable via Luci." -#~ msgstr ")。需要注意的是列表URL和列表類別選項無法通過Luci設定。" - -#~ msgid "Available blocklist sources (" -#~ msgstr "可用攔截列表來源(" - -#~ msgid "" -#~ "File with whitelisted hosts/domains that are allowed despite being on a " -#~ "blocklist." -#~ msgstr "允許的主機/域名列表" - -#~ msgid "Global options" -#~ msgstr "全域性選項" - -#~ msgid "Whitelist file" -#~ msgstr "白名單檔案" - -#~ msgid "see list details" -#~ msgstr "檢視列表詳情" - -#~ msgid "Count" -#~ msgstr "數量" - -#~ msgid "IPv4 blackhole ip address" -#~ msgstr "IPv4禁止列表" - -#~ msgid "IPv6 blackhole ip address" -#~ msgstr "IPv6禁止列表" - -#~ msgid "List date/state" -#~ msgstr "列表日期/狀態" - -#~ msgid "Name of the logical lan interface" -#~ msgstr "LAN介面名稱" - -#~ msgid "Port of the adblock uhttpd instance" -#~ msgstr "Adblock uhttpd埠" - -#~ msgid "Redirect all DNS queries to the local resolver" -#~ msgstr "將所有DNS查詢都重定向到本地解析器" - -#~ msgid "Timeout for blocklist fetch (seconds)" -#~ msgstr "列表查詢超時時間(秒)" - -#~ msgid "Total count of blocked domains" -#~ msgstr "阻止域名總數" - -#~ msgid "" -#~ "When adblock is active, all DNS queries are redirected to the local " -#~ "resolver in this server by default. You can disable that to allow queries " -#~ "to external DNS servers." -#~ msgstr "" -#~ "當Adblock處於活動狀態時,預設情況下會將所有的DNS查詢重定向到此伺服器的本地" -#~ "解析器。您可以禁用以允許查詢外部DNS伺服器。" diff --git a/applications/luci-app-advanced-reboot/Makefile b/applications/luci-app-advanced-reboot/Makefile index bb545a2049..d270498308 100644 --- a/applications/luci-app-advanced-reboot/Makefile +++ b/applications/luci-app-advanced-reboot/Makefile @@ -13,7 +13,7 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot LUCI_DEPENDS:=+luci LUCI_PKGARCH:=all -PKG_RELEASE:=26 +PKG_RELEASE:=27 include ../../luci.mk diff --git a/applications/luci-app-advanced-reboot/README.md b/applications/luci-app-advanced-reboot/README.md index a938479d98..d4659c8dc7 100644 --- a/applications/luci-app-advanced-reboot/README.md +++ b/applications/luci-app-advanced-reboot/README.md @@ -19,7 +19,7 @@ Currently supported dual-partition devices include: If you're interested in having your device supported, please post in [LEDE Project Forum Support Thread](https://forum.lede-project.org/t/web-ui-to-reboot-to-another-partition-dual-partition-routers/3423). ## Screenshot (luci-app-advanced-reboot) -![screenshot](https://raw.githubusercontent.com/stangri/screenshots/master/luci-app-advanced-reboot/screenshot01.png "screenshot") +![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/luci-app-advanced-reboot/screenshot01.png "screenshot") ## How to install Install ```luci-app-advanced-reboot``` from Web UI or connect to your router via ssh and run the following commands: diff --git a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua index 0f512df63c..b5dd4fe0f4 100644 --- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua +++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua @@ -8,19 +8,20 @@ devices = { {"Linksys EA3500", "linksys-audi", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, {"Linksys E4200v2/EA4500", "linksys-viper", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, {"Linksys EA8500", "ea8500", "mtd13", "mtd15", 32, "boot_part", 1, 2}, - {"Linksys WRT1200AC", "armada-385-linksys-caiman", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900AC", "armada-xp-linksys-mamba", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900ACv2", "armada-385-linksys-cobra", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900ACS", "armada-385-linksys-shelby", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT3200ACM", "armada-385-linksys-rango", "mtd5", "mtd7", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, +-- {"Linksys EA9500", "linksys,panamera", "mtd3", "mtd6", 28, "boot_part", 1, 2}, + {"Linksys WRT1200AC", "linksys-caiman", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900AC", "linksys-mamba", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900ACv2", "linksys-cobra", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900ACS", "linksys-shelby", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT3200ACM", "linksys-rango", "mtd5", "mtd7", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, {"ZyXEL NBG6817","nbg6817","mmcblk0p4","mmcblk0p7",32,nil,255,1} } errorMessage = "" device_board_name = luci.util.trim(luci.sys.exec("cat /tmp/sysinfo/board_name")) for i=1, #devices do - table_board_name = devices[i][2]:gsub('-','') - if device_board_name and device_board_name:gsub('-',''):match(table_board_name) then + table_board_name = devices[i][2]:gsub('%p','') + if device_board_name and device_board_name:gsub('%p',''):match(table_board_name) then device_name = devices[i][1] partition_one_mtd = devices[i][3] or nil partition_two_mtd = devices[i][4] or nil @@ -80,15 +81,17 @@ function index() end function action_reboot() + local uci = require "luci.model.uci".cursor() luci.template.render("admin_system/applyreboot", { title = luci.i18n.translate("Rebooting..."), msg = luci.i18n.translate("The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."), - addr = luci.ip.new(uci.cursor():get("network", "lan", "ipaddr")) or "192.168.1.1" + addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" }) luci.sys.reboot() end function action_altreboot() + local uci = require "luci.model.uci".cursor() local zyxelFlagPartition, zyxelBootFlag, zyxelNewBootFlag, errorCode, curEnvSetting, newEnvSetting errorMessage = "" errorCode = 0 @@ -162,7 +165,7 @@ function action_altreboot() luci.template.render("admin_system/applyreboot", { title = luci.i18n.translate("Rebooting..."), msg = luci.i18n.translate("The system is rebooting to an alternative partition now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."), - addr = luci.ip.new(uci.cursor():get("network", "lan", "ipaddr")) or "192.168.1.1" + addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" }) luci.sys.reboot() else @@ -179,6 +182,7 @@ function action_altreboot() end function action_poweroff() + local uci = require "luci.model.uci".cursor() if luci.http.formvalue("cancel") then luci.http.redirect(luci.dispatcher.build_url('admin/system/advanced_reboot')) return @@ -194,7 +198,7 @@ function action_poweroff() luci.template.render("admin_system/applyreboot", { title = luci.i18n.translate("Shutting down..."), msg = luci.i18n.translate("The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It might be necessary to renew the address of your computer to reach the device again, depending on your settings."), - addr = luci.ip.new(uci.cursor():get("network", "lan", "ipaddr")) or "192.168.1.1" + addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" }) luci.sys.call("/sbin/poweroff") end diff --git a/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po b/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po index be9d2d782f..75d463677b 100644 --- a/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po +++ b/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po @@ -12,8 +12,6 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Language: ru\n" -"Project-Info: Это технический перевод, не дословный. Главное-удобный русский " -"интерфейс, все проверялось в графическом режиме, совместим с другими apps\n" msgid "Action" msgstr "Действие" @@ -162,4 +160,4 @@ msgid "Warning: This system does not support powering off!" msgstr "Внимание: Эта система не поддерживает отключение питания!" msgid "to" -msgstr "к" +msgstr "" diff --git a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js index 604074ad37..60f586ded4 100644 --- a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js +++ b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js @@ -373,7 +373,7 @@ function server_request(request_dict, path, callback) { error_box("No firmware created due to image size. Try again with less packages selected.") } else if (request.status === 422) { - var package_missing = response.getResponseHeader("X-Unknown-Package"); + var package_missing = request.getResponseHeader("X-Unknown-Package"); error_box("Unknown package in request: <b>" + package_missing + "</b>") } else if (request.status === 500) { request_json = JSON.parse(request_text) diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm index f094e186d4..3b361558ee 100644 --- a/applications/luci-app-commands/luasrc/view/commands.htm +++ b/applications/luci-app-commands/luasrc/view/commands.htm @@ -136,7 +136,7 @@ uci:foreach("luci", "command", function(s) commands[#commands+1] = s end) %> -<form method="get" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>"> +<form method="get" action="<%=pcdata(FULL_REQUEST_URI)%>"> <div class="cbi-map"> <h2 name="content"><%:Custom Commands%></h2> diff --git a/applications/luci-app-cshark/luasrc/controller/cshark.lua b/applications/luci-app-cshark/luasrc/controller/cshark.lua index 4d9bbba290..43410a0045 100644 --- a/applications/luci-app-cshark/luasrc/controller/cshark.lua +++ b/applications/luci-app-cshark/luasrc/controller/cshark.lua @@ -53,7 +53,13 @@ function cshark_iface_dump_start(ifname, value, flag, filter) luci.http.prepare_content("text/plain") - local res = os.execute("(/sbin/cshark -i " .. ifname .. " -" .. flag .. " " .. value .. " -p /tmp/cshark-luci.pid " .. filter .. " > /tmp/cshark-luci.out 2>&1) &") + local res = os.execute("(/sbin/cshark -i %s -%s %s -p /tmp/cshark-luci.pid %s > /tmp/cshark-luci.out 2>&1) &" %{ + luci.util.shellquote(ifname), + luci.util.shellquote(flag), + luci.util.shellquote(value), + luci.util.shellquote(filter) + }) + luci.http.write(tostring(res)) end diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index 50365e5215..06dbefbcfd 100644 --- a/applications/luci-app-ddns/Makefile +++ b/applications/luci-app-ddns/Makefile @@ -16,7 +16,7 @@ PKG_VERSION:=2.4.9 # Release == build # increase on changes of translation files -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com> diff --git a/applications/luci-app-ddns/luasrc/controller/ddns.lua b/applications/luci-app-ddns/luasrc/controller/ddns.lua index 3d31e4e0b6..5f4a5118c3 100755 --- a/applications/luci-app-ddns/luasrc/controller/ddns.lua +++ b/applications/luci-app-ddns/luasrc/controller/ddns.lua @@ -301,7 +301,7 @@ function startstop(section, enabled) uci:unload("ddns") -- start ddns-updater for section - local command = luci_helper .. [[ -S ]] .. section .. [[ -- start]] + local command = "%s -S %s -- start" %{ luci_helper, UTIL.shellquote(section) } os.execute(command) NX.nanosleep(3) -- 3 seconds "show time" 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 a8f4cbf7ad..977dbe34b1 100644 --- a/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua +++ b/applications/luci-app-ddns/luasrc/model/cbi/ddns/detail.lua @@ -1229,7 +1229,7 @@ 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 = CRTL.luci_helper .. [[ -]] + local command = CTRL.luci_helper .. [[ -]] if (ipv6 == 1) then command = command .. [[6]] end if (force == 1) then command = command .. [[f]] end command = command .. [[p ]] .. value .. [[ -- verify_proxy]] diff --git a/applications/luci-app-dnscrypt-proxy/Makefile b/applications/luci-app-dnscrypt-proxy/Makefile index 4b632b8d04..d34fec87d7 100644 --- a/applications/luci-app-dnscrypt-proxy/Makefile +++ b/applications/luci-app-dnscrypt-proxy/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for DNSCrypt-Proxy -LUCI_DEPENDS:=+uclient-fetch +dnscrypt-proxy +LUCI_DEPENDS:=+uclient-fetch +dnscrypt-proxy +luci-lib-httpprotoutils LUCI_PKGARCH:=all include ../../luci.mk diff --git a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua index 9f6472e7de..ca078f0cd3 100644 --- a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua +++ b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua @@ -15,9 +15,9 @@ function index() entry({"admin", "services", "dnscrypt-proxy", "tab_from_cbi"}, cbi("dnscrypt-proxy/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "dnscrypt-proxy", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true entry({"admin", "services", "dnscrypt-proxy", "advanced"}, firstchild(), _("Advanced"), 100) - entry({"admin", "services", "dnscrypt-proxy", "advanced", "configuration"}, cbi("dnscrypt-proxy/configuration_tab"), _("Edit DNSCrypt-Proxy Configuration"), 110).leaf = true - entry({"admin", "services", "dnscrypt-proxy", "advanced", "cfg_dnsmasq"}, cbi("dnscrypt-proxy/cfg_dnsmasq_tab"), _("Edit Dnsmasq Configuration"), 120).leaf = true - entry({"admin", "services", "dnscrypt-proxy", "advanced", "cfg_resolvcrypt"}, cbi("dnscrypt-proxy/cfg_resolvcrypt_tab"), _("Edit Resolvcrypt Configuration"), 130).leaf = true + entry({"admin", "services", "dnscrypt-proxy", "advanced", "configuration"}, form("dnscrypt-proxy/configuration_tab"), _("Edit DNSCrypt-Proxy Configuration"), 110).leaf = true + entry({"admin", "services", "dnscrypt-proxy", "advanced", "cfg_dnsmasq"}, form("dnscrypt-proxy/cfg_dnsmasq_tab"), _("Edit Dnsmasq Configuration"), 120).leaf = true + entry({"admin", "services", "dnscrypt-proxy", "advanced", "cfg_resolvcrypt"}, form("dnscrypt-proxy/cfg_resolvcrypt_tab"), _("Edit Resolvcrypt Configuration"), 130).leaf = true entry({"admin", "services", "dnscrypt-proxy", "advanced", "view_reslist"}, call("view_reslist"), _("View Resolver List"), 140).leaf = true end diff --git a/applications/luci-app-dnscrypt-proxy/luasrc/model/cbi/dnscrypt-proxy/overview_tab.lua b/applications/luci-app-dnscrypt-proxy/luasrc/model/cbi/dnscrypt-proxy/overview_tab.lua index 999c81dee7..8f0e3224b4 100644 --- a/applications/luci-app-dnscrypt-proxy/luasrc/model/cbi/dnscrypt-proxy/overview_tab.lua +++ b/applications/luci-app-dnscrypt-proxy/luasrc/model/cbi/dnscrypt-proxy/overview_tab.lua @@ -4,7 +4,6 @@ local fs = require("nixio.fs") local uci = require("luci.model.uci").cursor() local util = require("luci.util") -local date = require("luci.http.protocol.date") local res_input = "/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv" local res_dir = fs.dirname(res_input) local dump = util.ubus("network.interface", "dump", {}) @@ -12,6 +11,11 @@ local plug_cnt = tonumber(luci.sys.exec("env -i /usr/sbin/dnscrypt-proxy --vers local res_list = {} local url = "https://raw.githubusercontent.com/dyne/dnscrypt-proxy/master/dnscrypt-resolvers.csv" +local _, date = pcall(require, "luci.http.date") +if not date then + _, date = pcall(require, "luci.http.protocol.date") +end + if not fs.access(res_input) then if not fs.access("/lib/libustream-ssl.so") then m = SimpleForm("error", nil, translate("No default resolver list and no SSL support available.<br />") diff --git a/applications/luci-app-dnscrypt-proxy/po/ja/dnscrypt-proxy.po b/applications/luci-app-dnscrypt-proxy/po/ja/dnscrypt-proxy.po index 3a081a352e..e35efa871b 100644 --- a/applications/luci-app-dnscrypt-proxy/po/ja/dnscrypt-proxy.po +++ b/applications/luci-app-dnscrypt-proxy/po/ja/dnscrypt-proxy.po @@ -7,7 +7,7 @@ msgstr "" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.4\n" +"X-Generator: Poedit 2.0.7\n" "Last-Translator: INAGAKI Hiroshi <musashino.open@gmail.com>\n" "Plural-Forms: nplurals=1; plural=0;\n" "Language: ja\n" @@ -79,6 +79,8 @@ msgstr "Dnsmasq オプション" msgid "" "Download the current resolver list from 'github.com/dyne/dnscrypt-proxy'." msgstr "" +"現在のリゾルバ リストを 'github.com/dyne/dnscrypt-proxy' からダウンロードしま" +"す。" msgid "Edit DNSCrypt-Proxy Configuration" msgstr "DNSCrypt-Proxy 設定の編集" @@ -164,6 +166,8 @@ msgid "" "Please install a 'libustream-ssl' library to download the current resolver " "list from 'github.com/dyne/dnscrypt-proxy'." msgstr "" +"現在のリゾルバ リストを 'github.com/dyne/dnscrypt-proxy' からダウンロードする" +"ために、 'libustream-ssl' ライブラリをインストールしてください。" msgid "" "Please install a resolver list to '/usr/share/dnscrypt-proxy/dnscrypt-" @@ -275,14 +279,3 @@ msgstr "ログファイルの確認" msgid "View Resolver List" msgstr "リゾルバ リストの確認" - -#~ msgid "Download the current resolver list from 'download.dnscrypt.org'." -#~ msgstr "" -#~ "現在のリゾルバ リストを 'download.dnscrypt.org' からダウンロードします。" - -#~ msgid "" -#~ "Please install a 'libustream-ssl' library to download the current " -#~ "resolver list from 'download.dnscrypt.org'." -#~ msgstr "" -#~ "現在のリゾルバ リストを 'download.dnscrypt.org' からダウンロードするため" -#~ "に、 'libustream-ssl' ライブラリをインストールしてください。" diff --git a/applications/luci-app-firewall/luasrc/controller/firewall.lua b/applications/luci-app-firewall/luasrc/controller/firewall.lua index 5a6ab0ad31..4fe7770efc 100644 --- a/applications/luci-app-firewall/luasrc/controller/firewall.lua +++ b/applications/luci-app-firewall/luasrc/controller/firewall.lua @@ -18,6 +18,6 @@ function index() _("Traffic Rules"), 30).leaf = true entry({"admin", "network", "firewall", "custom"}, - cbi("firewall/custom"), + form("firewall/custom"), _("Custom Rules"), 40).leaf = true end diff --git a/applications/luci-app-freifunk-diagnostics/luasrc/controller/freifunk/diag.lua b/applications/luci-app-freifunk-diagnostics/luasrc/controller/freifunk/diag.lua index 7bb47612b6..92b3afc80d 100644 --- a/applications/luci-app-freifunk-diagnostics/luasrc/controller/freifunk/diag.lua +++ b/applications/luci-app-freifunk-diagnostics/luasrc/controller/freifunk/diag.lua @@ -33,7 +33,7 @@ function diag_command(cmd, addr) if addr and addr:match("^[a-zA-Z0-9%-%.:_]+$") then luci.http.prepare_content("text/plain") - local util = io.popen(cmd % addr) + local util = io.popen(cmd % luci.util.shellquote(addr)) if util then while true do local ln = util:read("*l") @@ -52,21 +52,21 @@ function diag_command(cmd, addr) end function diag_ping(addr) - diag_command("ping -c 5 -W 1 %q 2>&1", addr) + diag_command("ping -c 5 -W 1 %s 2>&1", addr) end function diag_traceroute(addr) - diag_command("traceroute -q 1 -w 1 -n %q 2>&1", addr) + diag_command("traceroute -q 1 -w 1 -n %s 2>&1", addr) end function diag_nslookup(addr) - diag_command("nslookup %q 2>&1", addr) + diag_command("nslookup %s 2>&1", addr) end function diag_ping6(addr) - diag_command("ping6 -c 5 %q 2>&1", addr) + diag_command("ping6 -c 5 %s 2>&1", addr) end function diag_traceroute6(addr) - diag_command("traceroute6 -q 1 -w 2 -n %q 2>&1", addr) + diag_command("traceroute6 -q 1 -w 2 -n %s 2>&1", addr) end diff --git a/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm b/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm index fe205d053b..eac1ecdcf5 100644 --- a/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm +++ b/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm @@ -53,7 +53,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6") } //]]></script> -<form method="post" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>"> +<form method="post" action="<%=pcdata(FULL_REQUEST_URI)%>"> <div class="cbi-map"> <h2 name="content"><%:Diagnostics%></h2> diff --git a/applications/luci-app-lxc/Makefile b/applications/luci-app-lxc/Makefile index 9f313dfb11..85cae5c405 100644 --- a/applications/luci-app-lxc/Makefile +++ b/applications/luci-app-lxc/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LXC management Web UI -LUCI_DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc +getopt +xz +LUCI_DEPENDS:=+luci-mod-admin-full +lxc +lxc-attach +lxc-console +lxc-create +liblxc +rpcd-mod-lxc +getopt LUCI_PKGARCH:=all PKG_MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr> diff --git a/applications/luci-app-lxc/luasrc/controller/lxc.lua b/applications/luci-app-lxc/luasrc/controller/lxc.lua index ea7adbafbb..cc490f0b81 100644 --- a/applications/luci-app-lxc/luasrc/controller/lxc.lua +++ b/applications/luci-app-lxc/luasrc/controller/lxc.lua @@ -14,14 +14,11 @@ Author: Petar Koretic <petar.koretic@sartura.hr> ]]-- -module("luci.controller.lxc", package.seeall) - -require "ubus" -local conn = ubus.connect() -if not conn then - error("Failed to connect to ubus") -end +local uci = require "luci.model.uci" +local util = require "luci.util" +local nixio = require "nixio" +module("luci.controller.lxc", package.seeall) function fork_exec(command) local pid = nixio.fork() @@ -71,55 +68,52 @@ function index() end function lxc_get_downloadable() - luci.http.prepare_content("application/json") - - local f = io.popen('uname -m', 'r') - local target = f:read('*a') - f:close() - target = target:gsub("^%s*(.-)%s*$", "%1") - + local target = lxc_get_arch_target() local templates = {} - local f = io.popen('lxc-create -n just_want_to_list_available_lxc_templates -t download -- --list', 'r') + local f = io.popen('sh /usr/share/lxc/templates/lxc-download --list --no-validate --server %s' + % util.shellquote(uci.cursor():get("lxc", "lxc", "url")), 'r') + local line for line in f:lines() do - local dist,version = line:match("^(%S+)%s+(%S+)%s+" .. target .. "%s+default%s+%S+$") - if dist~=nil and version~=nil then templates[#templates + 1] = dist .. ":" .. version end + local dist, version, dist_target = line:match("^(%S+)%s+(%S+)%s+(%S+)%s+default%s+%S+$") + if dist and version and dist_target == target then + templates[#templates+1] = "%s:%s" %{ dist, version } + end end f:close() + + luci.http.prepare_content("application/json") luci.http.write_json(templates) end function lxc_create(lxc_name, lxc_template) luci.http.prepare_content("text/plain") - local uci = require("uci").cursor() - - local url = uci:get("lxc", "lxc", "url") - if not pcall(dofile, "/etc/openwrt_release") then return luci.http.write("1") end - local f = io.popen('uname -m', 'r') - local target = f:read('*a') - f:close() - target = target:gsub("^%s*(.-)%s*$", "%1") - - local lxc_dist = lxc_template:gsub("(.*):(.*)", '%1') - local lxc_release = lxc_template:gsub("(.*):(.*)", '%2') - - local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url, "--no-validate", "--dist", lxc_dist, "--release", lxc_release, "--arch", target } } ) - - luci.http.write(data) + local lxc_dist, lxc_release = lxc_template:match("^(.+):(.+)$") + + luci.http.write(util.ubus("lxc", "create", { + name = lxc_name, + template = "download", + args = { + "--server", uci.cursor():get("lxc", "lxc", "url"), + "--no-validate", + "--dist", lxc_dist, + "--release", lxc_release, + "--arch", lxc_get_arch_target() + } + })) end function lxc_action(lxc_action, lxc_name) - luci.http.prepare_content("application/json") - - local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} ) + local data, ec = util.ubus("lxc", lxc_action, lxc_name and { name = lxc_name } or {}) + luci.http.prepare_content("application/json") luci.http.write_json(ec and {} or data) end @@ -165,3 +159,22 @@ function lxc_configuration_set(lxc_name) luci.http.write("0") end +function lxc_get_arch_target() + local target = nixio.uname().machine + local target_map = { + armv5 = "armel", + armv6 = "armel", + armv7 = "armhf", + armv8 = "arm64", + x86_64 = "amd64" + } + + local k, v + for k, v in pairs(target_map) do + if target:find(k) then + return v + end + end + + return target +end diff --git a/applications/luci-app-lxc/root/etc/config/lxc b/applications/luci-app-lxc/root/etc/config/lxc index 5572c735fa..3b35951e1b 100644 --- a/applications/luci-app-lxc/root/etc/config/lxc +++ b/applications/luci-app-lxc/root/etc/config/lxc @@ -1,6 +1,3 @@ -# -# lxc uci configuration -# config lxc 'lxc' - option url 'virtualwrt.org/containers/' + option url 'images.linuxcontainers.org' diff --git a/applications/luci-app-mwan3/Makefile b/applications/luci-app-mwan3/Makefile index d65cd3af16..c719cb134c 100644 --- a/applications/luci-app-mwan3/Makefile +++ b/applications/luci-app-mwan3/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for the MWAN3 multiwan hotplug script -LUCI_DEPENDS:=+mwan3 +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio +LUCI_DEPENDS:=+mwan3 +libuci-lua +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio LUCI_PKGARCH:=all PKG_LICENSE:=GPLv2 diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index 64ee9f548c..d5fc4a3ede 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -56,7 +56,7 @@ function index() arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")), _("Rules"), 40).leaf = true entry({"admin", "network", "mwan", "notify"}, - cbi("mwan/notify"), + form("mwan/notify"), _("Notification"), 50).leaf = true end @@ -85,7 +85,8 @@ function diagnosticsData(interface, task) function getInterfaceNumber(interface) local number = 0 local interfaceNumber - uci.cursor():foreach("mwan3", "interface", + local uci = require "luci.model.uci".cursor() + uci:foreach("mwan3", "interface", function (section) number = number+1 if section[".name"] == interface then @@ -98,7 +99,7 @@ function diagnosticsData(interface, task) function diag_command(cmd, addr) if addr and addr:match("^[a-zA-Z0-9%-%.:_]+$") then - local util = io.popen(cmd % addr) + local util = io.popen(cmd % ut.shellquote(addr)) if util then while true do local ln = util:read("*l") @@ -130,7 +131,7 @@ function diagnosticsData(interface, task) local results = "" local number = getInterfaceNumber(interface) - local uci = uci.cursor(nil, "/var/state") + local uci = require "luci.model.uci".cursor(nil, "/var/state") local device = uci:get("network", interface, "ifname") luci.http.prepare_content("text/plain") @@ -138,7 +139,7 @@ function diagnosticsData(interface, task) if task == "ping_gateway" then local gateway = get_gateway(interface) if gateway ~= nil then - diag_command("ping -c 5 -W 1 %q 2>&1", gateway) + diag_command("ping -c 5 -W 1 %s 2>&1", gateway) else luci.http.prepare_content("text/plain") luci.http.write(string.format("No gateway for interface %s found.", interface)) @@ -147,7 +148,7 @@ function diagnosticsData(interface, task) local trackips = uci:get("mwan3", interface, "track_ip") if #trackips > 0 then for i in pairs(trackips) do - diag_command("ping -c 5 -W 1 %q 2>&1", trackips[i]) + diag_command("ping -c 5 -W 1 %s 2>&1", trackips[i]) end else luci.http.write(string.format("No tracking Hosts for interface %s defined.", interface)) @@ -185,10 +186,10 @@ function diagnosticsData(interface, task) luci.http.write(string.format("Routing table %s for interface %s not found", number, interface)) end elseif task == "hotplug_ifup" then - os.execute(string.format("/usr/sbin/mwan3 ifup %s", interface)) + os.execute(string.format("/usr/sbin/mwan3 ifup %s", ut.shellquote(interface))) luci.http.write(string.format("Hotplug ifup sent to interface %s", interface)) elseif task == "hotplug_ifdown" then - os.execute(string.format("/usr/sbin/mwan3 ifdown %s", interface)) + os.execute(string.format("/usr/sbin/mwan3 ifdown %s", ut.shellquote(interface))) luci.http.write(string.format("Hotplug ifdown sent to interface %s", interface)) else luci.http.write("Unknown task") diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua index 4b1a070d1b..162b388d17 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua @@ -3,42 +3,43 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" -function interfaceWarnings(overview, count) +function interfaceWarnings(overview, count, iface_max) local warnings = "" - if count <= 250 then - warnings = string.format("<strong>%s</strong></br>", - translatef("There are currently %d of 250 supported interfaces configured", count) + if count <= iface_max then + warnings = string.format("<strong>%s</strong><br />", + translatef("There are currently %d of %d supported interfaces configured", count, iface_max) ) else - warnings = string.format("<strong>%s</strong></br>", - translatef("WARNING: %d interfaces are configured exceeding the maximum of 250!", count) + warnings = string.format("<strong>%s</strong><br />", + translatef("WARNING: %d interfaces are configured exceeding the maximum of %d!", count, iface_max) ) end for i, k in pairs(overview) do if overview[i]["network"] == false then - warnings = warnings .. string.format("<strong>%s</strong></br>", + warnings = warnings .. string.format("<strong>%s</strong><br />", translatef("WARNING: Interface %s are not found in /etc/config/network", i) ) end if overview[i]["default_route"] == false then - warnings = warnings .. string.format("<strong>%s</strong></br>", + warnings = warnings .. string.format("<strong>%s</strong><br />", translatef("WARNING: Interface %s has no default route in the main routing table", i) ) end if overview[i]["reliability"] == false then - warnings = warnings .. string.format("<strong>%s</strong></br>", + warnings = warnings .. string.format("<strong>%s</strong><br />", translatef("WARNING: Interface %s has a higher reliability " .. "requirement than tracking hosts (%d)", i, overview[i]["tracking"]) ) end if overview[i]["duplicate_metric"] == true then - warnings = warnings .. string.format("<strong>%s</strong></br>", + warnings = warnings .. string.format("<strong>%s</strong><br />", translatef("WARNING: Interface %s has a duplicate metric %s configured", i, overview[i]["metric"]) ) end @@ -103,16 +104,43 @@ function configCheck() end end ) - return overview, count + + -- calculate iface_max usage from firewall mmx_mask + function bit(p) + return 2 ^ (p - 1) + end + function hasbit(x, p) + return x % (p + p) >= p + end + function setbit(x, p) + return hasbit(x, p) and x or x + p + end + + local uci = require("uci").cursor(nil, "/var/state") + local mmx_mask = uci:get("mwan3", "globals", "mmx_mask") or "0x3F00" + local number = tonumber(mmx_mask, 16) + local bits = 0 + local iface_max = 0 + for i=1,16 do + if hasbit(number, bit(i)) then + bits = bits + 1 + iface_max = setbit( iface_max, bit(bits)) + end + end + + -- subtract blackhole, unreachable and default table from iface_max + iface_max = iface_max - 3 + + return overview, count, iface_max end m5 = Map("mwan3", translate("MWAN - Interfaces"), interfaceWarnings(configCheck())) mwan_interface = m5:section(TypedSection, "interface", nil, - translate("MWAN supports up to 250 physical and/or logical interfaces<br />" .. + translate("MWAN supports up to 252 physical and/or logical interfaces<br />" .. "MWAN requires that all interfaces have a unique metric configured in /etc/config/network<br />" .. - "Names must match the interface name found in /etc/config/network (see advanced tab)<br />" .. + "Names must match the interface name found in /etc/config/network<br />" .. "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. "Interfaces may not share the same name as configured members, policies or rules")) mwan_interface.addremove = true @@ -142,7 +170,7 @@ track_method.rawhtml = true function track_method.cfgvalue(self, s) local tracked = self.map:get(s, "track_ip") if tracked then - return self.map:get(s, "track_method") or "—" + return self.map:get(s, "track_method") or "ping" else return "—" end @@ -153,7 +181,7 @@ reliability.rawhtml = true function reliability.cfgvalue(self, s) local tracked = self.map:get(s, "track_ip") if tracked then - return self.map:get(s, "reliability") or "—" + return self.map:get(s, "reliability") or "1" else return "—" end @@ -168,7 +196,7 @@ function interval.cfgvalue(self, s) if intervalValue then return intervalValue .. "s" else - return "—" + return "5s" end else return "—" @@ -180,7 +208,7 @@ down.rawhtml = true function down.cfgvalue(self, s) local tracked = self.map:get(s, "track_ip") if tracked then - return self.map:get(s, "down") or "—" + return self.map:get(s, "down") or "3" else return "—" end @@ -191,7 +219,7 @@ up.rawhtml = true function up.cfgvalue(self, s) local tracked = self.map:get(s, "track_ip") if tracked then - return self.map:get(s, "up") or "—" + return self.map:get(s, "up") or "3" else return "—" end diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua index 3a896d3bcf..a439502671 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua @@ -171,7 +171,7 @@ metric = mwan_interface:option(DummyValue, "metric", translate("Metric"), translate("This displays the metric assigned to this interface in /etc/config/network")) metric.rawhtml = true function metric.cfgvalue(self, s) - local uci = uci.cursor(nil, "/var/state") + local uci = require "luci.model.uci".cursor(nil, "/var/state") local metric = uci:get("network", arg[1], "metric") if metric then return metric diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua index 6f87a3d750..4c6e21003e 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua @@ -23,7 +23,11 @@ f = m5:section(SimpleSection, nil, "<br />" .. "There are three main environment variables that are passed to this script.<br />" .. "<br />" .. - "$ACTION Either \"ifup\" or \"ifdown\"<br />" .. + "$ACTION <br />" .. + "* \"ifup\" Is called by netifd and mwan3track <br />" .. + "* \"ifdown\" Is called by netifd and mwan3track <br />" .. + "* \"connected\" Is only called by mwan3track if tracking was successful <br />" .. + "* \"disconnected\" Is only called by mwan3track if tracking has failed <br />" .. "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" .. "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" .. "<br />")) diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua index 7f12782069..4543260f6f 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" function policyCheck() @@ -24,8 +25,8 @@ function policyError(policy_error) local warnings = "" for i, k in pairs(policy_error) do if policy_error[i] == true then - warnings = warnings .. string.format("<strong>%s</strong></br>", - translatef("WARNING: Policie %s has exceeding the maximum name of 15 characters", i) + warnings = warnings .. string.format("<strong>%s</strong><br />", + translatef("WARNING: Policy %s has exceeding the maximum name of 15 characters", i) ) end end @@ -38,9 +39,11 @@ m5 = Map("mwan3", translate("MWAN - Policies"), mwan_policy = m5:section(TypedSection, "policy", nil, translate("Policies are profiles grouping one or more members controlling how MWAN distributes traffic<br />" .. - "Member interfaces with lower metrics are used first. Interfaces with the same metric load-balance<br />" .. + "Member interfaces with lower metrics are used first<br />" .. + "Member interfaces with the same metric will be load-balanced<br />" .. "Load-balanced member interfaces distribute more traffic out those with higher weights<br />" .. - "Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be 15 characters or less<br />" .. + "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. + "Names must be 15 characters or less<br />" .. "Policies may not share the same name as configured interfaces, members or rules")) mwan_policy.addremove = true mwan_policy.dynamic = false diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua index cb2a99537b..f0b94bd0bb 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" function ruleCheck() @@ -28,7 +29,7 @@ function ruleWarn(rule_error) local warnings = "" for i, k in pairs(rule_error) do if rule_error[i] == true then - warnings = warnings .. string.format("<strong>%s</strong></br>", + warnings = warnings .. string.format("<strong>%s</strong><br />", translatef("WARNING: Rule %s have a port configured with no or improper protocol specified!", i) ) end diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm index 86b5ac696b..49d120c1ae 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm @@ -15,29 +15,35 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_ for ( var iface in status.interfaces) { var state = ''; + var css = '' switch (status.interfaces[iface].status) { case 'online': - state = '<%:Online (tracking active)%>'; - break; - case 'notMonitored': - state = '<%:Online (tracking off)%>'; + state = '<%:Online%>'; + css = 'success'; break; case 'offline': state = '<%:Offline%>'; + css = 'danger'; break; default: state = '<%:Disabled%>'; + css = 'warning'; break; } statusview += String.format( + '<div class="alert-message %s">', + css + ); + statusview += String.format( '<div><strong>Interface: </strong>%s</div>', iface ); statusview += String.format( - '<div><strong>Status: </strong>%s</div></br></br>', + '<div><strong>Status: </strong>%s</div>', state ); + statusview += '</div>' } statusDiv.innerHTML = statusview; } @@ -49,9 +55,21 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_ ); //]]></script> +<style type="text/css"> + #mwan_status_text > div { + display: inline-block; + margin: 1rem; + padding: 1rem; + width: 10rem; + float: left; + line-height: 125%; + } +</style> + <fieldset id="interface_field" class="cbi-section"> <legend><%:MWAN Interfaces%></legend> <div id="mwan_status_text"> - <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%> + <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> + <%:Collecting data...%> </div> </fieldset> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm index 70eac72520..bcc23beb31 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm @@ -18,9 +18,7 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null, function(x) { - var legend = document.getElementById('diag-rc-legend'); var output = document.getElementById('diag-rc-output'); - legend.style.display = 'none'; output.innerHTML = String.format('<pre>%h</pre>', x.responseText); } ); @@ -32,9 +30,9 @@ <div><strong><%:INFO: MWAN not running%></strong></div> <%end%> <fieldset class="cbi-section"> - <legend id="diag-rc-legend"><%:Collecting data...%></legend> <span id="diag-rc-output"> <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" /> + <%:Collecting data...%> </span> </fieldset> </div> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm index f1c5d8fd98..22f4734ddd 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm @@ -31,7 +31,6 @@ function update_status(iface, task) { - var legend = document.getElementById('diag-rc-legend'); var output = document.getElementById('diag-rc-output'); output.innerHTML = @@ -45,7 +44,6 @@ stxhr.post('<%=url('admin/status/mwan')%>/diagnostics_display' + '/' + iface + '/' + task, { token: '<%=token%>' }, function(x) { - legend.style.display = 'none'; output.innerHTML = String.format('<pre>%h</pre>', x.responseText); } ); @@ -86,7 +84,6 @@ </fieldset> </div> <fieldset class="cbi-section" style="display:none"> - <legend id="diag-rc-legend"><%:Collecting data...%></legend> <span id="diag-rc-output"></span> </fieldset> </form> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm index cb476967f9..4518bd6588 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm @@ -15,6 +15,7 @@ <script type="text/javascript" src="<%=resource%>/cbi.js"></script> -<%+mwan/overview_status_interface%> - +<div class="cbi-map"> + <%+mwan/overview_status_interface%> +</div> <%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm index 77d009231e..f60e0da0aa 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm @@ -18,9 +18,7 @@ XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "troubleshooting_display")%>', null, function(x) { - var legend = document.getElementById('diag-rc-legend'); var output = document.getElementById('diag-rc-output'); - legend.style.display = 'none'; output.innerHTML = String.format('<pre>%h</pre>', x.responseText); } ); @@ -32,9 +30,9 @@ <div><strong><%:INFO: MWAN not running%></strong></div> <%end%> <fieldset class="cbi-section"> - <legend id="diag-rc-legend"><%:Collecting data...%></legend> <span id="diag-rc-output"> <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" /> + <%:Collecting data...%> </span> </fieldset> </div> diff --git a/applications/luci-app-mwan3/po/ja/mwan3.po b/applications/luci-app-mwan3/po/ja/mwan3.po index 4b3662a425..6ee351c4c2 100644 --- a/applications/luci-app-mwan3/po/ja/mwan3.po +++ b/applications/luci-app-mwan3/po/ja/mwan3.po @@ -103,6 +103,9 @@ msgstr "ホットプラグ ifdown" msgid "Hotplug ifup" msgstr "ホットプラグ ifup" +msgid "INFO: MWAN not running" +msgstr "" + msgid "IPset" msgstr "IPset" @@ -174,8 +177,8 @@ msgstr "" msgid "MWAN Interface Configuration - %s" msgstr "MWAN インターフェース設定 - %s" -msgid "MWAN Interface Live Status" -msgstr "MWAN インターフェース Live ステータス" +msgid "MWAN Interfaces" +msgstr "" msgid "MWAN Member Configuration - %s" msgstr "MWAN メンバー設定 - %s" @@ -195,24 +198,21 @@ msgstr "" msgid "MWAN Status - Troubleshooting" msgstr "" -msgid "MWAN status - Interface Live Status" -msgstr "" - msgid "" -"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"MWAN supports up to 252 physical and/or logical interfaces<br />MWAN " "requires that all interfaces have a unique metric configured in /etc/config/" "network<br />Names must match the interface name found in /etc/config/" -"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " -"_ and no spaces<br />Interfaces may not share the same name as configured " -"members, policies or rules" +"network<br />Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br /" +">Interfaces may not share the same name as configured members, policies or " +"rules" msgstr "" -"MWAN は、250個までの物理または論理、あるいは両方のインターフェースをサポート" +"MWAN は、252個までの物理または論理、あるいは両方のインターフェースをサポート" "します。<br />MWAN は、全てのインターフェースが /etc/config/network で設定さ" "れるユニークなメトリックを持つことを必要とします。<br />下記 \"インターフェー" "ス\" の名前は、 /etc/config/network に存在するインターフェース名と同じでなけ" -"ればなりません(詳細設定タブを確認)。<br />名前は A-Z, a-z, 0-9, _ を含むこ" -"とができますが、スペースは使用できません。<br />インターフェースには、設定済" -"みのメンバーやポリシー、ルールと同じ名前を使用することはできません。" +"ればなりません。<br />名前は A-Z, a-z, 0-9, _ を含むことができますが、スペー" +"スは使用できません。<br />インターフェースには、設定済みのメンバーやポリ" +"シー、ルールと同じ名前を使用することはできません。" msgid "" "May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " @@ -268,12 +268,6 @@ msgstr "オフライン" msgid "Online" msgstr "オンライン" -msgid "Online (tracking active)" -msgstr "オンライン(追跡実行中)" - -msgid "Online (tracking off)" -msgstr "オンライン(追跡オフ)" - msgid "Ping count" msgstr "Ping 回数" @@ -304,11 +298,11 @@ msgstr "ポリシー" msgid "" "Policies are profiles grouping one or more members controlling how MWAN " "distributes traffic<br />Member interfaces with lower metrics are used " -"first. Interfaces with the same metric load-balance<br />Load-balanced " -"member interfaces distribute more traffic out those with higher weights<br /" -">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " -"15 characters or less<br />Policies may not share the same name as " -"configured interfaces, members or rules" +"first<br />Member interfaces with the same metric will be load-balanced<br /" +">Load-balanced member interfaces distribute more traffic out those with " +"higher weights<br />Names may contain characters A-Z, a-z, 0-9, _ and no " +"spaces<br />Names must be 15 characters or less<br />Policies may not share " +"the same name as configured interfaces, members or rules" msgstr "" "ポリシーは、MWANがどのようにトラフィックの分配を行うかを制御する、1つ以上のメ" "ンバーをグループ化するプロファイルです。<br />最小のメトリックを持つメンバー " @@ -370,8 +364,8 @@ msgstr "CIDR 表記のサポート(例: \"192.168.100.0/24\")" msgid "Task" msgstr "" -msgid "There are currently %d of 250 supported interfaces configured" -msgstr "現在、250個中 %d 個のサポートされたインターフェースが設定済みです。" +msgid "There are currently %d of %d supported interfaces configured" +msgstr "現在、%d 個中 %d 個のサポートされたインターフェースが設定済みです。" msgid "" "This displays the metric assigned to this interface in /etc/config/network" @@ -395,21 +389,14 @@ msgid "" "will<br />be executed with each netifd hotplug interface event<br />on " "interfaces for which mwan3 is enabled.<br /><br />There are three main " "environment variables that are passed to this script.<br /><br />$ACTION " -"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " -"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " -"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" -msgstr "" -"このセクションでは、 \"/etc/mwan3.user\" の内容を変更することができます。" -"<br />このファイルは、 sysupgrade 時に保持されます。<br /><br />注意: <br />" -"このファイルは、シェルスクリプトとして解釈されます。<br />スクリプトの1行目" -"は、"#!bin/sh" である必要があります(クォーテーション不要)。<br /># " -"で始まる行はコメントであり、実行されません。<br />mwan3 のカスタム動作をここ" -"に入力してください。これらは、 mwan3 が有効なインターフェースの<br />netifd " -"ホットプラグ インターフェース イベント毎に実行されます。<br /><br />主に3つの" -"環境変数が利用可能です。<br /><br />$ACTION - \"ifup\" および \"ifdown\"<br /" -">$INTERFACE - Up または Down が行われたインターフェース名(例: \"wan\" や " -"\"wwan\")<br />$DEVICE - Up または Down が行われた物理デバイス名(例: " -"\"eth0\" や \"wwan0\")<br /><br />" +"<br />* \"ifup\" Is called by netifd and mwan3track <br />* \"ifdown\" Is " +"called by netifd and mwan3track <br />* \"connected\" Is only called by " +"mwan3track if tracking was successful <br />* \"disconnected\" Is only " +"called by mwan3track if tracking has failed <br />$INTERFACE Name of the " +"interface which went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE " +"Physical device name which interface went up or down (e.g. \"eth0\" or " +"\"wwan0\")<br /><br />" +msgstr "" msgid "Tracking hostname or IP address" msgstr "追跡ホスト名または IP アドレス" @@ -441,9 +428,9 @@ msgstr "" msgid "View the content of /etc/protocols for protocol description" msgstr "" -msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!" msgstr "" -"警告: %d 個のインターフェースが、最大個数の 250個 を超えて設定されています!" +"警告: %d 個のインターフェースが、最大個数の %d 個 を超えて設定されています!" msgid "WARNING: Interface %s are not found in /etc/config/network" msgstr "" @@ -459,7 +446,7 @@ msgstr "" msgid "WARNING: Interface %s has no default route in the main routing table" msgstr "" -msgid "WARNING: Policie %s has exceeding the maximum name of 15 characters" +msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters" msgstr "" msgid "" @@ -503,6 +490,41 @@ msgstr "never" msgid "unreachable (reject)" msgstr "unreachable (reject)" +#~ msgid "Online (tracking active)" +#~ msgstr "オンライン(追跡実行中)" + +#~ msgid "MWAN Interface Live Status" +#~ msgstr "MWAN インターフェース Live ステータス" + +#~ msgid "Online (tracking off)" +#~ msgstr "オンライン(追跡オフ)" + +#~ msgid "" +#~ "This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +#~ ">The file is also preserved during sysupgrade.<br /><br />Notes:<br /" +#~ ">This file is interpreted as a shell script.<br />The first line of the " +#~ "script must be "#!/bin/sh" without quotes.<br />Lines beginning " +#~ "with # are comments and are not executed.<br />Put your custom mwan3 " +#~ "action here, they will<br />be executed with each netifd hotplug " +#~ "interface event<br />on interfaces for which mwan3 is enabled.<br /><br /" +#~ ">There are three main environment variables that are passed to this " +#~ "script.<br /><br />$ACTION Either \"ifup\" or \"ifdown\"<br />$INTERFACE " +#~ "Name of the interface which went up or down (e.g. \"wan\" or \"wwan" +#~ "\")<br />$DEVICE Physical device name which interface went up or down (e." +#~ "g. \"eth0\" or \"wwan0\")<br /><br />" +#~ msgstr "" +#~ "このセクションでは、 \"/etc/mwan3.user\" の内容を変更することができます。" +#~ "<br />このファイルは、 sysupgrade 時に保持されます。<br /><br />注意: " +#~ "<br />このファイルは、シェルスクリプトとして解釈されます。<br />スクリプト" +#~ "の1行目は、"#!bin/sh" である必要があります(クォーテーション不" +#~ "要)。<br /># で始まる行はコメントであり、実行されません。<br />mwan3 のカ" +#~ "スタム動作をここに入力してください。これらは、 mwan3 が有効なインター" +#~ "フェースの<br />netifd ホットプラグ インターフェース イベント毎に実行され" +#~ "ます。<br /><br />主に3つの環境変数が利用可能です。<br /><br />$ACTION - " +#~ "\"ifup\" および \"ifdown\"<br />$INTERFACE - Up または Down が行われたイン" +#~ "ターフェース名(例: \"wan\" や \"wwan\")<br />$DEVICE - Up または Down が" +#~ "行われた物理デバイス名(例: \"eth0\" や \"wwan0\")<br /><br />" + #~ msgid "Currently Configured Interfaces" #~ msgstr "設定済みインターフェース" diff --git a/applications/luci-app-mwan3/po/ru/mwan3.po b/applications/luci-app-mwan3/po/ru/mwan3.po index 8d5742c7e8..11721ecc57 100644 --- a/applications/luci-app-mwan3/po/ru/mwan3.po +++ b/applications/luci-app-mwan3/po/ru/mwan3.po @@ -107,6 +107,9 @@ msgstr "Hotplug ifdown" msgid "Hotplug ifup" msgstr "Hotplug ifup" +msgid "INFO: MWAN not running" +msgstr "" + msgid "IPset" msgstr "IPset" @@ -177,8 +180,8 @@ msgstr "MWAN - Правила" msgid "MWAN Interface Configuration - %s" msgstr "Настройка интерфейсов MWAN - %s" -msgid "MWAN Interface Live Status" -msgstr "Состояние интерфейса MWAN в настоящее время" +msgid "MWAN Interfaces" +msgstr "" msgid "MWAN Member Configuration - %s" msgstr "MWAN настройка узлов - %s" @@ -198,24 +201,20 @@ msgstr "Состояние MWAN - Диагностика" msgid "MWAN Status - Troubleshooting" msgstr "Состояние MWAN - Устранение неполадок" -msgid "MWAN status - Interface Live Status" -msgstr "Состояние MWAN - Интерфейс в настоящее время" - msgid "" -"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"MWAN supports up to 252 physical and/or logical interfaces<br />MWAN " "requires that all interfaces have a unique metric configured in /etc/config/" "network<br />Names must match the interface name found in /etc/config/" -"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " -"_ and no spaces<br />Interfaces may not share the same name as configured " -"members, policies or rules" +"network<br />Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br /" +">Interfaces may not share the same name as configured members, policies or " +"rules" msgstr "" -"MWAN поддерживает до 250 физических и / или логических интерфейсов.<br /" +"MWAN поддерживает до 252 физических и / или логических интерфейсов.<br /" ">MWAN требует, чтобы все интерфейсы имели уникальную метрику, настроенную в " "config файле /etc/config/network.<br />Имена должны соответствовать имени " -"интерфейса, найденному в /etc/config/network (см. соответствующую страницу)." -"<br />Имена могут содержать символы A-Z, a-z, 0-9, _ и пробелы.<br /" -">Интерфейсы не могут иметь одинаковые имена с настроенными узлами, " -"политиками или правилами." +"интерфейса, найденному в /etc/config/network.<br />Имена могут содержать " +"символы A-Z, a-z, 0-9, _ и пробелы.<br />Интерфейсы не могут иметь " +"одинаковые имена с настроенными узлами, политиками или правилами." msgid "" "May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " @@ -270,12 +269,6 @@ msgstr "Отключен" msgid "Online" msgstr "Онлайн" -msgid "Online (tracking active)" -msgstr "Онлайн (отслеживание активно)" - -msgid "Online (tracking off)" -msgstr "Онлайн (отслеживание отключено)" - msgid "Ping count" msgstr "Кол-во пинг-запросов" @@ -306,11 +299,11 @@ msgstr "Политики" msgid "" "Policies are profiles grouping one or more members controlling how MWAN " "distributes traffic<br />Member interfaces with lower metrics are used " -"first. Interfaces with the same metric load-balance<br />Load-balanced " -"member interfaces distribute more traffic out those with higher weights<br /" -">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " -"15 characters or less<br />Policies may not share the same name as " -"configured interfaces, members or rules" +"first<br />Member interfaces with the same metric will be load-balanced<br /" +">Load-balanced member interfaces distribute more traffic out those with " +"higher weights<br />Names may contain characters A-Z, a-z, 0-9, _ and no " +"spaces<br />Names must be 15 characters or less<br />Policies may not share " +"the same name as configured interfaces, members or rules" msgstr "" "Политики это профили, объединяющие один или несколько узлов, контролирующих, " "как MWAN распределяет трафик.<br />Сначала используются интерфейсы-узлы с " @@ -385,8 +378,8 @@ msgstr "Поддерживает CIDR нотацию (например '192.168. msgid "Task" msgstr "Задача" -msgid "There are currently %d of 250 supported interfaces configured" -msgstr "В настоящее время настроено %d из 250 поддерживаемых интерфейсов." +msgid "There are currently %d of %d supported interfaces configured" +msgstr "В настоящее время настроено %d из %d поддерживаемых интерфейсов." msgid "" "This displays the metric assigned to this interface in /etc/config/network" @@ -411,23 +404,14 @@ msgid "" "will<br />be executed with each netifd hotplug interface event<br />on " "interfaces for which mwan3 is enabled.<br /><br />There are three main " "environment variables that are passed to this script.<br /><br />$ACTION " -"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " -"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " -"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +"<br />* \"ifup\" Is called by netifd and mwan3track <br />* \"ifdown\" Is " +"called by netifd and mwan3track <br />* \"connected\" Is only called by " +"mwan3track if tracking was successful <br />* \"disconnected\" Is only " +"called by mwan3track if tracking has failed <br />$INTERFACE Name of the " +"interface which went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE " +"Physical device name which interface went up or down (e.g. \"eth0\" or " +"\"wwan0\")<br /><br />" msgstr "" -"Страница позволяет изменять содержимое файла mwan3.user (/etc/mwan3.user)." -"<br />Файл также сохраняется во время перепрошивки sysupgrade-совместимым " -"образом.<br /><br />Примечание:<br />Этот файл интерпретируется как shell " -"скрипт.<br />Первая строка скрипта должна быть "#!/bin/sh" без " -"кавычек.<br />Строки начинающиеся с #, являются комментариями и не " -"исполняются.<br />Поместите свои пользовательские действия mwan3 здесь, они " -"будут<br />выполняться с каждым событием netifd hotplug интерфейса<br />на " -"интерфейсах, для которых включен mwan3.<br /><br />В этот сценарий " -"передаются три основные переменные среды.<br /><br />$ACTION либо \"ifup\" " -"или \"ifdown\"<br />$INTERFACE - имя интерфейса, который включили или " -"отключили (например, 'wan' или 'wwan') <br />$DEVICE - имя физического " -"устройства, чей интерфейс включили или отключили (например, 'eth0' или " -"'wwan0')<br /><br />." msgid "Tracking hostname or IP address" msgstr "Отслеживание имени хоста или IP-адреса" @@ -459,10 +443,10 @@ msgstr "" msgid "View the content of /etc/protocols for protocol description" msgstr "Просмотр содержимого файла /etc/protocols для описания протокола." -msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!" msgstr "" "ВНИМАНИЕ: Интерфейсы %d настроены, превышая установленное ограничение в " -"количестве 250шт.!" +"количестве %dшт.!" msgid "WARNING: Interface %s are not found in /etc/config/network" msgstr "ВНИМАНИЕ: Интерфейс %s не настроен в config файле /etc/config/network." @@ -483,7 +467,7 @@ msgstr "" "ВНИМАНИЕ: Интерфейс %s не имеет маршрута по умолчанию в основной таблице " "маршрутизации." -msgid "WARNING: Policie %s has exceeding the maximum name of 15 characters" +msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters" msgstr "" "ВНИМАНИЕ: Имя политики %s превышает установленное ограничение в 15 символов." @@ -527,3 +511,43 @@ msgstr "никогда" msgid "unreachable (reject)" msgstr "недоступен (отклонить)" + +#~ msgid "Online (tracking active)" +#~ msgstr "Онлайн (отслеживание активно)" + +#~ msgid "MWAN Interface Live Status" +#~ msgstr "Состояние интерфейса MWAN в настоящее время" + +#~ msgid "MWAN status - Interface Live Status" +#~ msgstr "Состояние MWAN - Интерфейс в настоящее время" + +#~ msgid "Online (tracking off)" +#~ msgstr "Онлайн (отслеживание отключено)" + +#~ msgid "" +#~ "This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +#~ ">The file is also preserved during sysupgrade.<br /><br />Notes:<br /" +#~ ">This file is interpreted as a shell script.<br />The first line of the " +#~ "script must be "#!/bin/sh" without quotes.<br />Lines beginning " +#~ "with # are comments and are not executed.<br />Put your custom mwan3 " +#~ "action here, they will<br />be executed with each netifd hotplug " +#~ "interface event<br />on interfaces for which mwan3 is enabled.<br /><br /" +#~ ">There are three main environment variables that are passed to this " +#~ "script.<br /><br />$ACTION Either \"ifup\" or \"ifdown\"<br />$INTERFACE " +#~ "Name of the interface which went up or down (e.g. \"wan\" or \"wwan" +#~ "\")<br />$DEVICE Physical device name which interface went up or down (e." +#~ "g. \"eth0\" or \"wwan0\")<br /><br />" +#~ msgstr "" +#~ "Страница позволяет изменять содержимое файла mwan3.user (/etc/mwan3.user)." +#~ "<br />Файл также сохраняется во время перепрошивки sysupgrade-совместимым " +#~ "образом.<br /><br />Примечание:<br />Этот файл интерпретируется как shell " +#~ "скрипт.<br />Первая строка скрипта должна быть "#!/bin/sh" без " +#~ "кавычек.<br />Строки начинающиеся с #, являются комментариями и не " +#~ "исполняются.<br />Поместите свои пользовательские действия mwan3 здесь, " +#~ "они будут<br />выполняться с каждым событием netifd hotplug " +#~ "интерфейса<br />на интерфейсах, для которых включен mwan3.<br /><br />В " +#~ "этот сценарий передаются три основные переменные среды.<br /><br />" +#~ "$ACTION либо \"ifup\" или \"ifdown\"<br />$INTERFACE - имя интерфейса, " +#~ "который включили или отключили (например, 'wan' или 'wwan') <br />$DEVICE " +#~ "- имя физического устройства, чей интерфейс включили или отключили " +#~ "(например, 'eth0' или 'wwan0')<br /><br />." diff --git a/applications/luci-app-mwan3/po/templates/mwan3.pot b/applications/luci-app-mwan3/po/templates/mwan3.pot index b7266240f9..f6b3a1b380 100644 --- a/applications/luci-app-mwan3/po/templates/mwan3.pot +++ b/applications/luci-app-mwan3/po/templates/mwan3.pot @@ -88,6 +88,9 @@ msgstr "" msgid "Hotplug ifup" msgstr "" +msgid "INFO: MWAN not running" +msgstr "" + msgid "IPset" msgstr "" @@ -157,7 +160,7 @@ msgstr "" msgid "MWAN Interface Configuration - %s" msgstr "" -msgid "MWAN Interface Live Status" +msgid "MWAN Interfaces" msgstr "" msgid "MWAN Member Configuration - %s" @@ -178,16 +181,13 @@ msgstr "" msgid "MWAN Status - Troubleshooting" msgstr "" -msgid "MWAN status - Interface Live Status" -msgstr "" - msgid "" -"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"MWAN supports up to 252 physical and/or logical interfaces<br />MWAN " "requires that all interfaces have a unique metric configured in /etc/config/" "network<br />Names must match the interface name found in /etc/config/" -"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " -"_ and no spaces<br />Interfaces may not share the same name as configured " -"members, policies or rules" +"network<br />Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br /" +">Interfaces may not share the same name as configured members, policies or " +"rules" msgstr "" msgid "" @@ -236,12 +236,6 @@ msgstr "" msgid "Online" msgstr "" -msgid "Online (tracking active)" -msgstr "" - -msgid "Online (tracking off)" -msgstr "" - msgid "Ping count" msgstr "" @@ -272,11 +266,11 @@ msgstr "" msgid "" "Policies are profiles grouping one or more members controlling how MWAN " "distributes traffic<br />Member interfaces with lower metrics are used " -"first. Interfaces with the same metric load-balance<br />Load-balanced " -"member interfaces distribute more traffic out those with higher weights<br /" -">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " -"15 characters or less<br />Policies may not share the same name as " -"configured interfaces, members or rules" +"first<br />Member interfaces with the same metric will be load-balanced<br /" +">Load-balanced member interfaces distribute more traffic out those with " +"higher weights<br />Names may contain characters A-Z, a-z, 0-9, _ and no " +"spaces<br />Names must be 15 characters or less<br />Policies may not share " +"the same name as configured interfaces, members or rules" msgstr "" msgid "Policy" @@ -330,7 +324,7 @@ msgstr "" msgid "Task" msgstr "" -msgid "There are currently %d of 250 supported interfaces configured" +msgid "There are currently %d of %d supported interfaces configured" msgstr "" msgid "" @@ -351,9 +345,13 @@ msgid "" "will<br />be executed with each netifd hotplug interface event<br />on " "interfaces for which mwan3 is enabled.<br /><br />There are three main " "environment variables that are passed to this script.<br /><br />$ACTION " -"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " -"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " -"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +"<br />* \"ifup\" Is called by netifd and mwan3track <br />* \"ifdown\" Is " +"called by netifd and mwan3track <br />* \"connected\" Is only called by " +"mwan3track if tracking was successful <br />* \"disconnected\" Is only " +"called by mwan3track if tracking has failed <br />$INTERFACE Name of the " +"interface which went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE " +"Physical device name which interface went up or down (e.g. \"eth0\" or " +"\"wwan0\")<br /><br />" msgstr "" msgid "Tracking hostname or IP address" @@ -381,7 +379,7 @@ msgstr "" msgid "View the content of /etc/protocols for protocol description" msgstr "" -msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!" msgstr "" msgid "WARNING: Interface %s are not found in /etc/config/network" @@ -398,7 +396,7 @@ msgstr "" msgid "WARNING: Interface %s has no default route in the main routing table" msgstr "" -msgid "WARNING: Policie %s has exceeding the maximum name of 15 characters" +msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters" msgstr "" msgid "" diff --git a/applications/luci-app-mwan3/po/zh-cn/mwan3.po b/applications/luci-app-mwan3/po/zh-cn/mwan3.po index c838bdb563..ef59339862 100644 --- a/applications/luci-app-mwan3/po/zh-cn/mwan3.po +++ b/applications/luci-app-mwan3/po/zh-cn/mwan3.po @@ -99,6 +99,9 @@ msgstr "Hotplug ifdown" msgid "Hotplug ifup" msgstr "Hotplug ifup" +msgid "INFO: MWAN not running" +msgstr "" + msgid "IPset" msgstr "IPset" @@ -168,8 +171,8 @@ msgstr "" msgid "MWAN Interface Configuration - %s" msgstr "MWAN 接口配置 - %s" -msgid "MWAN Interface Live Status" -msgstr "MWAN 接口实时状态" +msgid "MWAN Interfaces" +msgstr "" msgid "MWAN Member Configuration - %s" msgstr "MWAN 成员配置 - %s" @@ -189,22 +192,18 @@ msgstr "" msgid "MWAN Status - Troubleshooting" msgstr "" -msgid "MWAN status - Interface Live Status" -msgstr "" - msgid "" -"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"MWAN supports up to 252 physical and/or logical interfaces<br />MWAN " "requires that all interfaces have a unique metric configured in /etc/config/" "network<br />Names must match the interface name found in /etc/config/" -"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " -"_ and no spaces<br />Interfaces may not share the same name as configured " -"members, policies or rules" +"network<br />Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br /" +">Interfaces may not share the same name as configured members, policies or " +"rules" msgstr "" -"MWAN 支持最多 250 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/" +"MWAN 支持最多 252 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/" "config/network 中设定唯一的网关跃点。<br />名称必须与 /etc/config/network 中" -"的接口名称匹配。(可查看“高级”选项卡)<br />名称允许包括 A-Z、a-z、0-9、_ 但" -"是不能有空格。<br />接口不应该与成员、策略、规则中的任意一个设置项使用相同的" -"名称" +"的接口名称匹配。<br />名称允许包括 A-Z、a-z、0-9、_ 但是不能有空格。<br />接" +"口不应该与成员、策略、规则中的任意一个设置项使用相同的名称" msgid "" "May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " @@ -259,12 +258,6 @@ msgstr "离线" msgid "Online" msgstr "在线" -msgid "Online (tracking active)" -msgstr "在线(跟踪启用中)" - -msgid "Online (tracking off)" -msgstr "在线(跟踪已关闭)" - msgid "Ping count" msgstr "Ping 计数" @@ -295,11 +288,11 @@ msgstr "策略" msgid "" "Policies are profiles grouping one or more members controlling how MWAN " "distributes traffic<br />Member interfaces with lower metrics are used " -"first. Interfaces with the same metric load-balance<br />Load-balanced " -"member interfaces distribute more traffic out those with higher weights<br /" -">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " -"15 characters or less<br />Policies may not share the same name as " -"configured interfaces, members or rules" +"first<br />Member interfaces with the same metric will be load-balanced<br /" +">Load-balanced member interfaces distribute more traffic out those with " +"higher weights<br />Names may contain characters A-Z, a-z, 0-9, _ and no " +"spaces<br />Names must be 15 characters or less<br />Policies may not share " +"the same name as configured interfaces, members or rules" msgstr "" "“策略”把成员进行分组,告诉 MWAN 如何分配“规则”中使用这一策略的流量<br />拥有" "较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。<br /" @@ -358,8 +351,8 @@ msgstr "支持 CIDR 记法(例如:\"192.168.100.0/24\")不含引号" msgid "Task" msgstr "" -msgid "There are currently %d of 250 supported interfaces configured" -msgstr "当前已配置 %d 个接口,最大支持 250 个" +msgid "There are currently %d of %d supported interfaces configured" +msgstr "当前已配置 %d 个接口,最大支持 %d 个" msgid "" "This displays the metric assigned to this interface in /etc/config/network" @@ -379,18 +372,14 @@ msgid "" "will<br />be executed with each netifd hotplug interface event<br />on " "interfaces for which mwan3 is enabled.<br /><br />There are three main " "environment variables that are passed to this script.<br /><br />$ACTION " -"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " -"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " -"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" -msgstr "" -"这里允许您修改“/etc/mwan3.user”的内容。<br />该文件在 sysupgrade 期间也会保" -"留。<br /><br />注意:<br />该文件会作为 shell 脚本解释。<br />脚本的第一行必" -"须是"#!/bin/sh",不带引号。<br />以#开头的行是注释,不会执行。<br />" -"将您的自定义 mwan3 动作放在这里,他们将<br />在启用 mwan3 的接口上<br />在 " -"netifd hotplug 接口事件时执行。<br /><br />有三个主要的环境变量传递给这个脚" -"本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 启动或停止的接口名" -"(例如“wan”或“wwan”)<br />$DEVICE 启动或停止接口的物理设备名(例" -"如“eth0”或“wwan0”)<br /><br />" +"<br />* \"ifup\" Is called by netifd and mwan3track <br />* \"ifdown\" Is " +"called by netifd and mwan3track <br />* \"connected\" Is only called by " +"mwan3track if tracking was successful <br />* \"disconnected\" Is only " +"called by mwan3track if tracking has failed <br />$INTERFACE Name of the " +"interface which went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE " +"Physical device name which interface went up or down (e.g. \"eth0\" or " +"\"wwan0\")<br /><br />" +msgstr "" msgid "Tracking hostname or IP address" msgstr "跟踪的主机或 IP 地址" @@ -419,8 +408,8 @@ msgstr "使用该接口的 IP 地址作为路由器本身发起的流量的源 I msgid "View the content of /etc/protocols for protocol description" msgstr "" -msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" -msgstr "警告:已配置 %d 个接口,超过最大值 250!" +msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!" +msgstr "警告:已配置 %d 个接口,超过最大值 %d!" msgid "WARNING: Interface %s are not found in /etc/config/network" msgstr "" @@ -436,7 +425,7 @@ msgstr "" msgid "WARNING: Interface %s has no default route in the main routing table" msgstr "" -msgid "WARNING: Policie %s has exceeding the maximum name of 15 characters" +msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters" msgstr "" msgid "" @@ -478,6 +467,38 @@ msgstr "从不" msgid "unreachable (reject)" msgstr "不可达(拒绝)" +#~ msgid "Online (tracking active)" +#~ msgstr "在线(跟踪启用中)" + +#~ msgid "MWAN Interface Live Status" +#~ msgstr "MWAN 接口实时状态" + +#~ msgid "Online (tracking off)" +#~ msgstr "在线(跟踪已关闭)" + +#~ msgid "" +#~ "This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +#~ ">The file is also preserved during sysupgrade.<br /><br />Notes:<br /" +#~ ">This file is interpreted as a shell script.<br />The first line of the " +#~ "script must be "#!/bin/sh" without quotes.<br />Lines beginning " +#~ "with # are comments and are not executed.<br />Put your custom mwan3 " +#~ "action here, they will<br />be executed with each netifd hotplug " +#~ "interface event<br />on interfaces for which mwan3 is enabled.<br /><br /" +#~ ">There are three main environment variables that are passed to this " +#~ "script.<br /><br />$ACTION Either \"ifup\" or \"ifdown\"<br />$INTERFACE " +#~ "Name of the interface which went up or down (e.g. \"wan\" or \"wwan" +#~ "\")<br />$DEVICE Physical device name which interface went up or down (e." +#~ "g. \"eth0\" or \"wwan0\")<br /><br />" +#~ msgstr "" +#~ "这里允许您修改“/etc/mwan3.user”的内容。<br />该文件在 sysupgrade 期间也会" +#~ "保留。<br /><br />注意:<br />该文件会作为 shell 脚本解释。<br />脚本的第" +#~ "一行必须是"#!/bin/sh",不带引号。<br />以#开头的行是注释,不会执" +#~ "行。<br />将您的自定义 mwan3 动作放在这里,他们将<br />在启用 mwan3 的接口" +#~ "上<br />在 netifd hotplug 接口事件时执行。<br /><br />有三个主要的环境变量" +#~ "传递给这个脚本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 启动" +#~ "或停止的接口名(例如“wan”或“wwan”)<br />$DEVICE 启动或停止接口的物理设备" +#~ "名(例如“eth0”或“wwan0”)<br /><br />" + #~ msgid "Currently Configured Interfaces" #~ msgstr "当前配置的接口" diff --git a/applications/luci-app-mwan3/po/zh-tw/mwan3.po b/applications/luci-app-mwan3/po/zh-tw/mwan3.po index d28bd82bdc..6af9fae7e3 100644 --- a/applications/luci-app-mwan3/po/zh-tw/mwan3.po +++ b/applications/luci-app-mwan3/po/zh-tw/mwan3.po @@ -99,6 +99,9 @@ msgstr "Hotplug ifdown" msgid "Hotplug ifup" msgstr "Hotplug ifup" +msgid "INFO: MWAN not running" +msgstr "" + msgid "IPset" msgstr "IPset" @@ -168,8 +171,8 @@ msgstr "" msgid "MWAN Interface Configuration - %s" msgstr "MWAN 介面配置 - %s" -msgid "MWAN Interface Live Status" -msgstr "MWAN 介面實時狀態" +msgid "MWAN Interfaces" +msgstr "" msgid "MWAN Member Configuration - %s" msgstr "MWAN 成員配置 - %s" @@ -189,22 +192,18 @@ msgstr "" msgid "MWAN Status - Troubleshooting" msgstr "" -msgid "MWAN status - Interface Live Status" -msgstr "" - msgid "" -"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"MWAN supports up to 252 physical and/or logical interfaces<br />MWAN " "requires that all interfaces have a unique metric configured in /etc/config/" "network<br />Names must match the interface name found in /etc/config/" -"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " -"_ and no spaces<br />Interfaces may not share the same name as configured " -"members, policies or rules" +"network<br />Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br /" +">Interfaces may not share the same name as configured members, policies or " +"rules" msgstr "" -"MWAN 支援最多 250 個物理或邏輯介面。<br />MWAN 要求所有介面必須在 /etc/" +"MWAN 支援最多 252 個物理或邏輯介面。<br />MWAN 要求所有介面必須在 /etc/" "config/network 中設定唯一的閘道器躍點。<br />名稱必須與 /etc/config/network " -"中的介面名稱匹配。(可檢視“高階”選項卡)<br />名稱允許包括 A-Z、a-z、0-9、_ " -"但是不能有空格。<br />介面不應該與成員、策略、規則中的任意一個設定項使用相同" -"的名稱" +"中的介面名稱匹配。<br />名稱允許包括 A-Z、a-z、0-9、_ 但是不能有空格。<br />" +"介面不應該與成員、策略、規則中的任意一個設定項使用相同的名稱" msgid "" "May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " @@ -259,12 +258,6 @@ msgstr "離線" msgid "Online" msgstr "線上" -msgid "Online (tracking active)" -msgstr "線上(跟蹤啟用中)" - -msgid "Online (tracking off)" -msgstr "線上(跟蹤已關閉)" - msgid "Ping count" msgstr "Ping 計數" @@ -295,11 +288,11 @@ msgstr "策略" msgid "" "Policies are profiles grouping one or more members controlling how MWAN " "distributes traffic<br />Member interfaces with lower metrics are used " -"first. Interfaces with the same metric load-balance<br />Load-balanced " -"member interfaces distribute more traffic out those with higher weights<br /" -">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " -"15 characters or less<br />Policies may not share the same name as " -"configured interfaces, members or rules" +"first<br />Member interfaces with the same metric will be load-balanced<br /" +">Load-balanced member interfaces distribute more traffic out those with " +"higher weights<br />Names may contain characters A-Z, a-z, 0-9, _ and no " +"spaces<br />Names must be 15 characters or less<br />Policies may not share " +"the same name as configured interfaces, members or rules" msgstr "" "“策略”把成員進行分組,告訴 MWAN 如何分配“規則”中使用這一策略的流量<br />擁有" "較低躍點數的成員將會被優先使用。擁有相同躍點數的成員把流量進行負載均衡。<br /" @@ -358,8 +351,8 @@ msgstr "支援 CIDR 記法(例如:\"192.168.100.0/24\")不含引號" msgid "Task" msgstr "" -msgid "There are currently %d of 250 supported interfaces configured" -msgstr "當前已配置 %d 個介面,最大支援 250 個" +msgid "There are currently %d of %d supported interfaces configured" +msgstr "當前已配置 %d 個介面,最大支援 %d 個" msgid "" "This displays the metric assigned to this interface in /etc/config/network" @@ -379,18 +372,14 @@ msgid "" "will<br />be executed with each netifd hotplug interface event<br />on " "interfaces for which mwan3 is enabled.<br /><br />There are three main " "environment variables that are passed to this script.<br /><br />$ACTION " -"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " -"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " -"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" -msgstr "" -"這裡允許您修改“/etc/mwan3.user”的內容。<br />該檔案在 sysupgrade 期間也會保" -"留。<br /><br />注意:<br />該檔案會作為 shell 指令碼解釋。<br />指令碼的第一" -"行必須是"#!/bin/sh",不帶引號。<br />以#開頭的行是註釋,不會執行。" -"<br />將您的自定義 mwan3 動作放在這裡,他們將<br />在啟用 mwan3 的介面上<br /" -">在 netifd hotplug 介面事件時執行。<br /><br />有三個主要的環境變數傳遞給這個" -"腳本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 啟動或停止的介面名" -"(例如“wan”或“wwan”)<br />$DEVICE 啟動或停止介面的物理裝置名(例" -"如“eth0”或“wwan0”)<br /><br />" +"<br />* \"ifup\" Is called by netifd and mwan3track <br />* \"ifdown\" Is " +"called by netifd and mwan3track <br />* \"connected\" Is only called by " +"mwan3track if tracking was successful <br />* \"disconnected\" Is only " +"called by mwan3track if tracking has failed <br />$INTERFACE Name of the " +"interface which went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE " +"Physical device name which interface went up or down (e.g. \"eth0\" or " +"\"wwan0\")<br /><br />" +msgstr "" msgid "Tracking hostname or IP address" msgstr "跟蹤的主機或 IP 位址" @@ -419,8 +408,8 @@ msgstr "使用該介面的 IP 位址作為路由器本身發起的流量的源 I msgid "View the content of /etc/protocols for protocol description" msgstr "" -msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" -msgstr "警告:已配置 %d 個介面,超過最大值 250!" +msgid "WARNING: %d interfaces are configured exceeding the maximum of %d!" +msgstr "警告:已配置 %d 個介面,超過最大值 %d!" msgid "WARNING: Interface %s are not found in /etc/config/network" msgstr "" @@ -436,7 +425,7 @@ msgstr "" msgid "WARNING: Interface %s has no default route in the main routing table" msgstr "" -msgid "WARNING: Policie %s has exceeding the maximum name of 15 characters" +msgid "WARNING: Policy %s has exceeding the maximum name of 15 characters" msgstr "" msgid "" @@ -478,6 +467,38 @@ msgstr "從不" msgid "unreachable (reject)" msgstr "不可達(拒絕)" +#~ msgid "Online (tracking active)" +#~ msgstr "線上(跟蹤啟用中)" + +#~ msgid "MWAN Interface Live Status" +#~ msgstr "MWAN 介面實時狀態" + +#~ msgid "Online (tracking off)" +#~ msgstr "線上(跟蹤已關閉)" + +#~ msgid "" +#~ "This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +#~ ">The file is also preserved during sysupgrade.<br /><br />Notes:<br /" +#~ ">This file is interpreted as a shell script.<br />The first line of the " +#~ "script must be "#!/bin/sh" without quotes.<br />Lines beginning " +#~ "with # are comments and are not executed.<br />Put your custom mwan3 " +#~ "action here, they will<br />be executed with each netifd hotplug " +#~ "interface event<br />on interfaces for which mwan3 is enabled.<br /><br /" +#~ ">There are three main environment variables that are passed to this " +#~ "script.<br /><br />$ACTION Either \"ifup\" or \"ifdown\"<br />$INTERFACE " +#~ "Name of the interface which went up or down (e.g. \"wan\" or \"wwan" +#~ "\")<br />$DEVICE Physical device name which interface went up or down (e." +#~ "g. \"eth0\" or \"wwan0\")<br /><br />" +#~ msgstr "" +#~ "這裡允許您修改“/etc/mwan3.user”的內容。<br />該檔案在 sysupgrade 期間也會" +#~ "保留。<br /><br />注意:<br />該檔案會作為 shell 指令碼解釋。<br />指令碼" +#~ "的第一行必須是"#!/bin/sh",不帶引號。<br />以#開頭的行是註釋,不會" +#~ "執行。<br />將您的自定義 mwan3 動作放在這裡,他們將<br />在啟用 mwan3 的介" +#~ "面上<br />在 netifd hotplug 介面事件時執行。<br /><br />有三個主要的環境變" +#~ "數傳遞給這個腳本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 啟" +#~ "動或停止的介面名(例如“wan”或“wwan”)<br />$DEVICE 啟動或停止介面的物理裝" +#~ "置名(例如“eth0”或“wwan0”)<br /><br />" + #~ msgid "Currently Configured Interfaces" #~ msgstr "當前配置的介面" diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 229f3d61b3..c5fb2b2a53 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -84,11 +84,11 @@ function action_json() local jsonreq4 local jsonreq6 - local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 - local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 + local v4_port = tonumber(uci:get("olsrd", "olsrd_jsoninfo", "port") or "") or 9090 + local v6_port = tonumber(uci:get("olsrd6", "olsrd_jsoninfo", "port") or "") or 9090 - jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 " .. v4_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null" ) - jsonreq6 = utl.exec("(echo /status | nc ::1 " .. v6_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") + jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 %d | sed -n '/^[}{ ]/p') 2>/dev/null" % v4_port) + jsonreq6 = utl.exec("(echo /status | nc ::1 %d | sed -n '/^[}{ ]/p') 2>/dev/null" % v6_port) http.prepare_content("application/json") if not jsonreq4 or jsonreq4 == "" then jsonreq4 = "{}" @@ -150,7 +150,7 @@ function action_neigh(json) for _, dev in ipairs(devices) do for _, net in ipairs(dev:get_wifinets()) do local radio = net:get_device() - assoclist[#assoclist+1] = {} + assoclist[#assoclist+1] = {} assoclist[#assoclist]['ifname'] = net:ifname() assoclist[#assoclist]['network'] = net:network()[1] assoclist[#assoclist]['device'] = radio and radio:name() or nil @@ -165,7 +165,7 @@ function action_neigh(json) local mac = "" local ip local neihgt = {} - + if resolve == "1" then hostname = nixio.getnameinfo(v.remoteIP, nil, 100) if hostname then @@ -350,11 +350,11 @@ function fetch_jsoninfo(otable) local IpVersion = uci:get_first("olsrd", "olsrd","IpVersion") local jsonreq4 = "" local jsonreq6 = "" - local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 - local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 + local v4_port = tonumber(uci:get("olsrd", "olsrd_jsoninfo", "port") or "") or 9090 + local v6_port = tonumber(uci:get("olsrd6", "olsrd_jsoninfo", "port") or "") or 9090 - jsonreq4 = utl.exec("(echo /" .. otable .. " | nc 127.0.0.1 " .. v4_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") - jsonreq6 = utl.exec("(echo /" .. otable .. " | nc ::1 " .. v6_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") + jsonreq4 = utl.exec("(echo /%s | nc 127.0.0.1 %d | sed -n '/^[}{ ]/p') 2>/dev/null" %{ otable, v4_port }) + jsonreq6 = utl.exec("(echo /%s | nc ::1 %d | sed -n '/^[}{ ]/p') 2>/dev/null" %{ otable, v6_port }) local jsondata4 = {} local jsondata6 = {} local data4 = {} diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua index 719145b887..d2b5d32c05 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua @@ -26,9 +26,9 @@ uci:foreach( "openvpn_recipes", "openvpn_recipe", ) function s.getPID(section) -- Universal function which returns valid pid # or nil - local pid = sys.exec("%s | grep -w %s | grep openvpn | grep -v grep | awk '{print $1}'" % { psstring,section} ) - if pid and #pid > 0 and tonumber(pid) ~= nil then - return tonumber(pid) + local pid = sys.exec("%s | grep -w '[o]penvpn(%s)'" % { psstring, section }) + if pid and #pid > 0 then + return tonumber(pid:match("^%s*(%d+)")) else return nil end diff --git a/applications/luci-app-splash/luasrc/controller/splash/splash.lua b/applications/luci-app-splash/luasrc/controller/splash/splash.lua index b4fdbd53a6..af7a3a3c01 100644 --- a/applications/luci-app-splash/luasrc/controller/splash/splash.lua +++ b/applications/luci-app-splash/luasrc/controller/splash/splash.lua @@ -9,7 +9,7 @@ function index() entry({"admin", "services", "splash", "splashtext" }, form("splash/splashtext"), _("Splashtext"), 10) local e - + e = node("splash") e.target = call("action_dispatch") @@ -82,7 +82,7 @@ function action_activate() end end) - if blacklisted then + if blacklisted then luci.http.redirect(luci.dispatcher.build_url("splash" ,"blocked")) else local id = tostring(mac):gsub(':', ''):lower() @@ -106,7 +106,7 @@ function action_status_admin() local uci = luci.model.uci.cursor_state() local macs = luci.http.formvaluetable("save") - local changes = { + local changes = { whitelist = { }, blacklist = { }, lease = { }, @@ -129,22 +129,22 @@ function action_status_admin() if #changes.whitelist > 0 then os.execute("luci-splash whitelist %s >/dev/null" - % table.concat(changes.whitelist)) + % util.shellquote(table.concat(changes.whitelist))) end if #changes.blacklist > 0 then os.execute("luci-splash blacklist %s >/dev/null" - % table.concat(changes.blacklist)) + % util.shellquote(table.concat(changes.blacklist))) end if #changes.lease > 0 then os.execute("luci-splash lease %s >/dev/null" - % table.concat(changes.lease)) + % util.shellquote(table.concat(changes.lease))) end if #changes.remove > 0 then os.execute("luci-splash remove %s >/dev/null" - % table.concat(changes.remove)) + % util.shellquote(table.concat(changes.remove))) end luci.template.render("admin_status/splash", { is_admin = true }) diff --git a/applications/luci-app-splash/root/usr/sbin/luci-splash b/applications/luci-app-splash/root/usr/sbin/luci-splash index 2870dbe6aa..9ec9f3a9e1 100755 --- a/applications/luci-app-splash/root/usr/sbin/luci-splash +++ b/applications/luci-app-splash/root/usr/sbin/luci-splash @@ -36,6 +36,10 @@ function call(cmd) os.execute(cmd) end +function esc(str) + return utl.shellquote(str) +end + function lock() call("lock /var/run/luci_splash.lock") @@ -84,14 +88,14 @@ end function get_physdev(interface) local dev - dev = utl.trim(sys.exec(". /lib/functions/network.sh; network_get_device IFNAME '" .. interface .. "'; echo $IFNAME")) + dev = utl.trim(sys.exec(". /lib/functions/network.sh; network_get_device IFNAME %s; echo $IFNAME" % esc(interface))) return dev end function get_filter_handle(parent, direction, device, mac) - local input = utl.split(sys.exec('/usr/sbin/tc filter show dev ' .. device .. ' parent ' .. parent) or {}) + local input = utl.split(sys.exec('/usr/sbin/tc filter show dev %s parent %s' %{ esc(device), esc(parent) }) or {}) local tbl = {} local handle for k, v in pairs(input) do @@ -264,7 +268,7 @@ function main(argv) elseif whitelist_macs[mac] then print("Removing %s from whitelist" % mac) remove_whitelist(mac) - whitelist_macs[mac] = nil + whitelist_macs[mac] = nil elseif blacklist_macs[mac] then print("Removing %s from blacklist" % mac) remove_blacklist(mac) @@ -295,7 +299,7 @@ function main(argv) print("\n luci-splash remove <MAC-or-IP>\n Remove given address from the lease-, black- or whitelist") print("") - os.exit(1) + os.exit(1) end end @@ -338,8 +342,8 @@ function ipt_delete_all(args, comp, off) off[r.table] = off[r.table] or { } off[r.table][r.chain] = off[r.table][r.chain] or 0 - exec("iptables -t %q -D %q %d 2>/dev/null" - %{ r.table, r.chain, r.index - off[r.table][r.chain] }) + exec("iptables -t %s -D %s %d 2>/dev/null" + %{ esc(r.table), esc(r.chain), r.index - off[r.table][r.chain] }) off[r.table][r.chain] = off[r.table][r.chain] + 1 end @@ -353,8 +357,8 @@ function ipt6_delete_all(args, comp, off) off[r.table] = off[r.table] or { } off[r.table][r.chain] = off[r.table][r.chain] or 0 - exec("ip6tables -t %q -D %q %d 2>/dev/null" - %{ r.table, r.chain, r.index - off[r.table][r.chain] }) + exec("ip6tables -t %s -D %s %d 2>/dev/null" + %{ esc(r.table), esc(r.chain), r.index - off[r.table][r.chain] }) off[r.table][r.chain] = off[r.table][r.chain] + 1 end @@ -460,13 +464,13 @@ function remove_whitelist_tc(mac) end local handle = get_filter_handle('ffff:', 'src', device, mac) if handle then - exec('tc filter del dev "%s" parent ffff: protocol ip prio 1 handle %s u32' % { device, handle }) + exec('tc filter del dev %s parent ffff: protocol ip prio 1 handle %s u32' % { esc(device), esc(handle) }) else print('Warning! Could not get a handle for %s parent :ffff on interface %s' % { mac, device }) end local handle = get_filter_handle('1:', 'dest', device, mac) if handle then - exec('tc filter del dev "%s" parent 1:0 protocol ip prio 1 handle %s u32' % { device, handle }) + exec('tc filter del dev %s parent 1:0 protocol ip prio 1 handle %s u32' % { esc(device), esc(handle) }) else print('Warning! Could not get a handle for %s parent 1:0 on interface %s' % { mac, device }) end @@ -492,37 +496,37 @@ function add_lease_rule(mac, ipaddr, device) id = get_id(ipaddr) end - exec("iptables -t mangle -I luci_splash_mark_out -m mac --mac-source %q -j RETURN" % mac) + exec("iptables -t mangle -I luci_splash_mark_out -m mac --mac-source %s -j RETURN" % esc(mac)) -- Mark incoming packets to a splashed host -- for ipv4 - by iptables and destination if id and device then - exec("iptables -t mangle -I luci_splash_mark_in -d %q -j MARK --set-mark 0x1%s -m comment --comment %s" % {ipaddr, id, mac:upper()}) + exec("iptables -t mangle -I luci_splash_mark_in -d %s -j MARK --set-mark 0x1%s -m comment --comment %s" % { esc(ipaddr), esc(id), esc(mac:upper())}) end --for ipv6: need to use the mac here if has_ipv6 then - exec("ip6tables -t mangle -I luci_splash_mark_out -m mac --mac-source %q -j MARK --set-mark 79" % mac) + exec("ip6tables -t mangle -I luci_splash_mark_out -m mac --mac-source %s -j MARK --set-mark 79" % esc(mac)) if id and device and tonumber(limit_down) then - exec("tc filter add dev %s parent 1:0 protocol ipv6 prio 1 u32 match ether dst %s classid 1:%s" % {device, mac:lower(), id}) + exec("tc filter add dev %s parent 1:0 protocol ipv6 prio 1 u32 match ether dst %s classid 1:%s" % { esc(device), esc(mac:lower()), esc(id) }) end end if device and tonumber(limit_up) > 0 then - exec('tc filter add dev "%s" parent ffff: protocol all prio 2 u32 match ether src %s police rate %skbit mtu 6k burst 6k drop' % {device, mac, limit_up}) + exec('tc filter add dev %s parent ffff: protocol all prio 2 u32 match ether src %s police rate %skbit mtu 6k burst 6k drop' % { esc(device), esc(mac), esc(limit_up) }) end if id and device and tonumber(limit_down) > 0 then - exec("tc class add dev %s parent 1: classid 1:0x%s htb rate %skbit" % { device, id, limit_down }) - exec("tc qdisc add dev %s parent 1:%s sfq perturb 10" % { device, id }) + exec("tc class add dev %s parent 1: classid 1:0x%s htb rate %skbit" % { esc(device), esc(id), esc(limit_down) }) + exec("tc qdisc add dev %s parent 1:%s sfq perturb 10" % { esc(device), esc(id) }) end - exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %q -j RETURN" % mac) - exec("iptables -t nat -I luci_splash_leases -m mac --mac-source %q -j RETURN" % mac) + exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %s -j RETURN" % esc(mac)) + exec("iptables -t nat -I luci_splash_leases -m mac --mac-source %s -j RETURN" % esc(mac)) if has_ipv6 then - exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %q -j RETURN" % mac) + exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %s -j RETURN" % esc(mac)) end end @@ -548,32 +552,32 @@ function remove_lease_rule(mac, ipaddr, device, limit_up, limit_down) if device and tonumber(limit_up) > 0 then local handle = get_filter_handle('ffff:', 'src', device, mac) if handle then - exec('tc filter del dev "%s" parent ffff: protocol all prio 2 handle %s u32 police rate %skbit mtu 6k burst 6k drop' % {device, handle, limit_up}) + exec('tc filter del dev %s parent ffff: protocol all prio 2 handle %s u32 police rate %skbit mtu 6k burst 6k drop' % { esc(device), esc(handle), esc(limit_up) }) else print('Warning! Could not get a handle for %s parent :ffff on interface %s' % { mac, device }) end end -- remove clients class if device and id then - exec('tc class del dev "%s" classid 1:%s' % {device, id}) - exec('tc filter del dev "%s" parent 1:0 prio 1' % device) -- ipv6 rule - --exec('tc qdisc del dev "%s" parent 1:%s sfq perturb 10' % { device, id }) + exec('tc class del dev %s classid 1:%s' % { esc(device), esc(id) }) + exec('tc filter del dev %s parent 1:0 prio 1' % esc(device)) -- ipv6 rule + --exec('tc qdisc del dev %s parent 1:%s sfq perturb 10' % { esc(device), esc(id) }) end end -- Add whitelist rules function add_whitelist_rule(mac) - exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %q -j RETURN" % mac) - exec("iptables -t nat -I luci_splash_leases -m mac --mac-source %q -j RETURN" % mac) + exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %s -j RETURN" % esc(mac)) + exec("iptables -t nat -I luci_splash_leases -m mac --mac-source %s -j RETURN" % esc(mac)) if has_ipv6 then - exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %q -j RETURN" % mac) + exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %s -j RETURN" % esc(mac)) end uci:foreach("luci_splash", "iface", function(s) local device = get_physdev(s['.name']) if device and device ~= "" then - exec('tc filter add dev "%s" parent ffff: protocol ip prio 1 u32 match ether src %s police pass' % { device, mac }) - exec('tc filter add dev "%s" parent 1:0 protocol ip prio 1 u32 match ether dst %s classid 1:1' % { device, mac }) + exec('tc filter add dev %s parent ffff: protocol ip prio 1 u32 match ether src %s police pass' % { esc(device), esc(mac) }) + exec('tc filter add dev %s parent 1:0 protocol ip prio 1 u32 match ether dst %s classid 1:1' % { esc(device), esc(mac) }) end end) end @@ -581,9 +585,9 @@ end -- Add blacklist rules function add_blacklist_rule(mac) - exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %q -j DROP" % mac) + exec("iptables -t filter -I luci_splash_filter -m mac --mac-source %s -j DROP" % esc(mac)) if has_ipv6 then - exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %q -j DROP" % mac) + exec("ip6tables -t filter -I luci_splash_filter -m mac --mac-source %s -j DROP" % esc(mac)) end end @@ -596,15 +600,15 @@ function sync() -- Current leases in state files local leases = uci:get_all("luci_splash_leases") - + -- Convert leasetime to seconds local leasetime = tonumber(uci:get("luci_splash", "general", "leasetime")) * 3600 - + -- Clean state file uci:load("luci_splash_leases") uci:revert("luci_splash_leases") - + local blackwhitelist = uci:get_all("luci_splash") local whitelist_total = 0 local whitelist_online = 0 @@ -628,7 +632,7 @@ function sync() end -- Rewrite state - uci:section("luci_splash_leases", "lease", convert_mac_to_secname(v.mac), { + uci:section("luci_splash_leases", "lease", convert_mac_to_secname(v.mac), { mac = v.mac, ipaddr = v.ipaddr, device = v.device, @@ -639,7 +643,7 @@ function sync() end end end - + -- Whitelist, Blacklist for _, s in utl.spairs(blackwhitelist, function(a,b) return blackwhitelist[a][".type"] > blackwhitelist[b][".type"] end @@ -666,7 +670,7 @@ function sync() -- ToDo: -- include a new field "leases_online" in stats to differ between active clients and leases: - -- update_stats(leasecount, leases_online, whitelist_online, whitelist_total, blacklist_online, blacklist_total) later: + -- update_stats(leasecount, leases_online, whitelist_online, whitelist_total, blacklist_online, blacklist_total) later: update_stats(leases_online, whitelist_online, whitelist_total, blacklist_online, blacklist_total) uci:save("luci_splash_leases") diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua index e29a2e17d9..47e1696ece 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua @@ -87,7 +87,7 @@ function Graph._rrdtool( self, def, rrd ) fs.mkdirr( dir ) -- construct commandline - local cmdline = "rrdtool graph" + local cmdline = { "rrdtool", "graph" } -- copy default arguments to def stack for i, opt in ipairs(self.args) do @@ -102,15 +102,11 @@ function Graph._rrdtool( self, def, rrd ) opt = opt:gsub( "{file}", rrd ) end - if opt:match("[^%w]") then - cmdline = cmdline .. " '" .. opt .. "'" - else - cmdline = cmdline .. " " .. opt - end + cmdline[#cmdline+1] = luci.util.shellquote(opt) end -- execute rrdtool - local rrdtool = io.popen( cmdline ) + local rrdtool = io.popen(table.concat(cmdline, " ")) rrdtool:close() end diff --git a/applications/luci-app-tinyproxy/luasrc/view/tinyproxy_status.htm b/applications/luci-app-tinyproxy/luasrc/view/tinyproxy_status.htm index d43a887b07..2ba9dddb8e 100644 --- a/applications/luci-app-tinyproxy/luasrc/view/tinyproxy_status.htm +++ b/applications/luci-app-tinyproxy/luasrc/view/tinyproxy_status.htm @@ -13,7 +13,11 @@ if luci.http.formvalue("frame") == "1" then end) local data = false - local wget = io.popen("wget -qO- http://%s:%s" % { addr, port }) + local wget = io.popen("wget -qO- http://%s:%s" %{ + luci.util.shellquote(addr), + luci.util.shellquote(port) + }) + if wget then while true do local l = wget:read("*l") @@ -30,7 +34,10 @@ if luci.http.formvalue("frame") == "1" then if not data then luci.http.write(translate("Failed to retrieve statistics from url:")) - luci.http.write(" http://%s:%s" % { addr, port }) + luci.http.write(" http://%s:%s" %{ + luci.util.pcdata(addr), + luci.util.pcdata(port) + }) end return @@ -43,7 +50,7 @@ end <div class="cbi-map"> <h2 name="content"><%:Tinyproxy Status%></h2> <div class="cbi-section"> - <iframe src="<%=REQUESTURL%>?frame=1" style="width:100%; height:350px; border:none"></iframe> + <iframe src="<%=REQUEST_URI%>?frame=1" style="width:100%; height:350px; border:none"></iframe> </div> </div> diff --git a/applications/luci-app-travelmate/Makefile b/applications/luci-app-travelmate/Makefile index 2bd25bc171..58d9bf37d4 100644 --- a/applications/luci-app-travelmate/Makefile +++ b/applications/luci-app-travelmate/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Travelmate -LUCI_DEPENDS:=+travelmate +luci-lib-jsonc +qrencode +LUCI_DEPENDS:=+travelmate +luci-lib-jsonc LUCI_PKGARCH:=all include ../../luci.mk diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua index 14b8d77ff6..493a387c3e 100644 --- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua +++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua @@ -14,27 +14,27 @@ function index() entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 40).dependent = false entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "travelmate", "stations"}, template("travelmate/stations"), _("Wireless Stations"), 20).leaf = true - entry({"admin", "services", "travelmate", "apqr"}, template("travelmate/ap_qr"), _("AP QR-Codes"), 30).leaf = true - entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 40).leaf = true + entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 30).leaf = true entry({"admin", "services", "travelmate", "advanced"}, firstchild(), _("Advanced"), 100) - entry({"admin", "services", "travelmate", "advanced", "configuration"}, cbi("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 110).leaf = true - entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, cbi("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 120).leaf = true - entry({"admin", "services", "travelmate", "advanced", "cfg_network"}, cbi("travelmate/cfg_network_tab"), _("Edit Network Configuration"), 130).leaf = true - entry({"admin", "services", "travelmate", "advanced", "cfg_firewall"}, cbi("travelmate/cfg_firewall_tab"), _("Edit Firewall Configuration"), 140).leaf = true + entry({"admin", "services", "travelmate", "advanced", "configuration"}, form("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 110).leaf = true + entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, form("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 120).leaf = true + entry({"admin", "services", "travelmate", "advanced", "cfg_network"}, form("travelmate/cfg_network_tab"), _("Edit Network Configuration"), 130).leaf = true + entry({"admin", "services", "travelmate", "advanced", "cfg_firewall"}, form("travelmate/cfg_firewall_tab"), _("Edit Firewall Configuration"), 140).leaf = true + entry({"admin", "services", "travelmate", "apqr"}, template("travelmate/ap_qr")).leaf = true entry({"admin", "services", "travelmate", "wifiscan"}, template("travelmate/wifi_scan")).leaf = true - entry({"admin", "services", "travelmate", "wifiadd"}, cbi("travelmate/wifi_add", {hideresetbtn=true, hidesavebtn=true})).leaf = true - entry({"admin", "services", "travelmate", "wifiedit"}, cbi("travelmate/wifi_edit", {hideresetbtn=true, hidesavebtn=true})).leaf = true - entry({"admin", "services", "travelmate", "wifidelete"}, cbi("travelmate/wifi_delete", {hideresetbtn=true, hidesavebtn=true})).leaf = true - entry({"admin", "services", "travelmate", "wifiorder"}, cbi("travelmate/wifi_order", {hideresetbtn=true, hidesavebtn=true})).leaf = true + entry({"admin", "services", "travelmate", "wifiadd"}, form("travelmate/wifi_add", {hideresetbtn=true, hidesavebtn=true})).leaf = true + entry({"admin", "services", "travelmate", "wifiedit"}, form("travelmate/wifi_edit", {hideresetbtn=true, hidesavebtn=true})).leaf = true + entry({"admin", "services", "travelmate", "wifidelete"}, form("travelmate/wifi_delete", {hideresetbtn=true, hidesavebtn=true})).leaf = true + entry({"admin", "services", "travelmate", "wifiorder"}, form("travelmate/wifi_order", {hideresetbtn=true, hidesavebtn=true})).leaf = true end function logread() - local logfile + local logfile = "" if nixio.fs.access("/var/log/messages") then logfile = util.trim(util.exec("grep -F 'travelmate-' /var/log/messages")) - else + elseif nixio.fs.access("/sbin/logread") then logfile = util.trim(util.exec("logread -e 'travelmate-'")) end templ.render("travelmate/logread", {title = i18n.translate("Travelmate Logfile"), content = logfile}) diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua index 860ce2295b..7b6b9658ca 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua @@ -73,45 +73,34 @@ o1 = s:option(Flag, "trm_enabled", translate("Enable travelmate")) o1.default = o1.disabled o1.rmempty = false -o2 = s:option(Flag, "trm_automatic", translate("Enable 'automatic' mode"), - translate("Keep travelmate in an active state. Check every n seconds the connection status, i.e. the uplink availability.")) +o2 = s:option(Flag, "trm_captive", translate("Captive Portal Detection"), + translate("Check the internet availability, log captive portal redirections and keep the uplink connection 'alive'.")) o2.default = o2.enabled o2.rmempty = false -o3 = s:option(Flag, "trm_captive", translate("Captive Portal Detection"), - translate("Check the internet availability, log captive portal redirections and keep the uplink connection 'alive'.")) -o3.default = o3.enabled -o3.rmempty = false - -o4 = s:option(ListValue, "trm_iface", translate("Uplink / Trigger interface"), +o3 = s:option(ListValue, "trm_iface", translate("Uplink / Trigger interface"), translate("Name of the used uplink interface.")) if dump then local i, v for i, v in ipairs(dump.interface) do if v.interface ~= "loopback" and v.interface ~= "lan" then - o4:value(v.interface) + o3:value(v.interface) end end end -o4.default = trmiface -o4.rmempty = false +o3.default = trmiface +o3.rmempty = false -o5 = s:option(Value, "trm_triggerdelay", translate("Trigger Delay"), - translate("Additional trigger delay in seconds before travelmate processing begins.")) -o5.datatype = "range(1,60)" -o5.default = 2 -o5.rmempty = false - -btn = s:option(Button, "", translate("Manual Rescan"), - translate("Force a manual uplink rescan / reconnect in 'trigger' mode.")) -btn:depends("trm_automatic", "") -btn.inputtitle = translate("Rescan") -btn.inputstyle = "find" -btn.disabled = false - -function btn.write() - luci.sys.call("env -i /etc/init.d/travelmate start >/dev/null 2>&1") - luci.http.redirect(luci.dispatcher.build_url("admin", "services", "travelmate")) +if fs.access("/usr/bin/qrencode") then + btn = s:option(Button, "btn", translate("View AP QR-Codes"), + translate("Connect your Android or iOS devices to your router's WiFi using the shown QR code.")) + btn.inputtitle = translate("QR-Codes") + btn.inputstyle = "apply" + btn.disabled = false + + function btn.write() + luci.http.redirect(luci.dispatcher.build_url("admin", "services", "travelmate", "apqr")) + end end -- Runtime information @@ -180,28 +169,34 @@ e2 = e:option(Value, "trm_radio", translate("Radio selection"), e2.datatype = "and(uciname,rangelength(6,6))" e2.rmempty = true -e3 = e:option(Value, "trm_maxretry", translate("Connection Limit"), - translate("Retry limit to connect to an uplink.")) -e3.default = 3 -e3.datatype = "range(1,10)" +e3 = e:option(Value, "trm_triggerdelay", translate("Trigger Delay"), + translate("Additional trigger delay in seconds before travelmate processing begins.")) +e3.datatype = "range(1,60)" +e3.default = 2 e3.rmempty = false -e4 = e:option(Value, "trm_minquality", translate("Signal Quality Threshold"), - translate("Minimum signal quality threshold as percent for conditional uplink (dis-) connections.")) -e4.default = 35 -e4.datatype = "range(20,80)" +e4 = e:option(Value, "trm_maxretry", translate("Connection Limit"), + translate("Retry limit to connect to an uplink.")) +e4.default = 3 +e4.datatype = "range(1,10)" e4.rmempty = false -e5 = e:option(Value, "trm_maxwait", translate("Interface Timeout"), - translate("How long should travelmate wait for a successful wlan uplink connection.")) -e5.default = 30 -e5.datatype = "range(20,40)" +e5 = e:option(Value, "trm_minquality", translate("Signal Quality Threshold"), + translate("Minimum signal quality threshold as percent for conditional uplink (dis-) connections.")) +e5.default = 35 +e5.datatype = "range(20,80)" e5.rmempty = false -e6 = e:option(Value, "trm_timeout", translate("Overall Timeout"), - translate("Timeout in seconds between retries in 'automatic' mode.")) -e6.default = 60 -e6.datatype = "range(30,300)" +e6 = e:option(Value, "trm_maxwait", translate("Interface Timeout"), + translate("How long should travelmate wait for a successful wlan uplink connection.")) +e6.default = 30 +e6.datatype = "range(20,40)" e6.rmempty = false +e7 = e:option(Value, "trm_timeout", translate("Overall Timeout"), + translate("Overall retry timeout in seconds.")) +e7.default = 60 +e7.datatype = "range(30,300)" +e7.rmempty = false + return m diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua index 50edd17bb8..83011e9dd5 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua @@ -26,18 +26,23 @@ m.hidden = { wpa_version = http.formvalue("wpa_version") } -if m.hidden.ssid ~= "" then - wssid = m:field(Value, "ssid", translate("SSID")) - wssid.datatype = "rangelength(1,32)" - wssid.default = m.hidden.ssid or "" -else +if m.hidden.ssid == "" then wssid = m:field(Value, "ssid", translate("SSID (hidden)")) +else + wssid = m:field(Value, "ssid", translate("SSID")) end +wssid.datatype = "rangelength(1,32)" +wssid.default = m.hidden.ssid or "" nobssid = m:field(Flag, "no_bssid", translate("Ignore BSSID")) -nobssid.default = nobssid.enabled +if m.hidden.ssid == "" then + nobssid.default = nobssid.disabled +else + nobssid.default = nobssid.enabled +end -bssid = m:field(Value, "bssid", translate("BSSID")) +bssid = m:field(Value, "bssid", translate("BSSID"), + translatef("The BSSID information '%s' is optional and only required for hidden networks", m.hidden.bssid or "")) bssid:depends("no_bssid", 0) bssid.datatype = "macaddr" bssid.default = m.hidden.bssid or "" @@ -171,6 +176,7 @@ function wssid.write(self, section, value) end uci:save("wireless") uci:commit("wireless") + luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1") http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations")) end diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua index 0c3cc1865b..0a7678f7ed 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua @@ -9,5 +9,6 @@ if cfg ~= nil then uci:delete("wireless", cfg) uci:save("wireless") uci:commit("wireless") + luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1") end http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations")) diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua index ee4d342ea1..f3ad762594 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua @@ -162,6 +162,7 @@ function wssid.write(self, section, value) end uci:save("wireless") uci:commit("wireless") + luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1") m.on_cancel() end diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm index 13342a3e66..a92dbe1469 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/ap_qr.htm @@ -44,9 +44,7 @@ This is free software, licensed under the Apache License, Version 2.0 local e_ssid = string.gsub(ssid,"[\"\\';:, ]",[[\\\%1]]) local e_key = string.gsub(key,"[\"\\';:, ]",[[\\\%1]]) local qrcode = "" - if nixio.fs.access("/usr/bin/qrencode") then - qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'" .. e_ssid .. "'\";T:'" .. enc .. "';P:\"'" .. e_key .. "'\";H:'" .. hidden .. "';'") - end + qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'" .. e_ssid .. "'\";T:'" .. enc .. "';P:\"'" .. e_key .. "'\";H:'" .. hidden .. "';'") -%> <fieldset class="cbi-section"> <legend>AP on <%=device%> with SSID "<%=ssid%>"</legend> @@ -58,5 +56,10 @@ This is free software, licensed under the Apache License, Version 2.0 end) %> </div> +<div class="cbi-page-actions right"> + <form class="inline" action="<%=luci.dispatcher.build_url('admin/services/travelmate/tab_from_cbi')%>" method="post"> + <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>"/> + </form> +</div> <%+footer%> diff --git a/applications/luci-app-travelmate/po/ja/travelmate.po b/applications/luci-app-travelmate/po/ja/travelmate.po index 30f34ef309..535a9db260 100644 --- a/applications/luci-app-travelmate/po/ja/travelmate.po +++ b/applications/luci-app-travelmate/po/ja/travelmate.po @@ -12,9 +12,6 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "Language: ja\n" -msgid "AP QR-Codes" -msgstr "AP QR-コード" - msgid "Actions" msgstr "操作" @@ -65,6 +62,12 @@ msgid "" msgstr "" "トラベル ルーター機能を有効化するための、 Travelmate パッケージの設定です。" +msgid "" +"Connect your Android or iOS devices to your router's WiFi using the shown QR " +"code." +msgstr "" +"Android や iOS デバイスを、表示される QR コードを使用して WiFi に接続します。" + msgid "Connection Limit" msgstr "接続制限" @@ -110,9 +113,6 @@ msgstr "無線アップリンク設定の編集" msgid "Edit this Uplink" msgstr "このアップリンクを編集" -msgid "Enable 'automatic' mode" -msgstr "'automatic' モードの有効化" - msgid "Enable travelmate" msgstr "Travelmate の有効化" @@ -144,10 +144,6 @@ msgstr "TKIP" msgid "Force TKIP and CCMP (AES)" msgstr "TKIP と CCMP (AES)" -msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." -msgstr "" -"'trigger' モード時に、手動でアップリンクの再スキャンと再接続を行います。" - msgid "" "Here you'll find the QR codes from all of your configured Access Points. It " "allows you to connect your Android or iOS devices to your router's WiFi " @@ -176,19 +172,9 @@ msgstr "インターフェース タイムアウト" msgid "Interface Wizard" msgstr "インターフェース ウィザード" -msgid "" -"Keep travelmate in an active state. Check every n seconds the connection " -"status, i.e. the uplink availability." -msgstr "" -"Travelmate をアクティブ状態で維持します。\"実行間隔\" で設定された時間毎" -"(秒)に、アップリンクの可用性を確認するために接続状態をチェックします" - msgid "Last rundate" msgstr "最終実行日時" -msgid "Manual Rescan" -msgstr "手動再スキャン" - msgid "" "Minimum signal quality threshold as percent for conditional uplink (dis-) " "connections." @@ -215,6 +201,9 @@ msgstr "デフォルトの設定が適切でない場合、さらに設定する msgid "Overall Timeout" msgstr "実行間隔" +msgid "Overall retry timeout in seconds." +msgstr "" + msgid "Overview" msgstr "概要" @@ -246,15 +235,15 @@ msgstr "" "ンクを追加することができます。現在使用されているアップリンクは、青色で強調さ" "れます。" +msgid "QR-Codes" +msgstr "QR-コード" + msgid "Radio selection" msgstr "無線の選択" msgid "Repeat scan" msgstr "再スキャン" -msgid "Rescan" -msgstr "再スキャン" - msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'." msgstr "Travelmate が指定された無線に接続するよう制御します。(例: 'radio0')" @@ -292,6 +281,10 @@ msgid "Station Radio" msgstr "ステーション電波" msgid "" +"The BSSID information '%s' is optional and only required for hidden networks" +msgstr "" + +msgid "" "This form allows you to modify the content of the main firewall " "configuration file (/etc/config/firewall)." msgstr "" @@ -326,9 +319,6 @@ msgstr "" "このフォームには、システムログ内の Travelmate に関するメッセージのみが表示さ" "れます。" -msgid "Timeout in seconds between retries in 'automatic' mode." -msgstr "'automatic' モード時に接続を確認または再試行する間隔(秒)です。" - msgid "Travelmate" msgstr "Travelmate" @@ -359,6 +349,9 @@ msgstr "アップリンク SSID" msgid "Uplink interface" msgstr "アップリンク インターフェース" +msgid "View AP QR-Codes" +msgstr "AP QR-コードを確認" + msgid "View Logfile" msgstr "ログファイルの確認" @@ -397,3 +390,26 @@ msgstr "(不明)" msgid "n/a" msgstr "利用不可" + +#~ msgid "Enable 'automatic' mode" +#~ msgstr "'automatic' モードの有効化" + +#~ msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." +#~ msgstr "" +#~ "'trigger' モード時に、手動でアップリンクの再スキャンと再接続を行います。" + +#~ msgid "" +#~ "Keep travelmate in an active state. Check every n seconds the connection " +#~ "status, i.e. the uplink availability." +#~ msgstr "" +#~ "Travelmate をアクティブ状態で維持します。\"実行間隔\" で設定された時間毎" +#~ "(秒)に、アップリンクの可用性を確認するために接続状態をチェックします" + +#~ msgid "Manual Rescan" +#~ msgstr "手動再スキャン" + +#~ msgid "Rescan" +#~ msgstr "再スキャン" + +#~ msgid "Timeout in seconds between retries in 'automatic' mode." +#~ msgstr "'automatic' モード時に接続を確認または再試行する間隔(秒)です。" diff --git a/applications/luci-app-travelmate/po/pt-br/travelmate.po b/applications/luci-app-travelmate/po/pt-br/travelmate.po index 7cb6ac0613..5ea4d4a0d3 100644 --- a/applications/luci-app-travelmate/po/pt-br/travelmate.po +++ b/applications/luci-app-travelmate/po/pt-br/travelmate.po @@ -12,9 +12,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "Language: pt_BR\n" -msgid "AP QR-Codes" -msgstr "" - msgid "Actions" msgstr "" @@ -62,6 +59,11 @@ msgid "" "functionality." msgstr "" +msgid "" +"Connect your Android or iOS devices to your router's WiFi using the shown QR " +"code." +msgstr "" + msgid "Connection Limit" msgstr "" @@ -105,9 +107,6 @@ msgstr "" msgid "Edit this Uplink" msgstr "" -msgid "Enable 'automatic' mode" -msgstr "" - msgid "Enable travelmate" msgstr "" @@ -137,9 +136,6 @@ msgstr "" msgid "Force TKIP and CCMP (AES)" msgstr "" -msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." -msgstr "" - msgid "" "Here you'll find the QR codes from all of your configured Access Points. It " "allows you to connect your Android or iOS devices to your router's WiFi " @@ -165,17 +161,9 @@ msgstr "" msgid "Interface Wizard" msgstr "" -msgid "" -"Keep travelmate in an active state. Check every n seconds the connection " -"status, i.e. the uplink availability." -msgstr "" - msgid "Last rundate" msgstr "" -msgid "Manual Rescan" -msgstr "" - msgid "" "Minimum signal quality threshold as percent for conditional uplink (dis-) " "connections." @@ -200,6 +188,9 @@ msgstr "" msgid "Overall Timeout" msgstr "" +msgid "Overall retry timeout in seconds." +msgstr "" + msgid "Overview" msgstr "" @@ -227,13 +218,13 @@ msgid "" "one. The currently used uplink is emphasized in blue." msgstr "" -msgid "Radio selection" +msgid "QR-Codes" msgstr "" -msgid "Repeat scan" +msgid "Radio selection" msgstr "" -msgid "Rescan" +msgid "Repeat scan" msgstr "" msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'." @@ -273,6 +264,10 @@ msgid "Station Radio" msgstr "" msgid "" +"The BSSID information '%s' is optional and only required for hidden networks" +msgstr "" + +msgid "" "This form allows you to modify the content of the main firewall " "configuration file (/etc/config/firewall)." msgstr "" @@ -297,9 +292,6 @@ msgid "" "messages only." msgstr "" -msgid "Timeout in seconds between retries in 'automatic' mode." -msgstr "" - msgid "Travelmate" msgstr "Travelmate" @@ -330,6 +322,9 @@ msgstr "" msgid "Uplink interface" msgstr "" +msgid "View AP QR-Codes" +msgstr "" + msgid "View Logfile" msgstr "" diff --git a/applications/luci-app-travelmate/po/ru/travelmate.po b/applications/luci-app-travelmate/po/ru/travelmate.po index 0b04e27838..fad31bb849 100644 --- a/applications/luci-app-travelmate/po/ru/travelmate.po +++ b/applications/luci-app-travelmate/po/ru/travelmate.po @@ -15,9 +15,6 @@ msgstr "" "Project-Info: Это технический перевод, не дословный. Главное-удобный русский " "интерфейс, все проверялось в графическом режиме, совместим с другими apps\n" -msgid "AP QR-Codes" -msgstr "" - msgid "Actions" msgstr "Действия" @@ -65,6 +62,11 @@ msgid "" "functionality." msgstr "Настройка утилиты TravelMate - помощника путешественника. " +msgid "" +"Connect your Android or iOS devices to your router's WiFi using the shown QR " +"code." +msgstr "" + msgid "Connection Limit" msgstr "Ограничение соединений" @@ -110,9 +112,6 @@ msgstr "Редактировать настройки беспроводной msgid "Edit this Uplink" msgstr "Редактировать настройки сети" -msgid "Enable 'automatic' mode" -msgstr "Включить режим 'автоматически'" - msgid "Enable travelmate" msgstr "Включить Travelmate" @@ -144,11 +143,6 @@ msgstr "Назначить TKIP" msgid "Force TKIP and CCMP (AES)" msgstr "Назначить TKIP и CCMP (AES)" -msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." -msgstr "" -"Принудительно выполнить повторное сканирование/повторное подключение внешних " -"сетей в режиме 'ручной'." - msgid "" "Here you'll find the QR codes from all of your configured Access Points. It " "allows you to connect your Android or iOS devices to your router's WiFi " @@ -174,19 +168,9 @@ msgstr "Временная задержка интерфейса" msgid "Interface Wizard" msgstr "Помощник настройки интерфейса" -msgid "" -"Keep travelmate in an active state. Check every n seconds the connection " -"status, i.e. the uplink availability." -msgstr "" -"Поддержка TravelMate в активном состоянии.<br />Проверка состояния " -"соединения каждые n секунд, т.е. доступность внешней сети." - msgid "Last rundate" msgstr "Дата последнего запуска" -msgid "Manual Rescan" -msgstr "Поиск сети вручную" - msgid "" "Minimum signal quality threshold as percent for conditional uplink (dis-) " "connections." @@ -213,6 +197,9 @@ msgstr "" msgid "Overall Timeout" msgstr "Общее время ожидания" +msgid "Overall retry timeout in seconds." +msgstr "" + msgid "Overview" msgstr "Главное меню" @@ -244,15 +231,15 @@ msgstr "" "упорядочивать существующий список внешних сетей или выполнять их поиск.<br /" ">Используемое сетевое соединение выделено синим цветом." +msgid "QR-Codes" +msgstr "" + msgid "Radio selection" msgstr "Выбор Wi-Fi устройства" msgid "Repeat scan" msgstr "Повторить поиск" -msgid "Rescan" -msgstr "Пересканировать" - msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'." msgstr "Выделить TravelMate-у конкретное Wi-Fi устройство, например 'radio0'." @@ -290,6 +277,10 @@ msgid "Station Radio" msgstr "Wi-Fi устройство клиента" msgid "" +"The BSSID information '%s' is optional and only required for hidden networks" +msgstr "" + +msgid "" "This form allows you to modify the content of the main firewall " "configuration file (/etc/config/firewall)." msgstr "" @@ -324,11 +315,6 @@ msgstr "" "Страница просмотра системного журнала, показаны только события связанные с " "работой утилиты TravelMate." -msgid "Timeout in seconds between retries in 'automatic' mode." -msgstr "" -"Время ожидания в секундах между повторными попытками соединения в режиме " -"'автоматически'." - msgid "Travelmate" msgstr "TravelMate" @@ -359,6 +345,9 @@ msgstr "SSID внешней сети" msgid "Uplink interface" msgstr "Интерфейс внешней сети" +msgid "View AP QR-Codes" +msgstr "" + msgid "View Logfile" msgstr "Показать системный журнал" @@ -396,6 +385,32 @@ msgstr "скрытый" msgid "n/a" msgstr "нет данных" +#~ msgid "Enable 'automatic' mode" +#~ msgstr "Включить режим 'автоматически'" + +#~ msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." +#~ msgstr "" +#~ "Принудительно выполнить повторное сканирование/повторное подключение " +#~ "внешних сетей в режиме 'ручной'." + +#~ msgid "" +#~ "Keep travelmate in an active state. Check every n seconds the connection " +#~ "status, i.e. the uplink availability." +#~ msgstr "" +#~ "Поддержка TravelMate в активном состоянии.<br />Проверка состояния " +#~ "соединения каждые n секунд, т.е. доступность внешней сети." + +#~ msgid "Manual Rescan" +#~ msgstr "Поиск сети вручную" + +#~ msgid "Rescan" +#~ msgstr "Пересканировать" + +#~ msgid "Timeout in seconds between retries in 'automatic' mode." +#~ msgstr "" +#~ "Время ожидания в секундах между повторными попытками соединения в режиме " +#~ "'автоматически'." + #~ msgid "" #~ "How long should travelmate wait for a successful wlan interface reload." #~ msgstr "" diff --git a/applications/luci-app-travelmate/po/templates/travelmate.pot b/applications/luci-app-travelmate/po/templates/travelmate.pot index e27c61a9d0..8ba17668ec 100644 --- a/applications/luci-app-travelmate/po/templates/travelmate.pot +++ b/applications/luci-app-travelmate/po/templates/travelmate.pot @@ -1,9 +1,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" -msgid "AP QR-Codes" -msgstr "" - msgid "Actions" msgstr "" @@ -51,6 +48,11 @@ msgid "" "functionality." msgstr "" +msgid "" +"Connect your Android or iOS devices to your router's WiFi using the shown QR " +"code." +msgstr "" + msgid "Connection Limit" msgstr "" @@ -94,9 +96,6 @@ msgstr "" msgid "Edit this Uplink" msgstr "" -msgid "Enable 'automatic' mode" -msgstr "" - msgid "Enable travelmate" msgstr "" @@ -126,9 +125,6 @@ msgstr "" msgid "Force TKIP and CCMP (AES)" msgstr "" -msgid "Force a manual uplink rescan / reconnect in 'trigger' mode." -msgstr "" - msgid "" "Here you'll find the QR codes from all of your configured Access Points. It " "allows you to connect your Android or iOS devices to your router's WiFi " @@ -154,17 +150,9 @@ msgstr "" msgid "Interface Wizard" msgstr "" -msgid "" -"Keep travelmate in an active state. Check every n seconds the connection " -"status, i.e. the uplink availability." -msgstr "" - msgid "Last rundate" msgstr "" -msgid "Manual Rescan" -msgstr "" - msgid "" "Minimum signal quality threshold as percent for conditional uplink (dis-) " "connections." @@ -189,6 +177,9 @@ msgstr "" msgid "Overall Timeout" msgstr "" +msgid "Overall retry timeout in seconds." +msgstr "" + msgid "Overview" msgstr "" @@ -216,13 +207,13 @@ msgid "" "one. The currently used uplink is emphasized in blue." msgstr "" -msgid "Radio selection" +msgid "QR-Codes" msgstr "" -msgid "Repeat scan" +msgid "Radio selection" msgstr "" -msgid "Rescan" +msgid "Repeat scan" msgstr "" msgid "Restrict travelmate to a dedicated radio, e.g. 'radio0'." @@ -262,6 +253,10 @@ msgid "Station Radio" msgstr "" msgid "" +"The BSSID information '%s' is optional and only required for hidden networks" +msgstr "" + +msgid "" "This form allows you to modify the content of the main firewall " "configuration file (/etc/config/firewall)." msgstr "" @@ -286,9 +281,6 @@ msgid "" "messages only." msgstr "" -msgid "Timeout in seconds between retries in 'automatic' mode." -msgstr "" - msgid "Travelmate" msgstr "" @@ -319,6 +311,9 @@ msgstr "" msgid "Uplink interface" msgstr "" +msgid "View AP QR-Codes" +msgstr "" + msgid "View Logfile" msgstr "" diff --git a/applications/luci-app-unbound/luasrc/controller/unbound.lua b/applications/luci-app-unbound/luasrc/controller/unbound.lua index b44bf038eb..730ca724a4 100644 --- a/applications/luci-app-unbound/luasrc/controller/unbound.lua +++ b/applications/luci-app-unbound/luasrc/controller/unbound.lua @@ -47,12 +47,12 @@ function index() if valman ~= "1" then entry({"admin", "services", "unbound", "files", "base"}, call("ShowUnboundConf"), _("UCI: Unbound"), 10).leaf = true else - entry({"admin", "services", "unbound", "files", "base"}, cbi("unbound/manual"), _("Edit: Unbound"), 10).leaf = true + entry({"admin", "services", "unbound", "files", "base"}, form("unbound/manual"), _("Edit: Unbound"), 10).leaf = true end - entry({"admin", "services", "unbound", "files", "server"}, cbi("unbound/server"), _("Edit: Server"), 20).leaf = true - entry({"admin", "services", "unbound", "files", "extended"}, cbi("unbound/extended"), _("Edit: Extended"), 30).leaf = true + entry({"admin", "services", "unbound", "files", "server"}, form("unbound/server"), _("Edit: Server"), 20).leaf = true + entry({"admin", "services", "unbound", "files", "extended"}, form("unbound/extended"), _("Edit: Extended"), 30).leaf = true if nixio.fs.access("/var/lib/unbound/unbound_dhcp.conf") then diff --git a/applications/luci-app-unbound/luasrc/model/cbi/unbound/configure.lua b/applications/luci-app-unbound/luasrc/model/cbi/unbound/configure.lua index cdf7757e3a..c92e379957 100644 --- a/applications/luci-app-unbound/luasrc/model/cbi/unbound/configure.lua +++ b/applications/luci-app-unbound/luasrc/model/cbi/unbound/configure.lua @@ -4,9 +4,12 @@ -- Licensed to the public under the Apache License 2.0. local m1, s1 -local ena, mcf, lci, lsv, rlh, rpv, vld, nvd, eds, prt, tlm -local ctl, dlk, dom, dty, lfq, wfq, exa, dp6, d64, pfx, qry, qrs +local ena, mcf, lci, lsv +local rlh, rpv, vld, nvd, eds, prt, tlm +local ctl, dlk, dom, dty, lfq, wfq, exa +local dp6, d64, pfx, qry, qrs local pro, tgr, rsc, rsn, ag2, stt +local rpn, din, dfw local ucl = luci.model.uci.cursor() local valman = ucl:get_first("unbound", "unbound", "manual_conf") @@ -19,10 +22,10 @@ s1.anonymous = true --LuCI, Unbound, or Not s1:tab("basic", translate("Basic"), translatef("<h3>Unbound Basic Settings</h3>\n" - .. "<a href=\"%s\" target=\"_blank\">Unbound</a>" + .. "<a href=\"%s\" target=\"_blank\">Unbound (link)</a>" .. " is a validating, recursive, and caching DNS resolver. " - .. "UCI help can be found on " - .. "<a href=\"%s\" target=\"_blank\">github</a>.", + .. "UCI documentation can be found on " + .. "<a href=\"%s\" target=\"_blank\">github (link)</a>.", "https://www.unbound.net/", "https://github.com/openwrt/packages/blob/master/net/unbound/files/README.md")) @@ -34,8 +37,8 @@ mcf = s1:taboption("basic", Flag, "manual_conf", translate("Manual Conf:"), translate("Skip UCI and use /etc/unbound/unbound.conf")) mcf.rmempty = false -lci = s1:taboption("basic", Flag, "extended_luci", translate("Advanced LuCI:"), - translate("See detailed tabs for debug and advanced manual configuration")) +lci = s1:taboption("basic", Flag, "extended_luci", translate("Extended Tabs:"), + translate("See detailed tabs for statistics, debug, and manual configuration")) lci.rmempty = false @@ -61,29 +64,23 @@ if valman ~= "1" then -- Not in manual configuration mode; show UCI s1:tab("advanced", translate("Advanced"), translatef("<h3>Unbound Advanced Settings</h3>\n" - .. "Advanced setttings and plugin modules for " - .. "<a href=\"%s\" target=\"_blank\">Unbound</a>" + .. "Link DHCP-DNS, Manipulate DNS, or protect your local domain in " + .. "<a href=\"%s\" target=\"_blank\">Unbound </a>" .. " DNS resolver.", "https://www.unbound.net/")) + s1:tab("resource", translate("Resource"), translatef("<h3>Unbound Resource Settings</h3>\n" .. "Memory and protocol setttings for " - .. "<a href=\"%s\" target=\"_blank\">Unbound</a>" + .. "<a href=\"%s\" target=\"_blank\">Unbound </a>" .. " DNS resolver.", "https://www.unbound.net/")) + --Basic Tab lsv = s1:taboption("basic", Flag, "localservice", translate("Local Service:"), translate("Accept queries only from local subnets")) lsv.rmempty = false - rlh = s1:taboption("basic", Flag, "rebind_localhost", translate("Block Localhost Rebind:"), - translate("Prevent upstream response of 127.0.0.0/8")) - rlh.rmempty = false - - rpv = s1:taboption("basic", Flag, "rebind_protection", translate("Block Private Rebind:"), - translate("Prevent upstream response of RFC1918 ranges")) - rpv.rmempty = false - vld = s1:taboption("basic", Flag, "validator", translate("Enable DNSSEC:"), translate("Enable the DNSSEC validator module")) vld.rmempty = false @@ -93,31 +90,37 @@ if valman ~= "1" then nvd.rmempty = false nvd:depends({ validator = true }) - eds = s1:taboption("basic", Value, "edns_size", translate("EDNS Size:"), - translate("Limit extended DNS packet size")) - eds.datatype = "and(uinteger,min(512),max(4096))" - eds.rmempty = false + din = s1:taboption("basic", DynamicList, "domain_insecure", + translate("Domain Insecure:"), + translate("List domains to bypass checks of DNSSEC")) + din:depends({ validator = true }) + + d64 = s1:taboption("basic", Flag, "dns64", translate("Enable DNS64:"), + translate("Enable the DNS64 module")) + d64.rmempty = false + + pfx = s1:taboption("basic", Value, "dns64_prefix", translate("DNS64 Prefix:"), + translate("Prefix for generated DNS64 addresses")) + pfx.datatype = "ip6addr" + pfx.placeholder = "64:ff9b::/96" + pfx.optional = true + pfx:depends({ dns64 = true }) + + qry = s1:taboption("basic", Flag, "query_minimize", translate("Query Minimize:"), + translate("Break down query components for limited added privacy")) + qry.rmempty = false + + qrs = s1:taboption("basic", Flag, "query_min_strict", translate("Strict Minimize:"), + translate("Strict version of 'query minimize' but it can break DNS")) + qrs.rmempty = false + qrs:depends({ query_minimize = true }) prt = s1:taboption("basic", Value, "listen_port", translate("Listening Port:"), translate("Choose Unbounds listening port")) prt.datatype = "port" prt.rmempty = false - tlm = s1:taboption("basic", Value, "ttl_min", translate("TTL Minimum:"), - translate("Prevent excessively short cache periods")) - tlm.datatype = "and(uinteger,min(0),max(600))" - tlm.rmempty = false - - --Advanced Tab - ctl = s1:taboption("advanced", ListValue, "unbound_control", translate("Unbound Control App:"), - translate("Enable access for unbound-control")) - ctl.rmempty = false - ctl:value("0", translate("No Remote Control")) - ctl:value("1", translate("Local Host, No Encryption")) - ctl:value("2", translate("Local Host, Encrypted")) - ctl:value("3", translate("Local Subnet, Encrypted")) - ctl:value("4", translate("Local Subnet, Static Encryption")) - + --Avanced Tab dlk = s1:taboption("advanced", ListValue, "dhcp_link", translate("DHCP Link:"), translate("Link to supported programs to load DHCP into DNS")) dlk:value("none", translate("No Link")) @@ -125,6 +128,11 @@ if valman ~= "1" then dlk:value("odhcpd", "odhcpd") dlk.rmempty = false + dp6 = s1:taboption("advanced", Flag, "dhcp4_slaac6", translate("DHCPv4 to SLAAC:"), + translate("Use DHCPv4 MAC to discover IP6 hosts SLAAC (EUI64)")) + dp6.rmempty = false + dp6:depends({ dhcp_link = "odhcpd" }) + dom = s1:taboption("advanced", Value, "domain", translate("Local Domain:"), translate("Domain suffix for this router and DHCP clients")) dom.placeholder = "lan" @@ -142,7 +150,7 @@ if valman ~= "1" then lfq = s1:taboption("advanced", ListValue, "add_local_fqdn", translate("LAN DNS:"), translate("How to enter the LAN or local network router in DNS")) - lfq:value("0", translate("No DNS")) + lfq:value("0", translate("No Entry")) lfq:value("1", translate("Hostname, Primary Address")) lfq:value("2", translate("Hostname, All Addresses")) lfq:value("3", translate("Host FQDN, All Addresses")) @@ -152,7 +160,7 @@ if valman ~= "1" then wfq = s1:taboption("advanced", ListValue, "add_wan_fqdn", translate("WAN DNS:"), translate("Override the WAN side router entry in DNS")) - wfq:value("0", translate("Upstream")) + wfq:value("0", translate("Use Upstream")) wfq:value("1", translate("Hostname, Primary Address")) wfq:value("2", translate("Hostname, All Addresses")) wfq:value("3", translate("Host FQDN, All Addresses")) @@ -169,33 +177,41 @@ if valman ~= "1" then exa:depends({ dhcp_link = "none" }) exa:depends({ dhcp_link = "odhcpd" }) - dp6 = s1:taboption("advanced", Flag, "dhcp4_slaac6", translate("DHCPv4 to SLAAC:"), - translate("Use DHCPv4 MAC to discover IP6 hosts SLAAC (EUI64)")) - dp6.rmempty = false + dfw = s1:taboption("advanced", DynamicList, "domain_forward", + translate("Domain Forward:"), + translate("List domains to simply forward to stub resolvers in /tmp/resolve.auto")) - d64 = s1:taboption("advanced", Flag, "dns64", translate("Enable DNS64:"), - translate("Enable the DNS64 module")) - d64.rmempty = false + rlh = s1:taboption("advanced", Flag, "rebind_localhost", translate("Filter Localhost Rebind:"), + translate("Protect against upstream response of 127.0.0.0/8")) + rlh.rmempty = false - pfx = s1:taboption("advanced", Value, "dns64_prefix", translate("DNS64 Prefix:"), - translate("Prefix for generated DNS64 addresses")) - pfx.datatype = "ip6addr" - pfx.placeholder = "64:ff9b::/96" - pfx.optional = true - pfx:depends({ dns64 = true }) + rpv = s1:taboption("advanced", ListValue, "rebind_protection", translate("Filter Private Rebind:"), + translate("Protect against upstream responses within local subnets")) + rpv:value("0", translate("No Filter")) + rpv:value("1", translate("Filter RFC1918/4193")) + rpv:value("2", translate("Filter Entire Subnet")) + rpv.rmempty = false - qry = s1:taboption("advanced", Flag, "query_minimize", translate("Query Minimize:"), - translate("Break down query components for limited added privacy")) - qry.rmempty = false - - qrs = s1:taboption("advanced", Flag, "query_min_strict", translate("Strict Minimize:"), - translate("Strict version of 'query minimize' but it can break DNS")) - qrs.rmempty = false - qrs:depends({ query_minimize = true }) + rpn = s1:taboption("advanced", Value, "rebind_interface", translate("Rebind Network Filter:"), + translate("Network subnets to filter from upstream responses")) + rpn.template = "cbi/network_netlist" + rpn.widget = "checkbox" + rpn.cast = "string" + rpn:depends({ rebind_protection = 2 }) + rpn:depends({ rebind_protection = 3 }) --TODO: dnsmasq needs to not reference resolve-file and get off port 53. --Resource Tuning Tab + ctl = s1:taboption("resource", ListValue, "unbound_control", translate("Unbound Control App:"), + translate("Enable access for unbound-control")) + ctl.rmempty = false + ctl:value("0", translate("No Remote Control")) + ctl:value("1", translate("Local Host, No Encryption")) + ctl:value("2", translate("Local Host, Encrypted")) + ctl:value("3", translate("Local Subnet, Encrypted")) + ctl:value("4", translate("Local Subnet, Static Encryption")) + pro = s1:taboption("resource", ListValue, "protocol", translate("Recursion Protocol:"), translate("Chose the protocol recursion queries leave on")) pro:value("mixed", translate("IP4 and IP6")) @@ -220,7 +236,7 @@ if valman ~= "1" then rsc.rmempty = false ag2 = s1:taboption("resource", Value, "root_age", translate("Root DSKEY Age:"), - translate("Limit days between RFC5011 to reduce flash writes")) + translate("Limit days between RFC 5011 copies to reduce flash writes")) ag2.datatype = "and(uinteger,min(1),max(99))" ag2:value("3", "3") ag2:value("9", "9 ("..translate("default")..")") @@ -228,11 +244,21 @@ if valman ~= "1" then ag2:value("24", "24") ag2:value("99", "99 ("..translate("never")..")") + eds = s1:taboption("resource", Value, "edns_size", translate("EDNS Size:"), + translate("Limit extended DNS packet size")) + eds.datatype = "and(uinteger,min(512),max(4096))" + eds.rmempty = false + + tlm = s1:taboption("resource", Value, "ttl_min", translate("TTL Minimum:"), + translate("Prevent excessively short cache periods")) + tlm.datatype = "and(uinteger,min(0),max(600))" + tlm.rmempty = false + stt = s1:taboption("resource", Flag, "extended_stats", translate("Extended Statistics:"), translate("Extended statistics are printed from unbound-control")) stt.rmempty = false - tgr = s1:taboption("resource", Value, "trigger", translate("Trigger Networks:"), + tgr = s1:taboption("resource", Value, "trigger_interface", translate("Trigger Networks:"), translate("Networks that may trigger Unbound to reload (avoid wan6)")) tgr.template = "cbi/network_netlist" tgr.widget = "checkbox" diff --git a/applications/luci-app-upnp/luasrc/controller/upnp.lua b/applications/luci-app-upnp/luasrc/controller/upnp.lua index e485708f0e..95a0ef4862 100644 --- a/applications/luci-app-upnp/luasrc/controller/upnp.lua +++ b/applications/luci-app-upnp/luasrc/controller/upnp.lua @@ -21,7 +21,7 @@ end function act_status() local uci = luci.model.uci.cursor() local lease_file = uci:get("upnpd", "config", "upnp_lease_file") - + local ipt = io.popen("iptables --line-numbers -t nat -xnvL MINIUPNPD 2>/dev/null") if ipt then local upnpf = lease_file and io.open(lease_file, "r") @@ -39,7 +39,7 @@ function act_status() num = tonumber(num) extport = tonumber(extport) intport = tonumber(intport) - + if upnpf then local uln = upnpf:read("*l") if uln then descr = uln:match(string.format("^%s:%d:%s:%d:%%d*:(.*)$", proto:upper(), extport, intaddr, intport)) end @@ -76,7 +76,7 @@ function act_delete(num) local lease_file = uci:get("upnpd", "config", "upnp_lease_file") if lease_file and nixio.fs.access(lease_file) then - luci.sys.call("sed -i -e '%dd' %q" %{ idx, lease_file }) + luci.sys.call("sed -i -e '%dd' %s" %{ idx, luci.util.shellquote(lease_file) }) end luci.http.status(200, "OK") diff --git a/applications/luci-app-upnp/po/zh-cn/upnp.po b/applications/luci-app-upnp/po/zh-cn/upnp.po index 6620d93c0d..894de1c260 100644 --- a/applications/luci-app-upnp/po/zh-cn/upnp.po +++ b/applications/luci-app-upnp/po/zh-cn/upnp.po @@ -16,31 +16,31 @@ msgstr "" msgid "" "ACLs specify which external ports may be redirected to which internal " "addresses and ports" -msgstr "指定外部端口的ACL可能会被重定向至某些内部地址及端口" +msgstr "ACL 指定哪些外部端口可以被重定向至哪些内部地址及端口" msgid "Action" msgstr "动作" msgid "Active UPnP Redirects" -msgstr "活动的UPnP重定向" +msgstr "活动的 UPnP 重定向" msgid "Advanced Settings" msgstr "高级设置" msgid "Allow adding forwards only to requesting ip addresses" -msgstr "允许添加只转发给请求的IP地址(当启用时,UPnP的客户可以只转发到其IP)" +msgstr "允许只向请求的 IP 地址添加转发" msgid "Announced model number" -msgstr "公布的型号" +msgstr "通告的型号" msgid "Announced serial number" -msgstr "公布的序列号" +msgstr "通告的序列号" msgid "Clean rules interval" -msgstr "定时自动清除无效规则" +msgstr "定时清除规则" msgid "Clean rules threshold" -msgstr "启动时清除端口转发" +msgstr "清除规则阈值" msgid "Client Address" msgstr "客户端地址" @@ -49,31 +49,31 @@ msgid "Client Port" msgstr "客户端端口" msgid "Collecting data..." -msgstr "正在收集数据" +msgstr "正在收集数据..." msgid "Comment" msgstr "备注" msgid "Delete" -msgstr "" +msgstr "删除" msgid "Description" -msgstr "" +msgstr "描述" msgid "Device UUID" -msgstr "设备UUID" +msgstr "设备 UUID" msgid "Downlink" msgstr "下行速率" msgid "Enable NAT-PMP functionality" -msgstr "启用NAT-PMP功能" +msgstr "启用 NAT-PMP 功能" msgid "Enable UPnP functionality" -msgstr "启用UPnP功能" +msgstr "启用 UPnP 功能" msgid "Enable additional logging" -msgstr "启用额外的日志记录" +msgstr "启用额外的日志" msgid "Enable secure mode" msgstr "启用安全模式" @@ -94,19 +94,19 @@ msgid "Internal ports" msgstr "内部端口" msgid "MiniUPnP ACLs" -msgstr "MiniUPnP的ACL" +msgstr "MiniUPnP 的 ACL" msgid "MiniUPnP settings" -msgstr "MiniUPnP设置" +msgstr "MiniUPnP 设置" msgid "Notify interval" -msgstr "警报间隔" +msgstr "通知间隔" msgid "Port" msgstr "端口" msgid "Presentation URL" -msgstr "显示URL" +msgstr "显示 URL" msgid "Protocol" msgstr "协议" @@ -118,10 +118,10 @@ msgid "Report system instead of daemon uptime" msgstr "用系统运行时间代替进程运行时间" msgid "Start UPnP and NAT-PMP service" -msgstr "启动UPnP与NAT-PMP服务" +msgstr "启动 UPnP 与 NAT-PMP 服务" msgid "There are no active redirects." -msgstr "没有活动的重定向" +msgstr "没有活动的重定向。" msgid "UPnP" msgstr "UPnP" @@ -129,19 +129,19 @@ msgstr "UPnP" msgid "" "UPnP allows clients in the local network to automatically configure the " "router." -msgstr "UPnP允许局域网内客户端自动设置路由上的端口转发。" +msgstr "UPnP 允许局域网内客户端自动设置路由器上的端口转发。" msgid "UPnP lease file" -msgstr "UPnP租约文件" +msgstr "UPnP 租约文件" msgid "Universal Plug & Play" -msgstr "通用即插即用(UPnP)" +msgstr "通用即插即用(UPnP)" msgid "Uplink" msgstr "上行速率" msgid "Value in KByte/s, informational only" -msgstr "值为KByte/s,仅供参考" +msgstr "值为 KByte/s,仅供参考" #~ msgid "Delete Redirect" #~ msgstr "删除转发规则" diff --git a/applications/luci-app-vnstat/luasrc/view/vnstat.htm b/applications/luci-app-vnstat/luasrc/view/vnstat.htm index 2b8d9ff9c9..42d7d2404b 100644 --- a/applications/luci-app-vnstat/luasrc/view/vnstat.htm +++ b/applications/luci-app-vnstat/luasrc/view/vnstat.htm @@ -21,12 +21,13 @@ style = (style and #style > 0) and style or "s" -- render image -- if iface then - style = style:gsub("[^%w]", "") - iface = iface:gsub("[^%w%.%-%_]", "") - luci.http.prepare_content("image/png") - local png = io.popen("vnstati -i '%s' '-%s' -o -" % { iface, style }) + local png = io.popen("vnstati -i %s -%s -o -" %{ + utl.shellquote(iface), + utl.shellquote(style) + }) + luci.http.write(png:read("*a")) png:close() @@ -89,7 +90,7 @@ dbdir = dbdir or "/var/lib/vnstat" <% end end - end + end %> <% if empty then %> diff --git a/applications/luci-app-vpnbypass/Makefile b/applications/luci-app-vpnbypass/Makefile index 838840e6b0..f426acc537 100644 --- a/applications/luci-app-vpnbypass/Makefile +++ b/applications/luci-app-vpnbypass/Makefile @@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service. LUCI_DEPENDS:=+luci +vpnbypass LUCI_PKGARCH:=all -PKG_RELEASE:=3 +PKG_RELEASE:=4 include ../../luci.mk diff --git a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua index 9d2f5f425c..6545154c2c 100644 --- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua @@ -30,7 +30,7 @@ p2.optional = false -- Local Subnets r1 = s:option(DynamicList, "localsubnet", translate("Local IP Addresses to Bypass"), translate("Local IP addresses or subnets with direct internet access (outside of the VPN tunnel)")) r1.datatype = "ip4addr" --- r1.placeholder = luci.ip.new(uci.cursor():get("network", "lan", "ipaddr") .. "/" .. uci.cursor():get("network", "lan", "netmask")) +-- r1.placeholder = luci.ip.new(m.uci:get("network", "lan", "ipaddr"), m.uci:get("network", "lan", "netmask")) r1.addremove = false r1.optional = false diff --git a/applications/luci-app-vpnbypass/po/ru/vpnbypass.po b/applications/luci-app-vpnbypass/po/ru/vpnbypass.po index 05e21935a0..d41cfac0c1 100644 --- a/applications/luci-app-vpnbypass/po/ru/vpnbypass.po +++ b/applications/luci-app-vpnbypass/po/ru/vpnbypass.po @@ -28,14 +28,14 @@ msgid "" "Local IP addresses or subnets with direct internet access (outside of the " "VPN tunnel)" msgstr "" -"Локальные IP-адреса или подсети с прямым доступом в Интернет (вне VPN-" +"Локальные IP-адреса или подсети с прямым доступом в интернет (вне VPN-" "туннеля)." msgid "Local Ports to Bypass" -msgstr "Локальные порты<br />для обхода VPN" +msgstr "Локальные порты для запуска обхода VPN" msgid "Local ports to trigger VPN Bypass" -msgstr "Локальные порты для запуска обхода VPN." +msgstr "Локальные порты<br />для обхода VPN" msgid "README" msgstr "Описание" @@ -54,10 +54,10 @@ msgid "Remote Ports to Bypass" msgstr "Удаленные порты<br />для обхода VPN" msgid "Remote ports to trigger VPN Bypass" -msgstr "Удаленные порты для запуска обхода VPN." +msgstr "Удаленные порты для запуска обхода VPN" msgid "Start VPNBypass service" -msgstr "Запуск сервиса VPNBypass" +msgstr "" msgid "VPN Bypass" msgstr "Обход VPN" @@ -66,4 +66,7 @@ msgid "VPN Bypass Settings" msgstr "Настройка обхода VPN" msgid "for syntax" -msgstr "для синтаксиса." +msgstr "для синтаксиса" + +#~ msgid "Enable/start service" +#~ msgstr "Включение / Запуск сервиса" diff --git a/applications/luci-app-wireguard/Makefile b/applications/luci-app-wireguard/Makefile index 92cdcf2700..ae315bdfe3 100644 --- a/applications/luci-app-wireguard/Makefile +++ b/applications/luci-app-wireguard/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=WireGuard Status -LUCI_DEPENDS:=+wireguard-tools +kmod-wireguard +LUCI_DEPENDS:=+wireguard-tools +kmod-wireguard +luci-proto-wireguard LUCI_PKGARCH:=all PKG_MAINTAINER:=Dan Luedtke <mail@danrl.com> diff --git a/applications/luci-app-wol/luasrc/controller/wol.lua b/applications/luci-app-wol/luasrc/controller/wol.lua index dbbfdde128..43ab84ab2a 100644 --- a/applications/luci-app-wol/luasrc/controller/wol.lua +++ b/applications/luci-app-wol/luasrc/controller/wol.lua @@ -1,6 +1,6 @@ module("luci.controller.wol", package.seeall) function index() - entry({"admin", "services", "wol"}, cbi("wol"), _("Wake on LAN"), 90) - entry({"mini", "services", "wol"}, cbi("wol"), _("Wake on LAN"), 90) + entry({"admin", "services", "wol"}, form("wol"), _("Wake on LAN"), 90) + entry({"mini", "services", "wol"}, form("wol"), _("Wake on LAN"), 90) end diff --git a/applications/luci-app-wol/luasrc/model/cbi/wol.lua b/applications/luci-app-wol/luasrc/model/cbi/wol.lua index d40dde0178..43b87dda9c 100644 --- a/applications/luci-app-wol/luasrc/model/cbi/wol.lua +++ b/applications/luci-app-wol/luasrc/model/cbi/wol.lua @@ -1,6 +1,7 @@ -- Copyright 2010 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. +local utl = require "luci.util" local sys = require "luci.sys" local ipc = require "luci.ip" local fs = require "nixio.fs" @@ -69,8 +70,8 @@ function host.write(self, s, val) if util == "/usr/bin/etherwake" then local iface = luci.http.formvalue("cbid.wol.1.iface") local broadcast = luci.http.formvalue("cbid.wol.1.broadcast") - cmd = "%s -D%s %s %q" %{ - util, (iface ~= "" and " -i %q" % iface or ""), + cmd = "%s -D%s %s %q 2>&1" %{ + util, (iface ~= "" and " -i %s" % utl.shellquote(iface) or ""), (broadcast == "1" and " -b" or ""), mac } else @@ -78,7 +79,7 @@ function host.write(self, s, val) end local msg = "<p><strong>%s</strong><br /><br /><code>%s<br /><br />" %{ - translate("Starting WoL utility:"), cmd + translate("Starting WoL utility:"), utl.pcdata(cmd) } local p = io.popen(cmd .. " 2>&1") |