This commit is contained in:
seb
2026-10-10 02:08:10 +02:00
parent d4e2b05cb0
commit 7f8661be3e
43 changed files with 3312 additions and 2339 deletions

View File

@@ -2,6 +2,8 @@ import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// #region Helpers
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const CRASH_DUMP_DIR = process.env.CRASH_DUMP_DIR || path.resolve(__dirname, '../../../logs/crash-dumps');
@@ -11,6 +13,8 @@ function telemetryErrorStatus(error) {
return 500;
}
// #endregion
/**
* Registers public telemetry endpoints (no session/cookie auth required).
* @param {import('express').Application} app
@@ -73,6 +77,8 @@ export function register(app, basePath = '') {
* error:
* type: string
*/
// #region POST /public/telemetry/crash
const routePaths = [`${basePath}/public/telemetry/crash`];
if (basePath && !routePaths.includes('/public/telemetry/crash')) {
routePaths.push('/public/telemetry/crash');
@@ -106,4 +112,6 @@ export function register(app, basePath = '') {
res.status(status).json({ error: error.message || 'Internal server error' });
}
});
// #endregion
}