diff --git a/luci-app-accesscontrol/Makefile b/luci-app-accesscontrol/Makefile index 4edf4f6c..d6bdcb55 100644 --- a/luci-app-accesscontrol/Makefile +++ b/luci-app-accesscontrol/Makefile @@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI Access Control Configuration LUCI_DEPENDS:= LUCI_PKGARCH:=all + PKG_NAME:=luci-app-accesscontrol PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-accesscontrol/luasrc/controller/mia.lua b/luci-app-accesscontrol/luasrc/controller/mia.lua index f92d11a7..60aa95db 100644 --- a/luci-app-accesscontrol/luasrc/controller/mia.lua +++ b/luci-app-accesscontrol/luasrc/controller/mia.lua @@ -5,10 +5,7 @@ function index() return end - local page = entry({"admin", "services", "mia"}, cbi("mia"), _("Internet Access Schedule Control"), 30) - page.dependent = true - page.acl_depends = { "luci-app-accesscontrol" } - + entry({"admin", "services", "mia"}, cbi("mia"), _("Internet Access Schedule Control"), 30).dependent = true entry({"admin", "services", "mia", "status"}, call("act_status")).leaf = true end diff --git a/luci-app-accesscontrol/luasrc/model/cbi/mia.lua b/luci-app-accesscontrol/luasrc/model/cbi/mia.lua index 1d801b8b..0d49867e 100644 --- a/luci-app-accesscontrol/luasrc/model/cbi/mia.lua +++ b/luci-app-accesscontrol/luasrc/model/cbi/mia.lua @@ -1,5 +1,7 @@ +a = Map("mia") +a.title = translate("Internet Access Schedule Control") +a.description = translate("Access Schedule Control Settins") -a = Map("mia", translate("Internet Access Schedule Control"), translate("Access Schedule Control Settins")) a:section(SimpleSection).template = "mia/mia_status" t = a:section(TypedSection, "basic") @@ -9,8 +11,8 @@ e = t:option(Flag, "enable", translate("Enabled")) e.rmempty = false e = t:option(Flag, "strict", translate("Strict Mode")) -e.rmempty = false e.description = translate("Strict Mode will degrade CPU performance, but it can achieve better results") +e.rmempty = false t = a:section(TypedSection, "macbind", translate("Client Rules")) t.template = "cbi/tblsection" @@ -28,12 +30,12 @@ e:value(t,"%s (%s)"%{t,a}) end) e = t:option(Value, "timeon", translate("Start time")) -e.default = "00:00" e.optional = false +e.default = "00:00" e = t:option(Value, "timeoff", translate("End time")) -e.default = "23:59" e.optional = false +e.default = "23:59" e = t:option(Flag, "z1", translate("Mon")) e.rmempty = true diff --git a/luci-app-accesscontrol/po/zh-cn b/luci-app-accesscontrol/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-accesscontrol/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-accesscontrol/po/zh_Hans/mia.po b/luci-app-accesscontrol/po/zh-cn/mia.po similarity index 96% rename from luci-app-accesscontrol/po/zh_Hans/mia.po rename to luci-app-accesscontrol/po/zh-cn/mia.po index 8848c130..8f7c16aa 100644 --- a/luci-app-accesscontrol/po/zh_Hans/mia.po +++ b/luci-app-accesscontrol/po/zh-cn/mia.po @@ -28,9 +28,6 @@ msgstr "开始时间" msgid "End time" msgstr "结束时间" -msgid "Enabled" -msgstr "启用" - msgid "Mon" msgstr "一" diff --git a/luci-app-accesscontrol/po/zh_Hans b/luci-app-accesscontrol/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-accesscontrol/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-accesscontrol/root/etc/mia.include b/luci-app-accesscontrol/root/etc/mia.include index 4d7859f3..359bbd6f 100755 --- a/luci-app-accesscontrol/root/etc/mia.include +++ b/luci-app-accesscontrol/root/etc/mia.include @@ -1 +1 @@ -/etc/init.d/mia restart \ No newline at end of file +/etc/init.d/mia restart diff --git a/luci-app-accesscontrol/root/etc/uci-defaults/mia b/luci-app-accesscontrol/root/etc/uci-defaults/luci-mia similarity index 99% rename from luci-app-accesscontrol/root/etc/uci-defaults/mia rename to luci-app-accesscontrol/root/etc/uci-defaults/luci-mia index f7ad30b8..6737992c 100644 --- a/luci-app-accesscontrol/root/etc/uci-defaults/mia +++ b/luci-app-accesscontrol/root/etc/uci-defaults/luci-mia @@ -13,6 +13,7 @@ uci -q batch <<-EOF >/dev/null add ucitrack mia set ucitrack.@mia[-1].init=mia commit ucitrack + delete firewall.mia set firewall.mia=include set firewall.mia.type=script diff --git a/luci-app-alist/Makefile b/luci-app-alist/Makefile deleted file mode 100644 index e3be692e..00000000 --- a/luci-app-alist/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# Copyright (C) 2023 ImmortalWrt.org - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI app for AList -LUCI_DEPENDS:=+alist -LUCI_PKGARCH:=all - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js deleted file mode 100644 index 818d6e00..00000000 --- a/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js +++ /dev/null @@ -1,151 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; -'require form'; -'require poll'; -'require rpc'; -'require uci'; -'require validation'; -'require view'; - -var callServiceList = rpc.declare({ - object: 'service', - method: 'list', - params: ['name'], - expect: { '': {} } -}); - -function getServiceStatus() { - return L.resolveDefault(callServiceList('alist'), {}).then(function (res) { - var isRunning = false; - try { - isRunning = res['alist']['instances']['instance1']['running']; - } catch (e) { } - return isRunning; - }); -} - -function renderStatus(isRunning, port) { - var spanTemp = '%s %s'; - var renderHTML; - if (isRunning) { - var button = String.format(' %s', - window.location.hostname, port, _('Open Web Interface')); - renderHTML = spanTemp.format('green', _('AList'), _('RUNNING')) + button; - } else { - renderHTML = spanTemp.format('red', _('AList'), _('NOT RUNNING')); - } - - return renderHTML; -} - -var stubValidator = { - factory: validation, - apply: function(type, value, args) { - if (value != null) - this.value = value; - - return validation.types[type].apply(this, args); - }, - assert: function(condition) { - return !!condition; - } -}; - -return view.extend({ - load: function() { - return Promise.all([ - uci.load('alist') - ]); - }, - - render: function(data) { - var m, s, o; - var webport = uci.get(data[0], 'config', 'listen_http_port') || '5244'; - - m = new form.Map('alist', _('AList'), - _('A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs.
' + - 'Default login username is admin and password is password.')); - - s = m.section(form.TypedSection); - s.anonymous = true; - s.render = function () { - poll.add(function () { - return L.resolveDefault(getServiceStatus()).then(function (res) { - var view = document.getElementById('service_status'); - view.innerHTML = renderStatus(res, webport); - }); - }); - - return E('div', { class: 'cbi-section', id: 'status_bar' }, [ - E('p', { id: 'service_status' }, _('Collecting data...')) - ]); - } - - s = m.section(form.NamedSection, 'config', 'alist'); - - o = s.option(form.Flag, 'enabled', _('Enable')); - o.default = o.disabled; - o.rmempty = false; - - o = s.option(form.Value, 'listen_addr', _('Listen address')); - o.default = '0.0.0.0'; - o.rmempty = false; - o.validate = function(section_id, value) { - if (!value) - return _('Expecting: %s').format(_('non-empty value')); - - var m4 = value.match(/^([^\[\]:]+)$/), - m6 = value.match(/^\[(.+)\]$/ ); - - if ((!m4 && !m6) || !stubValidator.apply('ipaddr', m4 ? m4[1] : m6[1])) - return _('Expecting: %s').format(_('valid IP address')); - - return true; - } - - o = s.option(form.Value, 'listen_http_port', _('Listen port')); - o.datatype = 'port'; - o.default = '5244'; - o.rmempty = false; - - o = s.option(form.Value, 'site_login_expire', _('Login expiration time'), - _('User login expiration time (in hours).')); - o.datatype = 'uinteger'; - o.default = '48'; - o.rmempty = false; - - o = s.option(form.Value, 'site_max_connections', _('Max connections'), - _('The maximum number of concurrent connections at the same time (0 = unlimited).')); - o.datatype = 'uinteger'; - o.default = '0'; - o.rmempty = false; - - o = s.option(form.Flag, 'site_tls_insecure', _('Allow insecure connection'), - _('Allow connection even if the remote TLS certificate is invalid (not recommended).')); - o.default = o.disabled; - - o = s.option(form.Flag, 'log_enable', _('Enable logging')); - o.default = o.enabled; - - o = s.option(form.Value, 'log_max_size', _('Max log size'), - _('The maximum size in megabytes of the log file before it gets rotated.')); - o.datatype = 'uinteger'; - o.default = '5'; - o.depends('log_enable', '1'); - - o = s.option(form.Value, 'log_max_backups', _('Max log backups'), - _('The maximum number of old log files to retain.')); - o.datatype = 'uinteger'; - o.default = '1'; - o.depends('log_enable', '1'); - - o = s.option(form.Value, 'log_max_age', _('Max log age'), - _('The maximum days of the log file to retain.')); - o.datatype = 'uinteger'; - o.default = '15'; - o.depends('log_enable', '1'); - - return m.render(); - } -}); diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js deleted file mode 100644 index f300abef..00000000 --- a/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; -'require dom'; -'require fs'; -'require poll'; -'require uci'; -'require view'; - -return view.extend({ - render: function() { - /* Thanks to luci-app-aria2 */ - var css = ' \ - #log_textarea { \ - padding: 10px; \ - text-align: left; \ - } \ - #log_textarea pre { \ - padding: .5rem; \ - word-break: break-all; \ - margin: 0; \ - } \ - .description { \ - background-color: #33ccff; \ - }'; - - var log_textarea = E('div', { 'id': 'log_textarea' }, - E('img', { - 'src': L.resource(['icons/loading.gif']), - 'alt': _('Loading...'), - 'style': 'vertical-align:middle' - }, _('Collecting data...')) - ); - - poll.add(L.bind(function() { - return fs.read_direct('/var/run/alist/log/alist.log', 'text') - .then(function(res) { - var log = E('pre', { 'wrap': 'pre' }, [ - res.trim() || _('Log is empty.') - ]); - - dom.content(log_textarea, log); - }).catch(function(err) { - var log; - - if (err.toString().includes('NotFoundError')) - log = E('pre', { 'wrap': 'pre' }, [ - _('Log file does not exist.') - ]); - else - log = E('pre', { 'wrap': 'pre' }, [ - _('Unknown error: %s').format(err) - ]); - - dom.content(log_textarea, log); - }); - })); - - return E([ - E('style', [ css ]), - E('div', {'class': 'cbi-map'}, [ - E('div', {'class': 'cbi-section'}, [ - log_textarea, - E('div', {'style': 'text-align:right'}, - E('small', {}, _('Refresh every %s seconds.').format(L.env.pollinterval)) - ) - ]) - ]) - ]); - }, - - handleSaveApply: null, - handleSave: null, - handleReset: null -}); diff --git a/luci-app-alist/po/templates/alist.pot b/luci-app-alist/po/templates/alist.pot deleted file mode 100644 index ea258b0b..00000000 --- a/luci-app-alist/po/templates/alist.pot +++ /dev/null @@ -1,146 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:67 -msgid "" -"A file list/WebDAV program that supports multiple storages, powered by Gin " -"and Solidjs.
Default login username is admin and password " -"is password." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:66 -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:3 -msgid "AList" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:125 -msgid "" -"Allow connection even if the remote TLS certificate is invalid (not " -"recommended)." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:124 -msgid "Allow insecure connection" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:81 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:32 -msgid "Collecting data..." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:87 -msgid "Enable" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:128 -msgid "Enable logging" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102 -msgid "Expecting: %s" -msgstr "" - -#: applications/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json:3 -msgid "Grant access to AList configuration" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:91 -msgid "Listen address" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:107 -msgid "Listen port" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:30 -msgid "Loading..." -msgstr "" - -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:22 -msgid "Log" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:48 -msgid "Log file does not exist." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:39 -msgid "Log is empty." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:112 -msgid "Login expiration time" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:118 -msgid "Max connections" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:143 -msgid "Max log age" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:137 -msgid "Max log backups" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:131 -msgid "Max log size" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36 -msgid "NOT RUNNING" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:33 -msgid "Open Web Interface" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34 -msgid "RUNNING" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:65 -msgid "Refresh every %s seconds." -msgstr "" - -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:14 -msgid "Settings" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:144 -msgid "The maximum days of the log file to retain." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:119 -msgid "" -"The maximum number of concurrent connections at the same time (0 = " -"unlimited)." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:138 -msgid "The maximum number of old log files to retain." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:132 -msgid "The maximum size in megabytes of the log file before it gets rotated." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:52 -msgid "Unknown error: %s" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:113 -msgid "User login expiration time (in hours)." -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96 -msgid "non-empty value" -msgstr "" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102 -msgid "valid IP address" -msgstr "" diff --git a/luci-app-alist/po/zh-cn b/luci-app-alist/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-alist/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-alist/po/zh_Hans/alist.po b/luci-app-alist/po/zh_Hans/alist.po deleted file mode 100644 index 1ece1133..00000000 --- a/luci-app-alist/po/zh_Hans/alist.po +++ /dev/null @@ -1,155 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: zh-Hans\n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:67 -msgid "" -"A file list/WebDAV program that supports multiple storages, powered by Gin " -"and Solidjs.
Default login username is admin and password " -"is password." -msgstr "" -"一个支持多存储的 文件列表/WebDAV 程序,使用 Gin 和 Solidjs。
默认登录用" -"户名 admin 密码 password。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:66 -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:3 -msgid "AList" -msgstr "AList" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:125 -msgid "" -"Allow connection even if the remote TLS certificate is invalid (not " -"recommended)." -msgstr "即使远程 TLS 证书无效,也允许连接(不推荐)。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:124 -msgid "Allow insecure connection" -msgstr "允许不安全连接" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:81 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:32 -msgid "Collecting data..." -msgstr "收集数据中..." - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:87 -msgid "Enable" -msgstr "启用" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:128 -msgid "Enable logging" -msgstr "启用日志" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96 -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102 -msgid "Expecting: %s" -msgstr "请输入:%s" - -#: applications/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json:3 -msgid "Grant access to AList configuration" -msgstr "授予访问 AList 配置的权限" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:91 -msgid "Listen address" -msgstr "监听地址" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:107 -msgid "Listen port" -msgstr "监听端口" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:30 -msgid "Loading..." -msgstr "加载中..." - -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:22 -msgid "Log" -msgstr "日志" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:48 -msgid "Log file does not exist." -msgstr "日志文件不存在。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:39 -msgid "Log is empty." -msgstr "日志为空。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:112 -msgid "Login expiration time" -msgstr "登录过期时间" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:118 -msgid "Max connections" -msgstr "最大连接数" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:143 -msgid "Max log age" -msgstr "日志最长保留时间" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:137 -msgid "Max log backups" -msgstr "日志最大备份数" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:131 -msgid "Max log size" -msgstr "日志最大大小" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36 -msgid "NOT RUNNING" -msgstr "未运行" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:33 -msgid "Open Web Interface" -msgstr "打开 Web 界面" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34 -msgid "RUNNING" -msgstr "运行中" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:65 -msgid "Refresh every %s seconds." -msgstr "每 %s 秒刷新。" - -#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:14 -msgid "Settings" -msgstr "设置" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:144 -msgid "The maximum days of the log file to retain." -msgstr "日志文件的最长保存天数。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:119 -msgid "" -"The maximum number of concurrent connections at the same time (0 = " -"unlimited)." -msgstr "允许的最大并发连接数(0 = 不限制)。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:138 -msgid "The maximum number of old log files to retain." -msgstr "要保留的最大旧日志文件数量。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:132 -msgid "The maximum size in megabytes of the log file before it gets rotated." -msgstr "轮换前的最大日志大小(单位:MB)。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:52 -msgid "Unknown error: %s" -msgstr "未知错误:%s" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:113 -msgid "User login expiration time (in hours)." -msgstr "用户登录过期时间(单位:小时)。" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96 -msgid "non-empty value" -msgstr "非空值" - -#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102 -msgid "valid IP address" -msgstr "有效 IP 地址" diff --git a/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json b/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json deleted file mode 100644 index ca8bcca3..00000000 --- a/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "admin/services/alist": { - "title": "AList", - "order": 10, - "action": { - "type": "firstchild" - }, - "depends": { - "acl": [ "luci-app-alist" ], - "uci": { "alist": true } - } - }, - "admin/services/alist/config": { - "title": "Settings", - "order": 10, - "action": { - "type": "view", - "path": "alist/config" - } - }, - "admin/services/alist/log": { - "title": "Log", - "order": 20, - "action": { - "type": "view", - "path": "alist/log" - } - } -} diff --git a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json b/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json deleted file mode 100644 index 1dd31ef7..00000000 --- a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "luci-app-alist": { - "description": "Grant access to AList configuration", - "read": { - "file": { - "/var/run/alist/log/alist.log": [ "read" ] - }, - "ubus": { - "service": [ "list" ] - }, - "uci": [ "alist" ] - }, - "write": { - "uci": [ "alist" ] - } - } -} diff --git a/luci-app-cifs/Makefile b/luci-app-cifs/Makefile deleted file mode 100644 index 91fc36f7..00000000 --- a/luci-app-cifs/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -## Copyright (C) 2018 By-Ameng Openwrt.org -# -## This is free software, licensed under the Apache License, Version 2.0 . -# -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=luci-app-cifs -LUCI_DEPENDS:=+kmod-fs-cifs +kmod-nls-utf8 +kmod-nls-base +kmod-crypto-hmac +kmod-crypto-md5 +kmod-crypto-misc +cifsmount -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-cifs/luasrc/controller/cifs.lua b/luci-app-cifs/luasrc/controller/cifs.lua deleted file mode 100644 index 0afe51cf..00000000 --- a/luci-app-cifs/luasrc/controller/cifs.lua +++ /dev/null @@ -1,24 +0,0 @@ --- Copyright 2015 --- Matthew --- Licensed to the public under the Apache License 2.0. - -module("luci.controller.cifs", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/cifs") then - return - end - - local page = entry({"admin", "services", "cifs"}, cbi("cifs"), _("Mounting NAT drives")) - page.dependent = true - page.acl_depends = { "luci-app-cifs" } - - entry({"admin", "services", "cifs", "status"}, call("act_status")).leaf = true -end - -function act_status() - local e = {} - e.running = luci.sys.call("pidof cifsd > /dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/luci-app-cifs/luasrc/model/cbi/cifs.lua b/luci-app-cifs/luasrc/model/cbi/cifs.lua deleted file mode 100644 index e598d6ef..00000000 --- a/luci-app-cifs/luasrc/model/cbi/cifs.lua +++ /dev/null @@ -1,97 +0,0 @@ --- Copyright 2015 --- Matthew --- Licensed to the public under the Apache License 2.0. - -local fs = require "nixio.fs" - -m = Map("cifs", translate("Mounting NAT drives")) -m.description = translate("Allows you mounting Nat drives") - -m:section(SimpleSection).template = "cifs/cifs_status" - -s = m:section(TypedSection, "cifs", "Cifs") -s.anonymous = true - -s:tab("general", translate("General Settings")) - -switch = s:taboption("general", Flag, "enabled", translate("Enable")) -switch.rmempty = false - -workgroup = s:taboption("general", Value, "workgroup", translate("Workgroup")) -workgroup.default = "WORKGROUP" - -mountarea = s:taboption("general", Value, "mountarea", translate("Mount Area")) -mountarea.description = translate("All the Mounted NAT Drives will be centralized into this folder.") -mountarea.default = "/tmp/mnt" -mountarea.rmempty = false - -delay = s:taboption("general", Value, "delay", translate("Delay")) -delay.description = translate("Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) ") -delay:value("0") -delay:value("3") -delay:value("5") -delay:value("7") -delay:value("10") -delay.default = "5" - -iocharset = s:taboption("general", Value, "iocharset", translate("Iocharset")) -iocharset.description = translate("Character Encoding") -iocharset.default = "utf8" - -s = m:section(TypedSection, "natshare", translate("NAT Drivers")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -server = s:option(Value, "server", translate("Server")) -server.description = translate("Server Name/IP") -server.size = 6 -server.rmempty = false - -name = s:option(Value, "name", translate("Name")) -name.description = translate("Mouting Folder Name") -name.size = 6 -name.rmempty = false - -sec = s:option(Value, "sec", translate("Choose Safety Mode")) -sec:value("none") -sec:value("krb5") -sec:value("krb5i") -sec:value("ntlm") -sec:value("ntlmi") -sec:value("ntlmv2") -sec:value("ntlmv2i") -sec.rmempty = true -sec.size = 7 - -agm = s:option(Value, "agm", translate("Arguments")) -agm:value("rm", translate"rm: Read Only") -agm:value("rw", translate"rw: Read and Write") -agm:value("noperm") -agm:value("noacl") -agm:value("sfu") -agm:value("dirctio") -agm:value("file_mode=0755,dir_mode=0n755") -agm:value("nounix", translate"nounix: Disable Unix Extensions") -agm.rmempty = true -agm.size = 8 - -guest = s:option(Flag, "guest", translate("Using Guest")) -guest.rmempty = false -guest.enabled = "1" -guest.disabled = "0" - -users = s:option(Value, "users", translate("Users")) -users.size = 3 -users.rmempty = true - -pwd = s:option(Value, "pwd", translate("password")) -pwd.rmempty = true -pwd.size = 3 - -local apply = luci.http.formvalue("cbi.apply") -if apply then - io.popen("/etc/init.d/cifs restart") -end - -return m diff --git a/luci-app-cifs/luasrc/view/cifs_status.htm b/luci-app-cifs/luasrc/view/cifs_status.htm deleted file mode 100644 index 3abb4dd2..00000000 --- a/luci-app-cifs/luasrc/view/cifs_status.htm +++ /dev/null @@ -1,22 +0,0 @@ - - -
-

- <%:Collecting data...%> -

-
diff --git a/luci-app-cifs/po/zh-cn b/luci-app-cifs/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-cifs/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-cifs/po/zh_Hans/cifs.po b/luci-app-cifs/po/zh_Hans/cifs.po deleted file mode 100644 index 796563ad..00000000 --- a/luci-app-cifs/po/zh_Hans/cifs.po +++ /dev/null @@ -1,41 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - -msgid "Mounting NAT drives" -msgstr "挂载网络驱动器" - -msgid "Allows you mounting Nat drives" -msgstr "允许挂载网络驱动器" - -msgid "Mount Area" -msgstr "挂载目录" - -msgid "All the Mounted NAT Drives will be centralized into this folder." -msgstr "所有安装的网络驱动器都将集中到这个文件夹中。" - -msgid "Delay" -msgstr "延迟" - -msgid "Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) " -msgstr "延迟命令运行,等待驱动程序联机。\n仅在启动模式下工作(/etc/init.d/cifs start)" - -msgid "Iocharset" -msgstr "编码" - -msgid "Character Encoding" -msgstr "字符编码" - -msgid "NAT Drivers" -msgstr "网络硬盘" - -msgid "Server Name/IP" -msgstr "服务器名称/ip地址" - -msgid "Mouting Folder Name" -msgstr "共享目录/名称" - -msgid "Choose Safety Mode" -msgstr "安全模式" - -msgid "Arguments" -msgstr "共享权限" diff --git a/luci-app-cifs/root/etc/config/cifs b/luci-app-cifs/root/etc/config/cifs deleted file mode 100644 index 87038a4f..00000000 --- a/luci-app-cifs/root/etc/config/cifs +++ /dev/null @@ -1,7 +0,0 @@ - -config cifs - option enabled '0' - option workgroup 'WORKGROUP' - option iocharset 'utf8' - option delay '5' - option mountarea '/tmp/mnt' diff --git a/luci-app-cifs/root/etc/init.d/cifs b/luci-app-cifs/root/etc/init.d/cifs deleted file mode 100755 index 2d6d5618..00000000 --- a/luci-app-cifs/root/etc/init.d/cifs +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -ENABLED=0 -MOUNTAREA=0 -WORKGROUPD=0 -IOCHARSET=0 -DELAY=0 -GUEST="" -USERS="" -SEC="" -AGM="" - -cifs_header() { - local enabled - local workgroup - local mountarea - local delay - local iocharset - - config_get enabled $1 enabled - config_get mountarea $1 mountarea - config_get workgroup $1 workgroup - config_get delay $1 delay - config_get iocharset $1 iocharset - - ENABLED=$enabled - MOUNTAREA=$mountarea - WORKGROUPD=$workgroup - IOCHARSET=$iocharset - - if [ $delay != 0 ] - then - DELAY=$delay - fi -} - -mount_natshare() { - local server - local name - local guest - local users - local pwd - local sec - local agm - - local _mount_path - local _agm - - config_get server $1 server - config_get name $1 name - config_get guest $1 guest - config_get users $1 users - config_get pwd $1 pwd - config_get sec $1 sec - config_get agm $1 agm - - if [ $guest == 1 ] - then - GUEST="guest," - USERS="" - else if [ $guest == 0 ] - then { - if [ $users ] - then - USERS="username=$users,password=$pwd," - GUEST="" - else - USERS="" - GUEST="guest," - fi - } - fi - fi - - if [ $sec ] - then - SEC=",sec=$sec" - else - SEC="" - fi - - if [ $agm ] - then - AGM=",$agm" - else - AGM="" - fi - - natpath="//${server}/$name" - - append _mount_path "$MOUNTAREA/$name" - append _agm "-o ${USERS}${GUEST},dom=$WORKGROUPD,iocharset=$IOCHARSET,$SEC,$AGM,vers=1.0" - - sleep 1 - mkdir -p $_mount_path - mount -t cifs $natpath $_mount_path $_agm -} - -umount_natshare() { - local server - local name - local _mount_path - - config_get server $1 server - config_get name $1 name - - append _mount_path "$MOUNTAREA/$name" - - sleep 1 - umount -d -l $_mount_path - rm -r -f $_mount_path -} - -change_natshare() { - sleep 1 -} - -start() { - config_load cifs - config_foreach cifs_header cifs - - echo "Checking..." - - if [ $ENABLED == 1 ] - then { - echo "Cifs Mount is Enabled." - echo "Starting..." - if [ $DELAY != 0 ] - then - sleep $DELAY - echo "DELAY Operation ${DELAY}s" - else - echo "Not DELAY ${DELAY}s" - fi - - config_foreach mount_natshare natshare - - echo "Cifs Mount succeed." - } - else - echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it." - fi -} - -stop() { - echo "Umounting..." - - config_load cifs - config_foreach cifs_header cifs - config_foreach umount_natshare natshare - - echo "Cifs Umount succeed." - -} - -restart() { - echo 'Umounting... ' - - config_load cifs - config_foreach cifs_header cifs - - config_foreach umount_natshare natshare - - echo "Cifs Umount succeed." - - echo '' - echo 'Checking... ' - - if [ $ENABLED == 1 ] - then { - echo 'Cifs Mmount is Enabled. ' - echo 'Starting... ' - - config_foreach mount_natshare natshare - - echo "Cifs Mount succeed." - } - else - /etc/init.d/cifs disable - echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it." - fi -} diff --git a/luci-app-cifs/root/etc/uci-defaults/luci-cifs b/luci-app-cifs/root/etc/uci-defaults/luci-cifs deleted file mode 100644 index 59a5cd6b..00000000 --- a/luci-app-cifs/root/etc/uci-defaults/luci-cifs +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-cifs.json" ] && { - cat > /usr/share/ucitrack/luci-app-cifs.json << EEOF -{ - "config": "cifs", - "init": "cifs" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@cifs[-1] - add ucitrack cifs - set ucitrack.@cifs[-1].init=cifs - commit ucitrack -EOF - -/etc/init.d/cifs stop >/dev/null 2>&1 -/etc/init.d/cifs disable >/dev/null 2>&1 - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json b/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json deleted file mode 100644 index b0646081..00000000 --- a/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-cifs": { - "description": "Grant UCI access for luci-app-cifs", - "read": { - "uci": [ "cifs" ] - }, - "write": { - "uci": [ "cifs" ] - } - } -} diff --git a/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json b/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json deleted file mode 100644 index ca5c972a..00000000 --- a/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "config": "cifs", - "init": "cifs" -} diff --git a/luci-app-fileassistant/Makefile b/luci-app-fileassistant/Makefile index ad383666..caa9385e 100644 --- a/luci-app-fileassistant/Makefile +++ b/luci-app-fileassistant/Makefile @@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Fileassistant LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_VERSION:=1.0-5 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature +# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file diff --git a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js index 2e3addef..616919d2 100644 --- a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js +++ b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js @@ -91,6 +91,40 @@ String.prototype.replaceAll = function(search, replacement) { } } + function chmodPath(filename, isdir) { + var newmod = prompt('请输入新的权限位(支持八进制权限位或者a+x格式):', isdir === "1" ? "0755" : "0644"); + if (newmod) { + iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chmod', + { + filepath: concatPath(currentPath, filename), + newmod: newmod + }, + function (x, res) { + if (res.ec === 0) { + refresh_list(res.data, currentPath); + } + } + ); + } + } + + function chownPath(filename) { + var newown = prompt('请输入新的用户名(支持用户名或用户名:群组格式):', "root"); + if (newown) { + iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chown', + { + filepath: concatPath(currentPath, filename), + newown: newown + }, + function (x, res) { + if (res.ec === 0) { + refresh_list(res.data, currentPath); + } + } + ); + } + } + function openpath(filename, dirname) { dirname = dirname || currentPath; window.open('/cgi-bin/luci/admin/nas/fileassistant/open?path=' @@ -130,6 +164,13 @@ String.prototype.replaceAll = function(search, replacement) { else if (targetElem.className.indexOf('cbi-button-edit') > -1) { renamePath(targetElem.parentNode.parentNode.dataset['filename']); } + else if (targetElem.className.indexOf('cbi-button-chmod') > -1) { + infoElem = targetElem.parentNode.parentNode; + chmodPath(infoElem.dataset['filename'] , infoElem.dataset['isdir']); + } + else if (targetElem.className.indexOf('cbi-button-chown') > -1) { + chownPath(targetElem.parentNode.parentNode.dataset['filename']); + } else if (targetElem = getFileElem(targetElem)) { if (targetElem.className.indexOf('parent-icon') > -1) { update_list(currentPath.replace(/\/[^/]+($|\/$)/, '')); @@ -156,7 +197,14 @@ String.prototype.replaceAll = function(search, replacement) { } } function refresh_list(filenames, path) { - var listHtml = ''; + var listHtml = '
' + +'' + +'' + +'' + +'' + +'' + +'' + +''; if (path !== '/') { listHtml += ''; } @@ -196,7 +244,9 @@ String.prototype.replaceAll = function(search, replacement) { + '' + '' + ''; @@ -270,6 +320,26 @@ String.prototype.replaceAll = function(search, replacement) { } }; + document.getElementById('mkdir-toggle').onclick = function() { + var dirname = null; + if (dirname = prompt("请输入文件夹名称:")) { + var formData = new FormData(); + formData.append('path', currentPath); + formData.append('dirname', dirname); + var xhr = new XMLHttpRequest(); + xhr.open("POST", "/cgi-bin/luci/admin/nas/fileassistant/mkdir", true); + xhr.onload = function() { + if (xhr.status == 200) { + var res = JSON.parse(xhr.responseText); + refresh_list(res.data, currentPath); + } + else { + alert('创建失败,请稍后再试...'); + } + }; + xhr.send(formData); + } + }; document.addEventListener('DOMContentLoaded', function(evt) { var initPath = '/'; if (/path=([/\w]+)/.test(location.search)) { diff --git a/luci-app-fileassistant/luasrc/controller/fileassistant.lua b/luci-app-fileassistant/luasrc/controller/fileassistant.lua index 7b880136..4c4bcb59 100644 --- a/luci-app-fileassistant/luasrc/controller/fileassistant.lua +++ b/luci-app-fileassistant/luasrc/controller/fileassistant.lua @@ -6,7 +6,6 @@ function index() page = entry({"admin", "system", "fileassistant"}, template("fileassistant"), _("文件管理"), 50) page.i18n = "base" page.dependent = true - page.acl_depends = { "luci-app-fileassistant" } page = entry({"admin", "nas", "fileassistant", "list"}, call("fileassistant_list"), nil) page.leaf = true @@ -26,6 +25,14 @@ function index() page = entry({"admin", "nas", "fileassistant", "install"}, call("fileassistant_install"), nil) page.leaf = true + page = entry({"admin", "nas", "fileassistant", "mkdir"}, call("fileassistant_mkdir"), nil) + page.leaf = true + + page = entry({"admin", "nas", "fileassistant", "chmod"}, call("fileassistant_chmod"), nil) + page.leaf = true + + page = entry({"admin", "nas", "fileassistant", "chown"}, call("fileassistant_chown"), nil) + page.leaf = true end function list_response(path, success) @@ -109,15 +116,18 @@ function installIPK(filepath) end function fileassistant_upload() - local filecontent = luci.http.formvalue("upload-file") - local filename = luci.http.formvalue("upload-filename") - local uploaddir = luci.http.formvalue("upload-dir") - local filepath = uploaddir..filename - local fp + -- MUST setfilehandler before formvalue, + -- beacuse formvalue will parse form and write body to /tmp if filehandler not present luci.http.setfilehandler( function(meta, chunk, eof) if not fp and meta and meta.name == "upload-file" then + local filename = luci.http.formvalue("upload-filename") + local uploaddir = luci.http.formvalue("upload-dir") + if not uploaddir or not filename then + error("uploaddir or filename is nil") + end + local filepath = uploaddir..filename fp = io.open(filepath, "w") end if fp and chunk then @@ -129,7 +139,28 @@ function fileassistant_upload() end ) - list_response(uploaddir, true) + list_response(luci.http.formvalue("upload-dir"), true) +end + +function fileassistant_mkdir() + local path = luci.http.formvalue("path") + local dirname = luci.http.formvalue("dirname") + local success = os.execute('sh -c \'cd "'..path..'" && mkdir -p "'..dirname..'"\'') + list_response(path, success) +end + +function fileassistant_chmod() + local path = luci.http.formvalue("filepath") + local newmod = luci.http.formvalue("newmod") + local success = os.execute('chmod '..newmod..' "'..path..'"') + list_response(nixio.fs.dirname(path), success) +end + +function fileassistant_chown() + local path = luci.http.formvalue("filepath") + local newown = luci.http.formvalue("newown") + local success = os.execute('chown '..newown..' "'..path..'"') + list_response(nixio.fs.dirname(path), success) end function scandir(directory) diff --git a/luci-app-fileassistant/luasrc/view/fileassistant.htm b/luci-app-fileassistant/luasrc/view/fileassistant.htm index 15f069b9..3d760b40 100644 --- a/luci-app-fileassistant/luasrc/view/fileassistant.htm +++ b/luci-app-fileassistant/luasrc/view/fileassistant.htm @@ -1,12 +1,13 @@ <%+header%> - +

文件助手

文件列表
+
@@ -15,6 +16,6 @@
- + <%+footer%> diff --git a/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json b/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json deleted file mode 100644 index 8db4ea32..00000000 --- a/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-fileassistant": { - "description": "Grant UCI access for luci-app-fileassistant", - "read": { - "uci": [ "fileassistant" ] - }, - "write": { - "uci": [ "fileassistant" ] - } - } -} diff --git a/luci-app-haproxy-tcp/Makefile b/luci-app-haproxy-tcp/Makefile index 265ac7b3..b9e3a585 100644 --- a/luci-app-haproxy-tcp/Makefile +++ b/luci-app-haproxy-tcp/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=luci for haproxy and shadowsocks LUCI_DEPENDS:=+haproxy LUCI_PKGARCH:=all + PKG_NAME:=luci-app-haproxy-tcp PKG_VERSION=1.4 -PKG_RELEASE:=1 -PKG_MAINTAINER:=Alex Zhuo <1886090@gmail.com> +PKG_RELEASE:=2 -include $(TOPDIR)/feeds/luci/luci.mk +PKG_MAINTAINER:=Alex Zhuo <1886090@gmail.com> define Package/$(PKG_NAME)/postinst #!/bin/sh @@ -24,4 +24,6 @@ echo stopping haproxy echo haproxy disabled endef +include $(TOPDIR)/feeds/luci/luci.mk + # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua b/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua index b1f5c438..84920969 100644 --- a/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua +++ b/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua @@ -1,9 +1,9 @@ module("luci.controller.haproxy", package.seeall) + function index() - if not nixio.fs.access("/etc/config/haproxy") then - return - end - local page = entry({"admin", "services", "haproxy"}, cbi("haproxy"), _("HAProxy")) - page.dependent = true - page.acl_depends = { "luci-app-haproxy-tcp" } -end \ No newline at end of file + if not nixio.fs.access("/etc/config/haproxy") then + return + end + + entry({"admin", "services", "haproxy"}, cbi("haproxy"), _("HAProxy")).dependent = true +end diff --git a/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua b/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua index f1812243..382fa5b0 100644 --- a/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua +++ b/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua @@ -16,11 +16,11 @@ if haproxy_on then else state_msg = "" .. translate("Not running") .. "" end -m=Map("haproxy",translate("HAProxy"),translate("HAProxy能够检测Shadowsocks服务器的连通情况,从而实现负载均衡和高可用的功能,支持主备用服务器宕机自动切换,并且可以设置多个主服务器用于分流,规定每个分流节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】一致。

使用方法:配置好你的Shadowsocks服务器ip地址和端口,然后开启Shadowsocks服务,将服务器地址填写为【127.0.0.1】,端口【2222】,其他参数和之前一样即可,你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin,密码root来观察各节点健康状况,红色为宕机,绿色正常,使用说明请点击这里") .. "

后台监控页面:" .. router_ip .. ":1111/haproxy 用户名admin,密码root" .. "

状态 - " .. state_msg) -s=m:section(TypedSection,"arguments","") - s.addremove=false - s.anonymous=true - view_enable = s:option(Flag,"enabled",translate("Enable")) +m = Map("haproxy", translate("HAProxy"), translate("HAProxy能够检测Shadowsocks服务器的连通情况,从而实现负载均衡和高可用的功能,支持主备用服务器宕机自动切换,并且可以设置多个主服务器用于分流,规定每个分流节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】一致。

使用方法:配置好你的Shadowsocks服务器ip地址和端口,然后开启Shadowsocks服务,将服务器地址填写为【127.0.0.1】,端口【2222】,其他参数和之前一样即可,你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin,密码root来观察各节点健康状况,红色为宕机,绿色正常,使用说明请点击这里") .. "

后台监控页面:" .. router_ip .. ":1111/haproxy 用户名admin,密码root" .. "

状态 - " .. state_msg) +s = m:section(TypedSection,"arguments","") + s.addremove = false + s.anonymous = true + view_enable = s:option(Flag, "enabled", translate("Enable")) --通过读写配置文件控制HAProxy这种方式已经弃用 --view_cfg = s:option(TextValue, "1", nil) --view_cfg.rmempty = false @@ -32,36 +32,37 @@ s=m:section(TypedSection,"arguments","") --function view_cfg.write(self, section, value) -- sync_value_to_file(value, "/etc/haproxy.cfg") --end -s=m:section(TypedSection,"main_server","" .. translate("Main Server List") .. "") - s.anonymous=true - s.addremove=true - o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces")) +s = m:section(TypedSection, "main_server","" .. translate("Main Server List") .. "") + s.anonymous = true + s.addremove = true + o = s:option(Value, "server_name", translate("Display Name"), translate("Only English Characters,No spaces")) o.rmempty = false - o=s:option(Flag,"validate",translate("validate")) + o = s:option(Flag,"validate",translate("validate")) - o=s:option(Value,"server_ip",translate("Proxy Server IP")) + o = s:option(Value, "server_ip", translate("Proxy Server IP")) - o=s:option(Value,"server_port",translate("Proxy Server Port")) - o.datatype="uinteger" - o=s:option(Value,"server_weight",translate("Weight")) - o.datatype="uinteger" + o = s:option(Value, "server_port", translate("Proxy Server Port")) + o.datatype = "uinteger" + o = s:option(Value, "server_weight", translate("Weight")) + o.datatype = "uinteger" -s=m:section(TypedSection,"backup_server","" .. translate("Backup Server List") .. "") - s.anonymous=true - s.addremove=true - o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces")) +s = m:section(TypedSection,"backup_server","" .. translate("Backup Server List") .. "") + s.anonymous = true + s.addremove = true + o = s:option(Value, "server_name", translate("Display Name"), translate("Only English Characters,No spaces")) o.rmempty = false - o=s:option(Flag,"validate",translate("validate")) + o = s:option(Flag, "validate", translate("validate")) - o=s:option(Value,"server_ip",translate("Proxy Server IP")) + o = s:option(Value, "server_ip", translate("Proxy Server IP")) - o=s:option(Value,"server_port",translate("Proxy Server Port")) - o.datatype="uinteger" + o = s:option(Value, "server_port", translate("Proxy Server Port")) + o.datatype = "uinteger" -- --------------------------------------------------- local apply = luci.http.formvalue("cbi.apply") if apply then os.execute("/etc/haproxy_init.sh restart >/dev/null 2>&1 &") end + return m diff --git a/luci-app-haproxy-tcp/po/zh-cn b/luci-app-haproxy-tcp/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-haproxy-tcp/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-haproxy-tcp/po/zh-cn/haproxy-tcp.po b/luci-app-haproxy-tcp/po/zh-cn/haproxy-tcp.po new file mode 100644 index 00000000..f0f2aa83 --- /dev/null +++ b/luci-app-haproxy-tcp/po/zh-cn/haproxy-tcp.po @@ -0,0 +1,34 @@ +msgid "Running" +msgstr "运行中" + +msgid "Not running" +msgstr "未运行" + +msgid "Main Server List" +msgstr "主服务器列表" + +msgid "Display Name" +msgstr "服务器名称" + +msgid "Only English Characters,No spaces" +msgstr "仅限英文字母,不要有空格" + +msgid "Proxy Server IP" +msgstr "代理服务器IP或域名" + +msgid "Proxy Server Port" +msgstr "代理服务器端口" + +msgid "Weight" +msgstr "分流权重" + +msgid "Backup Server List" +msgstr "备用服务器列表" + +msgid "validate" +msgstr "生效" + + + + + diff --git a/luci-app-haproxy-tcp/po/zh_Hans b/luci-app-haproxy-tcp/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-haproxy-tcp/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po b/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po deleted file mode 100644 index da223e89..00000000 --- a/luci-app-haproxy-tcp/po/zh_Hans/luci-app-haproxy-tcp.po +++ /dev/null @@ -1,69 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: zh-Hans\n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" - -#: luasrc/model/cbi/haproxy.lua:50 -msgid "Backup Server List" -msgstr "备用服务器列表" - -#: luasrc/model/cbi/haproxy.lua:38 luasrc/model/cbi/haproxy.lua:53 -msgid "Display Name" -msgstr "服务器名称" - -#: luasrc/model/cbi/haproxy.lua:23 -msgid "Enable" -msgstr "" - -#: luasrc/controller/haproxy.lua:6 luasrc/model/cbi/haproxy.lua:19 -msgid "HAProxy" -msgstr "" - -#: luasrc/model/cbi/haproxy.lua:19 -msgid "" -"HAProxy能够检测Shadowsocks服务器的连通情况,从而实现负载均衡和高可用的功能," -"支持主备用服务器宕机自动切换,并且可以设置多个主服务器用于分流,规定每个分流" -"节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】" -"一致。

使用方法:配置好你的Shadowsocks服务器ip地址和端口,然后开启" -"Shadowsocks服务,将服务器地址填写为【127.0.0.1】,端口【2222】,其他参数和之" -"前一样即可,你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin,密码" -"root来观察各节点健康状况,红色为宕机,绿色正常,使用说明请点击这里" -msgstr "" - -#: luasrc/model/cbi/haproxy.lua:35 -msgid "Main Server List" -msgstr "主服务器列表" - -#: luasrc/model/cbi/haproxy.lua:17 -msgid "Not running" -msgstr "未运行" - -#: luasrc/model/cbi/haproxy.lua:38 luasrc/model/cbi/haproxy.lua:53 -msgid "Only English Characters,No spaces" -msgstr "仅限英文字母,不要有空格" - -#: luasrc/model/cbi/haproxy.lua:43 luasrc/model/cbi/haproxy.lua:58 -msgid "Proxy Server IP" -msgstr "代理服务器IP或域名" - -#: luasrc/model/cbi/haproxy.lua:45 luasrc/model/cbi/haproxy.lua:60 -msgid "Proxy Server Port" -msgstr "代理服务器端口" - -#: luasrc/model/cbi/haproxy.lua:15 -msgid "Running" -msgstr "运行中" - -#: luasrc/model/cbi/haproxy.lua:47 -msgid "Weight" -msgstr "分流权重" - -#: luasrc/model/cbi/haproxy.lua:41 luasrc/model/cbi/haproxy.lua:56 -msgid "validate" -msgstr "生效" diff --git a/luci-app-haproxy-tcp/root/etc/haproxy_init.sh b/luci-app-haproxy-tcp/root/etc/haproxy_init.sh index c3a01dc2..9f969ee5 100755 --- a/luci-app-haproxy-tcp/root/etc/haproxy_init.sh +++ b/luci-app-haproxy-tcp/root/etc/haproxy_init.sh @@ -22,10 +22,10 @@ start(){ log 127.0.0.1 local0 #[日志输出配置,所有日志都记录在本机,通过local0输出] log 127.0.0.1 local1 notice #定义haproxy 日志级别[error warringinfo debug] daemon #以后台形式运行harpoxy - nbproc 1 #设置进程数量 + #nbproc 1 #设置进程数量 pidfile /var/run/haproxy.pid - ulimit-n 1024 #ulimit 的数量限制 - maxconn 1024 #默认最大连接数,需考虑ulimit-n限制 + #ulimit-n 1024 #ulimit 的数量限制 + #maxconn 2048 #默认最大连接数,需考虑ulimit-n限制 #chroot /usr/local/haproxy defaults log global @@ -130,4 +130,4 @@ restart(){ else stop; fi -} \ No newline at end of file +} diff --git a/luci-app-haproxy-tcp/root/etc/uci-defaults/z99-haproxy b/luci-app-haproxy-tcp/root/etc/uci-defaults/99_luci-haproxy similarity index 100% rename from luci-app-haproxy-tcp/root/etc/uci-defaults/z99-haproxy rename to luci-app-haproxy-tcp/root/etc/uci-defaults/99_luci-haproxy diff --git a/luci-app-k3usb/Makefile b/luci-app-k3usb/Makefile deleted file mode 100644 index d841f609..00000000 --- a/luci-app-k3usb/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 2018 XiaoShan mivm.cn - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI Support for k3usb3.0 on or off -LUCI_DEPENDS:=@TARGET_bcm53xx_generic_DEVICE_phicomm_k3 -LUCI_PKGARCH:=all - -PKG_NAME:=luci-app-k3usb -PKG_VERSION:=1.1.0 -PKG_RELEASE:=1 - -PKG_LICENSE:=GPLv3 -PKG_LICENSE_FILES:=LICENSE -PKG_MAINTAINER:=Shenzt - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-k3usb/luasrc/controller/k3usb.lua b/luci-app-k3usb/luasrc/controller/k3usb.lua deleted file mode 100644 index 68a52618..00000000 --- a/luci-app-k3usb/luasrc/controller/k3usb.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Copyright (C) 2018 XiaoShan mivm.cn - -module("luci.controller.k3usb", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/k3usb") then - return - end - - local page = entry({"admin", "system", "k3usb"}, cbi("k3usb"), _("k3usb"), 60) - page.dependent = true - page.acl_depends = { "luci-app-k3usb" } -end diff --git a/luci-app-k3usb/luasrc/model/cbi/k3usb.lua b/luci-app-k3usb/luasrc/model/cbi/k3usb.lua deleted file mode 100644 index 16541353..00000000 --- a/luci-app-k3usb/luasrc/model/cbi/k3usb.lua +++ /dev/null @@ -1,15 +0,0 @@ --- Copyright (C) 2018 XiaoShan mivm.cn - -local m, s, o - -m = Map("k3usb", translate("k3usb")) -m.description = translate("k3 usb mode") - -s = m:section(TypedSection, "config", translate("usb mode")) -s.anonymous = true - -o = s:option(Flag, "usb3_enable", translate("usb3 enable :")) -o.description = translate("usb3 mode enable") -o.default = 1 - -return m diff --git a/luci-app-k3usb/po/zh-cn b/luci-app-k3usb/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-k3usb/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-k3usb/po/zh_Hans/k3usb.po b/luci-app-k3usb/po/zh_Hans/k3usb.po deleted file mode 100644 index 16165299..00000000 --- a/luci-app-k3usb/po/zh_Hans/k3usb.po +++ /dev/null @@ -1,17 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - -msgid "usb3 enable :" -msgstr "USB3 开启:" - -msgid "usb3 mode enable" -msgstr "是否开启USB3模式,修改此选项设备将会自动重启" - -msgid "k3usb" -msgstr "K3USB管理" - -msgid "k3 usb mode" -msgstr "开启或禁用USB3" - -msgid "usb mode" -msgstr "USB3管理模式" diff --git a/luci-app-k3usb/root/etc/config/k3usb b/luci-app-k3usb/root/etc/config/k3usb deleted file mode 100644 index c71dd937..00000000 --- a/luci-app-k3usb/root/etc/config/k3usb +++ /dev/null @@ -1,3 +0,0 @@ -config config usb - option usb3_enable '0' - diff --git a/luci-app-k3usb/root/etc/init.d/k3usb b/luci-app-k3usb/root/etc/init.d/k3usb deleted file mode 100755 index cb506b63..00000000 --- a/luci-app-k3usb/root/etc/init.d/k3usb +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=55 -STOP=55 - -usb3_enable=$(uci get k3usb.usb.usb3_enable 2>/dev/null) - -kernel=$(uname -a | awk '{print $3}') - -boot(){ - if [ "$usb3_enable" == "1" ]; then - #usb3 - kmodloader /usr/k3usb/45-phy-bcm-ns-usb3 - kmodloader /usr/k3usb/54-usb3 - - #usb2 - kmodloader /usr/k3usb/35-usb-ehci - kmodloader /usr/k3usb/40-usb2 - kmodloader /usr/k3usb/45-phy-bcm-ns-usb2 - kmodloader /usr/k3usb/50-usb-ohci - - echo "usb switch to usb3 mode!" - else - #usb2 - kmodloader /usr/k3usb/35-usb-ehci - kmodloader /usr/k3usb/40-usb2 - kmodloader /usr/k3usb/45-phy-bcm-ns-usb2 - kmodloader /usr/k3usb/50-usb-ohci - echo "usb switch to usb2 mode!" - fi - - kmodloader /usr/k3usb/usb-storage - kmodloader /usr/k3usb/usb-storage-extras - -} - - -start(){ - if [ "$usb3_enable" == "1" ]; then - if [ -z "$(lsmod | grep usb3)" ]; then - echo "usb change to usb3 mode, will reboot!" - reboot - else - echo "usb mode is usb3 , nothing to do" - fi - else - if [ -n "$(lsmod | grep usb3)" ]; then - echo "usb change usb2 mode, will reboot!" - reboot - else - echo "usb mode is usb2 , nothing to do" - fi - fi -} - -stop(){ - echo "nothing do" -} - -restart(){ - start -} diff --git a/luci-app-k3usb/root/etc/uci-defaults/luci-k3usb b/luci-app-k3usb/root/etc/uci-defaults/luci-k3usb deleted file mode 100644 index fbbdd725..00000000 --- a/luci-app-k3usb/root/etc/uci-defaults/luci-k3usb +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-k3usb.json" ] && { - cat > /usr/share/ucitrack/luci-app-k3usb.json << EEOF -{ - "config": "k3usb", - "init": "k3usb" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@k3usb[-1] - add ucitrack k3usb - set ucitrack.@k3usb[-1].init=k3usb - commit ucitrack -EOF - -rm -rf /tmp/luci-* -exit 0 diff --git a/luci-app-k3usb/root/usr/k3usb/35-usb-ehci b/luci-app-k3usb/root/usr/k3usb/35-usb-ehci deleted file mode 100644 index 52ae03a9..00000000 --- a/luci-app-k3usb/root/usr/k3usb/35-usb-ehci +++ /dev/null @@ -1 +0,0 @@ -ehci-hcd diff --git a/luci-app-k3usb/root/usr/k3usb/40-usb2 b/luci-app-k3usb/root/usr/k3usb/40-usb2 deleted file mode 100644 index d9ec9836..00000000 --- a/luci-app-k3usb/root/usr/k3usb/40-usb2 +++ /dev/null @@ -1,4 +0,0 @@ -ehci-hcd -ehci-platform -ehci-orion -ehci-atmel diff --git a/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb2 b/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb2 deleted file mode 100644 index d7364c5e..00000000 --- a/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb2 +++ /dev/null @@ -1 +0,0 @@ -phy-bcm-ns-usb2 diff --git a/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb3 b/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb3 deleted file mode 100644 index e5730da8..00000000 --- a/luci-app-k3usb/root/usr/k3usb/45-phy-bcm-ns-usb3 +++ /dev/null @@ -1 +0,0 @@ -phy-bcm-ns-usb3 diff --git a/luci-app-k3usb/root/usr/k3usb/50-usb-ohci b/luci-app-k3usb/root/usr/k3usb/50-usb-ohci deleted file mode 100644 index cb1ed678..00000000 --- a/luci-app-k3usb/root/usr/k3usb/50-usb-ohci +++ /dev/null @@ -1,3 +0,0 @@ -ohci-hcd -ohci-platform -ohci-at91 diff --git a/luci-app-k3usb/root/usr/k3usb/54-usb3 b/luci-app-k3usb/root/usr/k3usb/54-usb3 deleted file mode 100644 index 5ba5d865..00000000 --- a/luci-app-k3usb/root/usr/k3usb/54-usb3 +++ /dev/null @@ -1,3 +0,0 @@ -xhci-hcd -xhci-pci -xhci-plat-hcd diff --git a/luci-app-k3usb/root/usr/k3usb/test b/luci-app-k3usb/root/usr/k3usb/test deleted file mode 100644 index e69de29b..00000000 diff --git a/luci-app-k3usb/root/usr/k3usb/usb-storage b/luci-app-k3usb/root/usr/k3usb/usb-storage deleted file mode 100644 index 6b30c924..00000000 --- a/luci-app-k3usb/root/usr/k3usb/usb-storage +++ /dev/null @@ -1 +0,0 @@ -usb-storage diff --git a/luci-app-k3usb/root/usr/k3usb/usb-storage-extras b/luci-app-k3usb/root/usr/k3usb/usb-storage-extras deleted file mode 100644 index 446fa697..00000000 --- a/luci-app-k3usb/root/usr/k3usb/usb-storage-extras +++ /dev/null @@ -1,10 +0,0 @@ -ums-alauda -ums-cypress -ums-datafab -ums-freecom -ums-isd200 -ums-jumpshot -ums-karma -ums-sddr09 -ums-sddr55 -ums-usbat diff --git a/luci-app-k3usb/root/usr/share/rpcd/acl.d/luci-app-k3usb.json b/luci-app-k3usb/root/usr/share/rpcd/acl.d/luci-app-k3usb.json deleted file mode 100644 index a133b79c..00000000 --- a/luci-app-k3usb/root/usr/share/rpcd/acl.d/luci-app-k3usb.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-k3usb": { - "description": "Grant UCI access for luci-app-k3usb", - "read": { - "uci": [ "k3usb" ] - }, - "write": { - "uci": [ "k3usb" ] - } - } -} diff --git a/luci-app-k3usb/root/usr/share/ucitrack/luci-app-k3usb.json b/luci-app-k3usb/root/usr/share/ucitrack/luci-app-k3usb.json deleted file mode 100644 index a6ffbb22..00000000 --- a/luci-app-k3usb/root/usr/share/ucitrack/luci-app-k3usb.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "config": "k3usb", - "init": "k3usb" -} diff --git a/luci-app-ltqtapi/Makefile b/luci-app-ltqtapi/Makefile new file mode 100644 index 00000000..88392341 --- /dev/null +++ b/luci-app-ltqtapi/Makefile @@ -0,0 +1,14 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI Support for Lantiq Devices +LUCI_DEPENDS:=@BROKEN + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua b/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua new file mode 100644 index 00000000..46c76840 --- /dev/null +++ b/luci-app-ltqtapi/luasrc/controller/ltqtapi.lua @@ -0,0 +1,40 @@ +-- Copyright 2019 John Crispin +-- Licensed to the public under the Apache License 2.0. + +module("luci.controller.ltqtapi", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/telephony") then + return + end + + page = node("admin", "telephony") + page.target = firstchild() + page.title = _("VoIP") + page.order = 90 + + entry({"admin", "telephony", "account"}, cbi("luci_ltqtapi/account") , _("Account"), 10) + entry({"admin", "telephony", "contact"}, cbi("luci_ltqtapi/contact") , _("Contacts"), 20) + + entry({"admin", "telephony", "status"}, call("tapi_status")).leaf = true +end + +function tapi_status() + local st = { } + local state = require "luci.model.uci".cursor_state() + state:load("telephony") + + st.status = "Offline"; + if state:get("telephony", "state", "port1", "0") == "0" then + st.line1 = "Idle"; + else + st.line1 = "Calling"; + end + if state:get("telephony", "state", "port2", "0") == "0" then + st.line2 = "Idle"; + else + st.line2 = "Calling"; + end + luci.http.prepare_content("application/json") + luci.http.write_json(st) +end diff --git a/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/account.lua b/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/account.lua new file mode 100644 index 00000000..907db56e --- /dev/null +++ b/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/account.lua @@ -0,0 +1,16 @@ +-- Copyright 2010 John Crispin +-- Licensed to the public under the Apache License 2.0. + +m = Map("telephony", translate("VoIP")) +m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony restart") end + +s = m:section(TypedSection, "account", translate("Account"), translate("Here You can specify the SIP account that you want to use.")) +s.anonymous = true +s.addremove = true + +s:option(Value, "realm", translate("Realm")) +s:option(Value, "username", translate("Username")) +s:option(Value, "password", translate("Password")) +s:option(Flag, "disabled", translate("Disabled")) + +return m diff --git a/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua b/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua new file mode 100644 index 00000000..b32feded --- /dev/null +++ b/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua @@ -0,0 +1,20 @@ +-- Copyright 2010 John Crispin +-- Licensed to the public under the Apache License 2.0. + +m = Map("telephony", translate("VoIP")) +m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony reload") end + +s = m:section(TypedSection, "contact", translate("Contact"), translate("Here You can specify the SIP contacts that you want to use.")) +s.anonymous = true +s.addremove = true +s.template = "cbi/tsection" + +s:option(Value, "desc", translate("Name")) +s:option(Value, "code", translate("Shortdial")) +s:option(Value, "dial", translate("Dial")) + +t = s:option(ListValue, "type", translate("Type")) +t:value("sip", "SIP") +t:value("realm", "Landline") + +return m diff --git a/luci-app-ltqtapi/luasrc/view/admin_status/index/telephony.htm b/luci-app-ltqtapi/luasrc/view/admin_status/index/telephony.htm new file mode 100644 index 00000000..c7a58dd3 --- /dev/null +++ b/luci-app-ltqtapi/luasrc/view/admin_status/index/telephony.htm @@ -0,0 +1 @@ +<%+telephony_status%> diff --git a/luci-app-ltqtapi/luasrc/view/telephony_status.htm b/luci-app-ltqtapi/luasrc/view/telephony_status.htm new file mode 100644 index 00000000..d861ef9f --- /dev/null +++ b/luci-app-ltqtapi/luasrc/view/telephony_status.htm @@ -0,0 +1,32 @@ + + +
+ <%:Current Telephony State%> +
文件所有者修改时间大小权限操作
..
'+o.perms+'\ \ - ' + \ + \ + ' + install_btn + '
+ + + + + + + + +
<%:Uplink%><%:Port1%><%:Port2%>

<%:Collecting data...%>
+ diff --git a/luci-app-minieap/Makefile b/luci-app-minieap/Makefile deleted file mode 100644 index a259c158..00000000 --- a/luci-app-minieap/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-minieap -PKG_VERSION=1.0 -PKG_RELEASE:=1 - -LUCI_TITLE:=minieap 802.1X Client for LuCI -LUCI_PKGARCH:=all -LUCI_DEPENDS:=+minieap - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-minieap/luasrc/controller/minieap.lua b/luci-app-minieap/luasrc/controller/minieap.lua deleted file mode 100644 index 46acc677..00000000 --- a/luci-app-minieap/luasrc/controller/minieap.lua +++ /dev/null @@ -1,20 +0,0 @@ -module("luci.controller.minieap", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/minieap") then - return - end - - if luci.sys.call("command -v minieap >/dev/null") ~= 0 then - return - end - - local page = entry({"admin", "services", "minieap"}, alias("admin", "services", "minieap", "general"), _("minieap")) - page.order = 10 - page.dependent = true - page.acl_depends = { "luci-app-minieap" } - - entry({"admin", "services", "minieap", "general"}, cbi("minieap/general"), _("minieap Settings"), 10).leaf = true - -- entry({"admin", "services", "minieap", "customfile"}, cbi("minieap/customfile"), _("custom configfiles"), 20).leaf = true - entry({"admin", "services", "minieap", "log"}, cbi("minieap/log"), _("minieap LOG"), 30).leaf = true -end diff --git a/luci-app-minieap/luasrc/model/cbi/minieap/customfile.lua b/luci-app-minieap/luasrc/model/cbi/minieap/customfile.lua deleted file mode 100644 index 13484b1d..00000000 --- a/luci-app-minieap/luasrc/model/cbi/minieap/customfile.lua +++ /dev/null @@ -1,8 +0,0 @@ - -require("luci.sys") - -local f = SimpleForm("minieap", - translate("minieap LOG"), - translate("Log file:/var/log/minieap.log")) - -return f diff --git a/luci-app-minieap/luasrc/model/cbi/minieap/general.lua b/luci-app-minieap/luasrc/model/cbi/minieap/general.lua deleted file mode 100644 index 2695e93f..00000000 --- a/luci-app-minieap/luasrc/model/cbi/minieap/general.lua +++ /dev/null @@ -1,182 +0,0 @@ -local function is_running(name) - if luci.sys.call("pidof %s >/dev/null" %{name}) == 0 then - return translate("RUNNING") - else - return translate("NOT RUNNING") - end -end - -local function is_online(ipaddr) - if ipaddr == "0.0.0.0" or ipaddr == "nil" then - return translate("Pinghost not set") - end - if luci.sys.call("ping -c1 -w1 %s >/dev/null 2>&1" %{ipaddr}) == 0 then - return translate("ONLINE") - else - return translate("NOT ONLINE") - end -end - -require("luci.sys") - -m = Map("minieap", translate("minieap")) -m.description = translate("Configure minieap 802.11x.") - -s = m:section(TypedSection, "minieap", translate("Status")) -s.anonymous = true - -status = s:option(DummyValue,"_minieap_status", "minieap") -status.value = "%s" %{is_running("minieap")} -status.rawhtml = true - -t = io.popen('uci get minieap.@minieap[0].pinghost') -netstat = is_online(tostring(t:read("*line"))) -t:close() -if netstat ~= "" then -netstatus = s:option(DummyValue,"_network_status", translate("Network Status")) -netstatus.value = "%s" %{netstat} -netstatus.rawhtml = true -end - -o = m:section(TypedSection, "minieap", translate("Settings")) -o.addremove = false -o.anonymous = true - -o:tab("base", translate("Normal Settings")) -o:tab("advanced", translate("Advanced Settings")) -o:tab("plugins", translate("Plugins List")) -o:tab("ruijie", translate("Ruijie EAP Settings")) - -enable = o:taboption("base", Flag, "enable", translate("Enable")) - -name = o:taboption("base", Value, "username", translate("Username")) -name.description = translate("The username given to you by your network administrator") - -pass = o:taboption("base", Value, "password", translate("Password")) -pass.description = translate("The password you set or given to you by your network administrator") -pass.password = true - -ifname = o:taboption("base", ListValue, "nic", translate("Interfaces")) -ifname.description = translate("Physical interface of WAN") -for k, v in ipairs(luci.sys.net.devices()) do - if v ~= "lo" then - ifname:value(v) - end -end - -pinghost = o:taboption("base", Value, "pinghost", translate("PingHost")) -pinghost.description = translate("Ping host for drop detection, 0.0.0.0 to turn off this feature.") -pinghost.default = "0.0.0.0" - -pingintval = o:taboption("base", Value, "pingintval", translate("Ping intval")) -pingintval.description = translate("Interval of each ping. (in second) [default: 30]") -pingintval.default = "30" - -pingcommand = o:taboption("base", Value, "pingcommand", translate("Offline command")) -pingcommand.description = translate("Run Command when ping failed. [default: minieap -k 1]") -pingcommand:value("minieap -k 1") -pingcommand.default = "minieap -k 1" - -stage_timeout = o:taboption("advanced", Value, "stage_timeout", translate("Auth Timeout")) -stage_timeout.description = translate("802.11X auth timeout (in second). [default: 5]") -stage_timeout.default = "5" - -wait_after_fail = o:taboption("advanced", Value, "wait_after_fail", translate("Wait after failed")) -wait_after_fail.description = translate("Wait time between failed and next time (in second). [default: 30]") -wait_after_fail.default = "30" - -max_fail = o:taboption("advanced", Value, "max_fail", translate("Max fail")) -max_fail.description = translate("Maximum allowed number of failures. [default: 3]") -max_fail.default = "3" - -no_auto_reauth = o:taboption("advanced", ListValue, "no_auto_reauth", translate("Disable auto reauth")) -no_auto_reauth.description = translate("Disable auto reauth after offline. [default: True]") -no_auto_reauth:value(0, translate("False")) -no_auto_reauth:value(1, translate("True")) -no_auto_reauth.default = 1 - -proxy_lan_iface = o:taboption("advanced", Value, "proxy_lan_iface", translate("Proxy LAN's name")) -proxy_lan_iface.description = translate("Name of LAN interface when use proxy auth. [default: None]") -proxy_lan_iface.default = "" - -auth_round = o:taboption("advanced", Value, "auth_round", translate("Auth times")) -auth_round.description = translate("Number of times required for auth. [default: 1]") -auth_round.default = "1" - -max_retries = o:taboption("advanced", Value, "max_retries", translate("Max timeout")) -max_retries.description = translate("Maximum retry time after timeout. [default: 3]") -max_retries.default = "3" - -pid_file = o:taboption("advanced", Value, "pid_file", translate("PID file")) -pid_file.description = translate("Path of PID file. (Set 'None' to disable) [default: /var/run/minieap.pid]") -pid_file:value("/var/run/minieap.pid") -pid_file.default = "/var/run/minieap.pid" - -if_impl = o:taboption("advanced", ListValue, "if_impl", translate("Network Module")) -if_impl.description = translate("Network module for send and recv packages (openwrt support sockraw only)") -if_impl:value("sockraw") -if_impl.default = "sockraw" - -plugins = o:taboption("plugins", DynamicList, "module", translate("Plugins list")) -plugins.description = translate("Packets flow through these plug-ins in sequence. Pay attention to the order in the environment where the package plug-in is modified") -plugins:value("printer", translate("printer: Print length of packets")) -plugins:value("rjv3", translate('rjv3: Ruijie 802.11X. Support V3 verification algorithm')) - -heartbeat = o:taboption("ruijie", Value, "heartbeat", translate("Heartbeat interval")) -heartbeat.description = translate("Interval for sending Heartbeat packets (seconds) [Default: 60]") -heartbeat.default = "60" - -eap_bcast_addr = o:taboption("ruijie", ListValue, "eap_bcast_addr", translate("Broadcast address")) -eap_bcast_addr.description = translate("Broadcast address type when searching for servers [Default: Standard]") -eap_bcast_addr:value(0, translate("Standard")) -eap_bcast_addr:value(1, translate("Ruijie private")) -eap_bcast_addr.default = 0 - -dhcp_type = o:taboption("ruijie", ListValue, "dhcp_type", translate("DhcpMode")) -dhcp_type.description = translate("DHCP method [Default: After certification]") -dhcp_type:value(0, translate("None")) -dhcp_type:value(1, translate("Secondary authentication")) -dhcp_type:value(2, translate("Before certification")) -dhcp_type:value(3, translate("After certification")) -dhcp_type.default = 3 - -dhcp_script = o:taboption("ruijie", Value, "dhcp_script", translate("DhcpScript")) -dhcp_script.description = translate("DHCP script [Default: None]") -dhcp_script.default = "" - -service = o:taboption("ruijie", Value, "service", translate("Service")) -service.description = translate("Service From Ruijie Server [Default: internet]") -service.default = "internet" - -version_str = o:taboption("ruijie", Value, "version_str", translate("Version String")) -version_str.description = translate("Custom version [Default: RG-SU For Linux V1.0]") -version_str:value("RG-SU For Linux V1.0") -version_str.default = "RG-SU For Linux V1.0" - -fake_dns1 = o:taboption("ruijie", Value, "fake_dns1", translate("Main DNS server")) -fake_dns1.description = translate("Custom main DNS server [Default: FromSystem]") - -fake_dns2 = o:taboption("ruijie", Value, "fake_dns2", translate("Second DNS server")) -fake_dns2.description = translate("Custom second DNS server [Default: FromSystem]") - -fake_serial = o:taboption("ruijie", Value, "fake_serial", translate("Disk serial")) -fake_serial.description = translate("Custom disk serial [Default: From /etc/mtab]") - -max_dhcp_count = o:taboption("ruijie", Value, "max_dhcp_count", translate("DHCP try times")) -max_dhcp_count.description = translate("DHCP try times [Default: 3]") -max_dhcp_count.default = "3" - -rj_option = o:taboption("ruijie", DynamicList, "rj_option", translate("Custom EAP Options")) -rj_option.description = translate("Format <type>:<value>[:r]. Add a option type: <type>, value: <value>. :r for replace") - -if nixio.fs.mkdir("/etc/minieap.conf.d") == true then - nixio.fs.symlink("/etc/minieap.conf.d/minieap.conf.utf8", "/etc/minieap.conf") -end - -local apply = luci.http.formvalue("cbi.apply") -if apply then - luci.sys.call("minieap-conver | sort > /etc/minieap.conf.d/minieap.conf.utf8") - io.popen("/etc/init.d/minieap restart") -end - -return m diff --git a/luci-app-minieap/luasrc/model/cbi/minieap/log.lua b/luci-app-minieap/luasrc/model/cbi/minieap/log.lua deleted file mode 100644 index c45c1d81..00000000 --- a/luci-app-minieap/luasrc/model/cbi/minieap/log.lua +++ /dev/null @@ -1,23 +0,0 @@ -local fs = require "nixio.fs" - -local f = SimpleForm("minieap", - translate("minieap LOG"), - translate("Log file:/var/log/minieap.log")) - -local o = f:field(Value, "minieap_log") - -o.template = "cbi/tvalue" -o.rows = 32 - -function o.cfgvalue(self, section) - return fs.readfile("/var/log/minieap.log") -end - -function o.write(self, section, value) - require("luci.sys").call('cat /dev/null > /var/log/minieap.log 2>/dev/null') -end - -f.submit = translate("Clear log") -f.reset = false - -return f diff --git a/luci-app-minieap/po/zh-cn b/luci-app-minieap/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-minieap/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-minieap/po/zh_Hans/minieap.po b/luci-app-minieap/po/zh_Hans/minieap.po deleted file mode 100644 index e365eade..00000000 --- a/luci-app-minieap/po/zh_Hans/minieap.po +++ /dev/null @@ -1,227 +0,0 @@ -msgid "minieap Settings" -msgstr "minieap 设置" - -msgid "minieap LOG" -msgstr "minieap 日志" - -msgid "Log file:/var/log/minieap.log" -msgstr "日志文件: /var/log/minieap.log" - -msgid "RUNNING" -msgstr "运行中" - -msgid "NOT RUNNING" -msgstr "未运行" - -msgid "Pinghost not set" -msgstr "没有设置Ping主机" - -msgid "ONLINE" -msgstr "能访问互联网" - -msgid "NOT ONLINE" -msgstr "不能访问互联网" - -msgid "Configure minieap 802.11x." -msgstr "配置minieap 802.11x验证。" - -msgid "Network Status" -msgstr "网络状态" - -msgid "Settings" -msgstr "设置" - -msgid "Normal Settings" -msgstr "常规设置" - -msgid "Plugins List" -msgstr "插件列表" - -msgid "Ruijie EAP Settings" -msgstr "锐捷认证设置" - -msgid "The username given to you by your network administrator" -msgstr "您的用户名(或管理员分配的用户名)" - -msgid "The password you set or given to you by your network administrator" -msgstr "您的密码(或管理员分配的密码)" - -msgid "Physical interface of WAN" -msgstr "WAN口的物理接口" - -msgid "PingHost" -msgstr "Ping主机" - -msgid "Ping host for drop detection, 0.0.0.0 to turn off this feature." -msgstr "Ping主机,用于掉线检测,0.0.0.0表示关闭该功能" - -msgid "Packets flow through these plug-ins in sequence. Pay attention to the order in the environment where the package plug-in is modified" -msgstr "数据包会按顺序流经这些插件。在有修改数据包插件的环境中请注意顺序" - -msgid "printer: Print length of packets" -msgstr "printer:打印流入流出数据包的大小" - -msgid "rjv3: Ruijie 802.11X. Support V3 verification algorithm" -msgstr "rjv3:锐捷认证,支持V3算法" - -msgid "Heartbeat interval" -msgstr "心跳间隔" - -msgid "Interval for sending Heartbeat packets (seconds) [Default: 60]" -msgstr "发送心跳包的间隔(秒)[默认:60]" - -msgid "Broadcast address" -msgstr "广播地址类型" - -msgid "Broadcast address type when searching for servers [Default: Standard]" -msgstr "寻找服务器时的广播地址类型 [默认:标准]" - -msgid "Standard" -msgstr "标准" - -msgid "Ruijie private" -msgstr "锐捷私有" - -msgid "DhcpMode" -msgstr "DHCP方式" - -msgid "DHCP method [Default: After certification]" -msgstr "DHCP方式 [默认:认证后]" - -msgid "None" -msgstr "无" - -msgid "Secondary authentication" -msgstr "二次认证" - -msgid "Before certification" -msgstr "认证前" - -msgid "After certification" -msgstr "认证后" - -msgid "DhcpScript" -msgstr "DHCP脚本" - -msgid "DHCP script [Default: None]" -msgstr "DHCP脚本 [默认:无]" - -msgid "Service" -msgstr "服务" - -msgid "Service From Ruijie Server [Default: internet]" -msgstr "锐捷认证服务器上配置的用户服务" - -msgid "Version String" -msgstr "版本信息" - -msgid "Custom version [Default: RG-SU For Linux V1.0]" -msgstr "自定义版本信息 [默认:RG-SU For Linux V1.0]" - -msgid "Main DNS server" -msgstr "主DNS服务器" - -msgid "Custom main DNS server [Default: FromSystem]" -msgstr "自定义主DNS服务器 [默认:自动获取]" - -msgid "Second DNS server" -msgstr "从DNS服务器" - -msgid "Custom second DNS server [Default: FromSystem]" -msgstr "自定义从DNS服务器 [默认:自动获取]" - -msgid "Disk serial" -msgstr "磁盘序列号" - -msgid "Custom disk serial [Default: From /etc/mtab]" -msgstr "自定义磁盘序列号 [默认:自动获取]" - -msgid "DHCP try times" -msgstr "DHCP尝试次数" - -msgid "DHCP try times [Default: 3]" -msgstr "二次认证的DHCP尝试次数 [默认:3]" - -msgid "Custom EAP Options" -msgstr "自定义EAP字段" - -msgid "Format <type>:<value>[:r]. Add a option type: <type>, value: <value>. :r for replace" -msgstr "格式: <type>:<value>[:r]。 不带r为增加字段,带r为替换字段" - -msgid "Configfile encoding" -msgstr "配置文件编码" - -msgid "Auth Timeout" -msgstr "认证超时" - -msgid "802.11X auth timeout (in second). [default: 5]" -msgstr "单个认证阶段的超时时间 [默认:5]" - -msgid "Wait after failed" -msgstr "认证失败等待" - -msgid "Wait time between failed and next time (in second). [default: 30]" -msgstr "认证失败后重新认证前的等待时间[默认:30]" - -msgid "Max fail" -msgstr "最大失败次数" - -msgid "Maximum allowed number of failures. [default: 3]" -msgstr "最大允许认证失败次数 [默认:3]" - -msgid "Disable auto reauth" -msgstr "禁止自动重连" - -msgid "Disable auto reauth after offline. [default: True]" -msgstr "认证掉线后不允许自动重连 [默认:是]" - -msgid "False" -msgstr "否" - -msgid "True" -msgstr "是" - -msgid "Daemon mode" -msgstr "运行模式" - -msgid "Proxy LAN's name" -msgstr "代理LAN口名称" - -msgid "Name of LAN interface when use proxy auth. [default: None]" -msgstr "代理认证时的 LAN 网络界面名 [默认:无]" - -msgid "Auth times" -msgstr "认证次数" - -msgid "Number of times required for auth. [default: 1]" -msgstr "需要认证的次数 [默认:1]" - -msgid "Max timeout" -msgstr "最大超时重试" - -msgid "Maximum retry time after timeout. [default: 3]" -msgstr "最大超时重试的次数 [默认:3]" - -msgid "PID file" -msgstr "PID文件" - -msgid "Path of PID file. (Set 'None' to disable) [default: /var/run/minieap.pid]" -msgstr "PID 文件路径,设为none可禁用 [默认:/var/run/minieap.pid]" - -msgid "Network Module" -msgstr "网络操作模块" - -msgid "Network module for send and recv packages (openwrt support sockraw only)" -msgstr "选择此网络操作模块(openwrt只支持sockraw)" - -msgid "Ping intval" -msgstr "Ping间隔" - -msgid "Interval of each ping. (in second) [default: 30]" -msgstr "Ping Ping主机的间隔(秒) [默认:30]" - -msgid "Offline command" -msgstr "掉线执行命令" - -msgid "Run Command when ping failed. [default: minieap -k 1]" -msgstr "Ping 检测到掉线后执行的命令 [默认: minieap -k 1]" diff --git a/luci-app-minieap/root/etc/config/minieap b/luci-app-minieap/root/etc/config/minieap deleted file mode 100644 index cf4cdbad..00000000 --- a/luci-app-minieap/root/etc/config/minieap +++ /dev/null @@ -1,18 +0,0 @@ -config minieap - option pinghost '0.0.0.0' - option pingintval '30' - option pingcommand 'minieap -k 1' - option stage_timeout '5' - option wait_after_fail '30' - option max_fail '3' - option no_auto_reauth '1' - option auth_round '1' - option max_retries '3' - option pid_file '/var/run/minieap.pid' - option if_impl 'sockraw' - option heartbeat '60' - option eap_bcast_addr '0' - option dhcp_type '3' - option service 'internet' - option version_str 'RG-SU For Linux V1.0' - option max_dhcp_count '3' diff --git a/luci-app-minieap/root/etc/init.d/minieap b/luci-app-minieap/root/etc/init.d/minieap deleted file mode 100755 index fb896a62..00000000 --- a/luci-app-minieap/root/etc/init.d/minieap +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh /etc/rc.common -START=93 - -run_minieap() -{ - kill $(cat /var/log/minieap-ping.pid 2>/dev/null) 2>/dev/null - - local enable - local username - local password - local nic - local pinghost - config_get_bool enable $1 enable - config_get username $1 username - config_get password $1 password - config_get nic $1 nic - config_get pinghost $1 pinghost - - if [ $enable ] && [ $username ] && [ $password ] && [ $nic ]; then - if [ $pinghost ]; then - /bin/ash -c "/usr/sbin/minieap-ping &" - fi - /bin/ash -c "minieap -b3" - else - /bin/ash -c "minieap -k" - fi -} - -restart_minieap() -{ - kill $(cat /var/log/minieap-ping.pid 2>/dev/null) 2>/dev/null - - local enable - local username - local password - local nic - local pinghost - config_get_bool enable $1 enable - config_get username $1 username - config_get password $1 password - config_get nic $1 nic - config_get pinghost $1 pinghost - - if [ $enable ] && [ $username ] && [ $password ] && [ $nic ]; then - if [ $pinghost ]; then - /bin/ash -c "/usr/sbin/minieap-ping &" - fi - /bin/ash -c "minieap -k 1" - else - /bin/ash -c "minieap -k" - fi -} - -start() -{ - config_load minieap - config_foreach run_minieap minieap -} - -stop() -{ - kill $(cat /var/log/minieap-ping.pid 2>/dev/null) 2>/dev/null - /bin/ash -c "minieap -k" -} - -restart() -{ - config_load minieap - config_foreach restart_minieap minieap -} diff --git a/luci-app-minieap/root/etc/uci-defaults/luci-minieap b/luci-app-minieap/root/etc/uci-defaults/luci-minieap deleted file mode 100644 index bb3c1d89..00000000 --- a/luci-app-minieap/root/etc/uci-defaults/luci-minieap +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-minieap.json" ] && { - cat > /usr/share/ucitrack/luci-app-minieap.json << EEOF -{ - "config": "minieap", - "init": "minieap" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@minieap[-1] - add ucitrack minieap - set ucitrack.@minieap[-1].init=minieap - commit ucitrack -EOF - -rm -rf /tmp/luci-* -exit 0 diff --git a/luci-app-minieap/root/usr/sbin/minieap-conver b/luci-app-minieap/root/usr/sbin/minieap-conver deleted file mode 100755 index 2b2cc35c..00000000 --- a/luci-app-minieap/root/usr/sbin/minieap-conver +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -default_config='''daemonize=3 -''' - -echo $default_config -config_keys=$(uci show minieap | cut -d "." -f3- | awk -F "=" '{if ($0 != "") print $1}') -for key in $config_keys -do - if [[ "$key" != "pinghost" ]] && [[ "$key" != "pingintval" ]]; then - echo ${key//_/-}=$(uci get minieap.@minieap[0].$key) - fi -done diff --git a/luci-app-minieap/root/usr/sbin/minieap-ping b/luci-app-minieap/root/usr/sbin/minieap-ping deleted file mode 100755 index fb56f290..00000000 --- a/luci-app-minieap/root/usr/sbin/minieap-ping +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -kill $(cat /var/log/minieap-ping.pid 2>/dev/null) 2>/dev/null - -echo $$ > /var/log/minieap-ping.pid - -ping_host=$(uci get minieap.@minieap[0].pinghost) -ping_intval=$(uci get minieap.@minieap[0].pingintval) -ping_command=$(uci get minieap.@minieap[0].pingcommand) -ipint=$(echo $ping_host | awk -F "." '{print $1*2**8**3 + $2*2**8**2 + $3*2**8 + $4}') -if [[ $ipint -le 0 ]] || [[ $ipint -ge 4294967295 ]]; then - exit -fi - -if [ ! -z $ping_host ]; then - while true - do - ping -c1 -w1 $ping_host > /dev/null 2>&1 - if [ $? -ne 0 ]; then - $ping_command - fi - sleep $ping_intval - done -fi diff --git a/luci-app-minieap/root/usr/share/rpcd/acl.d/luci-app-minieap.json b/luci-app-minieap/root/usr/share/rpcd/acl.d/luci-app-minieap.json deleted file mode 100644 index f897478a..00000000 --- a/luci-app-minieap/root/usr/share/rpcd/acl.d/luci-app-minieap.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-minieap": { - "description": "Grant UCI access for luci-app-minieap", - "read": { - "uci": [ "minieap" ] - }, - "write": { - "uci": [ "minieap" ] - } - } -} diff --git a/luci-app-minieap/root/usr/share/ucitrack/luci-app-minieap.json b/luci-app-minieap/root/usr/share/ucitrack/luci-app-minieap.json deleted file mode 100644 index 8bf0517a..00000000 --- a/luci-app-minieap/root/usr/share/ucitrack/luci-app-minieap.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "config": "minieap", - "init": "minieap" -} diff --git a/luci-app-mwan3helper/Makefile b/luci-app-mwan3helper/Makefile index f6149397..710f0713 100644 --- a/luci-app-mwan3helper/Makefile +++ b/luci-app-mwan3helper/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for MWAN3 Helper LUCI_DEPENDS:=+luci-app-mwan3 +pdnsd-alt +dnsmasq-full +ipset LUCI_PKGARCH:=all + +PKG_NAME:=luci-app-mwan3helper PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature - - diff --git a/luci-app-mwan3helper/luasrc/controller/mwan3helper.lua b/luci-app-mwan3helper/luasrc/controller/mwan3helper.lua index 56cb5e7c..ad9fffab 100644 --- a/luci-app-mwan3helper/luasrc/controller/mwan3helper.lua +++ b/luci-app-mwan3helper/luasrc/controller/mwan3helper.lua @@ -1,4 +1,3 @@ - -- Licensed to the public under the GNU General Public License v3. module("luci.controller.mwan3helper", package.seeall) @@ -8,21 +7,15 @@ function index() return end - - local page = entry({"admin", "services", "mwan3helper"},alias("admin", "services", "mwan3helper", "client"),_("MWAN3 Helper"), 300) - page.dependent = true - page.acl_depends = { "luci-app-mwan3helper" } - entry({"admin", "services", "mwan3helper", "client"},cbi("mwan3helper/client"),_("Settings"), 10).leaf = true - - entry({"admin", "services", "mwan3helper", "lists"},cbi("mwan3helper/list"),_("IPSet Lists"), 20).leaf = true - - entry({"admin","services","mwan3helper","status"},call("act_status")).leaf=true - + entry({"admin", "services", "mwan3helper"}, alias("admin", "services", "mwan3helper", "client"), _("MWAN3 Helper"), 300).dependent = true + entry({"admin", "services", "mwan3helper", "client"}, cbi("mwan3helper/client"), _("Settings"), 10).leaf = true + entry({"admin", "services", "mwan3helper", "lists"}, cbi("mwan3helper/list"), _("IPSet Lists"), 20).leaf = true + entry({"admin", "services", "mwan3helper", "status"}, call("act_status")).leaf = true end function act_status() - local e={} - e.running=luci.sys.call("pgrep mwan3dns >/dev/null")==0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) + local e = {} + e.running = luci.sys.call("pgrep mwan3dns >/dev/null") == 0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) end diff --git a/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/client.lua b/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/client.lua index 466b28c7..876ab915 100644 --- a/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/client.lua +++ b/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/client.lua @@ -1,5 +1,3 @@ - - m = Map("mwan3helper") m.title = translate("MWAN3 Helper") m.description = translate("MWAN3 Helper generate IPSets") @@ -11,8 +9,8 @@ s.addremove = false s.anonymous = true o = s:option(Flag, "enabled", translate("Enable GFW IPSet")) -o.rmempty = false o.description = translate("启用 DNS 防污染并打开GFW IPSet(与SSR的GFW列表模式不能同时开启)") +o.rmempty = false o = s:option(ListValue, "dns", translate("Anti-pollution DNS Server")) o:value("208.67.222.222:443", translate("OpenDNS (208.67.222.222)")) diff --git a/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/list.lua b/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/list.lua index c908ff19..2f845aed 100644 --- a/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/list.lua +++ b/luci-app-mwan3helper/luasrc/model/cbi/mwan3helper/list.lua @@ -1,5 +1,3 @@ - - m = Map("mwan3helper") m.title = translate("MWAN3 IPSets") diff --git a/luci-app-mwan3helper/luasrc/view/mwan3helper/mwan3helper_status.htm b/luci-app-mwan3helper/luasrc/view/mwan3helper/mwan3helper_status.htm index 44c6a393..048a8814 100644 --- a/luci-app-mwan3helper/luasrc/view/mwan3helper/mwan3helper_status.htm +++ b/luci-app-mwan3helper/luasrc/view/mwan3helper/mwan3helper_status.htm @@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[mwan3helper]], [[status]])%>', nu

<%:Collecting data...%>

- \ No newline at end of file + diff --git a/luci-app-mwan3helper/po/zh-cn b/luci-app-mwan3helper/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-mwan3helper/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-mwan3helper/po/zh_Hans/mwan3helper.po b/luci-app-mwan3helper/po/zh-cn/mwan3helper.po similarity index 96% rename from luci-app-mwan3helper/po/zh_Hans/mwan3helper.po rename to luci-app-mwan3helper/po/zh-cn/mwan3helper.po index ed36fb5c..ff418003 100644 --- a/luci-app-mwan3helper/po/zh_Hans/mwan3helper.po +++ b/luci-app-mwan3helper/po/zh-cn/mwan3helper.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"Language: zh_Hans\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/luci-app-mwan3helper/po/zh_Hans b/luci-app-mwan3helper/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-mwan3helper/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-mwan3helper/root/etc/init.d/mwan3helper b/luci-app-mwan3helper/root/etc/init.d/mwan3helper index 6247ec23..dd71017b 100755 --- a/luci-app-mwan3helper/root/etc/init.d/mwan3helper +++ b/luci-app-mwan3helper/root/etc/init.d/mwan3helper @@ -19,19 +19,19 @@ start_pdnsd() { cat > /var/etc/mwan3dns.conf < ---微信公众号【WiFi物联网】 - -module("luci.controller.mwol", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/mwol") then - return - end - - local page = entry({"admin", "services", "mwol"}, cbi("mwol"), _("Mwol")) - page.dependent = true - page.acl_depends = { "luci-app-mwol" } -end diff --git a/luci-app-mwol/luasrc/model/cbi/mwol.lua b/luci-app-mwol/luasrc/model/cbi/mwol.lua deleted file mode 100644 index 7bca0b8a..00000000 --- a/luci-app-mwol/luasrc/model/cbi/mwol.lua +++ /dev/null @@ -1,141 +0,0 @@ ---Copyright (C) 2019 mleaf ---微信公众号【WiFi物联网】 - -local NXFS = require "nixio.fs" -local SYS = require "luci.sys" -local HTTP = require "luci.http" -local DISP = require "luci.dispatcher" -local Status, subTopic, pubTopic -local m, s -local e, mwol -local encryption -local sys = require "luci.sys" - -local mac = luci.sys.exec("uci -q get mwol.mwol_conf.id") - -m = Map("mwol", translate("Mqtt wake on lan")) -m.description = translate("请关注微信公众号【WiFi物联网】获取更多信息: \【WiFi物联网】") - -if SYS.call("pidof mwol >/dev/null") == 0 then - Status = translate("Mwol正在运行...") -else - Status = translate("Mwol未运行...") -end - -subTopic = string.format("Mwol订阅消息主题: /mwol/pub/%s", mac) -pubTopic = string.format("Mwol发布消息主题: /mwol/sub/%s", mac) - --- --- LoRa Gateway config for gateway_conf --- -mwol = m:section(TypedSection, "mwol") ---mwol.addremove = false -mwol.anonymous = true -mwol.description = translate(string.format("%s

%s

%s", Status, subTopic, pubTopic)) - -mwol:tab("general", translate("General Settings")) -mwol:tab("encryptionSettings", translate("Encryption Settings")) -mwol:tab("ssl", translate("SSL Settings")) - --- --- MQTT general --- -e = mwol:taboption("general", Flag, "enable") -e.title = translate("Enable") -e.default = 0 -e.rmempty = false - -e = mwol:taboption("general", Value, "hostname") -e.title = translate("MQTT Server") - -e = mwol:taboption("general", Value, "port") -e.title = translate("MQTT Port") - -host = mwol:taboption("general", Value, "presetmac", translate("Host to wake up")) -host.description = translate("Choose the host to wake up or enter a custom MAC address to use") -host.title = translate("Preset Mac") -sys.net.mac_hints(function(mac, name) - host:value(mac, "%s (%s)" %{ mac, name }) -end) - -e = mwol:taboption("general", Value, "id") -e.default = mac -e.rmempty = false; -e.title = translate("MQTT Topic Id") - --- --- MQTT Using encryption --- -encryption_enable = mwol:taboption("encryptionSettings", ListValue, "encryptionenable", translate("Enable")) -encryption_enable.optional = false; -encryption_enable.rmempty = false; -encryption_enable.default = 0 -encryption_enable.datatype = "uinteger" -encryption_enable:value(1, translate("True")) -encryption_enable:value(0, translate("False")) - --- --- MQTT username --- -encryption_username = mwol:taboption("encryptionSettings", Value, "username", translate("MQTT UserName")) -encryption_username.optional = true; -encryption_username.rmempty = true; -encryption_username.default = "mleaf" -encryption_username.datatype = "string" -encryption_username:depends("encryptionenable", "1") - --- --- MQTT password --- -encryption_password = mwol:taboption("encryptionSettings", Value, "password", translate("MQTT Password")) -encryption_password.optional = true; -encryption_password.rmempty = true; -encryption_password.default = "www.mleaf.org" -encryption_password.datatype = "string" -encryption_password:depends("encryptionenable", "1") - --- --- MQTT Using SSL --- -ssl_enable = mwol:taboption("ssl", ListValue, "sslenable", translate("Enable")) -ssl_enable.optional = false; -ssl_enable.rmempty = false; -ssl_enable.default = 0 -ssl_enable.datatype = "uinteger" -ssl_enable:value(1, translate("True")) -ssl_enable:value(0, translate("False")) - --- --- MQTT cafile --- -cafile = mwol:taboption("ssl", Value, "cafile", translate("ca")) -cafile.description = translate("Edit the ca file path.") -cafile.optional = true; -cafile.rmempty = true; -cafile.default = false -cafile.datatype = "string" -cafile:depends("sslenable", "1") - --- --- MQTT crtfile --- -crtfile = mwol:taboption("ssl", Value, "crtfile", translate("crt")) -crtfile.description = translate("Edit the crt file path.") -crtfile.optional = true; -crtfile.rmempty = true; -crtfile.default = false -crtfile.datatype = "string" -crtfile:depends("sslenable", "1") - --- --- MQTT keyfile --- -keyfile = mwol:taboption("ssl", Value, "keyfile", translate("key")) -keyfile.description = translate("Edit the key file path.") -keyfile.optional = true; -keyfile.rmempty = true; -keyfile.default = false -keyfile.datatype = "string" -keyfile:depends("sslenable", "1") - -return m diff --git a/luci-app-mwol/po/zh-cn b/luci-app-mwol/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-mwol/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-mwol/po/zh_Hans/mwol.po b/luci-app-mwol/po/zh_Hans/mwol.po deleted file mode 100644 index 820eea7b..00000000 --- a/luci-app-mwol/po/zh_Hans/mwol.po +++ /dev/null @@ -1,54 +0,0 @@ - -msgid "Mwol Plus is Running" -msgstr "Mwol正在运行" - -msgid "Mwol Plus is Not Running" -msgstr "Mwol未运行" - -msgid "Mwol Sub Topic:" -msgstr "Mwol订阅消息主题:" - -msgid "Mwol Pub Topic:" -msgstr "Mwol发布消息主题:" - -msgid "General Settings" -msgstr "通用设置" - -msgid "Encryption Settings" -msgstr "加密设定" - -msgid "SSL Settings" -msgstr "SSL证书设置" - -msgid "Enable" -msgstr "开启" - -msgid "MQTT Server" -msgstr "MQTT服务器" - -msgid "MQTT Port" -msgstr "MQTT端口" - -msgid "Preset Mac" -msgstr "预设MAC地址" - -msgid "Choose the host to wake up or enter a custom MAC address to use" -msgstr "选择一个需要唤醒的主机或自定义唤醒主机的mac地址" - -msgid "MQTT Topic Id" -msgstr "MQTT主题ID" - -msgid "MQTT UserName" -msgstr "MQTT用户名" - -msgid "MQTT Password" -msgstr "MQTT密码" - -msgid "Edit the ca file path." -msgstr "编辑CA路径。" - -msgid "Edit the crt file path." -msgstr "编辑CRT路径。" - -msgid "Edit the key file path." -msgstr "编辑KEY路径。" diff --git a/luci-app-mwol/root/etc/uci-defaults/40_luci-mwol b/luci-app-mwol/root/etc/uci-defaults/40_luci-mwol deleted file mode 100644 index 7668d687..00000000 --- a/luci-app-mwol/root/etc/uci-defaults/40_luci-mwol +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-mwol.json" ] && { - cat > /usr/share/ucitrack/luci-app-mwol.json << EEOF -{ - "config": "mwol", - "init": "mwol" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@mwol[-1] - add ucitrack mwol - set ucitrack.@mwol[-1].init=mwol - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/luci-app-mwol/root/usr/share/rpcd/acl.d/luci-app-mwol.json b/luci-app-mwol/root/usr/share/rpcd/acl.d/luci-app-mwol.json deleted file mode 100644 index a3d3e54a..00000000 --- a/luci-app-mwol/root/usr/share/rpcd/acl.d/luci-app-mwol.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-mwol": { - "description": "Grant UCI access for luci-app-mwol", - "read": { - "uci": [ "mwol" ] - }, - "write": { - "uci": [ "mwol" ] - } - } -} diff --git a/luci-app-mwol/Makefile b/luci-app-nft-qos/Makefile similarity index 58% rename from luci-app-mwol/Makefile rename to luci-app-nft-qos/Makefile index 3fdf0db7..ae17a188 100644 --- a/luci-app-mwol/Makefile +++ b/luci-app-nft-qos/Makefile @@ -1,16 +1,17 @@ # -# Copyright (C) 2019 mleaf -# 微信公众号【WiFi物联网】 +# Copyright (C) 2008-2014 The LuCI Team # # This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI Support for Mwol -LUCI_DEPENDS:=+mwol +LUCI_TITLE:=Qos over Nftables +LUCI_DEPENDS:=+nft-qos LUCI_PKGARCH:=all -PKG_VERSION:=1.0 + +PKG_NAME:=luci-app-nft-qos +PKG_VERSION:=1 PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-nft-qos/luasrc/controller/nft-qos.lua b/luci-app-nft-qos/luasrc/controller/nft-qos.lua new file mode 100644 index 00000000..2fb6e102 --- /dev/null +++ b/luci-app-nft-qos/luasrc/controller/nft-qos.lua @@ -0,0 +1,52 @@ +-- Copyright 2018 Rosy Song +-- Licensed to the public under the Apache License 2.0. + +module("luci.controller.nft-qos", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/nft-qos") then + return + end + + entry({"admin", "status", "realtime", "rate"}, template("nft-qos/rate"), _("Rate"), 5).leaf = true + entry({"admin", "status", "realtime", "rate_status"}, call("action_rate")).leaf = true + entry({"admin", "services", "nft-qos"}, cbi("nft-qos/nft-qos"), _("Qos over Nftables"), 60) +end + +function _action_rate(rv, n) + local c = nixio.fs.access("/proc/net/ipv6_route") and + io.popen("nft list chain inet nft-qos-monitor " .. n .. " 2>/dev/null") or + io.popen("nft list chain ip nft-qos-monitor " .. n .. " 2>/dev/null") + + if c then + for l in c:lines() do + local _, i, p, b = l:match( + '^%s+ip ([^%s]+) ([^%s]+) counter packets (%d+) bytes (%d+)' + ) + if i and p and b then + -- handle expression + rv[#rv + 1] = { + rule = { + family = "inet", + table = "nft-qos-monitor", + chain = n, + handle = 0, + expr = { + { match = { right = i } }, + { counter = { packets = p, bytes = b } } + } + } + } + end + end + c:close() + end +end + +function action_rate() + luci.http.prepare_content("application/json") + local data = { nftables = {} } + _action_rate(data.nftables, "upload") + _action_rate(data.nftables, "download") + luci.http.write_json(data) +end diff --git a/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua b/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua new file mode 100644 index 00000000..61a6d76a --- /dev/null +++ b/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua @@ -0,0 +1,229 @@ +-- Copyright 2018 Rosy Song +-- Licensed to the public under the Apache License 2.0. + +local uci = require("luci.model.uci").cursor() +local wa = require("luci.tools.webadmin") +local fs = require("nixio.fs") +local ipc = require("luci.ip") + +local def_rate_dl = uci:get("nft-qos", "default", "static_rate_dl") +local def_rate_ul = uci:get("nft-qos", "default", "static_rate_ul") +local def_unit_dl = uci:get("nft-qos", "default", "static_unit_dl") +local def_unit_ul = uci:get("nft-qos", "default", "static_unit_ul") + +local def_up = uci:get("nft-qos", "default", "dynamic_bw_up") +local def_down = uci:get("nft-qos", "default", "dynamic_bw_down") + +local limit_enable = uci:get("nft-qos", "default", "limit_enable") +local limit_type = uci:get("nft-qos", "default", "limit_type") +local enable_priority = uci:get("nft-qos", "default", "priority_enable") + +local has_ipv6 = fs.access("/proc/net/ipv6_route") + +m = Map("nft-qos", translate("Qos over Nftables")) + +-- +-- Taboptions +-- +s = m:section(TypedSection, "default", translate("NFT-QoS Settings")) +s.addremove = false +s.anonymous = true + +s:tab("limit", "Limit Rate") +s:tab("priority", "Traffic Priority") + +-- +-- Static +-- +o = s:taboption("limit", Flag, "limit_enable", translate("Limit Enable"), translate("Enable Limit Rate Feature")) +o.default = limit_enable or o.enabled +o.rmempty = false + +o = s:taboption("limit", ListValue, "limit_type", translate("Limit Type"), translate("Type of Limit Rate")) +o.default = limit_static or "static" +o:depends("limit_enable","1") +o:value("static", "Static") +o:value("dynamic", "Dynamic") + +o = s:taboption("limit", Value, "static_rate_dl", translate("Default Download Rate"), translate("Default value for download rate")) +o.datatype = "uinteger" +o.default = def_rate_dl or '50' +o:depends("limit_type","static") + +o = s:taboption("limit", ListValue, "static_unit_dl", translate("Default Download Unit"), translate("Default unit for download rate")) +o.default = def_unit_dl or "kbytes" +o:depends("limit_type","static") +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +o = s:taboption("limit", Value, "static_rate_ul", translate("Default Upload Rate"), translate("Default value for upload rate")) +o.datatype = "uinteger" +o.default = def_rate_ul or '50' +o:depends("limit_type","static") + +o = s:taboption("limit", ListValue, "static_unit_ul", translate("Default Upload Unit"), translate("Default unit for upload rate")) +o.default = def_unit_ul or "kbytes" +o:depends("limit_type","static") +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +-- +-- Dynamic +-- +o = s:taboption("limit", Value, "dynamic_bw_down", translate("Download Bandwidth (Mbps)"), translate("Default value for download bandwidth")) +o.default = def_up or '100' +o.datatype = "uinteger" +o:depends("limit_type","dynamic") + +o = s:taboption("limit", Value, "dynamic_bw_up", translate("Upload Bandwidth (Mbps)"), translate("Default value for upload bandwidth")) +o.default = def_down or '100' +o.datatype = "uinteger" +o:depends("limit_type","dynamic") + +o = s:taboption("limit", Value, "dynamic_cidr", translate("Target Network (IPv4/MASK)"), translate("Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc")) +o.datatype = "cidr4" +ipc.routes({ family = 4, type = 1 }, function(rt) o.default = rt.dest end) +o:depends("limit_type","dynamic") + +if has_ipv6 then + o = s:taboption("limit", Value, "dynamic_cidr6", translate("Target Network6 (IPv6/MASK)"), translate("Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc")) + o.datatype = "cidr6" + o:depends("limit_type","dynamic") +end + +o = s:taboption("limit", DynamicList, "limit_whitelist", translate("White List for Limit Rate")) +o.datatype = "ipaddr" +o:depends("limit_enable","1") + +-- +-- Priority +-- +o = s:taboption("priority", Flag, "priority_enable", translate("Enable Traffic Priority"), translate("Enable this feature")) +o.default = enable_priority or o.enabled +o.rmempty = false + +o = s:taboption("priority", ListValue, "priority_netdev", translate("Default Network Interface"), translate("Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc")) +o:depends("priority_enable", "1") +wa.cbi_add_networks(o) + +-- +-- Static Limit Rate - Download Rate +-- +if limit_enable == "1" and limit_type == "static" then + +x = m:section(TypedSection, "download", translate("Static QoS-Download Rate")) +x.anonymous = true +x.addremove = true +x.template = "cbi/tblsection" + +o = x:option(Value, "hostname", translate("Hostname")) +o.datatype = "hostname" +o.default = 'undefined' + +if has_ipv6 then + o = x:option(Value, "ipaddr", translate("IP Address(V4 / V6)")) +else + o = x:option(Value, "ipaddr", translate("IP Address(V4 Only)")) +end +o.datatype = "ipaddr" +if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") +end + +o = x:option(Value, "macaddr", translate("MAC (optional)")) +o.rmempty = true +o.datatype = "macaddr" + +o = x:option(Value, "rate", translate("Rate")) +o.default = def_rate_dl or '50' +o.size = 4 +o.datatype = "uinteger" + +o = x:option(ListValue, "unit", translate("Unit")) +o.default = def_unit_dl or "kbytes" +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +-- +-- Static Limit Rate - Upload Rate +-- +y = m:section(TypedSection, "upload", translate("Static QoS-Upload Rate")) +y.anonymous = true +y.addremove = true +y.template = "cbi/tblsection" + +o = y:option(Value, "hostname", translate("Hostname")) +o.datatype = "hostname" +o.default = 'undefined' + +if has_ipv6 then + o = y:option(Value, "ipaddr", translate("IP Address(V4 / V6)")) +else + o = y:option(Value, "ipaddr", translate("IP Address(V4 Only)")) +end +o.datatype = "ipaddr" +if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") +end + +o = y:option(Value, "macaddr", translate("MAC (optional)")) +o.rmempty = true +o.datatype = "macaddr" + +o = y:option(Value, "rate", translate("Rate")) +o.default = def_rate_ul or '50' +o.size = 4 +o.datatype = "uinteger" + +o = y:option(ListValue, "unit", translate("Unit")) +o.default = def_unit_ul or "kbytes" +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +end + +-- +-- Traffic Priority Settings +-- +if enable_priority == "1" then + +s = m:section(TypedSection, "priority", translate("Traffic Priority Settings")) +s.anonymous = true +s.addremove = true +s.template = "cbi/tblsection" + +o = s:option(ListValue, "protocol", translate("Protocol")) +o.default = "tcp" +o:value("tcp", "TCP") +o:value("udp", "UDP") +o:value("udplite", "UDP-Lite") +o:value("sctp", "SCTP") +o:value("dccp", "DCCP") + +o = s:option(ListValue, "priority", translate("Priority")) +o.default = "1" +o:value("-400", "1") +o:value("-300", "2") +o:value("-225", "3") +o:value("-200", "4") +o:value("-150", "5") +o:value("-100", "6") +o:value("0", "7") +o:value("50", "8") +o:value("100", "9") +o:value("225", "10") +o:value("300", "11") + +o = s:option(Value, "service", translate("Service"), translate("e.g. https, 23, (separator is comma)")) +o.default = '?' + +o = s:option(Value, "comment", translate("Comment")) +o.default = '?' + +end + +return m diff --git a/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm b/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm new file mode 100644 index 00000000..fbe19aba --- /dev/null +++ b/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm @@ -0,0 +1,187 @@ +<%# + Copyright 2018 Rosy Song + Licensed to the public under the Apache License 2.0. +-%> + +<%+header%> + + + +

<%:Realtime Rate%>

+ +
<%:This page gives an overview over currently download/upload rate.%>
+ +
+ <%:Realtime Download Rate%> +
+
+
+
<%:IP Address%>
+
<%:Download Rate%>
+
<%:Bytes Total%>
+
<%:Packets Total%>
+
+
+
+ <%:Collecting data...%> +
+
+
+
+
+ +
+ <%:Realtime Upload Rate%> +
+
+
+
<%:IP Address%>
+
<%:Upload Rate%>
+
<%:Bytes Total%>
+
<%:Packets Total%>
+
+
+
+ <%:Collecting data...%> +
+
+
+
+
+ +<%+footer%> diff --git a/luci-app-nft-qos/po/es/nft-qos.po b/luci-app-nft-qos/po/es/nft-qos.po new file mode 100644 index 00000000..4cdcb95f --- /dev/null +++ b/luci-app-nft-qos/po/es/nft-qos.po @@ -0,0 +1,245 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.1\n" +"Last-Translator: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: es\n" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "Total de bytes" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "Recolectando datos..." + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "Comentario" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "Velocidad de descarga predeterminada" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "Unidad de descarga predeterminada" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "Interfaz de red predeterminada" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "Velocidad de carga predeterminada" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "Unidad de carga predeterminada" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "Unidad predeterminada para la velocidad de descarga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "Unidad predeterminada para la velocidad de carga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "Valor predeterminado para el ancho de banda de descarga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "Valor predeterminado para la velocidad de descarga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "Valor predeterminado para el ancho de banda de carga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "Valor predeterminado para la velocidad de carga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "Ancho de banda de descarga (Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "Velocidad de descarga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "Habilitar función de límite de velocidad" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "Habilitar prioridad de tráfico" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "Habilitar esta característica" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "Nombre de host" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "Dirección IP" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "Dirección IP (v4/v6)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "Dirección IP (sólo v4)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "Habilitar límite" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "Tipo de límite" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "MAC (opcional)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "MB" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "Configuración de NFT-QoS" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "" +"Interfaz de red para configuración de tráfico, por ejemplo, br-lan, eth0.1, " +"eth0, etc." + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "Red a aplicar, por ejemplo. 192.168.1.0/24, 10.2.0.0/16, etc." + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "Red a aplicar, por ejemplo. AAAA::BBBB/64, CCCC::1/128, etc." + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "No hay información disponible" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "Paquetes totales" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "Prioridad" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "Protocolo" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "Qos sobre Nftables" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "Velocidad" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "Velocidad de descarga en tiempo real" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "Velocidad en tiempo real" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "Velocidad de carga en tiempo real" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "Servicio" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "Velocidad de descarga de QoS estática" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "Velocidad de carga de QoS estática" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "Red de destino (IPv4 / MASK)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "Red de destino 6 (IPv6/MÁSCARA)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "" +"Esta página ofrece una vista general sobre la velocidad de descarga/carga " +"actual." + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "Ajustes de prioridad de tráfico" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "Tipo de límite de velocidad" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "Unidad" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "Ancho de banda de carga (Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "Velocidad de carga" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "Lista blanca para el límite de velocidad" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "p.ej. https, 23, (el separador es una coma)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "kB" diff --git a/luci-app-nft-qos/po/templates/nft-qos.pot b/luci-app-nft-qos/po/templates/nft-qos.pot new file mode 100644 index 00000000..8fecfa07 --- /dev/null +++ b/luci-app-nft-qos/po/templates/nft-qos.pot @@ -0,0 +1,230 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "" diff --git a/luci-app-nft-qos/po/zh-cn/nft-qos.po b/luci-app-nft-qos/po/zh-cn/nft-qos.po new file mode 100644 index 00000000..37a0d184 --- /dev/null +++ b/luci-app-nft-qos/po/zh-cn/nft-qos.po @@ -0,0 +1,244 @@ +# +# Yangfl , 2019. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2020-06-07 10:45+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3.1\n" +"Last-Translator: dingpengyu \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: zh_CN\n" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "字节总数" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "正在收集数据..." + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "注释" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "默认下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "默认下载速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "默认网络接口" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "默认上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "默认上传速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "默认的下载速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "默认的上传速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "下载带宽的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "下载速率的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "上传带宽的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "上传速率的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "下载带宽(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "开启速率限制功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "开启流量优先级" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "开启这个功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "主机名" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "IP 地址" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "IP 地址(V4 / V6)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "IP 地址(仅 V4)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "限速开启" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "限速类型" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "物理地址(可选)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "MB" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "NFT-QoS 设置" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "流量整形的目标网络接口,例如br-lan、eth0.1、eth0等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "将要应用规则的网络,例如192.168.1.0/24、10.2.0.0/16等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "将要应用规则的网络,例如AAAA::BBBB/64、CCCC::1/128等" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "没有更多的信息" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "数据包总数" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "优先级" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "协议" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "QoS Nftables 版" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "实时下载速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "实时速率显示" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "实时上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "服务" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "静态 QoS-下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "静态 QoS-上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "目标网络(IPv4 地址/掩码)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "目标网络 v6(IPv6 地址/掩码)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "该页面提供了当前上传和下载速率的一个总览。" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "流量优先级设置" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "限速的类型" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "上传带宽(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "限速白名单" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "例如https, 23(用逗号分隔)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "kB" diff --git a/luci-app-nft-qos/po/zh-tw/nft-qos.po b/luci-app-nft-qos/po/zh-tw/nft-qos.po new file mode 100644 index 00000000..5be9d8ab --- /dev/null +++ b/luci-app-nft-qos/po/zh-tw/nft-qos.po @@ -0,0 +1,244 @@ +# +# Yangfl , 2019. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2019-01-03 22:28+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 3.30.1\n" +"Last-Translator: Yangfl \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: zh_TW\n" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "位元組總數" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "正在收集資料…" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "註釋" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "預設下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "預設下載速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "預設網路介面" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "預設上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "預設上傳速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "預設的下載速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "預設的上傳速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "下載頻寬的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "下載速率的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "上傳頻寬的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "上傳速率的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "下載頻寬(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "開啟速率限制功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "開啟流量優先順序" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "開啟這個功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "主機名" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "IP 位址" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "IP 位址(V4 / V6)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "IP 位址(僅 V4)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "限速開啟" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "限速型別" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "實體位址(可選)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "MB" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "NFT-QoS 設定" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "流量整形的目標網路介面,例如br-lan、eth0.1、eth0等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "將要應用規則的網路,例如192.168.1.0/24、10.2.0.0/16等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "將要應用規則的網路,例如AAAA::BBBB/64、CCCC::1/128等" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "沒有更多的資訊" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "資料包總數" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "優先順序" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "協議" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "QoS Nftables 版" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "實時下載速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "實時速率顯示" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "實時上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "服務" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "靜態 QoS-下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "靜態 QoS-上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "目標網路(IPv4 位址/掩碼)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "目標網路 v6(IPv6 位址/掩碼)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "該頁面提供了當前上傳和下載速率的一個總覽。" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "流量優先順序設定" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "限速的型別" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "上傳頻寬(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "限速白名單" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "例如https, 23(用逗號分隔)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "kB" diff --git a/luci-app-nft-qos/po/zh_Hans b/luci-app-nft-qos/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-nft-qos/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-nft-qos/root/etc/uci-defaults/luci-nft-qos b/luci-app-nft-qos/root/etc/uci-defaults/luci-nft-qos new file mode 100644 index 00000000..270233b3 --- /dev/null +++ b/luci-app-nft-qos/root/etc/uci-defaults/luci-nft-qos @@ -0,0 +1,19 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-nft-qos.json" ] && { + cat > /usr/share/ucitrack/luci-app-nft-qos.json << EEOF +{ + "config": "nft-qos", + "init": "nft-qos" +} +EEOF +} + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@nft-qos[-1] + add ucitrack nft-qos + set ucitrack.@nft-qos[-1].init=nft-qos + commit ucitrack +EOF + +rm -rf /tmp/luci-*cache +exit 0 diff --git a/luci-app-pppwn/Makefile b/luci-app-pppwn/Makefile index 4e51fc74..639f8ed0 100644 --- a/luci-app-pppwn/Makefile +++ b/luci-app-pppwn/Makefile @@ -1,17 +1,17 @@ -# Copyright (C) 2022 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI support for PPPWN -LUCI_DEPENDS:=+pppwn-cpp -LUCI_PKGARCH:=all -PKG_NAME:=luci-app-pppwn -PKG_VERSION:=1 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature +# Copyright (C) 2022 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI support for PPPWN +LUCI_DEPENDS:=+pppwn-cpp +LUCI_PKGARCH:=all +PKG_NAME:=luci-app-pppwn +PKG_VERSION:=1 +PKG_RELEASE:=2 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-pppwn/luasrc/controller/pppwn.lua b/luci-app-pppwn/luasrc/controller/pppwn.lua index 3e0dedd9..c71b78ef 100644 --- a/luci-app-pppwn/luasrc/controller/pppwn.lua +++ b/luci-app-pppwn/luasrc/controller/pppwn.lua @@ -7,7 +7,7 @@ function index() entry({"admin", "services", "pppwn"}, alias("admin", "services", "pppwn", "general"), _("PS4 PPP PWN"), 80) entry({"admin", "services", "pppwn", "general"}, cbi("pppwn/settings"), _("Base Setting"), 1) - --entry({"admin", "services", "pppwn", "log"}, form("pppwn/info"), _("Log"), 2) + entry({"admin", "services", "pppwn", "log"}, form("pppwn/info"), _("Log"), 2) entry({"admin", "services", "pppwn", "status"}, call("status")).leaf = true end diff --git a/luci-app-pppwn/luasrc/model/cbi/pppwn/settings.lua b/luci-app-pppwn/luasrc/model/cbi/pppwn/settings.lua index fd064af6..74ced9c6 100644 --- a/luci-app-pppwn/luasrc/model/cbi/pppwn/settings.lua +++ b/luci-app-pppwn/luasrc/model/cbi/pppwn/settings.lua @@ -28,4 +28,7 @@ fwver:value("900", translate("9.00")) fwver:value("1100", translate("11.00")) fwver.description = translate("1100 means Ver 11.00 etc.") +goldhen = s:option(DummyValue, "goldhen", translate("Download GoldHEN Payload BIN")) +goldhen.description = translate(""..translate("Copy goldhen.bin to the root directory of an exfat/fat32 USB and insert it into your PS4").."") + return m diff --git a/luci-app-pppwn/po/zh-cn/pppwn.po b/luci-app-pppwn/po/zh-cn/pppwn.po index b4fc0ec8..9142c0e3 100644 --- a/luci-app-pppwn/po/zh-cn/pppwn.po +++ b/luci-app-pppwn/po/zh-cn/pppwn.po @@ -12,3 +12,9 @@ msgstr "PlayStation 4 系统版本" msgid "1100 means Ver 11.00 etc." msgstr "1100 代表 11.00 版本,以此类推" + +msgid "Download GoldHEN Payload BIN" +msgstr "点击下载 GoldHEN Payload 二进制文件" + +msgid "Copy goldhen.bin to the root directory of an exfat/fat32 USB and insert it into your PS4." +msgstr "首次越狱请把 goldhen.bin 文件复制到一个 exfat/fat32 U盘根目录,并插入您的 PS4" diff --git a/luci-app-pppwn/root/etc/init.d/pppwn b/luci-app-pppwn/root/etc/init.d/pppwn index 9cc8f195..168fd2a8 100755 --- a/luci-app-pppwn/root/etc/init.d/pppwn +++ b/luci-app-pppwn/root/etc/init.d/pppwn @@ -2,11 +2,10 @@ # Copyright (C) 2008-2022 OpenWrt.org START=99 -USE_PROCD=1 PROG=/usr/bin/pppwn -start_service() { +start() { config_load "pppwn" config_get "port" "config" "port" @@ -17,12 +16,11 @@ start_service() { [ "${enable}" -gt 0 ] || return - procd_open_instance - procd_set_param command $PROG --interface $port --fw $fwver --stage1 "/etc/pppwn/stage1.bin" --stage2 "/etc/pppwn/stage2.bin" -a - procd_set_param respawn - procd_close_instance + $PROG --interface $port --fw $fwver --stage1 "/etc/pppwn/stage1.bin" --stage2 "/etc/pppwn/stage2.bin" -a > /var/log/pppwn.log & + } -service_triggers() { - procd_add_reload_trigger "pppwn" -} +stop() { + ps -w | grep -v "grep" | grep "$PROG" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & + echo "" > /var/log/pppwn.log +} \ No newline at end of file diff --git a/luci-app-pppwn/root/www/goldhen.bin b/luci-app-pppwn/root/www/goldhen.bin new file mode 100644 index 00000000..70fdd34c Binary files /dev/null and b/luci-app-pppwn/root/www/goldhen.bin differ diff --git a/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js b/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js deleted file mode 100644 index be1e631d..00000000 --- a/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; -'require form'; -'require poll'; -'require uci'; -'require view'; -'require fs'; - -function getStatus() { - var result - try { - result = fs.exec('/usr/bin/qiyougamebooster.sh', ['status']); - return result.then(function(status) { - return status.stdout.trim() - }) - } catch (e) { } - return result; -} - -function getVersion() { - var result - try { - result = fs.exec('/usr/bin/qiyougamebooster.sh', ['version']) - return result.then(function(version) { - return version.stdout.trim() || _('QiYou Game Booster'); - }).catch(function() { - return _('QiYou Game Booster'); - }); - } catch (e) { } - return Promise.resolve(_('QiYou Game Booster')); -} - -function renderStatus(status, version) { - var spanTemp = '%s: %s %s'; - var renderHTML; - if (status == 'NOT ENABLED' || status == 'NOT RUNNING' || status == 'NOT SUPPORTED') { - renderHTML = spanTemp.format('red', _('Status'), _(version), _(status)); - } else { - renderHTML = spanTemp.format('green', _('Status'), _(version), _(status)); - } - return renderHTML; -} - -return view.extend({ - load: function() { - return Promise.all([ - uci.load('qiyougamebooster') - ]); - }, - - render: function() { - let m, s, o; - - m = new form.Map('qiyougamebooster', _('QiYou Game Booster'), - _('Play console games online with less lag and more stability.') + '
' + - _('— now supporting PS, Switch, Xbox, PC, and mobile.')); - - s = m.section(form.TypedSection); - s.anonymous = true; - s.render = function () { - poll.add(function () { - return L.resolveDefault(getStatus()).then(function (status) { - return L.resolveDefault(getVersion()).then(function (version) { - var view = document.getElementById('service_status'); - view.innerHTML = renderStatus(status, version); - }); - }); - }); - - return E('div', { class: 'cbi-section', id: 'status_bar' }, [ - E('p', { id: 'service_status' }, _('Collecting data...')) - ]); - } - - s = m.section(form.NamedSection, 'config', 'qiyougamebooster'); - - o = s.option(form.Flag, 'enabled', _('Enable')); - o.default = o.disabled; - o.rmempty = false; - - s = m.section(form.TypedSection); - s.anonymous = true; - s.render = function () { - return E('div', {class: 'cbi-section'}, [ - E('p', [ - E('img', {src: '/qiyougamebooster/Tutorial.png', height: '350'}) - ]) - ]) - } - - - return m.render(); - } - -}); diff --git a/luci-app-qiyougamebooster/luasrc/controller/qiyougamebooster.lua b/luci-app-qiyougamebooster/luasrc/controller/qiyougamebooster.lua new file mode 100644 index 00000000..7a28ee80 --- /dev/null +++ b/luci-app-qiyougamebooster/luasrc/controller/qiyougamebooster.lua @@ -0,0 +1,12 @@ +module("luci.controller.qiyougamebooster", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/qiyougamebooster") then + return + end + + local page + page = entry({"admin", "services", "qiyougamebooster"}, cbi("qiyougamebooster"), ("QiYou Game Booster"), 99) + page.dependent = false + page.acl_depends = {"luci-app-qiyougamebooster"} +end diff --git a/luci-app-qiyougamebooster/luasrc/model/cbi/qiyougamebooster.lua b/luci-app-qiyougamebooster/luasrc/model/cbi/qiyougamebooster.lua new file mode 100644 index 00000000..4fcde4a0 --- /dev/null +++ b/luci-app-qiyougamebooster/luasrc/model/cbi/qiyougamebooster.lua @@ -0,0 +1,28 @@ +require("luci.sys") + +m = Map("qiyougamebooster", translate("QiYou Game Booster"), + translate("Play console games online with less lag and more stability.") .. "
" .. + translate("— now supporting PS, Switch, Xbox, PC, and mobile.")) + +s = m:section(TypedSection, "qiyougamebooster") +s.anonymous = true +s.addremove = false + +sts = luci.sys.exec("qiyougamebooster.sh status 2> /dev/null") +ver = luci.sys.exec("qiyougamebooster.sh version 2> /dev/null") +o = s:option(DummyValue, "status") +o.rawhtml = true +if sts == "NOT ENABLED" or sts == "NOT SUPPORTED" or sts == "NOT RUNNING" then + o.value = string.format('%s: %s %s', "red", translate("Status"), ver, translate(sts)) +else + o.value = string.format('%s: %s %s', "green", translate("Status"), ver, translate(sts)) +end + +o = s:option(Flag, "enabled", translate("Enable")) +o.default = 0 + +o = s:option(DummyValue, "instructions") +o.rawhtml = true +o.value = "

" + +return m diff --git a/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot b/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot deleted file mode 100644 index d01d1f58..00000000 --- a/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot +++ /dev/null @@ -1,52 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:26 -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:28 -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:53 -msgid "QiYou Game Booster" -msgstr "" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:54 -msgid "Play console games online with less lag and more stability." -msgstr "" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:55 -msgid "— now supporting PS, Switch, Xbox, PC, and mobile." -msgstr "" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:70 -msgid "Collecting data..." -msgstr "" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:76 -msgid "Enable" -msgstr "" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:38 -msgid "Status" -msgstr "" - -msgid "NOT ENABLED" -msgstr "" - -msgid "CLOSED" -msgstr "" - -msgid "BOOSTING" -msgstr "" - -msgid "RUNNING" -msgstr "" - -msgid "NOT SUPPORTED" -msgstr "" - -msgid "DOWNLOADING" -msgstr "" - -msgid "INSTALLING" -msgstr "" - -msgid "NOT RUNNING" -msgstr "" diff --git a/luci-app-qiyougamebooster/po/zh-cn b/luci-app-qiyougamebooster/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-qiyougamebooster/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-qiyougamebooster/po/zh-cn/qiyougamebooster.po b/luci-app-qiyougamebooster/po/zh-cn/qiyougamebooster.po new file mode 100644 index 00000000..9740f135 --- /dev/null +++ b/luci-app-qiyougamebooster/po/zh-cn/qiyougamebooster.po @@ -0,0 +1,38 @@ +msgid "QiYou Game Booster" +msgstr "奇游联机宝" + +msgid "Play console games online with less lag and more stability." +msgstr "加速主机游戏,实现满速下载、稳定联机、飞快匹配体验。" + +msgid "— now supporting PS, Switch, Xbox, PC, and mobile." +msgstr "—— 现已支持 PS、Switch、Xbox、PC 与移动端。" + +msgid "Enable" +msgstr "启用" + +msgid "Status" +msgstr "状态" + +msgid "NOT ENABLED" +msgstr "未启用" + +msgid "CLOSED" +msgstr "已关闭" + +msgid "BOOSTING" +msgstr "加速中" + +msgid "RUNNING" +msgstr "运行中" + +msgid "NOT SUPPORTED" +msgstr "不支持" + +msgid "DOWNLOADING" +msgstr "下载中" + +msgid "INSTALLING" +msgstr "安装中" + +msgid "NOT RUNNING" +msgstr "未运行" diff --git a/luci-app-qiyougamebooster/po/zh_Hans b/luci-app-qiyougamebooster/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-qiyougamebooster/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po b/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po deleted file mode 100644 index 1e5856f3..00000000 --- a/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po +++ /dev/null @@ -1,52 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:26 -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:28 -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:53 -msgid "QiYou Game Booster" -msgstr "奇游联机宝" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:54 -msgid "Play console games online with less lag and more stability." -msgstr "加速主机游戏,实现满速下载、稳定联机、飞快匹配体验。" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:55 -msgid "— now supporting PS, Switch, Xbox, PC, and mobile." -msgstr "—— 现已支持 PS、Switch、Xbox、PC 与移动端。" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:70 -msgid "Collecting data..." -msgstr "正在收集数据中..." - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:76 -msgid "Enable" -msgstr "启用" - -#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:38 -msgid "Status" -msgstr "状态" - -msgid "NOT ENABLED" -msgstr "未启用" - -msgid "CLOSED" -msgstr "已关闭" - -msgid "BOOSTING" -msgstr "加速中" - -msgid "RUNNING" -msgstr "运行中" - -msgid "NOT SUPPORTED" -msgstr "不支持" - -msgid "DOWNLOADING" -msgstr "下载中" - -msgid "INSTALLING" -msgstr "安装中" - -msgid "NOT RUNNING" -msgstr "未运行" diff --git a/luci-app-qiyougamebooster/root/etc/uci-defaults/qiyougamebooster b/luci-app-qiyougamebooster/root/etc/uci-defaults/qiyougamebooster new file mode 100644 index 00000000..fbd81c30 --- /dev/null +++ b/luci-app-qiyougamebooster/root/etc/uci-defaults/qiyougamebooster @@ -0,0 +1,19 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-qiyougamebooster.json" ] && { + cat > /usr/share/ucitrack/luci-app-qiyougamebooster.json << EEOF +{ + "config": "qiyougamebooster", + "init": "qiyougamebooster" +} +EEOF +} + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@qiyougamebooster[-1] + add ucitrack qiyougamebooster + set ucitrack.@qiyougamebooster[-1].init=qiyougamebooster + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json b/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json deleted file mode 100644 index 0c161061..00000000 --- a/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "admin/services/qiyougamebooster": { - "title": "QiYou Game Booster", - "action": { - "type": "view", - "path": "qiyougamebooster" - }, - "depends": { - "acl": [ "luci-app-qiyougamebooster" ], - "fs": { - "/usr/bin/qiyougamebooster.sh": "executable" - }, - "uci": { "qiyougamebooster": true } - } - } -} diff --git a/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json b/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json index 205ce66e..ed85a9ce 100644 --- a/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json +++ b/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json @@ -1,10 +1,7 @@ { - "luci-app-qiyougamebooster": { + "luci-app-qiyougamebooster": { "description": "Grant UCI access for luci-app-qiyougamebooster", "read": { - "file": { - "/usr/bin/qiyougamebooster.sh": [ "exec" ] - }, "uci": [ "qiyougamebooster" ] }, "write": { diff --git a/luci-app-shadowsocks-libev/Makefile b/luci-app-shadowsocks-libev/Makefile new file mode 100644 index 00000000..05b0a66c --- /dev/null +++ b/luci-app-shadowsocks-libev/Makefile @@ -0,0 +1,16 @@ +# +# Copyright (C) 2017 Yousong Zhou +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI Support for shadowsocks-libev +LUCI_DEPENDS:= + +PKG_LICENSE:=Apache-2.0 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua b/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua new file mode 100644 index 00000000..05d12e38 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua @@ -0,0 +1,33 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. +-- +module("luci.controller.shadowsocks-libev", package.seeall) + +function index() + entry({"admin", "services", "shadowsocks-libev"}, + alias("admin", "services", "shadowsocks-libev", "instances"), + _("Shadowsocks-libev"), 59) + + entry({"admin", "services", "shadowsocks-libev", "instances"}, + arcombine(cbi("shadowsocks-libev/instances"), cbi("shadowsocks-libev/instance-details")), + _("Local Instances"), 10).leaf = true + + entry({"admin", "services", "shadowsocks-libev", "servers"}, + cbi("shadowsocks-libev/servers"), + _("Remote Servers"), 20).leaf = true + + entry({"admin", "services", "shadowsocks-libev", "rules"}, + cbi("shadowsocks-libev/rules"), + _("Redir Rules"), 30).leaf = true + + entry({"admin", "services", "shadowsocks-libev", "status"}, call("ss_status"), nil).leaf = true + +end + +function ss_status() + local ut = require "luci.util" + local rv = ut.ubus("service", "list", {name = "shadowsocks-libev"})["shadowsocks-libev"] or {_=0} + + luci.http.prepare_content("application/json") + luci.http.write_json(rv) +end diff --git a/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua new file mode 100644 index 00000000..195a31f2 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua @@ -0,0 +1,47 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. + +local ds = require "luci.dispatcher" +local ss = require "luci.model.shadowsocks-libev" + +local sname = arg[1] +local redirect_url = ds.build_url("admin/services/shadowsocks-libev/instances") +local s, o + +local m = Map("shadowsocks-libev") +local sdata = m:get(sname) +if not sdata then + luci.http.redirect(redirect_url) + return +end +local stype = sdata[".type"] +m.redirect = redirect_url +m.title = "shadowsocks-libev - %s - %s" % {stype, sname} + + +s = m:section(NamedSection, sname, stype) +s:tab("general", translate("General Settings")) +s:tab("advanced", translate("Advanced Settings")) +s:taboption("general", Flag, "disabled", translate("Disable")) +ss.option_install_package(s, "general") +ss.options_common(s, "advanced") + +if stype == "ss_server" then + ss.options_server(s, "general") + o = s:taboption("general", Value, "bind_address", + translate("Bind address"), + translate("The address ss-server will initiate connection from")) + o.datatype = "ipaddr" + o.placeholder = "0.0.0.0" + ss.values_ipaddr(o) +else + ss.options_client(s, "general") + if stype == "ss_tunnel" then + o = s:taboption("general", Value, "tunnel_address", + translate("Tunnel address"), + translate("The address ss-tunnel will forward traffic to")) + o.datatype = "hostport" + end +end + +return m diff --git a/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instances.lua b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instances.lua new file mode 100644 index 00000000..62a90fb4 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instances.lua @@ -0,0 +1,104 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. + +local ds = require "luci.dispatcher" +local ss = require "luci.model.shadowsocks-libev" +local ut = require "luci.util" +local m, s, o + +m = Map("shadowsocks-libev", + translate("Local Instances"), + translate("Instances of shadowsocks-libev components, e.g. ss-local, \ + ss-redir, ss-tunnel, ss-server, etc. To enable an instance it \ + is required to enable both the instance itself and the remote \ + server it refers to.")) + +local instances = {} +local cfgtypes = { "ss_local", "ss_redir", "ss_server", "ss_tunnel" } + +for sname, sdata in pairs(m:get()) do + local key, value = ss.cfgvalue_overview(sdata) + if key ~= nil then + instances[key] = value + end +end + +s = m:section(Table, instances) +s.addremove = true +s.template_addremove = "shadowsocks-libev/add_instance" +s.extedit = function(self, section) + local value = instances[section] + if type(value) == "table" then + return ds.build_url(unpack(ds.context.requestpath), + "services/shadowsocks-libev/instances", + value[".name"]) + end +end +s.parse = function(self, ...) + Table.parse(self, ...) + + local crval = REMOVE_PREFIX .. self.config + local name = self.map:formvaluetable(crval) + for k,v in pairs(name) do + local value = instances[k] + local sname = value[".name"] + if type(value) == "table" then + m:del(sname) + instances[k] = nil + for _, oname in ipairs({"redir_tcp", "redir_udp"}) do + local ovalue = m:get("ss_rules", oname) + if ovalue == sname then + m:del("ss_rules", oname) + end + end + end + end + + local stype = m:formvalue("_newinst.type") + local sname = m:formvalue("_newinst.name") + if ut.contains(cfgtypes, stype) then + local created + if sname and #sname > 0 then + created = m:set(sname, nil, stype) + else + created = m:add(stype) + sname = created + end + if created then + m.uci:save("shadowsocks-libev") + luci.http.redirect(ds.build_url( + "admin/services/shadowsocks-libev/instances", sname + )) + end + end +end + +o = s:option(DummyValue, "name", translate("Name")) +o.rawhtml = true +o = s:option(DummyValue, "overview", translate("Overview")) +o.rawhtml = true + +s:option(DummyValue, "running", translate("Running")) + +o = s:option(Button, "disabled", translate("Enable/Disable")) +o.render = function(self, section, scope) + if instances[section].disabled then + self.title = translate("Disabled") + self.inputstyle = "reset" + else + self.title = translate("Enabled") + self.inputstyle = "save" + end + Button.render(self, section, scope) +end +o.write = function(self, section) + local sdata = instances[section] + if type(sdata) == "table" then + local sname = sdata[".name"] + local disabled = not sdata["disabled"] + sdata["disabled"] = disabled + m:set(sname, "disabled", tostring(disabled)) + end +end + +return m diff --git a/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua new file mode 100644 index 00000000..4a01bed2 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua @@ -0,0 +1,109 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. + +local ss = require("luci.model.shadowsocks-libev") + +local m, s, o + +m = Map("shadowsocks-libev", + translate("Redir Rules"), + translate("On this page you can configure how traffics are to be \ + forwarded to ss-redir instances. \ + If enabled, packets will first have their src ip addresses checked \ + against Src ip/net bypass, Src ip/net forward, \ + Src ip/net checkdst and if none matches Src default \ + will give the default action to be taken. \ + If the prior check results in action checkdst, packets will continue \ + to have their dst addresses checked.")) + +local sdata = m:get('ss_rules') +if not sdata then + m:set('ss_rules', nil, 'ss_rules') + m:set('ss_rules', 'disabled', "1") +end + +function src_dst_option(s, ...) + local o = s:taboption(...) + o.datatype = "or(ip4addr,cidr4)" +end + +s = m:section(NamedSection, "ss_rules", "ss_rules") +s:tab("general", translate("General Settings")) +s:tab("src", translate("Source Settings")) +s:tab("dst", translate("Destination Settings")) + +s:taboption('general', Flag, "disabled", translate("Disable")) +ss.option_install_package(s, 'general') + +o = s:taboption('general', ListValue, "redir_tcp", + translate("ss-redir for TCP")) +ss.values_redir(o, 'tcp') +o = s:taboption('general', ListValue, "redir_udp", + translate("ss-redir for UDP")) +ss.values_redir(o, 'udp') + +o = s:taboption('general', ListValue, "local_default", + translate("Local-out default"), + translate("Default action for locally generated TCP packets")) +ss.values_actions(o) +o = s:taboption('general', DynamicList, "ifnames", + translate("Ingress interfaces"), + translate("Only apply rules on packets from these network interfaces")) +ss.values_ifnames(o) +s:taboption('general', Value, "ipt_args", + translate("Extra arguments"), + translate("Passes additional arguments to iptables. Use with care!")) + +src_dst_option(s, 'src', DynamicList, "src_ips_bypass", + translate("Src ip/net bypass"), + translate("Bypass ss-redir for packets with src address in this list")) +src_dst_option(s, 'src', DynamicList, "src_ips_forward", + translate("Src ip/net forward"), + translate("Forward through ss-redir for packets with src address in this list")) +src_dst_option(s, 'src', DynamicList, "src_ips_checkdst", + translate("Src ip/net checkdst"), + translate("Continue to have dst address checked for packets with src address in this list")) +o = s:taboption('src', ListValue, "src_default", + translate("Src default"), + translate("Default action for packets whose src address do not match any of the src ip/net list")) +ss.values_actions(o) + +src_dst_option(s, 'dst', DynamicList, "dst_ips_bypass", + translate("Dst ip/net bypass"), + translate("Bypass ss-redir for packets with dst address in this list")) +src_dst_option(s, 'dst', DynamicList, "dst_ips_forward", + translate("Dst ip/net forward"), + translate("Forward through ss-redir for packets with dst address in this list")) + +o = s:taboption('dst', FileBrowser, "dst_ips_bypass_file", + translate("Dst ip/net bypass file"), + translate("File containing ip/net for the purposes as with Dst ip/net bypass")) +o.datatype = "file" +s:taboption('dst', FileBrowser, "dst_ips_forward_file", + translate("Dst ip/net forward file"), + translate("File containing ip/net for the purposes as with Dst ip/net forward")) +o.datatype = "file" +o = s:taboption('dst', ListValue, "dst_default", + translate("Dst default"), + translate("Default action for packets whose dst address do not match any of the dst ip list")) +ss.values_actions(o) + +local installed = os.execute("iptables -m recent -h &>/dev/null") == 0 +if installed then + o = s:taboption('dst', Flag, "dst_forward_recentrst") +else + m:set('ss_rules', 'dst_forward_recentrst', "0") + o = s:taboption("dst", Button, "_install") + o.inputtitle = translate("Install package iptables-mod-conntrack-extra") + o.inputstyle = "apply" + o.write = function() + return luci.http.redirect( + luci.dispatcher.build_url("admin/system/packages") .. + "?submit=1&install=iptables-mod-conntrack-extra" + ) + end +end +o.title = translate("Forward recentrst") +o.description = translate("Forward those packets whose dst have recently sent to us multiple tcp-rst") + +return m diff --git a/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua new file mode 100644 index 00000000..71c66562 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua @@ -0,0 +1,31 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. + +local ds = require "luci.dispatcher" +local ss = require("luci.model.shadowsocks-libev") + +local m, s + +m = Map("shadowsocks-libev", + translate("Remote Servers"), + translate("Definition of remote shadowsocks servers. \ + Disable any of them will also disable instances refering to it.")) + +local sname = arg[1] +if sname then + if not m:get(sname) then + luci.http.redirect(ds.build_url("admin/services/shadowsocks-libev/servers")) + return + end + s = m:section(NamedSection, sname, "server") + m.title = m.title .. ' - ' .. sname +else + s = m:section(TypedSection, "server") + s.template = 'cbi/tblsection' + s.addremove = true +end + +s:option(Flag, "disabled", translate("Disable")) +ss.options_server(s) + +return m diff --git a/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua b/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua new file mode 100644 index 00000000..af1a75b6 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua @@ -0,0 +1,264 @@ +-- Copyright 2017 Yousong Zhou +-- Licensed to the public under the Apache License 2.0. + +local _up = getfenv(3) +local ut = require("luci.util") +local sys = require("luci.sys") +local ds = require("luci.dispatcher") +local nw = require("luci.model.network") +nw.init() +module("luci.model.shadowsocks-libev", function(m) + setmetatable(m, {__index=function (self, k) + local tb = _up + return rawget(self, k) or _up[k] + end}) +end) + +function values_actions(o) + o:value("bypass") + o:value("forward") + if o.option ~= "dst_default" then + o:value("checkdst") + end +end + +function values_redir(o, xmode) + o.map.uci.foreach("shadowsocks-libev", "ss_redir", function(sdata) + local disabled = ucival_to_bool(sdata["disabled"]) + local sname = sdata[".name"] + local mode = sdata["mode"] or "tcp_only" + if not disabled and mode:find(xmode) then + local desc = "%s - %s" % {sname, mode} + o:value(sname, desc) + end + end) + o:value("", "") + o.default = "" +end + +function values_serverlist(o) + o.map.uci.foreach("shadowsocks-libev", "server", function(sdata) + local sname = sdata[".name"] + local server = sdata["server"] + local server_port = sdata["server_port"] + if server and server_port then + local disabled = ucival_to_bool(sdata[".disabled"]) and " - disabled" or "" + local desc = "%s - %s:%s%s" % {sname, server, server_port, disabled} + o:value(sname, desc) + end + end) +end + +function values_ipaddr(o) + for _, v in ipairs(nw:get_interfaces()) do + for _, a in ipairs(v:ipaddrs()) do + o:value(a:host():string(), '%s (%s)' %{ a:host(), v:shortname() }) + end + end +end + +function values_ifnames(o) + for _, v in ipairs(sys.net.devices()) do + o:value(v) + end +end + +function options_client(s, tab) + local o + + o = s:taboption(tab, ListValue, "server", translate("Remote server")) + values_serverlist(o) + o = s:taboption(tab, Value, "local_address", translate("Local address")) + o.datatype = "ipaddr" + o.placeholder = "0.0.0.0" + values_ipaddr(o) + o = s:taboption(tab, Value, "local_port", translate("Local port")) + o.datatype = "port" +end + +function options_server(s, tab) + local o + local optfunc + + if tab == nil then + optfunc = function(...) return s:option(...) end + else + optfunc = function(...) return s:taboption(tab, ...) end + end + + o = optfunc(Value, "server", translate("Server")) + o.datatype = "host" + o.size = 16 + o = optfunc(Value, "server_port", translate("Server port")) + o.datatype = "port" + o.size = 5 + o = optfunc(ListValue, "method", translate("Method")) + for _, m in ipairs(methods) do + o:value(m) + end + o = optfunc(Value, "key", translate("Key (base64 encoding)")) + o.datatype = "base64" + o.password = true + o.size = 12 + o = optfunc(Value, "password", translate("Password")) + o.password = true + o.size = 12 +end + +function options_common(s, tab) + local o + + o = s:taboption(tab, ListValue, "mode", translate("Mode of operation")) + for _, m in ipairs(modes) do + o:value(m) + end + o.default = "tcp_and_udp" + o = s:taboption(tab, Value, "mtu", translate("MTU")) + o.datatype = "uinteger" + o = s:taboption(tab, Value, "timeout", translate("Timeout (sec)")) + o.datatype = "uinteger" + s:taboption(tab, Value, "user", translate("Run as")) + + s:taboption(tab, Flag, "verbose", translate("Verbose")) + s:taboption(tab, Flag, "ipv6_first", translate("IPv6 First"), translate("Prefer IPv6 addresses when resolving names")) + s:taboption(tab, Flag, "fast_open", translate("Enable TCP Fast Open")) + s:taboption(tab, Flag, "no_delay", translate("Enable TCP_NODELAY")) + s:taboption(tab, Flag, "reuse_port", translate("Enable SO_REUSEPORT")) +end + +function ucival_to_bool(val) + return val == "true" or val == "1" or val == "yes" or val == "on" +end + +function cfgvalue_overview(sdata) + local stype = sdata[".type"] + local lines = {} + + if stype == "ss_server" then + cfgvalue_overview_(sdata, lines, names_options_server) + cfgvalue_overview_(sdata, lines, names_options_common) + cfgvalue_overview_(sdata, lines, { + "bind_address", + }) + elseif stype == "ss_local" or stype == "ss_redir" or stype == "ss_tunnel" then + cfgvalue_overview_(sdata, lines, names_options_client) + if stype == "ss_tunnel" then + cfgvalue_overview_(sdata, lines, {"tunnel_address"}) + end + cfgvalue_overview_(sdata, lines, names_options_common) + else + return nil, nil + end + local sname = sdata[".name"] + local key = "%s.%s" % {stype, sname} + local value = { + [".name"] = sname, + name = '%s.%s' % {stype, sname}, + overview = table.concat(lines, "
"), + disabled = ucival_to_bool(sdata["disabled"]), + } + return key, value +end + +function cfgvalue_overview_(sdata, lines, names) + local line + + for _, n in ipairs(names) do + local v = sdata[n] + if v ~= nil then + if n == "key" or n == "password" then + v = translate("") + end + local fv = "%s" % ut.pcdata(v) + if sdata[".type"] ~= "ss_server" and n == "server" then + fv = '%s' % { + ds.build_url("admin/services/shadowsocks-libev/servers", v), fv} + end + line = n .. ": " .. fv + table.insert(lines, line) + end + end +end + +function option_install_package(s, tab) + local bin = s.sectiontype:gsub("_", "-", 1) + local installed = nixio.fs.access("/usr/bin/" .. bin) + if installed then + return + end + local opkg_package = "shadowsocks-libev-" .. bin + local p_install + if tab then + p_install = s:taboption(tab, Button, "_install") + else + p_install = s:option(Button, "_install") + end + p_install.title = translate("Package is not installed") + p_install.inputtitle = translate("Install package %q" % opkg_package) + p_install.inputstyle = "apply" + + function p_install.write() + return luci.http.redirect( + luci.dispatcher.build_url("admin/system/packages") .. + "?submit=1&install=%s" % opkg_package + ) + end +end + +names_options_server = { + "server", + "server_port", + "method", + "key", + "password", +} + +names_options_client = { + "server", + "local_address", + "local_port", +} + +names_options_common = { + "verbose", + "ipv6_first", + "fast_open", + "no_delay", + "reuse_port", + "mode", + "mtu", + "timeout", + "user", +} + +modes = { + "tcp_only", + "tcp_and_udp", + "udp_only", +} + +methods = { + -- aead + "aes-128-gcm", + "aes-192-gcm", + "aes-256-gcm", + "chacha20-ietf-poly1305", + "xchacha20-ietf-poly1305", + -- stream + "table", + "rc4", + "rc4-md5", + "aes-128-cfb", + "aes-192-cfb", + "aes-256-cfb", + "aes-128-ctr", + "aes-192-ctr", + "aes-256-ctr", + "bf-cfb", + "camellia-128-cfb", + "camellia-192-cfb", + "camellia-256-cfb", + "salsa20", + "chacha20", + "chacha20-ietf", +} diff --git a/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm b/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm new file mode 100644 index 00000000..219d89b0 --- /dev/null +++ b/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm @@ -0,0 +1,45 @@ +
+
+ + + + + + +
+ + + + + +
+
+ diff --git a/luci-app-shadowsocks-libev/root/etc/uci-defaults/40_luci-shadowsocks-libev b/luci-app-shadowsocks-libev/root/etc/uci-defaults/40_luci-shadowsocks-libev new file mode 100644 index 00000000..9f86bdac --- /dev/null +++ b/luci-app-shadowsocks-libev/root/etc/uci-defaults/40_luci-shadowsocks-libev @@ -0,0 +1,19 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-shadowsocks-libev.json" ] && { + cat > /usr/share/ucitrack/luci-app-shadowsocks-libev.json << EEOF +{ + "config": "shadowsocks-libev", + "init": "shadowsocks-libev" +} +EEOF +} + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@shadowsocks-libev[-1] + add ucitrack shadowsocks-libev + set ucitrack.@shadowsocks-libev[-1].init=shadowsocks-libev + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-webrestriction/Makefile b/luci-app-shairplay/Makefile similarity index 59% rename from luci-app-webrestriction/Makefile rename to luci-app-shairplay/Makefile index 53670f9f..c5250f11 100644 --- a/luci-app-webrestriction/Makefile +++ b/luci-app-shairplay/Makefile @@ -1,17 +1,14 @@ -# Copyright (C) 2016 Openwrt.org +# +# Copyright (C) 2008-2014 The LuCI Team # # This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI support for Webrestriction -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=1 +LUCI_TITLE:=LuCI Support for Shairplay +LUCI_DEPENDS:=+shairplay include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature - - diff --git a/luci-app-shairplay/luasrc/controller/shairplay.lua b/luci-app-shairplay/luasrc/controller/shairplay.lua new file mode 100644 index 00000000..d3223016 --- /dev/null +++ b/luci-app-shairplay/luasrc/controller/shairplay.lua @@ -0,0 +1,14 @@ +-- Copyright 2014 Álvaro Fernández Rojas +-- Licensed to the public under the Apache License 2.0. + +module("luci.controller.shairplay", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/shairplay") then + return + end + + local page = entry({"admin", "services", "shairplay"}, cbi("shairplay"), _("Shairplay")) + page.dependent = true + +end diff --git a/luci-app-shairplay/luasrc/model/cbi/shairplay.lua b/luci-app-shairplay/luasrc/model/cbi/shairplay.lua new file mode 100644 index 00000000..4e078d7e --- /dev/null +++ b/luci-app-shairplay/luasrc/model/cbi/shairplay.lua @@ -0,0 +1,65 @@ +-- Copyright 2014 Álvaro Fernández Rojas +-- Licensed to the public under the Apache License 2.0. + +m = Map("shairplay", "Shairplay", translate("Shairplay is a simple AirPlay server implementation, here you can configure the settings.")) + +s = m:section(TypedSection, "shairplay", "") +s.addremove = true +s.anonymous = false + +enable=s:option(Flag, "disabled", translate("Enabled")) +enable.enabled="0" +enable.disabled="1" +enable.default = "1" +enable.rmempty = false +respawn=s:option(Flag, "respawn", translate("Respawn")) +respawn.default = false + +apname = s:option(Value, "apname", translate("Airport Name")) +apname.rmempty = true + +port=s:option(Value, "port", translate("Port")) +port.rmempty = true +port.datatype = "port" + +pw = s:option(Value, "password", translate("Password")) +pw.rmempty = true +pw.password = true + +hwaddr=s:option(Value, "hwaddr", translate("HW Address")) +hwaddr.rmempty = true +hwaddr.datatype = "macaddr" + +ao_driver=s:option(ListValue, "ao_driver", translate("AO Driver")) +ao_driver:value("", translate("Default")) +ao_driver:value("alsa") +--ao_driver:value("alsa05") +--ao_driver:value("arts") +--ao_driver:value("esd") +--ao_driver:value("irix") +--ao_driver:value("nas") +ao_driver:value("oss") +--ao_driver:value("sun") + +ao_devicename=s:option(Value, "ao_devicename", translate("AO Device Name")) +ao_devicename.rmempty = true + +ao_deviceid = s:option(ListValue, "ao_deviceid", translate("AO Device ID")) +ao_deviceid.rmempty = true +ao_deviceid:value("", translate("Default")) +local pats = io.popen("find /proc/asound/ -type d -name 'card*' | sort") +if pats then + local l + while true do + l = pats:read("*l") + if not l then break end + + l = string.gsub(l, "/proc/asound/card", "") + if l then + ao_deviceid:value(l) + end + end + pats:close() +end + +return m diff --git a/luci-app-shairplay/po/ja/shairplay.po b/luci-app-shairplay/po/ja/shairplay.po new file mode 100644 index 00000000..07fa7be6 --- /dev/null +++ b/luci-app-shairplay/po/ja/shairplay.po @@ -0,0 +1,54 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2017-01-03 15:06+0900\n" +"Last-Translator: INAGAKI Hiroshi \n" +"Language-Team: \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "AO Device ID" +msgstr "オーディオ出力 デバイスID" + +msgid "AO Device Name" +msgstr "オーディオ出力 デバイス名" + +msgid "AO Driver" +msgstr "オーディオ出力 デバイスドライバー" + +msgid "Airport Name" +msgstr "Airport名" + +msgid "Default" +msgstr "デフォルト" + +msgid "Enabled" +msgstr "有効" + +msgid "HW Address" +msgstr "ハードウェア アドレス" + +msgid "Password" +msgstr "パスワード" + +msgid "Port" +msgstr "ポート" + +msgid "Respawn" +msgstr "リスポーン" + +msgid "Shairplay" +msgstr "" + +msgid "" +"Shairplay is a simple AirPlay server implementation, here you can configure " +"the settings." +msgstr "" +"Shairplayは、シンプルなAirPlay サーバー実装です。ここでは、設定を行うことがで" +"きます。" diff --git a/luci-app-shairplay/po/pt-br/shairplay.po b/luci-app-shairplay/po/pt-br/shairplay.po new file mode 100644 index 00000000..c7d0ab18 --- /dev/null +++ b/luci-app-shairplay/po/pt-br/shairplay.po @@ -0,0 +1,54 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" +"X-Poedit-Bookmarks: -1,5,-1,-1,-1,-1,-1,-1,-1,-1\n" + +msgid "AO Device ID" +msgstr "Identificador do dispositivo AO" + +msgid "AO Device Name" +msgstr "Nome do dispositivo AO" + +msgid "AO Driver" +msgstr "Driver do AO" + +msgid "Airport Name" +msgstr "Nome do Airport" + +msgid "Default" +msgstr "Padrão" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "HW Address" +msgstr "Endereço de Hardware" + +msgid "Password" +msgstr "Senha" + +msgid "Port" +msgstr "Porta" + +msgid "Respawn" +msgstr "Redisparar" + +msgid "Shairplay" +msgstr "Shairplay" + +msgid "" +"Shairplay is a simple AirPlay server implementation, here you can configure " +"the settings." +msgstr "" +"Shairplay é uma implementação simples de um servidor AirPlay. Aqui você pode " +"configurá-lo." diff --git a/luci-app-shairplay/po/ru/shairplay.po b/luci-app-shairplay/po/ru/shairplay.po new file mode 100644 index 00000000..037e90b5 --- /dev/null +++ b/luci-app-shairplay/po/ru/shairplay.po @@ -0,0 +1,56 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: LuCI: shairplay\n" +"POT-Creation-Date: 2017-12-06 11:15+0300\n" +"PO-Revision-Date: 2018-01-14 11:43+0300\n" +"Language-Team: http://cyber-place.ru\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"Last-Translator: Vladimir aka sunny \n" +"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 "AO Device ID" +msgstr "AO ID устройства" + +msgid "AO Device Name" +msgstr "AO имя устройства" + +msgid "AO Driver" +msgstr "AO драйвер" + +msgid "Airport Name" +msgstr "Имя Air-порта" + +msgid "Default" +msgstr "По умолчанию" + +msgid "Enabled" +msgstr "Включено" + +msgid "HW Address" +msgstr "HW адрес" + +msgid "Password" +msgstr "Пароль" + +msgid "Port" +msgstr "Порт" + +msgid "Respawn" +msgstr "Перерождение" + +msgid "Shairplay" +msgstr "Shairplay" + +msgid "" +"Shairplay is a simple AirPlay server implementation, here you can configure " +"the settings." +msgstr "" +"Shairplay является простой реализацией сервера AirPlay, здесь вы можете его " +"настроить." diff --git a/luci-app-shairplay/po/templates/shairplay.pot b/luci-app-shairplay/po/templates/shairplay.pot new file mode 100644 index 00000000..b3da99e0 --- /dev/null +++ b/luci-app-shairplay/po/templates/shairplay.pot @@ -0,0 +1,40 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "AO Device ID" +msgstr "" + +msgid "AO Device Name" +msgstr "" + +msgid "AO Driver" +msgstr "" + +msgid "Airport Name" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "HW Address" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Port" +msgstr "" + +msgid "Respawn" +msgstr "" + +msgid "Shairplay" +msgstr "" + +msgid "" +"Shairplay is a simple AirPlay server implementation, here you can configure " +"the settings." +msgstr "" diff --git a/luci-app-shairplay/root/etc/uci-defaults/40_luci-shairplay b/luci-app-shairplay/root/etc/uci-defaults/40_luci-shairplay new file mode 100644 index 00000000..6ab44fbe --- /dev/null +++ b/luci-app-shairplay/root/etc/uci-defaults/40_luci-shairplay @@ -0,0 +1,20 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-shairplay.json" ] && { + cat > /usr/share/ucitrack/luci-app-shairplay.json << EEOF +{ + "config": "shairplay", + "init": "shairplay" +} +EEOF +} + +# needed for "Save and Apply" to restart shairplay +uci -q batch <<-EOF >/dev/null + delete ucitrack.@shairplay[-1] + add ucitrack shairplay + set ucitrack.@shairplay[-1].init="shairplay" + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-trojan-server/Makefile b/luci-app-trojan-server/Makefile deleted file mode 100644 index 27999b7e..00000000 --- a/luci-app-trojan-server/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2019-2020 Lienol -# -# This is free software, licensed under the GNU General Public License v3. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-trojan-server -LUCI_TITLE:=LuCI support for Trojan Server -LUCI_DEPENDS:=+luci-lib-jsonc +trojan -LUCI_PKGARCH:=all -PKG_VERSION:=1 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file diff --git a/luci-app-trojan-server/luasrc/controller/trojan_server.lua b/luci-app-trojan-server/luasrc/controller/trojan_server.lua deleted file mode 100644 index 98846fa8..00000000 --- a/luci-app-trojan-server/luasrc/controller/trojan_server.lua +++ /dev/null @@ -1,44 +0,0 @@ --- Copyright 2019 Lienol -module("luci.controller.trojan_server", package.seeall) -local http = require "luci.http" - -function index() - if not nixio.fs.access("/etc/config/trojan_server") then return end - entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false - local page = entry({"admin", "vpn", "trojan_server"}, cbi("trojan_server/index"), - _("Trojan Server")) - page.order = 3 - page.dependent = true - page.acl_depends = { "luci-app-trojan-server" } - entry({"admin", "vpn", "trojan_server", "config"}, - cbi("trojan_server/config")).leaf = true - - entry({"admin", "vpn", "trojan_server", "users_status"}, - call("trojan_users_status")).leaf = true - entry({"admin", "vpn", "trojan_server", "get_log"}, call("get_log")).leaf = - true - entry({"admin", "vpn", "trojan_server", "clear_log"}, call("clear_log")).leaf = - true -end - -local function http_write_json(content) - http.prepare_content("application/json") - http.write_json(content or {code = 1}) -end - -function trojan_users_status() - local e = {} - e.index = luci.http.formvalue("index") - e.status = luci.sys.call( - "ps -w| grep -v grep | grep '/var/etc/trojan_server/" .. - luci.http.formvalue("id") .. "' >/dev/null") == 0 - http_write_json(e) -end - -function get_log() - luci.http.write(luci.sys.exec( - "[ -f '/var/log/trojan_server/app.log' ] && cat /var/log/trojan_server/app.log")) -end - -function clear_log() luci.sys.call("echo '' > /var/log/trojan_server/app.log") end - diff --git a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/api/gen_trojan_config_file.lua b/luci-app-trojan-server/luasrc/model/cbi/trojan_server/api/gen_trojan_config_file.lua deleted file mode 100644 index e4811085..00000000 --- a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/api/gen_trojan_config_file.lua +++ /dev/null @@ -1,40 +0,0 @@ -local ucursor = require"luci.model.uci".cursor() -local json = require "luci.jsonc" -local server_section = arg[1] -local server = ucursor:get_all("trojan_server", server_section) - -local trojan = { - run_type = "server", - local_addr = "0.0.0.0", - local_port = tonumber(server.port), - remote_addr = (server.remote_enable == "1" and server.remote_address) and - server.remote_address or nil, - remote_port = (server.remote_enable == "1" and server.remote_port) and - server.remote_port or nil, - password = server.password, - log_level = 1, - ssl = { - cert = server.ssl_certFile, - key = server.ssl_keyFile, - key_password = "", - cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA", - cipher_tls13 = "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384", - prefer_server_cipher = true, - alpn = {"http/1.1"}, - reuse_session = true, - session_ticket = false, - session_timeout = 600, - plain_http_response = "", - curves = "", - dhparam = "" - }, - tcp = { - prefer_ipv4 = false, - no_delay = true, - keep_alive = true, - reuse_port = false, - fast_open = (server.fast_open == "true") and true or false, - fast_open_qlen = 20 - } -} -print(json.stringify(trojan, 1)) diff --git a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/config.lua b/luci-app-trojan-server/luasrc/model/cbi/trojan_server/config.lua deleted file mode 100644 index 060ce52d..00000000 --- a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/config.lua +++ /dev/null @@ -1,54 +0,0 @@ -local app_name = "trojan_server" -local d = require "luci.dispatcher" - -map = Map(app_name, "Trojan " .. translate("Server Config")) -map.redirect = d.build_url("admin", "vpn", "trojan_server") - -t = map:section(NamedSection, arg[1], "user", "") -t.addremove = false -t.dynamic = false - -enable = t:option(Flag, "enable", translate("Enable")) -enable.default = "1" -enable.rmempty = false - -remarks = t:option(Value, "remarks", translate("Remarks")) -remarks.default = translate("Remarks") -remarks.rmempty = false - -port = t:option(Value, "port", translate("Port")) -port.datatype = "port" -port.rmempty = false - -password = t:option(DynamicList, "password", translate("Password")) - -tcp_fast_open = t:option(ListValue, "tcp_fast_open", translate("TCP Fast Open"), - translate( - "Enable TCP fast open (kernel support required)")) -tcp_fast_open:value("false") -tcp_fast_open:value("true") - -remote_enable = t:option(Flag, "remote_enable", translate("Enable Remote"), - translate( - "You can forward to Nginx/Caddy/V2ray WebSocket and more.")) -remote_enable.default = "1" -remote_enable.rmempty = false - -remote_address = t:option(Value, "remote_address", translate("Remote Address")) -remote_address.default = "127.0.0.1" -remote_address:depends("remote_enable", 1) - -remote_port = t:option(Value, "remote_port", translate("Remote Port")) -remote_port.datatype = "port" -remote_port.default = "80" -remote_port:depends("remote_enable", 1) - -tls_certFile = t:option(Value, "ssl_certFile", - "HTTPS" .. translate("Public key absolute path"), - translate("as:") .. "/etc/ssl/fullchain.pem") - -tls_keyFile = t:option(Value, "ssl_keyFile", - "HTTPS" .. translate("Private key absolute path"), - translate("as:") .. "/etc/ssl/private.key") - -return map diff --git a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/index.lua b/luci-app-trojan-server/luasrc/model/cbi/trojan_server/index.lua deleted file mode 100644 index a6348a78..00000000 --- a/luci-app-trojan-server/luasrc/model/cbi/trojan_server/index.lua +++ /dev/null @@ -1,58 +0,0 @@ -local i = require "luci.dispatcher" -local e = require "nixio.fs" -local e = require "luci.sys" -local e = luci.model.uci.cursor() -local o = "trojan_server" - -m = Map(o, translate("Trojan Server")) - -t = m:section(TypedSection, "global", translate("Global Settings")) -t.anonymous = true -t.addremove = false -e = t:option(Flag, "enable", translate("Enable")) -e.rmempty = false - -t = m:section(TypedSection, "user", translate("Users Manager")) -t.anonymous = true -t.addremove = true -t.template = "cbi/tblsection" -t.extedit = i.build_url("admin", "vpn", o, "config", "%s") -function t.create(t, e) - local e = TypedSection.create(t, e) - luci.http.redirect(i.build_url("admin", "vpn", o, "config", e)) -end -function t.remove(t, a) - t.map.proceed = true - t.map:del(a) - luci.http.redirect(i.build_url("admin", "vpn", o)) -end -e = t:option(Flag, "enable", translate("Enable")) -e.width = "5%" -e.rmempty = false -e = t:option(DummyValue, "status", translate("Status")) -e.template = "trojan_server/users_status" -e.value = translate("Collecting data...") -e = t:option(DummyValue, "remarks", translate("Remarks")) -e.width = "20%" -e = t:option(DummyValue, "port", translate("Port")) -e.width = "20%" - -e = t:option(DummyValue, "password", translate("Password")) -e.width = "30%" -e.cfgvalue = function(self, section) - local e = m:get(section, "password") or "" - local t = "" - if type(e) == "table" then - for a = 1, #e do t = t .. e[a] .. "," end - t = string.sub(t, 0, #t - 1) - else - t = e - end - return t -end - -m:append(Template("trojan_server/log")) - -m:append(Template("trojan_server/users_list_status")) -return m - diff --git a/luci-app-trojan-server/luasrc/view/trojan_server/log.htm b/luci-app-trojan-server/luasrc/view/trojan_server/log.htm deleted file mode 100644 index b3e480f2..00000000 --- a/luci-app-trojan-server/luasrc/view/trojan_server/log.htm +++ /dev/null @@ -1,31 +0,0 @@ - -
- - <%:Logs%> - - - -
diff --git a/luci-app-trojan-server/luasrc/view/trojan_server/users_list_status.htm b/luci-app-trojan-server/luasrc/view/trojan_server/users_list_status.htm deleted file mode 100644 index 7b9009b5..00000000 --- a/luci-app-trojan-server/luasrc/view/trojan_server/users_list_status.htm +++ /dev/null @@ -1,23 +0,0 @@ -<% -local dsp = require "luci.dispatcher" --%> - - \ No newline at end of file diff --git a/luci-app-trojan-server/luasrc/view/trojan_server/users_status.htm b/luci-app-trojan-server/luasrc/view/trojan_server/users_status.htm deleted file mode 100644 index 73baddc1..00000000 --- a/luci-app-trojan-server/luasrc/view/trojan_server/users_status.htm +++ /dev/null @@ -1,3 +0,0 @@ -<%+cbi/valueheader%> --- -<%+cbi/valuefooter%> \ No newline at end of file diff --git a/luci-app-trojan-server/po/zh-cn b/luci-app-trojan-server/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-trojan-server/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-trojan-server/po/zh_Hans/trojan_server.po b/luci-app-trojan-server/po/zh_Hans/trojan_server.po deleted file mode 100644 index 2111c944..00000000 --- a/luci-app-trojan-server/po/zh_Hans/trojan_server.po +++ /dev/null @@ -1,68 +0,0 @@ -msgid "Trojan Server" -msgstr "Trojan 服务器" - -msgid "Global Settings" -msgstr "全局设置" - -msgid "Server Config" -msgstr "服务器配置" - -msgid "Users Manager" -msgstr "用户管理" - -msgid "Remarks" -msgstr "备注" - -msgid "Port" -msgstr "端口" - -msgid "Password" -msgstr "密码" - -msgid "TCP Fast Open" -msgstr "TCP快速打开" - -msgid "Enable TCP fast open (kernel support required)" -msgstr "是否启用TCP快速打开(需要内核支持)" - -msgid "Enable Remote" -msgstr "启用转发" - -msgid "You can forward to Nginx/Caddy/V2ray WebSocket and more." -msgstr "您可以转发到Nginx/Caddy/V2ray WebSocket等。" - -msgid "Remote Address" -msgstr "远程地址" - -msgid "Remote Port" -msgstr "远程端口" - -msgid "as:" -msgstr "如:" - -msgid "Public key absolute path" -msgstr "公钥文件绝对路径" - -msgid "Private key absolute path" -msgstr "私钥文件绝对路径" - -msgid "Logs" -msgstr "日志" - -msgid "Clear logs" -msgstr "清空日志" - -msgid "Enabled" -msgstr "启用" - -msgid "Status" -msgstr "状态" - -msgid "Current Condition" -msgstr "当前状态" - -msgid "NOT RUNNING" -msgstr "未运行" - -msgid "RUNNING" -msgstr "运行中" \ No newline at end of file diff --git a/luci-app-trojan-server/root/etc/config/trojan_server b/luci-app-trojan-server/root/etc/config/trojan_server deleted file mode 100644 index cff3b916..00000000 --- a/luci-app-trojan-server/root/etc/config/trojan_server +++ /dev/null @@ -1,13 +0,0 @@ - -config global - option enable '0' - -config user - option enable '1' - option remarks '测试' - option port '45443' - option tcp_fast_open 'false' - option ssl_certFile '/etc/config/ssl/fullchain.pem' - option ssl_keyFile '/etc/config/ssl/private.key' - list password '123456' - diff --git a/luci-app-trojan-server/root/etc/init.d/trojan_server b/luci-app-trojan-server/root/etc/init.d/trojan_server deleted file mode 100755 index fb2bf361..00000000 --- a/luci-app-trojan-server/root/etc/init.d/trojan_server +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2019-2020 Lienol - -START=99 - -CONFIG=trojan_server -CONFIG_PATH=/var/etc/$CONFIG -LOG_PATH=/var/log/$CONFIG -LOG_APP_FILE=$LOG_PATH/app.log - -echolog() { - echo -e "$(date "+%Y-%m-%d %H:%M:%S"): $1" >> $LOG_APP_FILE -} - -gen_trojan_config_file() { - config_get enable $1 enable - [ "$enable" = "0" ] && return 0 - config_get remarks $1 remarks - config_get port $1 port - config_get ssl_certFile $1 ssl_certFile - config_get ssl_keyFile $1 ssl_keyFile - [ ! -f "$ssl_certFile" ] && echolog "$remarks $port 找不到HTTPS公钥文件,运行失败!" && exit - [ ! -f "$ssl_keyFile" ] && echolog "$remarks $port 找不到HTTPS私钥文件,运行失败!" && exit - lua /usr/lib/lua/luci/model/cbi/trojan_server/api/gen_trojan_config_file.lua $1 > $CONFIG_PATH/$1.json - echolog "$remarks $port 生成并运行 Trojan 配置文件 - $CONFIG_PATH/$1.json" - trojan -c $CONFIG_PATH/$1.json >/dev/null 2>&1 & -} - -start_trojan_server() { - mkdir -p $CONFIG_PATH $LOG_PATH - touch $LOG_APP_FILE - config_foreach gen_trojan_config_file "user" - fw3 reload >/dev/null 2>&1 & -} - -stop_trojan_server() { - fw3 reload >/dev/null 2>&1 - ps -w | grep "$CONFIG_PATH/" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & - rm -rf $CONFIG_PATH - rm -rf $LOG_PATH -} - -start() { - config_load $CONFIG - enable=$(uci get $CONFIG.@global[0].enable) - if [ "$enable" = "0" ];then - stop_trojan_server - else - start_trojan_server - fi -} - -stop() { - stop_trojan_server -} - -restart() { - stop - start -} \ No newline at end of file diff --git a/luci-app-trojan-server/root/etc/uci-defaults/luci-app-trojan-server b/luci-app-trojan-server/root/etc/uci-defaults/luci-app-trojan-server deleted file mode 100644 index 53db7e03..00000000 --- a/luci-app-trojan-server/root/etc/uci-defaults/luci-app-trojan-server +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-trojan_server.json" ] && { - cat > /usr/share/ucitrack/luci-app-trojan_server.json << EEOF -{ - "config": "trojan_server", - "init": "trojan_server" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete firewall.trojan_server - set firewall.trojan_server=include - set firewall.trojan_server.type=script - set firewall.trojan_server.path=/usr/share/trojan_server/firewall.include - set firewall.trojan_server.reload=1 -EOF - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@trojan_server[-1] - add ucitrack trojan_server - set ucitrack.@trojan_server[-1].init=trojan_server - commit ucitrack -EOF - -chmod a+x /usr/share/trojan_server/* >/dev/null 2>&1 - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/luci-app-trojan-server/root/usr/share/rpcd/acl.d/luci-app-trojan-server.json b/luci-app-trojan-server/root/usr/share/rpcd/acl.d/luci-app-trojan-server.json deleted file mode 100644 index 7eb91aec..00000000 --- a/luci-app-trojan-server/root/usr/share/rpcd/acl.d/luci-app-trojan-server.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-trojan-server": { - "description": "Grant UCI access for luci-app-trojan-server", - "read": { - "uci": [ "trojan_server" ] - }, - "write": { - "uci": [ "trojan_server" ] - } - } -} diff --git a/luci-app-trojan-server/root/usr/share/trojan_server/firewall.include b/luci-app-trojan-server/root/usr/share/trojan_server/firewall.include deleted file mode 100755 index 462ad5b4..00000000 --- a/luci-app-trojan-server/root/usr/share/trojan_server/firewall.include +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -count=$(iptables -n -L INPUT 2>/dev/null | grep -c "TROJAN-SERVER") -if [ -n "$count" ]; then - until [ "$count" = 0 ] - do - rules=$(iptables -n -L INPUT --line-num 2>/dev/null | grep "TROJAN-SERVER" | awk '{print $1}') - for rule in $rules - do - iptables -D INPUT $rule 2>/dev/null - break - done - count=$(expr $count - 1) - done -fi - -iptables -F TROJAN-SERVER 2>/dev/null && iptables -X TROJAN-SERVER 2>/dev/null - -enable=$(uci -q get trojan_server.@global[0].enable) -if [ $enable -eq 1 ]; then - iptables -N TROJAN-SERVER - iptables -I INPUT -j TROJAN-SERVER - - count=$(uci show trojan_server | grep "@user" | sed -n '$p' | cut -d '[' -f 2 | cut -d ']' -f 1) - [ -n "$count" ] && [ "$count" -ge 0 ] && { - u_get() { - local ret=$(uci -q get trojan_server.@user[$1].$2) - echo ${ret:=$3} - } - for i in $(seq 0 $count); do - enable=$(u_get $i enable 0) - [ $enable -eq 0 ] && continue - remarks=$(u_get $i remarks) - port=$(u_get $i port) - iptables -A TROJAN-SERVER -p tcp --dport $port -m comment --comment "$remarks" -j ACCEPT - iptables -A TROJAN-SERVER -p udp --dport $port -m comment --comment "$remarks" -j ACCEPT - done - } -fi diff --git a/luci-app-trojan-server/root/usr/share/ucitrack/luci-app-trojan-server.json b/luci-app-trojan-server/root/usr/share/ucitrack/luci-app-trojan-server.json deleted file mode 100644 index 152e1059..00000000 --- a/luci-app-trojan-server/root/usr/share/ucitrack/luci-app-trojan-server.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "config": "trojan_server", - "init": "trojan_server" -} diff --git a/luci-app-uugamebooster/Makefile b/luci-app-uugamebooster/Makefile index e6db4e99..7e7a3524 100644 --- a/luci-app-uugamebooster/Makefile +++ b/luci-app-uugamebooster/Makefile @@ -1,14 +1,18 @@ -# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk -PKG_LICENSE:=Apache-2.0 - LUCI_TITLE:=LuCI support for UUgamebooster LUCI_DEPENDS:=+uugamebooster LUCI_PKGARCH:=all +PKG_NAME:=luci-app-uugamebooster +PKG_VERSION:=2.0 +PKG_RELEASE:=2 + include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js b/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js deleted file mode 100644 index de7e6be6..00000000 --- a/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; -'require form'; -'require poll'; -'require rpc'; -'require uci'; -'require view'; - -const callServiceList = rpc.declare({ - object: 'service', - method: 'list', - params: ['name'], - expect: { '': {} } -}); - -function getServiceStatus() { - return L.resolveDefault(callServiceList('uugamebooster'), {}).then(function (res) { - var isRunning = false; - try { - isRunning = res['uugamebooster']['instances']['uugamebooster']['running']; - } catch (e) { } - return isRunning; - }); -} - -function renderStatus(isRunning) { - var spanTemp = '%s %s'; - var renderHTML; - if (isRunning) { - renderHTML = spanTemp.format('green', _('UU GameAcc'), _('RUNNING')) - } else { - renderHTML = spanTemp.format('red', _('UU GameAcc'), _('NOT RUNNING')); - } - - return renderHTML; -} - -return view.extend({ - load: function() { - return Promise.all([ - uci.load('uugamebooster') - ]); - }, - - render: function() { - let m, s, o; - - m = new form.Map('uugamebooster', _('UU Game Accelerator'), - _('A Paid Game Acceleration service')); - - s = m.section(form.TypedSection); - s.anonymous = true; - s.render = function () { - poll.add(function () { - return L.resolveDefault(getServiceStatus()).then(function (res) { - var view = document.getElementById('service_status'); - view.innerHTML = renderStatus(res); - }); - }); - - return E('div', { class: 'cbi-section', id: 'status_bar' }, [ - E('p', { id: 'service_status' }, _('Collecting data...')) - ]); - } - - s = m.section(form.NamedSection, 'config', 'uugamebooster'); - - o = s.option(form.Flag, 'enabled', _('Enable')); - o.default = o.disabled; - o.rmempty = false; - - s = m.section(form.TypedSection); - s.anonymous = true; - s.render = function () { - return E('div', {class: 'cbi-section'}, [ - E('p', [ - E('img', {src: '/uugamebooster/uuios.png', height: '300'}), - E('img', {src: '/uugamebooster/uuandroid.png', height: '300'}) - ]) - ]) - } - - return m.render(); - } - -}); diff --git a/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua b/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua new file mode 100644 index 00000000..d427f275 --- /dev/null +++ b/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua @@ -0,0 +1,17 @@ +module("luci.controller.uugamebooster", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/uugamebooster") then + return + end + + entry({"admin", "services", "uugamebooster"}, cbi("uugamebooster"), ("UU GameAcc"), 99).dependent = true + entry({"admin", "services", "uugamebooster", "status"}, call("act_status")).leaf = true +end + +function act_status() + local e = {} + e.running = luci.sys.call("pgrep -f uugamebooster >/dev/null") == 0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster.lua b/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster.lua new file mode 100644 index 00000000..812c4068 --- /dev/null +++ b/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster.lua @@ -0,0 +1,19 @@ +require("luci.util") + +mp = Map("uugamebooster") +mp.title = translate("UU Game Accelerator") +mp.description = translate("A Paid Game Acceleration service") + +mp:section(SimpleSection).template = "uugamebooster/uugamebooster_status" + +s = mp:section(TypedSection, "uugamebooster") +s.anonymous = true +s.addremove = false + +o = s:option(Flag, "enabled", translate("Enable")) +o.default = 0 +o.optional = false + +mp:section(SimpleSection).template = "uugamebooster/uugamebooster_qcode" + +return mp diff --git a/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_qcode.htm b/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_qcode.htm new file mode 100644 index 00000000..12cb2e97 --- /dev/null +++ b/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_qcode.htm @@ -0,0 +1,6 @@ + +
+

+ +

+
diff --git a/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm b/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm new file mode 100644 index 00000000..c8abb464 --- /dev/null +++ b/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm @@ -0,0 +1,21 @@ + + +
+

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

+
diff --git a/luci-app-uugamebooster/po/templates/uugamebooster.pot b/luci-app-uugamebooster/po/templates/uugamebooster.pot deleted file mode 100644 index e328b81e..00000000 --- a/luci-app-uugamebooster/po/templates/uugamebooster.pot +++ /dev/null @@ -1,23 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:70 -msgid "Enable" -msgstr "" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:32 -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:34 -msgid "UU GameAcc" -msgstr "" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:50 -msgid "UU Game Accelerator" -msgstr "" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:51 -msgid "A Paid Game Acceleration service" -msgstr "" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:64 -msgid "Collecting data..." -msgstr "" diff --git a/luci-app-uugamebooster/po/zh-cn b/luci-app-uugamebooster/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-uugamebooster/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-uugamebooster/po/zh-cn/uuplugin.po b/luci-app-uugamebooster/po/zh-cn/uuplugin.po new file mode 100644 index 00000000..d2a3ddbb --- /dev/null +++ b/luci-app-uugamebooster/po/zh-cn/uuplugin.po @@ -0,0 +1,12 @@ + +msgid "Enable" +msgstr "启用" + +msgid "UU GameAcc" +msgstr "UU游戏加速器" + +msgid "UU Game Accelerator" +msgstr "UU游戏加速器" + +msgid "A Paid Game Acceleration service" +msgstr "一个富家子弟用的主机游戏加速器 (开启服务后,使用手机APP绑定路由器并指定加速主机)" diff --git a/luci-app-uugamebooster/po/zh_Hans b/luci-app-uugamebooster/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-uugamebooster/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-uugamebooster/po/zh_Hans/uugamebooster.po b/luci-app-uugamebooster/po/zh_Hans/uugamebooster.po deleted file mode 100644 index f0df78aa..00000000 --- a/luci-app-uugamebooster/po/zh_Hans/uugamebooster.po +++ /dev/null @@ -1,23 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:70 -msgid "Enable" -msgstr "启用" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:32 -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:34 -msgid "UU GameAcc" -msgstr "UU游戏加速器" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:50 -msgid "UU Game Accelerator" -msgstr "UU游戏加速器" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:51 -msgid "A Paid Game Acceleration service" -msgstr "一个付费主机游戏加速器 (开启服务后,使用手机APP绑定路由器并指定加速主机)" - -#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:64 -msgid "Collecting data..." -msgstr "正在收集数据中..." diff --git a/luci-app-uugamebooster/root/etc/config/uuplugin b/luci-app-uugamebooster/root/etc/config/uuplugin new file mode 100644 index 00000000..3df31274 --- /dev/null +++ b/luci-app-uugamebooster/root/etc/config/uuplugin @@ -0,0 +1,4 @@ + +config uuplugin 'uuplugin' + option enabled '0' + diff --git a/luci-app-uugamebooster/root/etc/init.d/uugamebooster b/luci-app-uugamebooster/root/etc/init.d/uugamebooster new file mode 100755 index 00000000..ed517955 --- /dev/null +++ b/luci-app-uugamebooster/root/etc/init.d/uugamebooster @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2021 Tianling Shen + +USE_PROCD=1 +START=99 + +CONF="uugamebooster" +PROG="/usr/bin/uugamebooster" + +UU_CONF="/usr/share/uugamebooster/uu.conf" + +start_service() { + config_load "$CONF" + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + procd_open_instance "$CONF" + + procd_set_param command "$PROG" "$UU_CONF" + + procd_set_param limits core="unlimited" + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster b/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster new file mode 100644 index 00000000..b8689ef2 --- /dev/null +++ b/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster @@ -0,0 +1,19 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-uugamebooster.json" ] && { + cat > /usr/share/ucitrack/luci-app-uugamebooster.json << EEOF +{ + "config": "uugamebooster", + "init": "uugamebooster" +} +EEOF +} + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@uugamebooster[-1] + add ucitrack uugamebooster + set ucitrack.@uugamebooster[-1].init=uugamebooster + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-uugamebooster/root/usr/share/luci/menu.d/luci-app-uugamebooster.json b/luci-app-uugamebooster/root/usr/share/luci/menu.d/luci-app-uugamebooster.json deleted file mode 100644 index e66370b9..00000000 --- a/luci-app-uugamebooster/root/usr/share/luci/menu.d/luci-app-uugamebooster.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "admin/services/uugamebooster": { - "title": "UU GameAcc", - "action": { - "type": "view", - "path": "uugamebooster" - }, - "depends": { - "acl": [ "luci-app-uugamebooster" ], - "uci": { "uugamebooster": true } - } - } -} diff --git a/luci-app-uugamebooster/root/usr/share/rpcd/acl.d/luci-app-uugamebooster.json b/luci-app-uugamebooster/root/usr/share/rpcd/acl.d/luci-app-uugamebooster.json index 11cbb55f..a99fc152 100644 --- a/luci-app-uugamebooster/root/usr/share/rpcd/acl.d/luci-app-uugamebooster.json +++ b/luci-app-uugamebooster/root/usr/share/rpcd/acl.d/luci-app-uugamebooster.json @@ -2,13 +2,10 @@ "luci-app-uugamebooster": { "description": "Grant UCI access for luci-app-uugamebooster", "read": { - "ubus": { - "service": [ "list" ] - }, - "uci": [ "uugamebooster" ] + "uci": [ "uuplugin" ] }, "write": { - "uci": [ "uugamebooster" ] + "uci": [ "uuplugin" ] } } } diff --git a/luci-app-uugamebooster/root/www/uuandriod.png b/luci-app-uugamebooster/root/www/uuandriod.png new file mode 100644 index 00000000..edf7e8f5 Binary files /dev/null and b/luci-app-uugamebooster/root/www/uuandriod.png differ diff --git a/luci-app-uugamebooster/root/www/uugamebooster/uuandroid.png b/luci-app-uugamebooster/root/www/uugamebooster/uuandroid.png deleted file mode 100644 index 279b9f70..00000000 Binary files a/luci-app-uugamebooster/root/www/uugamebooster/uuandroid.png and /dev/null differ diff --git a/luci-app-uugamebooster/root/www/uugamebooster/uuios.png b/luci-app-uugamebooster/root/www/uugamebooster/uuios.png deleted file mode 100644 index bce47ab9..00000000 Binary files a/luci-app-uugamebooster/root/www/uugamebooster/uuios.png and /dev/null differ diff --git a/luci-app-uugamebooster/root/www/uuios.png b/luci-app-uugamebooster/root/www/uuios.png new file mode 100644 index 00000000..f76dc74e Binary files /dev/null and b/luci-app-uugamebooster/root/www/uuios.png differ diff --git a/luci-app-v2ray-server/Makefile b/luci-app-v2ray-server/Makefile index a5710d53..4528e7f1 100644 --- a/luci-app-v2ray-server/Makefile +++ b/luci-app-v2ray-server/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for V2ray Server -LUCI_DEPENDS:=+luci-compat +unzip +LUCI_DEPENDS:=+unzip LUCI_PKGARCH:=all PKG_NAME:=luci-app-v2ray-server PKG_VERSION:=13 -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-v2ray-server/po/zh-cn b/luci-app-v2ray-server/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-v2ray-server/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-v2ray-server/po/zh_Hans/v2ray_server.po b/luci-app-v2ray-server/po/zh-cn/v2ray_server.po similarity index 100% rename from luci-app-v2ray-server/po/zh_Hans/v2ray_server.po rename to luci-app-v2ray-server/po/zh-cn/v2ray_server.po diff --git a/luci-app-v2ray-server/po/zh_Hans b/luci-app-v2ray-server/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-v2ray-server/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-verysync/Makefile b/luci-app-verysync/Makefile index f9823d89..09afdbb7 100644 --- a/luci-app-verysync/Makefile +++ b/luci-app-verysync/Makefile @@ -8,8 +8,10 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Verysync LUCI_DEPENDS:=+verysync LUCI_PKGARCH:=all + +PKG_NAME:=luci-app-verysync PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-verysync/luasrc/controller/verysync.lua b/luci-app-verysync/luasrc/controller/verysync.lua index ab6381ee..f89a2a1c 100644 --- a/luci-app-verysync/luasrc/controller/verysync.lua +++ b/luci-app-verysync/luasrc/controller/verysync.lua @@ -5,15 +5,13 @@ function index() return end - local page = entry({"admin", "nas", "verysync"}, cbi("verysync"), _("Verysync"), 10) - page.dependent = true - page.acl_depends = { "luci-app-verysync" } - entry({"admin","nas","verysync","status"},call("act_status")).leaf=true + entry({"admin", "nas", "verysync"}, cbi("verysync"), _("Verysync"), 10).dependent = true + entry({"admin", "nas", "verysync", "status"}, call("act_status")).leaf = true end function act_status() - local e={} - e.running=luci.sys.call("pgrep verysync >/dev/null")==0 + local e = {} + e.running = luci.sys.call("pgrep verysync >/dev/null") == 0 luci.http.prepare_content("application/json") luci.http.write_json(e) end diff --git a/luci-app-verysync/luasrc/view/verysync/verysync_status.htm b/luci-app-verysync/luasrc/view/verysync/verysync_status.htm index 65d8cbee..bd7874c5 100644 --- a/luci-app-verysync/luasrc/view/verysync/verysync_status.htm +++ b/luci-app-verysync/luasrc/view/verysync/verysync_status.htm @@ -5,7 +5,7 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null, if (data && tb) { if (data.running) { - var links = 'Verysync <%:RUNNING%>'; + var links = 'Verysync <%:RUNNING%>'; tb.innerHTML = links; } else { tb.innerHTML = 'Verysync <%:NOT RUNNING%>'; @@ -14,9 +14,14 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null, } ); -function openwebui(){ - var url = window.location.host+":<%=luci.sys.exec("uci -q get verysync.config.port"):gsub("^%s*(.-)%s*$", "%1")%>"; - window.open('http://'+url,'target',''); +function openClient() { + var curWwwPath = window.document.location.href; + var pathName = window.document.location.pathname; + var pos = curWwwPath.indexOf(pathName); + var localhostPath = curWwwPath.substring(0, pos); + var clientPort = window.document.getElementById("cbid.verysync.config.port").value + var url = localhostPath + ":" + clientPort; + window.open(url) }; //]]> diff --git a/luci-app-verysync/po/zh-cn b/luci-app-verysync/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-verysync/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-verysync/po/zh_Hans/verysync.po b/luci-app-verysync/po/zh-cn/verysync.po similarity index 100% rename from luci-app-verysync/po/zh_Hans/verysync.po rename to luci-app-verysync/po/zh-cn/verysync.po diff --git a/luci-app-verysync/po/zh_Hans b/luci-app-verysync/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-verysync/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-verysync/root/etc/uci-defaults/luci-verysync b/luci-app-verysync/root/etc/uci-defaults/luci-verysync new file mode 100644 index 00000000..13da5d67 --- /dev/null +++ b/luci-app-verysync/root/etc/uci-defaults/luci-verysync @@ -0,0 +1,19 @@ +#!/bin/sh +[ ! -f "/usr/share/ucitrack/luci-app-verysync.json" ] && { + cat > /usr/share/ucitrack/luci-app-verysync.json << EEOF +{ + "config": "verysync", + "init": "verysync" +} +EEOF +} + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@verysync[-1] + add ucitrack verysync + set ucitrack.@verysync[-1].init=verysync + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-webadmin/Makefile b/luci-app-webadmin/Makefile index 48d42b2a..71e365e4 100644 --- a/luci-app-webadmin/Makefile +++ b/luci-app-webadmin/Makefile @@ -8,11 +8,12 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI page for Web Admin LUCI_DEPENDS:=+uhttpd -PKG_VERSION:=1.0 -PKG_RELEASE:=1 +LUCI_PKGARCH:=all + +PKG_NAME:=luci-app-webadmin +PKG_VERSION:=2 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature - - diff --git a/luci-app-webadmin/luasrc/controller/webadmin.lua b/luci-app-webadmin/luasrc/controller/webadmin.lua index 3ed295f9..5f173005 100644 --- a/luci-app-webadmin/luasrc/controller/webadmin.lua +++ b/luci-app-webadmin/luasrc/controller/webadmin.lua @@ -8,10 +8,5 @@ function index() return end - local page - - page = entry({"admin", "system", "webadmin"}, cbi("webadmin"), _("Web Admin"), 1) - page.leaf = true - page.acl_depends = { "luci-app-webadmin" } + entry({"admin", "system", "webadmin"}, cbi("webadmin"), _("Web Admin"), 1).leaf = true end - diff --git a/luci-app-webadmin/luasrc/model/cbi/webadmin.lua b/luci-app-webadmin/luasrc/model/cbi/webadmin.lua index e1872d20..dc80851c 100644 --- a/luci-app-webadmin/luasrc/model/cbi/webadmin.lua +++ b/luci-app-webadmin/luasrc/model/cbi/webadmin.lua @@ -3,14 +3,16 @@ local fs = require("nixio.fs") -local m = Map("uhttpd", translate("Web Admin Settings"), - translate("Web Admin Settings Page")) +m = Map("uhttpd") +m.title = translate("Web Admin Settings") +m.description = translate("Web Admin Settings Page") -local ucs = m:section(TypedSection, "uhttpd") +ucs = m:section(TypedSection, "uhttpd") ucs.addremove = false ucs.anonymous = true -lhttp = ucs:option(DynamicList, "listen_http", translate("HTTP listeners (address:port)"), translate("Bind to specific interface:port (by specifying interface address")) +lhttp = ucs:option(DynamicList, "listen_http", translate("HTTP listeners (address:port)")) +lhttp.description = translate("Bind to specific interface:port (by specifying interface address") lhttp.datatype = "list(ipaddrport(1))" function lhttp.validate(self, value, section) @@ -39,11 +41,12 @@ function lhttp.validate(self, value, section) end o = ucs:option(Flag, "redirect_https", translate("Redirect all HTTP to HTTPS")) +o.description = translate("Redirect all HTTP to HTTPS when SSl cert was installed") o.default = o.enabled o.rmempty = false -o.description = translate("Redirect all HTTP to HTTPS when SSl cert was installed") -o = ucs:option(Flag, "rfc1918_filter", translate("Ignore private IPs on public interface"), translate("Prevent access from private (RFC1918) IPs on an interface if it has an public IP address")) +o = ucs:option(Flag, "rfc1918_filter", translate("Ignore private IPs on public interface")) +o.description = translate("Prevent access from private (RFC1918) IPs on an interface if it has an public IP address") o.default = o.enabled o.rmempty = false diff --git a/luci-app-webadmin/po/zh-cn b/luci-app-webadmin/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-webadmin/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-webadmin/po/zh_Hans/webadmin.po b/luci-app-webadmin/po/zh-cn/webadmin.po similarity index 78% rename from luci-app-webadmin/po/zh_Hans/webadmin.po rename to luci-app-webadmin/po/zh-cn/webadmin.po index 176fdcc8..d2dab011 100644 --- a/luci-app-webadmin/po/zh_Hans/webadmin.po +++ b/luci-app-webadmin/po/zh-cn/webadmin.po @@ -1,10 +1,16 @@ msgid "" msgstr "" -"Language: zh_Hans\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"X-Generator: Poedit 2.3.1\n" msgid "Web Admin" msgstr "Web 管理" @@ -15,8 +21,8 @@ msgstr "Web 管理页面设置" msgid "Web Admin Settings Page" msgstr "设置更改Web管理页面端口,绑定地址,是否允许从互联网访问等" -msgid "HTTP listeners (address:port)"" -msgstr "HTTP 监听 (IP地址:端口)"" +msgid "HTTP listeners (address:port)" +msgstr "HTTP 监听 (IP地址:端口)" msgid "Bind to specific interface:port (by specifying interface address" msgstr "绑定到指定的IP地址:端口" @@ -38,4 +44,3 @@ msgstr "只允许内网访问" msgid "Prevent access from private (RFC1918) IPs on an interface if it has an public IP address" msgstr "拒绝从互联网访问Web管理页面" - diff --git a/luci-app-webadmin/po/zh_Hans b/luci-app-webadmin/po/zh_Hans new file mode 120000 index 00000000..41451e4a --- /dev/null +++ b/luci-app-webadmin/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/luci-app-webadmin/root/usr/share/rpcd/acl.d/luci-app-webadmin.json b/luci-app-webadmin/root/usr/share/rpcd/acl.d/luci-app-webadmin.json deleted file mode 100644 index fccda4de..00000000 --- a/luci-app-webadmin/root/usr/share/rpcd/acl.d/luci-app-webadmin.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-webadmin": { - "description": "Grant UCI access for luci-app-webadmin", - "read": { - "uci": [ "uhttpd" ] - }, - "write": { - "uci": [ "uhttpd" ] - } - } -} diff --git a/luci-app-webrestriction/luasrc/controller/webrestriction.lua b/luci-app-webrestriction/luasrc/controller/webrestriction.lua deleted file mode 100644 index 7ee5ee14..00000000 --- a/luci-app-webrestriction/luasrc/controller/webrestriction.lua +++ /dev/null @@ -1,18 +0,0 @@ -module("luci.controller.webrestriction", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/webrestriction") then return end - - entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false - local page = entry({"admin", "control", "webrestriction"}, cbi("webrestriction"),_("访问限制"), 11) - page.dependent = true - page.acl_depends = { "luci-app-webrestriction" } - entry({"admin", "control", "webrestriction", "status"}, call("status")).leaf = true -end - -function status() - local e = {} - e.status = luci.sys.call("iptables -L FORWARD |grep WEB_RESTRICTION >/dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/luci-app-webrestriction/luasrc/model/cbi/webrestriction.lua b/luci-app-webrestriction/luasrc/model/cbi/webrestriction.lua deleted file mode 100644 index bb0c688c..00000000 --- a/luci-app-webrestriction/luasrc/model/cbi/webrestriction.lua +++ /dev/null @@ -1,30 +0,0 @@ -local o = require "luci.sys" -local a, e, t -a = Map("webrestriction", translate("访问限制"), translate( - "使用黑名单或者白名单模式控制列表中的客户端是否能够连接到互联网。")) -a.template = "webrestriction/index" -e = a:section(TypedSection, "basic", translate("Running Status")) -e.anonymous = true -t = e:option(DummyValue, "webrestriction_status", translate("当前状态")) -t.template = "webrestriction/webrestriction" -t.value = translate("Collecting data...") -e = a:section(TypedSection, "basic", translate("全局设置")) -e.anonymous = true -t = e:option(Flag, "enable", translate("开启")) -t.rmempty = false -t = e:option(ListValue, "limit_type", translate("限制模式")) -t.default = "blacklist" -t:value("whitelist", translate("白名单")) -t:value("blacklist", translate("黑名单")) -t.rmempty = false -e = a:section(TypedSection, "macbind", translate("名单设置"), translate( - "如果是黑名单模式,列表中的客户端将被禁止连接到互联网;白名单模式表示仅有列表中的客户端可以连接到互联网。")) -e.template = "cbi/tblsection" -e.anonymous = true -e.addremove = true -t = e:option(Flag, "enable", translate("开启控制")) -t.rmempty = false -t = e:option(Value, "macaddr", translate("MAC地址")) -t.rmempty = true -o.net.mac_hints(function(e, a) t:value(e, "%s (%s)" % {e, a}) end) -return a diff --git a/luci-app-webrestriction/luasrc/view/webrestriction/index.htm b/luci-app-webrestriction/luasrc/view/webrestriction/index.htm deleted file mode 100644 index 21f269e7..00000000 --- a/luci-app-webrestriction/luasrc/view/webrestriction/index.htm +++ /dev/null @@ -1,18 +0,0 @@ -<%# - Copyright 2016 Chen RuiWei - Licensed to the public under the Apache License 2.0. --%> - -<% include("cbi/map") %> - diff --git a/luci-app-webrestriction/luasrc/view/webrestriction/webrestriction.htm b/luci-app-webrestriction/luasrc/view/webrestriction/webrestriction.htm deleted file mode 100644 index 03702cf7..00000000 --- a/luci-app-webrestriction/luasrc/view/webrestriction/webrestriction.htm +++ /dev/null @@ -1,3 +0,0 @@ -<%+cbi/valueheader%> -<%=pcdata(self:cfgvalue(section) or self.default or "")%> -<%+cbi/valuefooter%> diff --git a/luci-app-webrestriction/po/zh-cn b/luci-app-webrestriction/po/zh-cn deleted file mode 120000 index 8d69574d..00000000 --- a/luci-app-webrestriction/po/zh-cn +++ /dev/null @@ -1 +0,0 @@ -zh_Hans \ No newline at end of file diff --git a/luci-app-webrestriction/po/zh_Hans/webrestriction.po b/luci-app-webrestriction/po/zh_Hans/webrestriction.po deleted file mode 100644 index a883cf73..00000000 --- a/luci-app-webrestriction/po/zh_Hans/webrestriction.po +++ /dev/null @@ -1,2 +0,0 @@ -msgid "Control" -msgstr "管控" diff --git a/luci-app-webrestriction/root/etc/config/webrestriction b/luci-app-webrestriction/root/etc/config/webrestriction deleted file mode 100644 index 50459394..00000000 --- a/luci-app-webrestriction/root/etc/config/webrestriction +++ /dev/null @@ -1,5 +0,0 @@ - -config basic - option enable '0' - option limit_type 'blacklist' - diff --git a/luci-app-webrestriction/root/etc/init.d/webrestriction b/luci-app-webrestriction/root/etc/init.d/webrestriction deleted file mode 100755 index ab1d28cd..00000000 --- a/luci-app-webrestriction/root/etc/init.d/webrestriction +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# Copyright (C) 2015 OpenWrt-dist -# Copyright (C) 2016 fw867 -# -# This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -START=99 - -CONFIG=webrestriction -limit_type=$(uci -q get webrestriction.@basic[0].limit_type) - -uci_get_by_type() { - local index=0 - if [ -n $4 ]; then - index=$4 - fi - local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null) - echo ${ret:=$3} -} - -is_true() { - case $1 in - 1|on|true|yes|enabled) echo 0;; - *) echo 1;; - esac -} - -load_config() { - ENABLED=$(uci_get_by_type basic enable) - return $(is_true $ENABLED) -} - - -add_rule(){ - action=$1 - for i in $(seq 0 100) - do - enable=$(uci_get_by_type macbind enable '' $i) - macaddr=$(uci_get_by_type macbind macaddr '' $i) - if [ -z $enable ] || [ -z $macaddr ]; then - break - fi - if [ "$enable" == "1" ]; then - iptables -t filter -A WEB_RESTRICTION -m mac --mac-source $macaddr -j $action - [ "$limit_type" == "blacklist" ] && iptables -t nat -A WEB_RESTRICTION -m mac --mac-source $macaddr -j RETURN - #unset "$macaddr" - fi - done -} - -start(){ - - ! load_config && exit 0 - [ "`iptables -L FORWARD|grep -c WEB_RESTRICTION`" -gt 0 ] && exit 0; - iptables -P FORWARD DROP - iptables -t filter -N WEB_RESTRICTION - if [ "$limit_type" == "blacklist" ]; then - iptables -t nat -N WEB_RESTRICTION - add_rule DROP - else - add_rule ACCEPT - iptables -t filter -A WEB_RESTRICTION -j DROP - fi - - #获取FORWARD ACCEPT规则行号 - FA_INDEX=`iptables -t filter -L FORWARD|tail -n +3|sed -n -e '/^ACCEPT/='` - if [ -n "$FA_INDEX" ]; then - let FA_INDEX+=1 - fi - #确保添加到FORWARD ACCEPT规则之后 - iptables -t filter -I FORWARD $FA_INDEX -m comment --comment "Rule For Control" -j WEB_RESTRICTION - [ "$limit_type" == "blacklist" ] && iptables -t nat -I PREROUTING 1 -m comment --comment "Rule For Control" -j WEB_RESTRICTION -} -stop(){ - [ "`iptables -t filter -L | grep -c WEB_RESTRICTION`" -gt 0 ] && { - iptables -t filter -D FORWARD -m comment --comment "Rule For Control" -j WEB_RESTRICTION - iptables -t nat -D PREROUTING -m comment --comment "Rule For Control" -j WEB_RESTRICTION - iptables -t filter -F WEB_RESTRICTION - iptables -t filter -X WEB_RESTRICTION - iptables -t nat -F WEB_RESTRICTION - iptables -t nat -X WEB_RESTRICTION - } -} \ No newline at end of file diff --git a/luci-app-webrestriction/root/etc/uci-defaults/luci-app-control-webrestriction b/luci-app-webrestriction/root/etc/uci-defaults/luci-app-control-webrestriction deleted file mode 100644 index 0e2cce83..00000000 --- a/luci-app-webrestriction/root/etc/uci-defaults/luci-app-control-webrestriction +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -[ ! -f "/usr/share/ucitrack/luci-app-webrestriction.json" ] && { - cat > /usr/share/ucitrack/luci-app-webrestriction.json << EEOF -{ - "config": "webrestriction", - "init": "webrestriction" -} -EEOF -} - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@webrestriction[-1] - add ucitrack webrestriction - set ucitrack.@webrestriction[-1].init=webrestriction - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/luci-app-webrestriction/root/usr/share/rpcd/acl.d/luci-app-webrestriction.json b/luci-app-webrestriction/root/usr/share/rpcd/acl.d/luci-app-webrestriction.json deleted file mode 100644 index d14c51ff..00000000 --- a/luci-app-webrestriction/root/usr/share/rpcd/acl.d/luci-app-webrestriction.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-webrestriction": { - "description": "Grant UCI access for luci-app-webrestriction", - "read": { - "uci": [ "webrestriction" ] - }, - "write": { - "uci": [ "webrestriction" ] - } - } -} diff --git a/luci-app-webrestriction/root/usr/share/ucitrack/luci-app-webrestriction.json b/luci-app-webrestriction/root/usr/share/ucitrack/luci-app-webrestriction.json deleted file mode 100644 index 7a1b3845..00000000 --- a/luci-app-webrestriction/root/usr/share/ucitrack/luci-app-webrestriction.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "config": "webrestriction", - "init": "webrestriction" -} diff --git a/luci-app-yggdrasil/Makefile b/luci-app-yggdrasil/Makefile deleted file mode 100644 index e69de29b..00000000 diff --git a/luci-lib-fs/Makefile b/luci-lib-fs/Makefile index 156c709f..edce8238 100644 --- a/luci-lib-fs/Makefile +++ b/luci-lib-fs/Makefile @@ -9,27 +9,41 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-lib-fs PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk define Package/luci-lib-fs + SUBMENU:=Lua SECTION:=lang CATEGORY:=Languages - SUBMENU:=Lua TITLE:=luci-lib-fs - URL:=https://github.com/lbthomsen/openwrt-luci - DEPENDS:=+luci +luci-lib-nixio PKGARCH:=all + URL:=https://github.com/lbthomsen/openwrt-luci + DEPENDS:=+luci-lib-nixio +endef + +define Package/luci-lib-fs/description + luci-lib-fs +endef + +define Build/Configure endef define Build/Compile - true endef +define Build/Install +endef + + define Package/luci-lib-fs/install $(INSTALL_DIR) $(1)/usr/lib/lua/luci - $(CP) ./files/fs.lua $(1)/usr/lib/lua/luci/fs.lua + $(CP) ./files/*.lua $(1)/usr/lib/lua/luci + endef $(eval $(call BuildPackage,luci-lib-fs))