1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-20 19:11:30 +08:00

update 2025-02-13 16:26:12

This commit is contained in:
kenzok8
2025-02-13 16:26:12 +08:00
parent 6678b882c4
commit 72fb874fed
16 changed files with 258 additions and 177 deletions

View File

@ -777,7 +777,9 @@ return view.extend({
so.value('routing_gfw', _('Routing GFW'));
so = ss.taboption('routing_control', form.Flag, 'routing_domain', _('Handle domain'),
_('Routing mode will be handle domain.'));
_('Routing mode will be handle domain.') + '</br>' +
_('Please ensure that the DNS query of the domains to be processed in the DNS policy</br>' +
'are send via DIRECT/Proxy Node in the same semantics as Routing mode.'));
so.default = so.disabled;
if (!features.hm_has_dnsmasq_full) {
so.description = _('To enable, you need to install <code>dnsmasq-full</code>.');

View File

@ -1549,6 +1549,13 @@ msgstr ""
msgid "Plain text"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:781
msgid ""
"Please ensure that the DNS query of the domains to be processed in the DNS "
"policy</br>are send via DIRECT/Proxy Node in the same semantics as Routing "
"mode."
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/ruleset.js:124
msgid ""
"Please refer to <a href=\"%s\" target=\"_blank\">%s</a> for link format "

View File

@ -1571,6 +1571,15 @@ msgstr "性能可能会略有下降,建议仅在需要时开启。"
msgid "Plain text"
msgstr "纯文本"
#: htdocs/luci-static/resources/view/fchomo/global.js:781
msgid ""
"Please ensure that the DNS query of the domains to be processed in the DNS "
"policy</br>are send via DIRECT/Proxy Node in the same semantics as Routing "
"mode."
msgstr ""
"请在 DNS 策略 中确保要处理的域名的 DNS 查询</br>以与路由模式相同的语义通过 "
"直连/代理节点 发送。"
#: htdocs/luci-static/resources/view/fchomo/ruleset.js:124
msgid ""
"Please refer to <a href=\"%s\" target=\"_blank\">%s</a> for link format "

View File

@ -1571,6 +1571,15 @@ msgstr "效能可能會略有下降,建議僅在需要時開啟。"
msgid "Plain text"
msgstr "純文本"
#: htdocs/luci-static/resources/view/fchomo/global.js:781
msgid ""
"Please ensure that the DNS query of the domains to be processed in the DNS "
"policy</br>are send via DIRECT/Proxy Node in the same semantics as Routing "
"mode."
msgstr ""
"請在 DNS 策略 中確保要處理的網域的 DNS 查詢</br>以與路由模式相同的語意透過 "
"直連/代理節點 傳送。"
#: htdocs/luci-static/resources/view/fchomo/ruleset.js:124
msgid ""
"Please refer to <a href=\"%s\" target=\"_blank\">%s</a> for link format "

View File

@ -6,13 +6,9 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI page for KMS
LUCI_TITLE:=LuCI support for Vlmcsd KMS Server
LUCI_DEPENDS:=+vlmcsd
PKG_VERSION:=1.0
PKG_RELEASE:=5
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,65 @@
'use strict';
'require form';
'require poll';
'require rpc';
'require view';
'require fs';
const callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});
function getServiceStatus() {
return L.resolveDefault(callServiceList('vlmcsd'), {}).then(res =>
res?.['vlmcsd']?.['instances']?.['vlmcsd']?.['running']
);
}
function renderStatus(status) {
const color = status ? 'green' : 'red';
const service = _('Vlmcsd KMS Server');
const running = status ? _('RUNNING') : _('NOT RUNNING');
return `<em><span style="color:${color}"><strong>${service} ${running}</strong></span></em>`;
}
return view.extend({
render: function () {
const m = new form.Map('vlmcsd', _('Vlmcsd KMS Server'));
let s = m.section(form.TypedSection);
s.anonymous = true;
s.render = function () {
poll.add(function () {
return L.resolveDefault(getServiceStatus()).then(function (res) {
const stats = renderStatus(res);
const view = document.getElementById('vlmcsd_status');
view.innerHTML = stats;
});
});
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'vlmcsd_status' }, _('Collecting data…'))
]);
};
s = m.section(form.NamedSection, 'config', 'vlmcsd');
s.tab('general', _('General Settings'));
s.tab('config_file', _('Configuration File'), _('Edit the content of the /etc/vlmcsd.ini file.'));
s.taboption('general', form.Flag, 'enabled', _('Enable Vlmcsd KMS Server'));
s.taboption('general', form.Flag, 'auto_activate', _('Allow automatic activation'));
s.taboption('general', form.Flag, 'internet_access', _('Allow connection from Internet'));
const o = s.taboption('config_file', form.TextValue, '_tmpl',
null,
_("This is the content of the file '/etc/vlmcsd.ini', you can edit it here, usually no modification is needed."));
o.rows = 20;
o.cfgvalue = () => fs.trimmed('/etc/vlmcsd.ini');
o.write = (_, value) => fs.write('/etc/vlmcsd.ini', value.trim().replace(/\r\n/g, '\n') + '\n');
return m.render();
}
});

View File

@ -1,20 +0,0 @@
module("luci.controller.vlmcsd", package.seeall)
function index()
if not nixio.fs.access("/etc/config/vlmcsd") then
return
end
local page
page = entry({"admin", "services", "vlmcsd"}, cbi("vlmcsd"), _("KMS Server"), 100)
page.i18n = "vlmcsd"
page.dependent = true
page.acl_depends = { "luci-app-vlmcsd" }
entry({"admin","services","vlmcsd","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep vlmcsd >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -1,35 +0,0 @@
m = Map("vlmcsd")
m.title = translate("vlmcsd config")
m.description = translate("A KMS Server Emulator to active your Windows or Office")
m:section(SimpleSection).template = "vlmcsd/vlmcsd_status"
s = m:section(TypedSection, "vlmcsd")
s.addremove = false
s.anonymous = true
s:tab("basic", translate("Basic Setting"))
enable = s:taboption("basic",Flag, "enabled", translate("Enable"))
enable.rmempty = false
autoactivate = s:taboption("basic", Flag, "autoactivate", translate("Auto activate"))
autoactivate.rmempty = false
s:tab("config", translate("Config File"))
config = s:taboption("config", Value, "config", translate("configfile"), translate("This file is /etc/vlmcsd.ini."), "")
config.template = "cbi/tvalue"
config.rows = 13
config.wrap = "off"
function config.cfgvalue(self, section)
return nixio.fs.readfile("/etc/vlmcsd.ini")
end
function config.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("/etc/vlmcsd.ini", value)
end
return m

View File

@ -1,22 +0,0 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[vlmcsd]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('vlmcsd_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>KMS <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>KMS <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="vlmcsd_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,54 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:53
msgid "Allow automatic activation"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:54
msgid "Allow connection from Internet"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:44
msgid "Collecting data…"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Configuration File"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Edit the content of the /etc/vlmcsd.ini file."
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:52
msgid "Enable Vlmcsd KMS Server"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:49
msgid "General Settings"
msgstr ""
#: applications/luci-app-vlmcsd/root/usr/share/rpcd/acl.d/luci-app-vlmcsd.json:3
msgid "Grant UCI access for luci-app-vlmcsd"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "NOT RUNNING"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "RUNNING"
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:58
msgid ""
"This is the content of the file '/etc/vlmcsd.ini', you can edit it here, "
"usually no modification is needed."
msgstr ""
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:23
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:30
#: applications/luci-app-vlmcsd/root/usr/share/luci/menu.d/luci-app-vlmcsd.json:3
msgid "Vlmcsd KMS Server"
msgstr ""

View File

@ -1,40 +1,61 @@
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-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
msgid "vlmcsd config"
msgstr "KMS 服务器设置"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:53
msgid "Allow automatic activation"
msgstr "允许自动激活客户端"
msgid "KMS Server"
msgstr "KMS 服务器"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:54
msgid "Allow connection from Internet"
msgstr "允许来自互联网的连接"
msgid "Basic Setting"
msgstr "基本设置"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:44
msgid "Collecting data…"
msgstr "正在收集数据中..."
msgid "Config File"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Configuration File"
msgstr "配置文件"
msgid "A KMS Server Emulator to active your Windows or Office"
msgstr "KMS服务器可用于激活Windows或Office"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Edit the content of the /etc/vlmcsd.ini file."
msgstr "编辑 /etc/vlmcsd.ini 文件的内容。"
msgid "<b><font color=green>Vlmcsd is running.</font></b>"
msgstr "<b><font color=green>KMS 服务器运行中</font></b>"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:52
msgid "Enable Vlmcsd KMS Server"
msgstr "启用 Vlmcsd KMS 服务器"
msgid "<b><font color=red>Vlmcsd is not running.</font></b>"
msgstr "<b><font color=red>KMS 服务器未运行</font></b>"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:49
msgid "General Settings"
msgstr "常规设置"
msgid "Enable"
msgstr "启用"
#: applications/luci-app-vlmcsd/root/usr/share/rpcd/acl.d/luci-app-vlmcsd.json:3
msgid "Grant UCI access for luci-app-vlmcsd"
msgstr "授予 luci-app-vlmcsd 访问 UCI 的权限"
msgid "Auto activate"
msgstr "自动激活局域网客户端"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "NOT RUNNING"
msgstr "未运行"
msgid "configfile"
msgstr "配置文件"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "RUNNING"
msgstr "运行中"
msgid "This file is /etc/vlmcsd.ini."
msgstr "这个文件在 /etc/vlmcsd.ini 下,可以增加新的产品主密钥。"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:58
msgid ""
"This is the content of the file '/etc/vlmcsd.ini', you can edit it here, "
"usually no modification is needed."
msgstr "这是 /etc/vlmcsd.ini 文件的内容,您可以在此进行编辑,通常无需修改。"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:23
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:30
#: applications/luci-app-vlmcsd/root/usr/share/luci/menu.d/luci-app-vlmcsd.json:3
msgid "Vlmcsd KMS Server"
msgstr "Vlmcsd KMS 服务器"

View File

@ -1,40 +1,61 @@
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_Hant\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"
msgid "vlmcsd config"
msgstr "KMS 伺服器設定"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:53
msgid "Allow automatic activation"
msgstr "允許自動激活客戶端"
msgid "KMS Server"
msgstr "KMS 伺服器"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:54
msgid "Allow connection from Internet"
msgstr "允許來自網際網路的連接"
msgid "Basic Setting"
msgstr "基礎設定"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:44
msgid "Collecting data…"
msgstr "正在收集資料中..."
msgid "Config File"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Configuration File"
msgstr "設定檔案"
msgid "A KMS Server Emulator to active your Windows or Office"
msgstr "KMS 伺服器可用於啟用 Windows 或 Office"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:50
msgid "Edit the content of the /etc/vlmcsd.ini file."
msgstr "編輯 /etc/vlmcsd.ini 檔案的內容。"
msgid "<b><font color=green>Vlmcsd is running.</font></b>"
msgstr "<b><font color=green>KMS 伺服器正在執行</font></b>"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:52
msgid "Enable Vlmcsd KMS Server"
msgstr "啟用 Vlmcsd KMS 伺服器"
msgid "<b><font color=red>Vlmcsd is not running.</font></b>"
msgstr "<b><font color=red>KMS 伺服器尚未執行</font></b>"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:49
msgid "General Settings"
msgstr "一般設定"
msgid "Enable"
msgstr "啟用"
#: applications/luci-app-vlmcsd/root/usr/share/rpcd/acl.d/luci-app-vlmcsd.json:3
msgid "Grant UCI access for luci-app-vlmcsd"
msgstr "授予 luci-app-vlmcsd 訪問 UCI 的權限"
msgid "Auto activate"
msgstr "自動啟用"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "NOT RUNNING"
msgstr "未運行"
msgid "configfile"
msgstr "設定檔案"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:24
msgid "RUNNING"
msgstr "運行中"
msgid "This file is /etc/vlmcsd.ini."
msgstr "檔案路徑在 /etc/vlmcsd.ini"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:58
msgid ""
"This is the content of the file '/etc/vlmcsd.ini', you can edit it here, "
"usually no modification is needed."
msgstr "這是 /etc/vlmcsd.ini 檔案的內容,您可以在此進行編輯,通常無需修改。"
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:23
#: applications/luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd.js:30
#: applications/luci-app-vlmcsd/root/usr/share/luci/menu.d/luci-app-vlmcsd.json:3
msgid "Vlmcsd KMS Server"
msgstr "Vlmcsd KMS 伺服器"

View File

@ -1,5 +0,0 @@
config vlmcsd 'config'
option autoactivate '1'
option enabled '1'

View File

@ -1,43 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2011-2015 OpenWrt.org
START=90
USE_PROCD=1
start_instance() {
config_get_bool enabled $1 enabled 0
config_get autoactivate $1 autoactivate 1
[ $enabled -eq 0 ] && return 0
HOSTNAME=$(uci get system.@system[0].hostname)
host_name=$(awk -F ',' '/^[ \t]*srv-host=_vlmcs\._tcp/{print $2}' /etc/dnsmasq.conf)
echo $HOSTNAME
echo $host_name
if [ "$HOSTNAME" != "$host_name" ];then
sed -i '/^[ \t]*srv-host=_vlmcs\._tcp/d' /etc/dnsmasq.conf
sed -i '$a\srv-host=_vlmcs\._tcp,'"$HOSTNAME"','"1688"',0,100' /etc/dnsmasq.conf
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
procd_open_instance
procd_set_param command /usr/bin/vlmcsd -D -i /etc/vlmcsd.ini -L 0.0.0.0:1688 -L [::]:1688
procd_append_param command -l /var/log/vlmcsd.log
procd_set_param respawn
procd_set_param file /etc/vlmcsd.ini
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
start_service() {
config_load vlmcsd
config_foreach start_instance vlmcsd
}
service_triggers() {
procd_add_reload_trigger "vlmcsd"
}

View File

@ -0,0 +1,13 @@
{
"admin/services/vlmcsd": {
"title": "Vlmcsd KMS Server",
"action": {
"type": "view",
"path": "vlmcsd"
},
"depends": {
"acl": [ "luci-app-vlmcsd" ],
"uci": { "vlmcsd": true }
}
}
}

View File

@ -2,9 +2,18 @@
"luci-app-vlmcsd": {
"description": "Grant UCI access for luci-app-vlmcsd",
"read": {
"file": {
"/etc/vlmcsd.ini": [ "read" ]
},
"ubus": {
"service": [ "list" ]
},
"uci": [ "vlmcsd" ]
},
"write": {
"file": {
"/etc/vlmcsd.ini": [ "write" ]
},
"uci": [ "vlmcsd" ]
}
}