Julkaistu lähde
Lataa lähde ZIP
CH-J Server Manager
Selaile hakemistoja ja tiedostoja tietyn sovelluksen julkaisua varten.
CH-J / Server Manager
193 tiedostot
core-20261011T184039Z-4148710795d0
Lisätty: Kirjaamaton päivä · Rakennettu:
1
"use strict";3
const fs = require("node:fs");4
const path = require("node:path");6
function assertFile(filePath, pattern, minimumSize = 1) {7
const stat = fs.statSync(filePath, { throwIfNoEntry: false });8
if (!stat?.isFile() || stat.size < minimumSize) throw new Error(`Required license file is missing or incomplete: ${filePath}`);9
if (pattern && !pattern.test(fs.readFileSync(filePath, "utf8"))) throw new Error(`Unexpected license content: ${filePath}`);10
}12
module.exports = async function afterPack(context) {13
const resources = context.electronPlatformName === "darwin"14
? path.join(context.appOutDir, `${context.packager.appInfo.productFilename}.app`, "Contents", "Resources")15
: path.join(context.appOutDir, "resources");16
const { validateRuntime } = require("../src/main/diagnostics/httpRuntime");17
const runtime = validateRuntime({ resourcesPath: resources, platform: context.electronPlatformName, arch: require("builder-util").Arch[context.arch] });18
const version = require("node:child_process").execFileSync(runtime.executable, ["--disable", "--version"], { encoding: "utf8" });19
if (!/Features:.*HTTP2/.test(version) || !/Features:.*HTTP3/.test(version)) throw new Error("Packaged HTTP runtime lacks HTTP/2 or HTTP/3");20
const licenses = path.join(resources, "licenses");21
assertFile(path.join(licenses, "APPLICATION_LICENSE.txt"), /CH-J\s+Proprietary Software License[\s\S]*Version 1\.14/, 10000);22
if (!fs.readFileSync(path.join(licenses, "APPLICATION_LICENSE.txt")).equals(fs.readFileSync(path.join(__dirname, "..", "LICENSE")))) {23
throw new Error("Packaged application license differs from the release license.");24
}25
for (const name of ["README.md", "license-acceptance.md", "provozni-bezpecnost-a-zalohovani.md", "betriebssicherheit-und-datensicherung.md", "operational-safety-and-backup-guidance.md"]) {26
assertFile(path.join(resources, "docs", name), null, 100);27
}28
assertFile(path.join(licenses, "NOTICE.txt"), /Copyright 2026 Josef Chudy/);29
assertFile(path.join(licenses, "THIRD_PARTY_NOTICES.txt"), /isarray@1\.0\.0/);30
assertFile(path.join(licenses, "THIRD_PARTY_LICENSES.zip"), null, 1000000);31
assertFile(path.join(licenses, "ELECTRON_LICENSE.txt"), /Copyright \(c\) Electron contributors/i);32
assertFile(path.join(licenses, "CHROMIUM_LICENSES.html"), /Chromium/, 1000000);33
assertFile(34
path.join(resources, "signing", "ch-j-signing-public.asc"),35
/-----BEGIN PGP PUBLIC KEY BLOCK-----/,36
100037
);38
};SHA-256
035138e59417d3f21948e8319d7bcddada7de739ba321ae16ccf021424c4dd33CH-J Proprietary Software License 1.14 · Lähde ilmoitetaan CH-J Proprietary Software License 1.14-koodilla. Sen saatavuus ei muuta lisenssiehtoja eikä myönnä lisäoikeuksia.
Arkisto SHA-256
5a8ea02d06a5643cf2330fe9f54b8767a06c1c59d36527705e536fa9dbca7614