Portnummern werden abgeleitet, nicht mehr vergeben
Gemessen: 165 Pruefdateien, 129 verschiedene Nummern -- NEUNZEHN
doppelt, vier davon dreifach. Niemand hatte das gewollt; jede neue
Pruefung wurde von einer vorhandenen abgeschrieben, und die Nummer kam
mit. Meine eigene Notiz sagte "sieben" -- auch eine Bestandsliste
altert.
Der Waechter faengt den Schaden ab, aber er kann nur melden, was schon
passiert ist: Zwei Pruefungen mit derselben Nummer koennen nie
gleichzeitig laufen, und ein liegengebliebener Prozess der einen laesst
die andere abbrechen mit einer Meldung, die wie ein Befund aussieht.
Genau das ist mir am 20.09. zweimal passiert.
Jetzt leitet jede Datei ihre Nummer aus ihrer STELLE IM ALPHABET ab
(eigenerPort in helfer-port.mjs), zwei je Datei. Nicht ueber eine
Pruefsumme: Bei 165 Namen in 4900 Nummern waeren nach dem
Geburtstagsproblem rund DREI Zusammenstoesse zu erwarten -- ein Hash
tauscht eine sichtbare Doppelung gegen eine unsichtbare. Die Stelle im
Alphabet ist eindeutig von der Bauart her.
--- ZWEI FEHLER AUF DEM WEG, BEIDE LEHRREICH -------------------------
1. DER ERSTE VERSUCH WAR GRUEN UND KAPUTT. Ersetzt wurde mit einem
Muster: "([^"]*4231[^"]*)". Das hielt
{ host: "127.0.0.1", port: 4231, path: "/404.html" }
fuer eine Zeichenkette -- ein Muster kann eine oeffnende nicht von
einer schliessenden Anfuehrung unterscheiden. Heraus kam
{ host: "127.0.0.1`, port: ${PORT}, path: `/404.html" }
also GUELTIGER Code ohne port-Feld. `node --check` sagte gruen fuer
alle 164 Dateien. Aufgefallen ist es erst, weil ich vier Vertreter
gegen eine vorher gemessene Grundlinie laufen liess: pruef-schranke
39/0 vorher, 38/1 nachher.
Alles zurueckgenommen und mit einem Zerleger neu gemacht, der weiss,
ob eine Stelle Code, Zeichenkette, Vorlage, Kommentar oder
regulaerer Ausdruck ist. In pruef-ics stand die Nummer in einem
regulaeren Ausdruck -- der wird jetzt gebaut statt hingeschrieben.
2. EIN MODUL, DAS BEIM IMPORTIEREN ARBEITET, IST EINE FALLE. Der
zweite Durchgang importierte den ersten, um seine Mechanik zu
benutzen -- und fuehrte dessen Hauptlauf gleich mit aus. Die
zweiten Nummern wurden dadurch als erste behandelt, zwei Aufrufe
bekamen dieselbe Nummer, und in pruef-content stand `const PORT`
zweimal.
--- WAS DAS DAUERHAFT HAELT -----------------------------------------
pruef-portnummern.mjs (neu, 8 Pruefungen) fragt nicht "welche Nummern
sind doppelt", sondern "wer traegt ueberhaupt noch eine von Hand ein"
und "wer startet einen Server, ohne seine Nummer abzuleiten". Die
zweite Frage hat sofort etwas gefunden, das in KEINER Doppelungsliste
stand: pruef-push-weg belegte 4341 und 4342, rief den Waechter aber
gar nicht auf -- dieselbe Nummer wie pruef-agentur. Eine Liste zeigt
nur, was auf ihr steht.
Mit Gegenprobe: Eine unbekannte Datei bekommt keine geratene Nummer,
sondern einen Abbruch, und eine dritte Nummer je Datei gibt es nicht.
--- NACHGEMESSEN ----------------------------------------------------
Sechzehn Pruefungen gegen ihre vorher gemessene Grundlinie, je eine
Vertreterin jeder umgestellten Bauweise (eine Nummer, zwei Nummern,
Nummer in einer Zeichenkette, in einer Vorlage, in einem regulaeren
Ausdruck, dynamische Einfuhr, Nachtlauf mit zwei Laeufen):
crew-adresse 132/0 · schranke 39/0 · content 45/0 · entwicklung 46/0
anruf 127/0 · ics 37/0 · push-weg 20/0 · arten 28/0 · video 67/0
kanalzeile 14/0 · agentur 62/0 · spicy 83/0 · creator-anlegen 50/0
push-ziel 10/0 · portnummern 8/0
Alle exakt wie vorher. Zwei waren schon vorher rot und sind es
unveraendert geblieben (crew-wand-bild 41/4, teilen 14/3) -- per
`git stash` belegt, nicht angenommen.
Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
@@ -56,3 +56,100 @@ export async function portMussFreiSein(port, wer = "diese Pruefung") {
|
||||
}
|
||||
return port;
|
||||
}
|
||||
|
||||
/* =====================================================================
|
||||
WELCHER PORT GEHOERT MIR? (20.09.2026)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
WARUM ES DIESE FUNKTION GIBT
|
||||
|
||||
Gemessen am 20.09.2026: 164 Pruefdateien, 129 verschiedene Ports --
|
||||
NEUNZEHN Nummern waren doppelt vergeben, eine sogar dreifach
|
||||
(4186, 4188, 4196, 4198 ...). Niemand hatte das absichtlich getan;
|
||||
jede neue Pruefung wurde von einer vorhandenen abgeschrieben, und
|
||||
die Nummer kam mit.
|
||||
|
||||
Der Waechter darueber faengt den Schaden ab -- er bricht ab, statt
|
||||
gegen einen fremden Server zu messen. Aber er kann nur melden, was
|
||||
schon passiert ist: Zwei Pruefungen mit derselben Nummer koennen nie
|
||||
gleichzeitig laufen, und ein liegengebliebener Prozess der einen
|
||||
laesst die andere mit einer Meldung abbrechen, die wie ein Befund
|
||||
aussieht. Genau das ist mir heute zweimal passiert.
|
||||
|
||||
EINE GEPFLEGTE NUMMERNLISTE IST DIE FALSCHE LOESUNG. Dieses Haus ist
|
||||
an abgeschriebenen Listen schon dreimal gescheitert (Spaltenliste
|
||||
beim Datenumbau, Namensliste in pruef-anruf, Namensliste in
|
||||
pruef-entwicklung). Eine Liste, die niemand pflegt, kann nicht
|
||||
veralten -- also wird die Nummer ABGELEITET.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
WIE ABGELEITET WIRD, UND WARUM NICHT MIT EINER PRUEFSUMME
|
||||
|
||||
Der naheliegende Weg waere ein Hash des Dateinamens. Nachgerechnet
|
||||
ist er der schlechtere: Bei 164 Namen in 4900 moeglichen Ports sind
|
||||
nach dem Geburtstagsproblem rund DREI Zusammenstoesse zu erwarten --
|
||||
der Hash tauscht eine sichtbare Doppelung gegen eine unsichtbare.
|
||||
|
||||
Stattdessen: die Stelle im Alphabet. Alle `pruef-*.mjs` im selben
|
||||
Ordner werden sortiert, und wer an Stelle n steht, bekommt Port
|
||||
BASIS + n*2. Das ist NICHT ZUFAELLIG EINDEUTIG, sondern eindeutig
|
||||
von der Bauart her -- zwei Dateien koennen nicht dieselbe Stelle im
|
||||
Alphabet haben.
|
||||
|
||||
Jede Datei bekommt ZWEI Nummern (nr = 0 und 1). Fuenf Pruefungen
|
||||
starten heute einen zweiten Server; der braucht dann keinen eigenen
|
||||
Eintrag irgendwo.
|
||||
|
||||
Nebenwirkung, bewusst in Kauf genommen: Kommt eine neue Pruefung
|
||||
dazu, verschieben sich die Nummern dahinter. Das ist harmlos -- es
|
||||
sind Testports, kein Mensch merkt sie sich -- und der Waechter faengt
|
||||
den einen Fall ab, in dem es zaehlt (ein Prozess von vorhin liegt
|
||||
noch auf der Nummer).
|
||||
===================================================================== */
|
||||
|
||||
import { readdirSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { basename, dirname } from "node:path";
|
||||
|
||||
/** Ab hier aufwaerts, zwei je Datei.
|
||||
*
|
||||
* NICHT 4100: Der echte Dienst hoert dort, und eine Pruefung, die
|
||||
* versehentlich dorthin zielt, waere der eine Fehler, den der Waechter
|
||||
* NICHT erkennen kann -- sie bekaeme brav Antworten.
|
||||
*
|
||||
* UND NICHT 4500, wie hier zuerst stand. Nachgemessen reichen die
|
||||
* bisher von Hand vergebenen Nummern von 4176 bis 4504 -- der Bereich
|
||||
* 4500-4827 haette sich also mit dem obersten Rest ueberschnitten.
|
||||
* Das ist der Grund, warum solche Zahlen gemessen und nicht geschaetzt
|
||||
* werden: "irgendwo ueber 4400" haette plausibel geklungen. */
|
||||
const BASIS = 5000;
|
||||
const PRO_DATEI = 2;
|
||||
|
||||
/** Der Port dieser Datei -- abgeleitet, nicht vergeben.
|
||||
*
|
||||
* `meta` ist `import.meta` der aufrufenden Datei. Prueft danach
|
||||
* gleich, ob er frei ist, und bricht sonst ab (siehe oben).
|
||||
*
|
||||
* DRITTER AUSGANG: Findet sich die eigene Datei nicht in der Liste --
|
||||
* etwa weil jemand die Funktion aus einem anderen Ordner aufruft --,
|
||||
* wird NICHT geraten. Eine geratene Nummer waere genau die Doppelung,
|
||||
* die hier abgeschafft wird. */
|
||||
export async function eigenerPort(meta, wer = null, nr = 0) {
|
||||
const pfad = fileURLToPath(meta.url);
|
||||
const mein = basename(pfad);
|
||||
const ordner = dirname(pfad);
|
||||
const alle = readdirSync(ordner)
|
||||
.filter((f) => f.startsWith("pruef-") && f.endsWith(".mjs"))
|
||||
.sort();
|
||||
const stelle = alle.indexOf(mein);
|
||||
if (stelle < 0) {
|
||||
throw new Error(
|
||||
`[Port] ${mein} steht nicht in der Liste der Pruefdateien in ${ordner}.\n`
|
||||
+ " Die Nummer wird aus der Stelle im Alphabet abgeleitet -- ohne\n"
|
||||
+ " Stelle gibt es keine Nummer, und geraten wird nicht.");
|
||||
}
|
||||
if (nr < 0 || nr >= PRO_DATEI) {
|
||||
throw new Error(`[Port] Es gibt ${PRO_DATEI} Nummern je Datei (0 und 1), nicht ${nr}.`);
|
||||
}
|
||||
return portMussFreiSein(BASIS + stelle * PRO_DATEI + nr, wer || mein.replace(/\.mjs$/, ""));
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-abopt-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4297, "die Optikpruefung des Abbrechens");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Optikpruefung des Abbrechens");
|
||||
|
||||
process.env.PORT = "4297";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -47,7 +47,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-abbrechen-optik");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4297";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-abbrechen-optik-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -90,9 +90,9 @@ const altPfad = join(ordner, "alt.db");
|
||||
/* Der Server wird jetzt AUF DIESER Datei gestartet -- die Umstellung
|
||||
läuft beim Import. */
|
||||
process.env.WORKSPACE_DB = altPfad;
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4295, "die Abbruchpruefung");
|
||||
process.env.PORT = "4295";
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Abbruchpruefung");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -101,7 +101,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 1400));
|
||||
const BASIS = "http://127.0.0.1:4295";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
{
|
||||
const p = new DatabaseSync(altPfad);
|
||||
|
||||
@@ -36,9 +36,8 @@ import { scryptSync, randomBytes } from "node:crypto";
|
||||
import { heuteLokal } from "./helfer-zeit.mjs";
|
||||
|
||||
const HIER = dirname(fileURLToPath(import.meta.url));
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const PORT = 4341;
|
||||
await portMussFreiSein(PORT, "die Agentur-Pruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Agentur-Pruefung");
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-agentur-"));
|
||||
|
||||
@@ -39,9 +39,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4495, "pruef-alle-sehen-es");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-alle-sehen-es");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-sicht-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -44,10 +44,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-wege-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
/* Der Port muss frei sein -- sonst wird gegen einen fremden Server
|
||||
gemessen. Begruendung in helfer-port.mjs. */
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4247, "die Wegepruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Wegepruefung");
|
||||
|
||||
process.env.PORT = "4247";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -56,7 +56,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4247";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -29,9 +29,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4413, "pruef-alter");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-alter");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-alter-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -16,8 +16,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4206, "pruef-ampel");
|
||||
process.env.PORT = "4206";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-ampel");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -26,7 +26,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -35,7 +35,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-ampel");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4206";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 250_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -31,9 +31,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4416, "pruef-anhaenge");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-anhaenge");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-anh-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4199, "pruef-anruf-ruhezeit");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-anruf-ruhezeit");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-ruhe-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -20,9 +20,9 @@ import { mkdtempSync, rmSync, writeFileSync, unlinkSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4196, "pruef-anruf");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-anruf");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-anruf-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -68,9 +68,8 @@ import { notbremse } from "./helfer-notbremse.mjs";
|
||||
notbremse(300_000, "die Artenpruefung");
|
||||
|
||||
const HIER = dirname(fileURLToPath(import.meta.url));
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const PORT = 4359;
|
||||
await portMussFreiSein(PORT, "die Artenpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Artenpruefung");
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-arten-"));
|
||||
|
||||
@@ -26,9 +26,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4410, "pruef-aufbewahrung");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-aufbewahrung");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-aufb-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -25,8 +25,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4211, "pruef-aufgaben-vorlagen");
|
||||
process.env.PORT = "4211";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-aufgaben-vorlagen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -35,11 +35,11 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(240_000, "pruef-aufgaben-vorlagen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4211";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -40,8 +40,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4216, "pruef-aufgabenbrett");
|
||||
process.env.PORT = "4216";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-aufgabenbrett");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -50,7 +50,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -59,7 +59,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-aufgabenbrett");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4216";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -31,9 +31,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4412, "pruef-auskunft");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-auskunft");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-ausk-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -35,10 +35,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
/* Der Port muss frei sein -- sonst wird gegen einen fremden Server
|
||||
gemessen. Begruendung in helfer-port.mjs. */
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4253, "die Barrierefreiheitspruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Barrierefreiheitspruefung");
|
||||
|
||||
process.env.PORT = "4253";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -53,7 +53,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-barrierefrei-workspace");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4253";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -30,9 +30,9 @@ import { mkdtempSync, rmSync, readFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4419, "pruef-befinden");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-befinden");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-bef-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-bereiche-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
@@ -22,8 +22,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4183, "pruef-bereiche-lesend");
|
||||
process.env.PORT = "4183";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-bereiche-lesend");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -34,7 +34,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4183";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 180_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-betreuung-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
@@ -21,8 +21,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4189, "pruef-betreuung");
|
||||
process.env.PORT = "4189";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-betreuung");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -33,7 +33,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4189";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -38,9 +38,9 @@ import { mkdtempSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4504, "pruef-bewerbung");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-bewerbung");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-bewerb-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -38,10 +38,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
/* Der Port muss frei sein -- sonst wird gegen einen fremden Server
|
||||
gemessen. Begruendung in helfer-port.mjs. */
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4277, "die Breitenpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Breitenpruefung");
|
||||
|
||||
process.env.PORT = "4277";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -56,7 +56,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-breiten");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4277";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -41,10 +41,10 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4485, "pruef-bremse");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-bremse");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-bremse-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -40,10 +40,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
/* Der Port muss frei sein -- sonst wird gegen einen fremden Server
|
||||
gemessen. Begruendung in helfer-port.mjs. */
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4289, "die Browserpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Browserpruefung");
|
||||
|
||||
process.env.PORT = "4289";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -58,7 +58,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-browser");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4289";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
/* LAUFEND MITSCHREIBEN, nicht erst am Ende.
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4193, "pruef-buehne");
|
||||
process.env.PORT = "4193";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-buehne");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -116,7 +116,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -125,7 +125,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(120_000 + SEITEN_ZEIT, "pruef-buehne");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4193";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
/* Die Frist waechst mit der Liste: 220 s reichten fuer sechs Seiten.
|
||||
Eine feste Zahl waere hier eine Zeitbombe -- die zwoelf neuen
|
||||
haetten sie gerissen, und der Abbruch saehe aus wie ein Befund. */
|
||||
|
||||
@@ -28,10 +28,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { sauberBeenden } from "./helfer-beenden.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4321, "die Kategorienpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Kategorienpruefung");
|
||||
|
||||
process.env.PORT = "4321";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -46,7 +46,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-call-kategorien");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4321";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-call-kategorien-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -34,10 +34,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { bestaetige } from "./helfer-nachfrage.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4323, "die Chat-Anhangpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Chat-Anhangpruefung");
|
||||
|
||||
process.env.PORT = "4323";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -47,7 +47,7 @@ express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(
|
||||
await import("./index.js");
|
||||
notbremse(600_000, "pruef-chat-anhaenge");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4323";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
const ANHANG_ORDNER = join(ordner, "chat-anhaenge");
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-chat-anhaenge-lauf.txt");
|
||||
|
||||
@@ -37,13 +37,13 @@ const HIER_BILD = dirname(fileURLToPath(import.meta.url));
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-aufloesen-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4391, "die Aufloesen-Pruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Aufloesen-Pruefung");
|
||||
|
||||
process.env.PORT = "4391";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
const BASIS = "http://127.0.0.1:4391";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
await import("./index.js");
|
||||
|
||||
@@ -104,7 +104,7 @@ function anmelden(rolle, code, wand = "crew.dogfather-universe.com") {
|
||||
return new Promise((fertig) => {
|
||||
const rumpf = JSON.stringify({ rolle, code });
|
||||
const a = httpAnfrage({
|
||||
host: "127.0.0.1", port: 4391, path: "/workspace/api/anmelden", method: "POST",
|
||||
host: "127.0.0.1", port: PORT, path: "/workspace/api/anmelden", method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Length": Buffer.byteLength(rumpf),
|
||||
|
||||
@@ -32,10 +32,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { bestaetige } from "./helfer-nachfrage.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4319, "die Chat-Ausbaupruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Chat-Ausbaupruefung");
|
||||
|
||||
process.env.PORT = "4319";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -45,7 +45,7 @@ express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(
|
||||
await import("./index.js");
|
||||
notbremse(480_000, "pruef-chat-ausbau");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4319";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-chat-ausbau-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -46,10 +46,10 @@ import { join } from "node:path";
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kanal-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4377, "die Kanalpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Kanalpruefung");
|
||||
|
||||
process.env.PORT = "4377";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -90,7 +90,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4377";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
/* ---- Notbremse und eigener Zuhoerer -------------------------------------
|
||||
|
||||
@@ -185,7 +185,7 @@ function anmelden(rolle, code, wand = "crew.dogfather-universe.com") {
|
||||
return new Promise((fertig) => {
|
||||
const rumpf = JSON.stringify({ rolle, code });
|
||||
const a = httpAnfrage({
|
||||
host: "127.0.0.1", port: 4377, path: "/workspace/api/anmelden", method: "POST",
|
||||
host: "127.0.0.1", port: PORT, path: "/workspace/api/anmelden", method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Length": Buffer.byteLength(rumpf),
|
||||
|
||||
@@ -32,10 +32,10 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { bestaetige } from "./helfer-nachfrage.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4317, "die Chat-Optikpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Chat-Optikpruefung");
|
||||
|
||||
process.env.PORT = "4317";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -50,7 +50,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-chat-optik");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4317";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-chat-optik-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -30,10 +30,10 @@ import { join } from "node:path";
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-chat-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4313, "die Chatpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Chatpruefung");
|
||||
|
||||
process.env.PORT = "4313";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -42,7 +42,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4313";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4442, "pruef-chatkachel");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-chatkachel");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kachel-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -24,8 +24,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4207, "pruef-checkliste");
|
||||
process.env.PORT = "4207";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-checkliste");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -34,7 +34,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -43,7 +43,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-checkliste");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4207";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -30,8 +30,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4195, "pruef-code");
|
||||
process.env.PORT = "4195";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-code");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -41,7 +41,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { bestaetige } from "./helfer-nachfrage.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
@@ -51,7 +51,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-code");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4195";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 240_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -36,9 +36,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4198, "pruef-community-sicht");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-community-sicht");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-cs-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -11,8 +11,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4185, "pruef-content-ansicht");
|
||||
process.env.PORT = "4185";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-content-ansicht");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -22,7 +22,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -31,7 +31,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-content-ansicht");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4185";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-content-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
@@ -14,9 +14,9 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
4194 fuer die Gegenprobe. Nur den ersten zu pruefen hiesse, die
|
||||
Gegenprobe ungeschuetzt zu lassen, und die ist der Teil, dem man
|
||||
glaubt. */
|
||||
await portMussFreiSein(4184, "pruef-content");
|
||||
await portMussFreiSein(4194, "pruef-content (Gegenprobe)");
|
||||
process.env.PORT = "4184";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-content");
|
||||
const PORT2 = await eigenerPort(import.meta, "pruef-content (Gegenprobe)", 1);
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -27,7 +27,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4184";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
@@ -81,7 +81,7 @@ d.close();
|
||||
const { spawnSync } = await import("node:child_process");
|
||||
const zweiter = spawnSync(process.execPath, ["-e", `
|
||||
process.env.WORKSPACE_DB = ${JSON.stringify(process.env.WORKSPACE_DB)};
|
||||
process.env.PORT = "4194";
|
||||
process.env.PORT = "${PORT2}";
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "X";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "Y";
|
||||
|
||||
@@ -40,10 +40,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal, tagLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4481, "pruef-countdown");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-countdown");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-count-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -42,9 +42,8 @@ import { notbremse } from "./helfer-notbremse.mjs";
|
||||
notbremse(240_000, "die Creator-Anlegen-Pruefung");
|
||||
|
||||
const HIER = dirname(fileURLToPath(import.meta.url));
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const PORT = 4347;
|
||||
await portMussFreiSein(PORT, "die Creator-Anlegen-Pruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Creator-Anlegen-Pruefung");
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-canlegen-"));
|
||||
|
||||
@@ -34,8 +34,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4371, "pruef-crew-adresse");
|
||||
process.env.PORT = "4371";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-crew-adresse");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -44,7 +44,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-crew-adresse");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
@@ -68,7 +68,7 @@ function hole(pfad, { host, methode = "GET", rumpf = null, keks = "" } = {}) {
|
||||
const kopf = { Host: host };
|
||||
if (rumpf) { kopf["Content-Type"] = "application/json"; kopf["Content-Length"] = Buffer.byteLength(rumpf); }
|
||||
if (keks) kopf.Cookie = keks;
|
||||
const a = request({ host: "127.0.0.1", port: 4371, path: pfad, method: methode, headers: kopf },
|
||||
const a = request({ host: "127.0.0.1", port: PORT, path: pfad, method: methode, headers: kopf },
|
||||
(antwort) => {
|
||||
let text = "";
|
||||
antwort.setEncoding("utf8");
|
||||
@@ -122,7 +122,7 @@ const idModi = anlegen("Marina", "modi", "CODE-MODI-0001");
|
||||
const CREW = "crew.dogfather-universe.com";
|
||||
const WS = "workspace.dogfather-universe.com";
|
||||
const HAUPT = "dogfather-universe.com";
|
||||
const LOKAL = "127.0.0.1:4371";
|
||||
const LOKAL = `127.0.0.1:${PORT}`;
|
||||
|
||||
/* =====================================================================
|
||||
TEIL A -- DIE REGELN, OHNE SERVER
|
||||
|
||||
@@ -32,14 +32,14 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4373, "pruef-crew-wand-bild");
|
||||
process.env.PORT = "4373";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-crew-wand-bild");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-crew-wand-bild");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
@@ -85,8 +85,8 @@ for (const geraet of [
|
||||
seite.on("console", (m) => { if (m.type() === "error") meldungen.push(m.text()); });
|
||||
|
||||
const adresse = geraet.alt
|
||||
? "http://127.0.0.1:4373/workspace/index.html"
|
||||
: "http://127.0.0.1:4373/workspace/crew-index.html";
|
||||
? `http://127.0.0.1:${PORT}/workspace/index.html`
|
||||
: `http://127.0.0.1:${PORT}/workspace/crew-index.html`;
|
||||
await seite.goto(adresse, { waitUntil: "networkidle" });
|
||||
await seite.waitForTimeout(400);
|
||||
|
||||
@@ -279,13 +279,13 @@ for (const wer of [
|
||||
{ name: "Manager", rolle: "manager", code: "CODE-MAN-0001", eigen: false },
|
||||
]) {
|
||||
const ctx = await browser.newContext({ viewport: { width: 1280, height: 860 } });
|
||||
const antwort = await ctx.request.post("http://127.0.0.1:4373/workspace/api/anmelden", {
|
||||
const antwort = await ctx.request.post(`http://127.0.0.1:${PORT}/workspace/api/anmelden`, {
|
||||
data: { rolle: wer.rolle, code: wer.code },
|
||||
});
|
||||
ok(antwort.ok(), wer.name + ": die Anmeldung geht durch");
|
||||
|
||||
const seite = await ctx.newPage();
|
||||
await seite.goto("http://127.0.0.1:4373/workspace/aufgaben.html", { waitUntil: "networkidle" });
|
||||
await seite.goto(`http://127.0.0.1:${PORT}/workspace/aufgaben.html`, { waitUntil: "networkidle" });
|
||||
await seite.waitForTimeout(500);
|
||||
|
||||
const titel = await seite.title();
|
||||
|
||||
@@ -34,10 +34,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-dabei-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4293, "die Optikpruefung der Teilnehmerwahl");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Optikpruefung der Teilnehmerwahl");
|
||||
|
||||
process.env.PORT = "4293";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -52,7 +52,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-dabei-optik");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4293";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
/* LAUFEND MITSCHREIBEN. Node puffert stdout, sobald es umgeleitet wird
|
||||
-- bei einem Lauf mit sechs Browser-Anmeldungen steht bis zum Schluss
|
||||
|
||||
@@ -40,9 +40,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4475, "pruef-entwicklung-kacheln");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-entwicklung-kacheln");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-ekach-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -32,10 +32,10 @@ import { request } from "node:http";
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-entw-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4389, "die Entwicklungspruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Entwicklungspruefung");
|
||||
|
||||
process.env.PORT = "4389";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -62,7 +62,7 @@ function hole(pfad, { host = WS, methode = "GET", rumpf = null, keks = "" } = {}
|
||||
const kopf = { Host: host };
|
||||
if (rumpf) { kopf["Content-Type"] = "application/json"; kopf["Content-Length"] = Buffer.byteLength(rumpf); }
|
||||
if (keks) kopf.Cookie = keks;
|
||||
const a = request({ host: "127.0.0.1", port: 4389, path: pfad, method: methode, headers: kopf },
|
||||
const a = request({ host: "127.0.0.1", port: PORT, path: pfad, method: methode, headers: kopf },
|
||||
(antwort) => {
|
||||
let text = "";
|
||||
antwort.setEncoding("utf8");
|
||||
|
||||
@@ -38,12 +38,12 @@ import { tmpdir } from "node:os";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { erwaehnungenFinden, erwaehnteIds } from "./chat-erwaehnung.js";
|
||||
|
||||
const HIER = dirname(fileURLToPath(import.meta.url));
|
||||
const PORT = await portMussFreiSein(4426, "pruef-erwaehnung");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-erwaehnung");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-erwaehnung-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -29,10 +29,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal, tagLokal, tagVon } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4417, "pruef-eskalation");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-eskalation");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-eskal-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -34,9 +34,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4415, "pruef-fassungen");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-fassungen");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-fass-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -26,8 +26,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4203, "pruef-formulare");
|
||||
process.env.PORT = "4203";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-formulare");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -36,7 +36,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -45,7 +45,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-formulare");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4203";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 250_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -31,8 +31,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4192, "pruef-freie-namen");
|
||||
process.env.PORT = "4192";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-freie-namen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -42,7 +42,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -51,7 +51,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-freie-namen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4192";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 240_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -41,10 +41,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4487, "pruef-galerie");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-galerie");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-gal-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.WORKSPACE_DATEN = join(ordner, "daten");
|
||||
|
||||
@@ -30,10 +30,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4493, "pruef-gespraech");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-gespraech");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-gespr-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -52,10 +52,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-glocke-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4299, "die Glockenpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Glockenpruefung");
|
||||
|
||||
process.env.PORT = "4299";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -70,7 +70,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-glocke");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4299";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-glocke-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -49,8 +49,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4218, "pruef-grosscheck");
|
||||
process.env.PORT = "4218";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-grosscheck");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -60,7 +60,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -69,7 +69,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-grosscheck");
|
||||
await new Promise((r) => setTimeout(r, 800));
|
||||
const BASIS = "http://127.0.0.1:4218";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH — zu lange gelaufen"); process.exit(1); }, 900_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
Binary file not shown.
@@ -103,13 +103,13 @@ import { tmpdir } from "node:os";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const REPO = join(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-handy-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const PORT = await portMussFreiSein(4231, "pruef-handy-teamdogi");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-handy-teamdogi");
|
||||
process.env.PORT = String(PORT);
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -33,8 +33,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4198, "pruef-handy");
|
||||
process.env.PORT = "4198";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-handy");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -43,7 +43,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -52,7 +52,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-handy");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4198";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 400_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -30,9 +30,9 @@ import { mkdtempSync, rmSync, readdirSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4422, "pruef-haus-seiten");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-haus-seiten");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-haus-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -37,10 +37,10 @@ import { request } from "node:http";
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-haus-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4381, "die Haustrennung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Haustrennung");
|
||||
|
||||
process.env.PORT = "4381";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -67,7 +67,7 @@ function hole(pfad, { host, methode = "GET", rumpf = null, keks = "" } = {}) {
|
||||
const kopf = { Host: host };
|
||||
if (rumpf) { kopf["Content-Type"] = "application/json"; kopf["Content-Length"] = Buffer.byteLength(rumpf); }
|
||||
if (keks) kopf.Cookie = keks;
|
||||
const a = request({ host: "127.0.0.1", port: 4381, path: pfad, method: methode, headers: kopf },
|
||||
const a = request({ host: "127.0.0.1", port: PORT, path: pfad, method: methode, headers: kopf },
|
||||
(antwort) => {
|
||||
let text = "";
|
||||
antwort.setEncoding("utf8");
|
||||
@@ -652,7 +652,7 @@ console.log("=== Haengt es wirklich an der Adresse? ===");
|
||||
Pruefungen im Haus laufen dort, und eine stille Einschraenkung
|
||||
haette sie alle blind gemacht, ohne dass irgendwo etwas rot wird.
|
||||
Genau diese Falle steht schon in crew-adresse.js beschrieben. */
|
||||
const lokal = await hole("/workspace/api/aufgaben", { host: "127.0.0.1:4381", keks: dogi.keks });
|
||||
const lokal = await hole("/workspace/api/aufgaben", { host: `127.0.0.1:${PORT}`, keks: dogi.keks });
|
||||
const t = (lokal.daten?.aufgaben || []).map((z) => z.titel);
|
||||
ok(t.includes("Lunas Steckbrief nachtragen"),
|
||||
`auf 127.0.0.1 bleibt alles wie bisher (${t.length} Aufgaben)`);
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4438, "pruef-highlights");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-highlights");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-highlight-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -32,9 +32,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4188, "pruef-hilfe");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-hilfe");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-hilfe-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -68,8 +68,8 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-hochlade-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const PORT = await portMussFreiSein(4327, "die Hochladepruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Hochladepruefung");
|
||||
|
||||
process.env.PORT = String(PORT);
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
|
||||
@@ -32,10 +32,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-ics-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4345, "die Kalender-Abo-Pruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Kalender-Abo-Pruefung");
|
||||
|
||||
process.env.PORT = "4345";
|
||||
process.env.PORT = String(PORT);
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -45,7 +45,7 @@ express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(
|
||||
await import("./index.js");
|
||||
notbremse(240_000, "pruef-ics");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4345";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-ics-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
@@ -185,7 +185,7 @@ melde("=== Der Link entsteht erst auf Wunsch ===");
|
||||
}
|
||||
|
||||
const linkLuna = await linkHolen(keksLuna);
|
||||
ok(/^http:\/\/127\.0\.0\.1:4345\/workspace\/kalender\/[A-Za-z0-9_-]{40,}\.ics$/.test(linkLuna || ""),
|
||||
ok(new RegExp(`^http://127\\.0\\.0\\.1:${PORT}/workspace/kalender/[A-Za-z0-9_-]{40,}\\.ics$`).test(linkLuna || ""),
|
||||
`der Link sieht richtig aus (…${String(linkLuna).slice(-24)})`);
|
||||
|
||||
/* =======================================================================
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4435, "pruef-installieren");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-installieren");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-install-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -41,9 +41,9 @@ import { mkdtempSync, rmSync, readFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4191, "pruef-jeder-hat-eine-seite");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-jeder-hat-eine-seite");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-seite-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -45,7 +45,7 @@ import { mkdtempSync, rmSync, readFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { pngLesen, pixel, kontrast } from "./helfer-png.mjs";
|
||||
|
||||
const HIER = dirname(fileURLToPath(import.meta.url));
|
||||
@@ -216,7 +216,7 @@ melde("=== 2. Das Universum im Hintergrund ===");
|
||||
melde("");
|
||||
melde("=== 3. Der Text auf der fertigen Kachel ===");
|
||||
|
||||
const PORT = await portMussFreiSein(4194, "pruef-kachel-universum");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kachel-universum");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kachel-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -42,9 +42,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4479, "pruef-kachelraster");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kachelraster");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-raster-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -18,8 +18,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4188, "pruef-kalender");
|
||||
process.env.PORT = "4188";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kalender");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -29,7 +29,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -38,7 +38,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-kalender");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4188";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4477, "pruef-kanaele");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kanaele");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kanal-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -26,10 +26,10 @@ import { createServer } from "node:http";
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kz-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4332, "das Bildwerkzeug");
|
||||
const TIKTOK = await portMussFreiSein(4502, "nachgebautes TikTok");
|
||||
process.env.PORT = "4332";
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "das Bildwerkzeug");
|
||||
const TIKTOK = await eigenerPort(import.meta, "nachgebautes TikTok", 1);
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
process.env.TIKTOK_OEMBED_BASIS = `http://127.0.0.1:${TIKTOK}/oembed`;
|
||||
@@ -67,7 +67,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 1200));
|
||||
const BASIS = "http://127.0.0.1:4332";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const { DatabaseSync } = await import("node:sqlite");
|
||||
const { scryptSync, randomBytes } = await import("node:crypto");
|
||||
|
||||
@@ -31,8 +31,8 @@ process.env.WORKSPACE_DB = join(ordner, "pruef.sqlite");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4179, "pruef-kopf-messen");
|
||||
process.env.PORT = "4179";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kopf-messen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -42,7 +42,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -51,7 +51,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-kopf-messen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4179";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -39,10 +39,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { heuteLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4491, "pruef-kreislauf");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-kreislauf");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-kreis-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -56,8 +56,8 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-ladefehler-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const PORT = await portMussFreiSein(4339, "die Ladefehlerpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Ladefehlerpruefung");
|
||||
|
||||
process.env.PORT = String(PORT);
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
|
||||
@@ -36,10 +36,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-leistoptik-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4337, "die Zahlen-Optikpruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Zahlen-Optikpruefung");
|
||||
|
||||
process.env.PORT = "4337";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -54,7 +54,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-leistung-optik");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4337";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-leistung-optik-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -30,10 +30,10 @@ import { join } from "node:path";
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-leistung-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4333, "die Leistungspruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Leistungspruefung");
|
||||
|
||||
process.env.PORT = "4333";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -42,7 +42,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
const BASIS = "http://127.0.0.1:4333";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
const ok = (b, t) => { console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; };
|
||||
|
||||
@@ -33,8 +33,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4214, "pruef-lesbarkeit");
|
||||
process.env.PORT = "4214";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-lesbarkeit");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -43,7 +43,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -52,7 +52,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-lesbarkeit");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4214";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -43,8 +43,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4199, "pruef-manager-sicht");
|
||||
process.env.PORT = "4199";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-manager-sicht");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -54,7 +54,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -63,7 +63,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-manager-sicht");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4199";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -31,8 +31,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4369, "pruef-modi-checkliste");
|
||||
process.env.PORT = "4369";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-checkliste");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -41,11 +41,11 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-modi-checkliste");
|
||||
await new Promise((r) => setTimeout(r, 800));
|
||||
const BASIS = "http://127.0.0.1:4369";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -36,8 +36,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4365, "pruef-modi-ideen");
|
||||
process.env.PORT = "4365";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-ideen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -102,11 +102,11 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-modi-ideen");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4365";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
console.log("\n=== 2. Die Umstellung ===\n");
|
||||
{
|
||||
|
||||
@@ -27,8 +27,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4363, "pruef-modi-katalog");
|
||||
process.env.PORT = "4363";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-katalog");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -39,11 +39,11 @@ express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { ersatzschreibungen } from "./helfer-deutsch.mjs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-modi-katalog");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4363";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -28,8 +28,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4361, "pruef-modi-kategorien");
|
||||
process.env.PORT = "4361";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-kategorien");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -38,11 +38,11 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-modi-kategorien");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4361";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -32,8 +32,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4367, "pruef-modi-livecheck");
|
||||
process.env.PORT = "4367";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-livecheck");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -42,11 +42,11 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
notbremse(180_000, "pruef-modi-livecheck");
|
||||
await new Promise((r) => setTimeout(r, 800));
|
||||
const BASIS = "http://127.0.0.1:4367";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -28,8 +28,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4359, "pruef-modi-verborgen");
|
||||
process.env.PORT = "4359";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-modi-verborgen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
@@ -38,14 +38,14 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* NACH index.js: Der Server haengt dort zwei Auffangnetze ein, die
|
||||
einen Absturz nur protokollieren. Fuer den Betrieb richtig, fuer eine
|
||||
Pruefung fatal -- ohne diese Zeile bliebe der Prozess ewig stehen. */
|
||||
notbremse(180_000, "pruef-modi-verborgen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4359";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
let fehler = 0;
|
||||
let geprueft = 0;
|
||||
|
||||
@@ -326,12 +326,12 @@ if (process.env.OHNE_BROWSER === "ja") {
|
||||
} else {
|
||||
const { mkdtempSync, rmSync } = await import("node:fs");
|
||||
const { tmpdir } = await import("node:os");
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const { notbremse } = await import("./helfer-notbremse.mjs");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-nachfrage-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
const PORT = await portMussFreiSein(4329, "die Nachfragepruefung");
|
||||
const PORT = await eigenerPort(import.meta, "die Nachfragepruefung");
|
||||
process.env.PORT = String(PORT);
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -35,9 +35,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4191, "pruef-nachruesten");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-nachruesten");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-nachruesten-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -24,10 +24,10 @@ import { mkdtempSync, rmSync, readFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
import { tagLokal } from "./helfer-tag.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4404, "pruef-nachwuchs");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-nachwuchs");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-nachwuchs-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -35,9 +35,9 @@ import { mkdtempSync, rmSync, mkdirSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4403, "pruef-neue-seiten");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-neue-seiten");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-treffs-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -29,8 +29,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4198, "pruef-personen-formular");
|
||||
process.env.PORT = "4198";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-personen-formular");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -40,7 +40,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -49,7 +49,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-personen-formular");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4198";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -31,10 +31,10 @@ const ordner = mkdtempSync(join(tmpdir(), "ws-perskachel-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
const { portMussFreiSein } = await import("./helfer-port.mjs");
|
||||
await portMussFreiSein(4329, "die Personenkachel-Pruefung");
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "die Personenkachel-Pruefung");
|
||||
|
||||
process.env.PORT = "4329";
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00";
|
||||
|
||||
@@ -44,7 +44,7 @@ express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(
|
||||
await import("./index.js");
|
||||
notbremse(420_000, "pruef-personen-kachel");
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
const BASIS = "http://127.0.0.1:4329";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
|
||||
const PROTOKOLL = join(process.cwd(), "pruef-personen-kachel-lauf.txt");
|
||||
try { rmSync(PROTOKOLL, { force: true }); } catch { /* gab es noch nicht */ }
|
||||
|
||||
@@ -23,8 +23,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4187, "pruef-personen-liste");
|
||||
process.env.PORT = "4187";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-personen-liste");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -34,7 +34,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -43,7 +43,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-personen-liste");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4187";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { mkdtempSync, rmSync, readdirSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-loeschen-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
@@ -17,8 +17,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4188, "pruef-personen-loeschen");
|
||||
process.env.PORT = "4188";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-personen-loeschen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -29,7 +29,7 @@ const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
await import("./index.js");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4188";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
/* ORTSZEIT, nicht UTC. Die Anwendung rechnet "heute" nach der Uhr des
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* =====================================================================
|
||||
pruef-portnummern.mjs — Zwei Pruefungen, eine Nummer
|
||||
|
||||
WAS HIER SCHIEFGING (20.09.2026 gemessen):
|
||||
164 Pruefdateien, 129 verschiedene Nummern -- NEUNZEHN waren doppelt
|
||||
vergeben, 4186 und 4188 und 4196 und 4198 sogar dreifach. Niemand
|
||||
hatte das gewollt; jede neue Pruefung wurde von einer vorhandenen
|
||||
abgeschrieben, und die Nummer kam mit.
|
||||
|
||||
WAS DAS ANRICHTET: Der Waechter bricht ab, statt gegen einen fremden
|
||||
Server zu messen -- so weit, so richtig. Aber zwei Pruefungen mit
|
||||
derselben Nummer koennen nie gleichzeitig laufen, und ein
|
||||
liegengebliebener Prozess der einen laesst die andere mit einer
|
||||
Meldung abbrechen, die wie ein Befund aussieht. Genau das ist am
|
||||
20.09. zweimal passiert, beide Male mit Fehlersuche an der falschen
|
||||
Stelle.
|
||||
|
||||
WAS DIESE PRUEFUNG SICHERT: Dass die Nummer ABGELEITET bleibt. Eine
|
||||
von Hand eingetragene Zahl ist der Anfang der naechsten Doppelung --
|
||||
sie faellt nur niemandem auf, bis zwei Laeufe kollidieren.
|
||||
===================================================================== */
|
||||
|
||||
import { readdirSync, readFileSync } from "node:fs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
let ok_ = 0, fehl = 0;
|
||||
const ok = (b, text) => { if (b) { ok_++; console.log(" ok " + text); }
|
||||
else { fehl++; console.log(" FEHL " + text); } };
|
||||
|
||||
const ORDNER = new URL(".", import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1");
|
||||
const dateien = readdirSync(ORDNER)
|
||||
.filter((f) => f.startsWith("pruef-") && f.endsWith(".mjs")).sort();
|
||||
|
||||
console.log("\n=== 1. Niemand traegt eine Nummer von Hand ein ===");
|
||||
const vonHand = [];
|
||||
const ohneWaechter = [];
|
||||
for (const f of dateien) {
|
||||
const s = readFileSync(ORDNER + "/" + f, "utf8");
|
||||
/* Kommentare zaehlen nicht: In helfer-port.mjs und hier stehen alte
|
||||
Nummern als Beleg, und ein Beleg ist kein Eintrag. */
|
||||
const code = s.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/.*$/gm, "");
|
||||
if (/portMussFreiSein\(\s*\d/.test(code)) vonHand.push(f);
|
||||
const startetServer = /listen\(|process\.env\.PORT\s*=/.test(code);
|
||||
if (startetServer && !/eigenerPort\(\s*import\.meta/.test(code)) ohneWaechter.push(f);
|
||||
}
|
||||
ok(dateien.length > 100, `${dateien.length} Pruefdateien angesehen`);
|
||||
ok(vonHand.length === 0,
|
||||
`keine traegt eine feste Nummer im Waechter (${vonHand.slice(0, 4).join(", ") || "—"})`);
|
||||
ok(ohneWaechter.length === 0,
|
||||
`jede, die einen Server startet, leitet ihre Nummer ab (${ohneWaechter.slice(0, 4).join(", ") || "—"})`);
|
||||
|
||||
console.log("\n=== 2. Die abgeleiteten Nummern sind eindeutig ===");
|
||||
const belegt = new Map();
|
||||
let doppelt = 0;
|
||||
dateien.forEach((f, i) => {
|
||||
for (let n = 0; n < 2; n++) {
|
||||
const p = 5000 + i * 2 + n;
|
||||
if (belegt.has(p)) { doppelt++; console.log(` ${p}: ${belegt.get(p)} und ${f}`); }
|
||||
belegt.set(p, f);
|
||||
}
|
||||
});
|
||||
ok(belegt.size === dateien.length * 2 && doppelt === 0,
|
||||
`${belegt.size} Nummern fuer ${dateien.length} Dateien, ${doppelt} doppelt`);
|
||||
|
||||
console.log("\n=== 3. Die Ableitung stimmt wirklich (gemessen, nicht gerechnet) ===");
|
||||
/* NICHT die Formel gegen sich selbst pruefen -- das waere eine
|
||||
Bestaetigung ohne Aussage. Gefragt wird die Funktion, die die
|
||||
Pruefungen auch benutzen, und verglichen wird mit der Stelle im
|
||||
Alphabet. */
|
||||
const ersteDatei = dateien[0];
|
||||
const meine = dateien.indexOf("pruef-portnummern.mjs");
|
||||
const p0 = await eigenerPort(import.meta, "pruef-portnummern (Selbsttest)", 0);
|
||||
ok(p0 === 5000 + meine * 2,
|
||||
`meine eigene Nummer ist ${p0} — Stelle ${meine} im Alphabet, erste Datei ${ersteDatei}`);
|
||||
const p1 = await eigenerPort(import.meta, "pruef-portnummern (Selbsttest)", 1);
|
||||
ok(p1 === p0 + 1, `und die zweite ist ${p1}, also genau eine daneben`);
|
||||
|
||||
console.log("\n=== 4. Gegenprobe: kann sie auch NICHT IN ORDNUNG sagen? ===");
|
||||
/* Eine Pruefung, die immer bestaetigt, bestaetigt nichts. */
|
||||
let drittesAusgangGriff = false;
|
||||
try {
|
||||
/* Eine Datei, die es nicht gibt -- die Ableitung darf dann NICHT
|
||||
raten, sondern muss abbrechen. */
|
||||
await eigenerPort({ url: new URL("./gibt-es-nicht.mjs", import.meta.url).href }, "Gegenprobe");
|
||||
} catch (f) {
|
||||
drittesAusgangGriff = /steht nicht in der Liste/.test(f?.message || "");
|
||||
}
|
||||
ok(drittesAusgangGriff, "eine unbekannte Datei bekommt keine geratene Nummer, sondern einen Abbruch");
|
||||
|
||||
let zuHoheNummer = false;
|
||||
try { await eigenerPort(import.meta, "Gegenprobe", 7); }
|
||||
catch (f) { zuHoheNummer = /Nummern je Datei/.test(f?.message || ""); }
|
||||
ok(zuHoheNummer, "und eine dritte Nummer je Datei gibt es nicht");
|
||||
|
||||
console.log(`\n${ok_} Pruefungen, ${fehl} Fehler`);
|
||||
console.log(fehl ? "NICHT IN ORDNUNG\n" : "ALLES IN ORDNUNG\n");
|
||||
process.exit(fehl ? 1 : 0);
|
||||
@@ -15,8 +15,8 @@ process.env.WORKSPACE_DB = join(ordner, "pruef.sqlite");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4180, "pruef-protokoll-klappe");
|
||||
process.env.PORT = "4180";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-protokoll-klappe");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -26,7 +26,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -35,7 +35,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-protokoll-klappe");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4180";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 200_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -36,8 +36,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4197, "pruef-protokoll-loeschen");
|
||||
process.env.PORT = "4197";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-protokoll-loeschen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -47,7 +47,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -56,7 +56,7 @@ await import("./index.js");
|
||||
Server ihn am Leben haelt (siehe helfer-notbremse.mjs). */
|
||||
notbremse(480_000, "pruef-protokoll-loeschen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4197";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 300_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
@@ -51,6 +51,18 @@ import {
|
||||
|
||||
`unref()` allein genuegt nicht -- es nimmt dem Handle nur das Recht,
|
||||
den Prozess am Leben zu halten; im Schliessen ist es trotzdem. */
|
||||
/* ZWEI NACHGEBAUTE PUSH-DIENSTE, ZWEI NUMMERN (20.09.2026).
|
||||
Vorher standen hier 4341 und 4342 fest -- und 4341 gehoerte
|
||||
gleichzeitig pruef-agentur. Aufgefallen ist das NICHT beim
|
||||
Nachzaehlen der Doppelungen: Diese Datei rief den Waechter gar
|
||||
nicht auf und tauchte in der Liste deshalb nie auf. Gefunden hat
|
||||
sie erst pruef-portnummern mit der anderen Frage -- "wer startet
|
||||
einen Server, ohne seine Nummer abzuleiten?". Eine Liste zeigt
|
||||
nur, was auf ihr steht. */
|
||||
const { eigenerPort } = await import("./helfer-port.mjs");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-push-weg", 0);
|
||||
const PORT2 = await eigenerPort(import.meta, "pruef-push-weg (Fehlercodes)", 1);
|
||||
|
||||
const schliessen = (dienst) => new Promise((fertig) => {
|
||||
if (!dienst.listening) return fertig();
|
||||
dienst.close(() => fertig());
|
||||
@@ -141,10 +153,10 @@ let empfangen = null, kopfzeilen = null;
|
||||
a.writeHead(201); a.end();
|
||||
});
|
||||
});
|
||||
await new Promise((r) => dienst.listen(4341, "127.0.0.1", r));
|
||||
await new Promise((r) => dienst.listen(PORT, "127.0.0.1", r));
|
||||
|
||||
const paar = schluesselErzeugen();
|
||||
const e = await schicken({ endpunkt: "http://127.0.0.1:4341/push/abc", ...anmeldung },
|
||||
const e = await schicken({ endpunkt: `http://127.0.0.1:${PORT}/push/abc`, ...anmeldung },
|
||||
TEXT, paar, "mailto:[email protected]");
|
||||
|
||||
ok(e.ok, `zugestellt (Status ${e.status})`);
|
||||
@@ -181,8 +193,8 @@ console.log("\n=== Ein Geraet, das es nicht mehr gibt ===");
|
||||
const paar = schluesselErzeugen();
|
||||
for (const [code, erwartetWeg] of [[410, true], [404, true], [500, false], [429, false]]) {
|
||||
const d = createServer((q, a) => { a.writeHead(code); a.end(); });
|
||||
await new Promise((r) => d.listen(4342, "127.0.0.1", r));
|
||||
const e = await schicken({ endpunkt: "http://127.0.0.1:4342/x", ...anmeldung },
|
||||
await new Promise((r) => d.listen(PORT2, "127.0.0.1", r));
|
||||
const e = await schicken({ endpunkt: `http://127.0.0.1:${PORT2}/x`, ...anmeldung },
|
||||
TEXT, paar, "mailto:[email protected]");
|
||||
ok(e.weg === erwartetWeg,
|
||||
`${code} -> weg=${e.weg} (erwartet ${erwartetWeg})`
|
||||
|
||||
@@ -37,10 +37,10 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { createServer } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4423, "pruef-push-ziel");
|
||||
const DIENST = await portMussFreiSein(4424, "pruef-push-ziel (Push-Dienst)");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-push-ziel");
|
||||
const DIENST = await eigenerPort(import.meta, "pruef-push-ziel (Push-Dienst)", 1);
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-pz-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -24,9 +24,9 @@ import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { request as httpAnfrage } from "node:http";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4405, "pruef-rechte-umstellen");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-rechte-umstellen");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-rechte-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
import { mkdtempSync, rmSync, readdirSync, existsSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4397, "pruef-rechtetafel");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-rechtetafel");
|
||||
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-rechte-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
|
||||
const PORT = await portMussFreiSein(4497, "pruef-rollen-anlegen");
|
||||
const PORT = await eigenerPort(import.meta, "pruef-rollen-anlegen");
|
||||
const ordner = mkdtempSync(join(tmpdir(), "ws-ra-"));
|
||||
process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
process.env.PORT = String(PORT);
|
||||
|
||||
@@ -38,8 +38,8 @@ process.env.WORKSPACE_DB = join(ordner, "workspace.db");
|
||||
STILL nicht -- und alles Folgende misst gegen einen fremden
|
||||
Stand. Das ist der dritte Ausgang: belegt ist etwas anderes
|
||||
als kaputt. */
|
||||
await portMussFreiSein(4193, "pruef-rollen");
|
||||
process.env.PORT = "4193";
|
||||
const PORT = await eigenerPort(import.meta, "pruef-rollen");
|
||||
process.env.PORT = `${PORT}`;
|
||||
process.env.SITE_ACCESS_SECRET = "lokaler-test";
|
||||
process.env.SITE_ACCESS_CODE_DOGI = "DOGI-TEST-1";
|
||||
process.env.SITE_ACCESS_CODE_VANVAN = "VANVAN-TEST-1";
|
||||
@@ -49,7 +49,7 @@ const express = (await import("express")).default;
|
||||
const ec = express.response.cookie;
|
||||
express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); };
|
||||
import { notbremse } from "./helfer-notbremse.mjs";
|
||||
import { portMussFreiSein } from "./helfer-port.mjs";
|
||||
import { eigenerPort } from "./helfer-port.mjs";
|
||||
await import("./index.js");
|
||||
/* DIE NOTBREMSE. Muss NACH index.js stehen: Der Server haengt dort
|
||||
zwei Auffangnetze ein, die einen Absturz nur protokollieren --
|
||||
@@ -76,7 +76,7 @@ await import("./index.js");
|
||||
irgendwann gar nichts mehr. */
|
||||
notbremse(900_000, "pruef-rollen");
|
||||
await new Promise((r) => setTimeout(r, 700));
|
||||
const BASIS = "http://127.0.0.1:4193";
|
||||
const BASIS = `http://127.0.0.1:${PORT}`;
|
||||
setTimeout(() => { console.log("ABBRUCH"); process.exit(1); }, 540_000).unref?.();
|
||||
|
||||
let fehler = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user