CH-J Server Managerġestjoni tas-server fuq SSH
Menu
Sors ippubblikat

CH-J Server Manager

direttorji browse u fajls għal rilaxx applikazzjoni speċifika.

Sors ta' tniżżil ZIP
CH-J / Server Manager 196 fajls
core-20261013T133631Z-faa4ab45100e Miżjud: Data mhux irreġistrata · Buillt:
Fajls
httpRuntime.js Miżjud: Data mhux irreġistrata 2.1 KB · 31 linji
Fajl tat-tniżżil
1"use strict";
2const fs = require("node:fs");
3const path = require("node:path");
4const crypto = require("node:crypto");
5const { DiagnosticError } = require("./common");
6function runtimePaths({ resourcesPath = process.resourcesPath && fs.existsSync(path.join(process.resourcesPath, "app.asar")) ? process.resourcesPath : null, platform = process.platform, arch = process.arch } = {}) {
7 const root = resourcesPath ? path.join(resourcesPath, "native-runtime", `${platform}-${arch}`) : path.resolve(__dirname, "../../../build/native-runtime", `${platform}-${arch}`);
8 return { root, executable: path.join(root, platform === "win32" ? "curl.exe" : "curl"), caPath: path.join(root, "ca-bundle.pem"), platform, arch };
9}
10function validateRuntime(options) {
11 const runtime = runtimePaths(options);
12 try {
13 const manifest = JSON.parse(fs.readFileSync(path.join(runtime.root, "manifest.json"), "utf8"));
14 if (manifest.platform !== runtime.platform || manifest.arch !== runtime.arch) throw new Error("architecture");
15 const executableName = path.basename(runtime.executable);
16 for (const name of [executableName, "ca-bundle.pem"]) {
17 const content = fs.readFileSync(path.join(runtime.root, name));
18 if (!/^[a-f0-9]{64}$/.test(manifest.files?.[name]) || crypto.createHash("sha256").update(content).digest("hex") !== manifest.files[name]) throw new Error("checksum");
19 }
20 if (runtime.platform !== "win32") fs.accessSync(runtime.executable, fs.constants.X_OK);
21 return { ...runtime, manifest };
22 } catch (error) { throw new DiagnosticError(error.code === "ENOENT" ? "HTTP_RUNTIME_MISSING" : "HTTP_RUNTIME_INVALID"); }
24function runtimeEnvironment() {
25 // Explicit allowlist: no curl config, proxy, trust override, TLS key logging,
26 // injected dynamic libraries or inherited credentials in this subprocess.
27 const result = { LANG: "C", LC_ALL: "C" };
28 for (const name of ["SystemRoot", "SYSTEMROOT", "WINDIR", "TEMP", "TMP", "TMPDIR"]) if (process.env[name]) result[name] = process.env[name];
29 return result;
31module.exports = { runtimePaths, validateRuntime, runtimeEnvironment };
SHA-25619246642e8b0964b0769044aef2b96b3d88c1a38d792bc54277c262349961b8e

CH-J Proprietary Software License 1.14 · Sors huwa pprovdut taħt iż-CH-J Proprietary Software License 1.14. Id-disponibbiltà tagħha ma tibdilx it-termini tal-liċenzja jew tagħti drittijiet addizzjonali.

Archive SHA-256de757268dbc4f0226549f8b4f41f9b7e585c856ee97fa0d43b17a0e95c281449