refactor(server): legacy services read env via app-config

This commit is contained in:
jubnl
2026-07-25 15:37:37 +02:00
parent d13758221e
commit 7f795a2199
15 changed files with 98 additions and 97 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import { ADDON_IDS } from '../addons';
import { readEnv } from '../app-config';
import { updateJwtSecret } from '../config';
import { db } from '../db/database';
import { revokeUserSessions, revokeUserSessionsForClient } from '../mcp';
@@ -349,7 +350,7 @@ export function updateOidcSettings(data: {
// ── Demo Baseline ──────────────────────────────────────────────────────────
export function saveDemoBaseline(): { error?: string; status?: number; message?: string } {
if (process.env.DEMO_MODE?.toLowerCase() !== 'true') {
if (!readEnv().demo.enabled) {
return { error: 'Not found', status: 404 };
}
try {
@@ -399,7 +400,7 @@ export async function checkVersion(): Promise<VersionInfo> {
return _versionCache.data;
}
const currentVersion: string = process.env.APP_VERSION || require('../../package.json').version;
const currentVersion: string = readEnv().app.appVersion || require('../../package.json').version;
const isPrerelease = currentVersion.includes('-pre.');
const fallback: VersionInfo = {
current: currentVersion,