Upload via GUI (39 Dateien)

This commit is contained in:
Git Manager GUI
2026-08-02 17:01:18 +02:00
parent a803f297ea
commit eff6403dd5
26 changed files with 3536 additions and 134 deletions

View File

@@ -0,0 +1,54 @@
'use strict';
/*
* pm2-Konfiguration für die CurseForge-Weiterleitung.
*
* pm2 start ecosystem.config.js
* pm2 save
*
* pm2 liest .env-Dateien nicht von selbst, deshalb tut es diese Datei.
* So bleibt der Schlüssel in der .env und steht nicht in der Konfiguration,
* die man eher mal weitergibt oder eincheckt.
*/
const fs = require('fs');
const path = require('path');
// kleiner .env-Leser Kommentare, Anführungszeichen und Werte mit "=" inklusive
function leseEnv(datei) {
const werte = {};
if (!fs.existsSync(datei)) return werte;
for (const zeile of fs.readFileSync(datei, 'utf8').split(/\r?\n/)) {
const t = zeile.trim();
if (!t || t.startsWith('#')) continue;
const i = t.indexOf('=');
if (i < 1) continue;
const name = t.slice(0, i).trim();
let wert = t.slice(i + 1).trim();
const q = wert[0];
if ((q === '"' || q === "'") && wert.endsWith(q) && wert.length > 1) wert = wert.slice(1, -1);
werte[name] = wert;
}
return werte;
}
module.exports = {
apps: [{
name: 'aeromc-cf-proxy',
script: 'index.js',
cwd: __dirname,
// Fork-Betrieb mit genau einem Prozess. Im Cluster-Betrieb hätte jeder
// Arbeiter seine eigene Zählung die Ratenbegrenzung wäre dann bei
// vier Prozessen viermal so hoch wie eingestellt.
exec_mode: 'fork',
instances: 1,
autorestart: true,
max_restarts: 10,
restart_delay: 3000,
max_memory_restart: '256M',
env: leseEnv(path.join(__dirname, '.env')),
}],
};