CH-J Server Managerspráva serverů přes SSH
Menu
Vydané zdroje

CH-J Server Manager

Procházejte adresáře a soubory konkrétního vydání aplikace.

Stáhnout zdroje ZIP
CH-J Proprietary Software License 1.14

Zdroje jsou zveřejněny pod CH-J Proprietary Software License 1.14. Jejich dostupnost nemění licenční podmínky ani neposkytuje další oprávnění.

4,8 KB · 72 řádkůStáhnout soubor
1"use strict";
3const test = require("node:test");
4const assert = require("node:assert/strict");
5const fs = require("node:fs");
6const path = require("node:path");
7const AdmZip = require("adm-zip");
9const root = path.join(__dirname, "..");
11test("application includes the complete project and dependency license texts", () => {
12 const license = fs.readFileSync(path.join(root, "LICENSE"), "utf8");
13 const notice = fs.readFileSync(path.join(root, "NOTICE"), "utf8");
14 const thirdParty = fs.readFileSync(path.join(root, "THIRD_PARTY_NOTICES.txt"), "utf8");
15 const packageJson = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
16 assert.match(license, /CH-J\s+Proprietary Software License[\s\S]*Version 1\.14/);
17 assert.match(license, /End of License\./);
18 assert.equal(packageJson.license, "SEE LICENSE IN LICENSE");
19 assert.equal(packageJson.build.nsis.license, "build/license.rtf");
20 assert.equal(packageJson.build.dmg.license, "build/installation.rtf");
21 const installerLicense = fs.readFileSync(path.join(root, "build", "license.rtf"), "ascii");
22 assert.ok(installerLicense.startsWith("{\\rtf1"));
23 assert.ok(installerLicense.includes("Chud\\u253?"));
24 assert.match(installerLicense, /End of License\./);
25 const installation = fs.readFileSync(path.join(root, "build", "installation.rtf"), "ascii");
26 assert.ok(installation.indexOf("provozn") < installation.indexOf("APPLICATION LICENSE"));
27 assert.ok(installation.indexOf("Betriebssicherheit") < installation.indexOf("APPLICATION LICENSE"));
28 assert.ok(installation.indexOf("Operational Safety") < installation.indexOf("APPLICATION LICENSE"));
29 assert.equal(packageJson.build.nsis.include, "build/installer.nsh");
30 assert.equal(packageJson.build.nsis.displayLanguageSelector, true);
31 for (const language of ["cs", "de", "en"]) {
32 const bytes = fs.readFileSync(path.join(root, "build", `guidance-${language}.txt`));
33 assert.deepEqual([...bytes.subarray(0, 2)], [255, 254]);
34 const source = fs.readFileSync(path.join(root, "docs", require("../src/main/legal/guidanceDocuments").GUIDANCE_FILES[language]), "utf8");
35 assert.equal(bytes.toString("utf16le").slice(1).replace(/\r\n/g, "\n"), source);
36 }
37 assert.deepEqual(fs.readFileSync(path.join(root, "build", "license.txt")), fs.readFileSync(path.join(root, "LICENSE")));
38 assert.match(notice, /CH-J Proprietary Software License/);
39 assert.ok(license.length > 10000);
40 assert.match(notice, /Copyright 2026 Josef Chudy/);
41 assert.match(thirdParty, /isarray@1\.0\.0/);
42 for (const filename of ["APPLICATION_LICENSE.txt", "NOTICE.txt", "THIRD_PARTY_NOTICES.txt", "THIRD_PARTY_LICENSES.zip", "ELECTRON_LICENSE.txt", "CHROMIUM_LICENSES.html"]) {
43 assert.ok(packageJson.build.extraResources.some((entry) => entry.to === `licenses/${filename}`), filename);
44 }
45 assert.equal(packageJson.build.afterPack, "scripts/afterPack.js");
46 const bundle = new AdmZip(path.join(root, "THIRD_PARTY_LICENSES.zip"));
47 assert.match(bundle.readAsText("README.txt"), /CH-J Proprietary Software License, version 1\.14/);
48 for (const filename of ["THIRD_PARTY_NOTICES.txt", "ELECTRON_LICENSE.txt", "CHROMIUM_LICENSES.html", "MONACO_LICENSE.txt", "MONACO_THIRD_PARTY_NOTICES.txt", "FB_TIGER_HASH_LICENSE.txt", "GOOGLE_CITYHASH_LICENSE.txt", "SHA512SUMS.txt"]) {
49 assert.ok(bundle.getEntry(filename), filename);
50 }
51 for (const dependency of ["@noble/hashes@2.3.0", "farmhashjs@1.0.1", "hash-wasm@4.12.0", "highwayhasher@0.4.4", "fb-tiger-hash@1.0.0", "google-cityhash"]) {
52 assert.match(thirdParty, new RegExp(dependency.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")));
53 }
54});
56test("license documents are accessible from the sandboxed renderer through narrow IPC", () => {
57 const preload = fs.readFileSync(path.join(root, "src", "preload", "corePreload.js"), "utf8");
58 const ipc = fs.readFileSync(path.join(root, "src", "main", "ipc", "registerCoreIpc.js"), "utf8");
59 const html = fs.readFileSync(path.join(root, "src", "renderer", "index.html"), "utf8");
60 assert.match(preload, /openLegalDocument/);
61 assert.match(ipc, /handle\("legal:open"/);
62 assert.match(html, /data-legal-document="thirdParty"/);
63 assert.match(html, /data-legal-document="thirdPartyBundle"/);
64 for (const key of ["documentation", "safetyCzech", "safetyEnglish", "safetyGerman"]) assert.ok(html.includes(`data-legal-document="${key}"`));
65 assert.ok(JSON.parse(fs.readFileSync(path.join(root, "package.json"))).build.extraResources.some(entry => entry.from === "docs" && entry.to === "docs"));
66 for (const name of ["provozni-bezpecnost-a-zalohovani.md", "betriebssicherheit-und-datensicherung.md", "operational-safety-and-backup-guidance.md"]) {
67 const bundled = fs.readFileSync(path.join(root, "docs", name));
68 assert.ok(bundled.length > 1000);
69 const canonical = path.join(root, "..", "docs", name);
70 if (fs.existsSync(canonical)) assert.deepEqual(bundled, fs.readFileSync(canonical));
71 }
72});

SHA-256: a06c8edf230060d27e7e83c3240cb729f4bdb3eead73983824b786e2b93d50ab

SHA-256 archivu: 5ac91caf4fa32a6fdb114f2430deed486fbe7489d5eea343d1f034169fafb5e0