Skip to content

Commit

Permalink
Sync upstream up to 20250102
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub Actions <[email protected]>
  • Loading branch information
actions-user committed Jan 1, 2025
1 parent 5c399e5 commit 65c5685
Show file tree
Hide file tree
Showing 83 changed files with 22,538 additions and 201 deletions.
13 changes: 7 additions & 6 deletions luci-app-vlmcsd/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#
# Copyright (C) 2008-2014 The LuCI Team <[email protected]>
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#

include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI support for KMS
PKG_NAME:=luci-app-vlmcsd
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

LUCI_TITLE:=LuCI support for vlmcsd
LUCI_DEPENDS:=+vlmcsd
LUCI_PKGARCH:=all

PKG_NAME:=luci-app-vlmcsd
PKG_VERSION:=1.0
PKG_RELEASE:=7
PKG_MAINTAINER:=sbwml <[email protected]>

include $(TOPDIR)/feeds/luci/luci.mk

Expand Down
41 changes: 41 additions & 0 deletions luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';
'require form';
'require fs';
'require ui';
'require view';

return view.extend({
render: function () {
var m, s, o;

m = new form.Map("vlmcsd", _("Config File"));

s = m.section(form.TypedSection);
s.anonymous = true;
s.sortable = true;

o = s.option(form.TextValue, '_vlmcsd', null, _('This file is /etc/vlmcsd/vlmcsd.ini.'));
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/vlmcsd/vlmcsd.ini').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/vlmcsd/vlmcsd.ini', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
});
};

return m.render();
},

handleSaveApply: function (ev) {
onclick = L.bind(this.handleSave, this, ev);
return fs.exec('/etc/init.d/vlmcsd', ['restart']);
},
handleReset: null
});
75 changes: 75 additions & 0 deletions luci-app-vlmcsd/htdocs/luci-static/resources/view/vlmcsd/vlmcsd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'use strict';
'require form';
'require poll';
'require rpc';
'require uci';
'require view';

var callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});

function getServiceStatus() {
return L.resolveDefault(callServiceList('vlmcsd'), {}).then(function (res) {
var isRunning = false;
try {
isRunning = res['vlmcsd']['instances']['vlmcsd']['running'];
} catch (e) { }
return isRunning;
});
}

function renderStatus(isRunning) {
var spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
var renderHTML;
if (isRunning) {
renderHTML = spanTemp.format('green', 'VLMCSD', _('RUNNING'));
} else {
renderHTML = spanTemp.format('red', 'VLMCSD', _('NOT RUNNING'));
}

return renderHTML;
}

return view.extend({
render: function() {
var m, s, o;

m = new form.Map('vlmcsd', _('KMS Server'),
_('A KMS Server Emulator to active your Windows or Office.'));

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', 'vlmcsd');

o = s.option(form.Flag, 'enabled', _('Enabled'));
o.default = o.disabled;
o.rmempty = false;

o = s.option(form.Flag, 'autoactivate', _('Auto activate'));
o.default = o.disabled;
o.rmempty = false;

o = s.option(form.Flag, 'firewall', _('Open firewall port'));
o.default = o.disabled;
o.rmempty = false;

return m.render();
}
});
19 changes: 0 additions & 19 deletions luci-app-vlmcsd/luasrc/controller/vlmcsd.lua

This file was deleted.

17 changes: 0 additions & 17 deletions luci-app-vlmcsd/luasrc/model/cbi/vlmcsd/basic.lua

This file was deleted.

22 changes: 0 additions & 22 deletions luci-app-vlmcsd/luasrc/model/cbi/vlmcsd/config.lua

This file was deleted.

22 changes: 0 additions & 22 deletions luci-app-vlmcsd/luasrc/view/vlmcsd/vlmcsd_status.htm

This file was deleted.

33 changes: 23 additions & 10 deletions luci-app-vlmcsd/po/zh_Hans/vlmcsd.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
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"

msgid "KMS Server"
msgstr "KMS 服务器"

msgid "Basic Setting"
msgstr "基本设置"

msgid "Config File"
msgstr "配置文件"

msgid "A KMS Server Emulator to active your Windows or Office"
msgstr "KMS服务器可用于激活Windows或Office"
msgid "A KMS Server Emulator to active your Windows or Office."
msgstr "KMS服务器可用于激活 Windows 或 Office。"

msgid "RUNNING"
msgstr "运行中"
Expand All @@ -17,13 +21,22 @@ msgid "NOT RUNNING"
msgstr "未运行"

msgid "Collecting data..."
msgstr "收集数据..."
msgstr "获取数据中..."

msgid "Enable"
msgid "Basic Setting"
msgstr "基本设置"

msgid "Config File"
msgstr "配置文件"

msgid "Enabled"
msgstr "启用"

msgid "Auto activate"
msgstr "自动激活局域网客户端"

msgid "Open firewall port"
msgstr "打开防火墙端口"

msgid "This file is /etc/vlmcsd/vlmcsd.ini."
msgstr "这个文件在 /etc/vlmcsd/vlmcsd.ini 下,可以增加新的产品主密钥。"
12 changes: 1 addition & 11 deletions luci-app-vlmcsd/root/etc/uci-defaults/luci-vlmcsd
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,5 @@ uci -q batch <<-EOF >/dev/null
EOF
}

uci delete firewall.vlmcsd
uci add firewall rule
uci rename firewall.@rule[-1]="vlmcsd"
uci set firewall.@rule[-1].name="vlmcsd"
uci set firewall.@rule[-1].target="ACCEPT"
uci set firewall.@rule[-1].src="wan"
uci set firewall.@rule[-1].proto="tcp"
uci set firewall.@rule[-1].dest_port="1688"
uci commit firewall

rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-indexcache*
exit 0
29 changes: 29 additions & 0 deletions luci-app-vlmcsd/root/usr/share/luci/menu.d/luci-app-vlmcsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"admin/services/vlmcsd": {
"title": "KMS Server",
"order": 60,
"action": {
"type": "firstchild"
},
"depends": {
"acl": [ "luci-app-vlmcsd" ],
"uci": { "vlmcsd": true }
}
},
"admin/services/vlmcsd/vlmcsd": {
"title": "Basic Setting",
"order": 10,
"action": {
"type": "view",
"path": "vlmcsd/vlmcsd"
}
},
"admin/services/vlmcsd/config": {
"title": "Config File",
"order": 20,
"action": {
"type": "view",
"path": "vlmcsd/config"
}
}
}
10 changes: 10 additions & 0 deletions luci-app-vlmcsd/root/usr/share/rpcd/acl.d/luci-app-vlmcsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
"luci-app-vlmcsd": {
"description": "Grant UCI access for luci-app-vlmcsd",
"read": {
"file": {
"/etc/init.d/vlmcsd": [ "exec" ],
"/etc/vlmcsd/vlmcsd.ini": [ "read" ]
},
"ubus": {
"service": [ "list" ]
},
"uci": [ "vlmcsd" ]
},
"write": {
"file": {
"/etc/vlmcsd/vlmcsd.ini": [ "write" ]
},
"uci": [ "vlmcsd" ]
}
}
Expand Down
26 changes: 8 additions & 18 deletions vlmcsd/Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=vlmcsd
PKG_VERSION:=svn1113
PKG_RELEASE:=4

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/Wind4/vlmcsd/tar.gz/$(PKG_VERSION)?
PKG_HASH:=62f55c48f5de1249c2348ab6b96dabbe7e38899230954b0c8774efb01d9c42cc

PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=fuyumi <[email protected]>
PKG_VERSION:=2023.7.28
PKG_RELEASE:=1

PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=sbwml <[email protected]>

include $(INCLUDE_DIR)/package.mk

define Package/vlmcsd
SECTION:=net
CATEGORY:=Network
TITLE:=vlmcsd for OpenWRT
URL:=http://forums.mydigitallife.info/threads/50234
TITLE:=KMS Emulator in C
URL:=https://github.com/Wind4/vlmcsd
DEPENDS:=+libpthread
endef

define Package/vlmcsd/description
vlmcsd is a KMS Emulator in C.
vlmcsd is an open-source KMS (Key Management Service) server emulator that allows
for the activation of Microsoft products such as Windows and Office within a local network,
without needing to connect to Microsoft's official KMS servers.
endef

TARGET_CC:= $(filter-out ccache,$(TARGET_CC))

MAKE_FLAGS += \
-C $(PKG_BUILD_DIR)

define Package/vlmcsd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcsd $(1)/usr/bin/vlmcsd
Expand Down
Loading

0 comments on commit 65c5685

Please sign in to comment.