Monitoring settings (Sentry, Umami) and the CSP origins come from the build environment
One build per environment: PROD_* variables for the production artifact, TEST_* for the test build and the CSP check. The build fails when a variable is empty. Tests use the production values from config/monitoringTestEnv.ts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,15 @@
|
||||
// Draait direct met Node (type stripping), zonder extra tooling.
|
||||
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||
import { dirname } from 'node:path';
|
||||
import { monitoringTestEnv } from './monitoringTestEnv.ts';
|
||||
import { serverConfigFiles } from './serverConfig.ts';
|
||||
|
||||
// The committed files carry the CSP of the production build; the origins of
|
||||
// Umami and Sentry come from the environment (src/monitoring/config.ts)
|
||||
for (const [name, value] of Object.entries(monitoringTestEnv)) {
|
||||
process.env[name] ??= value;
|
||||
}
|
||||
|
||||
for (const [path, generate] of Object.entries(serverConfigFiles)) {
|
||||
mkdirSync(dirname(path), { recursive: true });
|
||||
writeFileSync(path, generate());
|
||||
|
||||
Reference in New Issue
Block a user