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>
22 lines
706 B
TypeScript
22 lines
706 B
TypeScript
import type { FastifyInstance } from 'fastify';
|
|
import type { Pool } from 'pg';
|
|
import { buildApp } from '../../src/app.ts';
|
|
import { loadConfig } from '../../src/config.ts';
|
|
import { createIngestToken } from '../../src/ingest/tokens.ts';
|
|
import { TEST_SECRET } from './sign.ts';
|
|
|
|
export function testConfig() {
|
|
return loadConfig({
|
|
NODE_ENV: 'test',
|
|
DATABASE_URL: process.env.TEST_DATABASE_URL,
|
|
INGEST_HMAC_SECRET: TEST_SECRET,
|
|
LOG_LEVEL: 'silent',
|
|
});
|
|
}
|
|
|
|
export async function makeApp(pool: Pool): Promise<{ app: FastifyInstance; token: string }> {
|
|
const app = await buildApp({ pool, config: testConfig() });
|
|
const token = await createIngestToken(pool);
|
|
return { app, token };
|
|
}
|