This commit is contained in:
2026-06-25 20:57:09 -05:00
parent 552b86c323
commit e47d09d7d6
35 changed files with 4507 additions and 101 deletions

View File

@@ -1,6 +1,8 @@
import { db, now } from '../db.js';
import { config } from '../config.js';
const runtimeEditableEnvKeys = new Set(['powershell_bin']);
export function getSetting(key) {
const row = db.prepare('SELECT value FROM settings WHERE key = ?').get(key);
return row ? row.value : undefined;
@@ -45,7 +47,7 @@ export function updateSettings(payload) {
for (const [key, value] of entries) {
// Env-pinned settings are owned by the deployment environment; ignore
// attempts to override them so the UI and process never disagree.
if (sourceOf.get(key)?.source === 'env') continue;
if (sourceOf.get(key)?.source === 'env' && !runtimeEditableEnvKeys.has(key)) continue;
stmt.run(key, String(value ?? ''), now());
}
return settingsPayload();