Devlog-Endpoint: Bot postet Devlogs selbst — gebrandet, mit Bilder-Grid

- POST /webhooks/devlog/<secret> — Discord-Webhook-kompatibel (JSON + Multipart),
  devlog.py braucht nur die neue URL in tools/.devlog_webhook
- Bot postet Embed in Brand-Gelb mit 'D4RKST3R // DEVLOG'-Footer, bis zu 4 Bilder
  als Grid (Embed-Gruppierung über gemeinsame URL)
- Direkt-Archivierung inkl. Bilder (kein Umweg über den Live-Listener)
- Neue Env-Var DEVLOG_POST_SECRET, README-Abschnitt neu geschrieben

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 01:09:49 +02:00
co-authored by Claude Opus 4.8
parent ed69d859ca
commit bf0eca3546
8 changed files with 202 additions and 15 deletions
+5
View File
@@ -1,6 +1,7 @@
// Fastify-Webserver: Gitea-Webhook, Discord-OAuth2, REST-API + React-Frontend
import Fastify from 'fastify';
import fastifyCookie from '@fastify/cookie';
import fastifyMultipart from '@fastify/multipart';
import fastifyStatic from '@fastify/static';
import crypto from 'node:crypto';
import { existsSync } from 'node:fs';
@@ -11,6 +12,7 @@ import { saveCommits } from '../db.js';
import { postPushEmbed } from '../bot/commit-feed.js';
import { registerAuthRoutes } from './auth.js';
import { registerApiRoutes } from './api.js';
import { registerDevlogEndpoint } from './devlog-endpoint.js';
import { imagesDir } from '../bot/devlog-archive.js';
// Gebautes React-Frontend (frontend/dist) — im Container immer vorhanden,
@@ -53,9 +55,12 @@ export async function startWebServer(client) {
// Signierte Cookies (Session + OAuth-State)
await app.register(fastifyCookie, { secret: config.sessionSecret });
// Multipart für den Devlog-Endpoint (Bilder von devlog.py, max 10 MB pro Datei)
await app.register(fastifyMultipart, { limits: { fileSize: 10 * 1024 * 1024, files: 8 } });
registerAuthRoutes(app);
registerApiRoutes(app);
registerDevlogEndpoint(app, client);
// Healthcheck (für Portainer/NPM)
app.get('/health', async () => ({ status: 'ok' }));