Initial
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user