Statistikportal für den All-the-Mods-10-Server (Minecraft 1.21.1, NeoForge 21.1): - mod/: serverseitige NeoForge-Mod atmstats – Ereignisse, Live-Zähler, Servergesundheit, FTB-Dateien; Outbox auf der Festplatte, signierter gzip-Versand per HTTPS mit Backoff - backend/: Fastify + PostgreSQL – idempotenter Ingest, Projektionen, Parser für SNBT, FTB Quests/Teams, world/stats, world/advancements und latest.log; Ranglisten, Snapshots, Retention, öffentliche API, SSE-Live-Updates, Admin mit argon2/CSRF, SFTP-Worker - web/: Next.js-Dashboard – Übersicht, Ranglisten, Spielerprofile, ATM10, Server, Datenquellen, Verwaltung - shared/: Protokoll v1 und API-Typen; tools/: Simulator, Log-Anonymisierer, RCON-Client - deploy/: Docker Compose hinter Traefik, Backup; docs/: Architektur, Datenquellen, Betrieb Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
785 B
JavaScript
17 lines
785 B
JavaScript
#!/usr/bin/env node
|
|
// Entfernt Spieler-IP-Adressen aus einem Minecraft-Log, damit es als Test-Fixture versioniert werden kann.
|
|
// Aufruf: node tools/anonymize-log.mjs <eingabe> <ausgabe>
|
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
|
|
const [input, output] = process.argv.slice(2);
|
|
if (!input || !output) {
|
|
console.error('usage: node tools/anonymize-log.mjs <in> <out>');
|
|
process.exit(1);
|
|
}
|
|
const text = readFileSync(input, 'utf8')
|
|
.replace(/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+/g, '/0.0.0.0:0')
|
|
.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g, '0.0.0.0')
|
|
// login positions ("logged in with entity id … at (x, y, z)") would reveal where players build
|
|
.replace(/ at \(-?[\d.]+, -?[\d.]+, -?[\d.]+\)/g, ' at (0.0, 0.0, 0.0)');
|
|
writeFileSync(output, text);
|