Einstellungen-Seite: .env-Werte in DB (app_state), keine .env mehr

Neue /einstellungen-Seite (Zahnrad im Header) mit allen bisherigen .env-Werten
(Ollama, E-Mail, CalDAV, REST-API), gespeichert in SQLite (app_state, cfg:-Prefix).
Libs lesen per lib/config.js zur Laufzeit statt beim Start -> Aenderungen
wirken sofort, kein Neustart. Bestehende .env wird beim ersten Start einmalig
migriert.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-13 20:57:31 +02:00
co-authored by Claude
parent 41887dd56c
commit 97b48f9841
12 changed files with 410 additions and 72 deletions
+8 -5
View File
@@ -4,7 +4,7 @@
// creates / updates / deletes events (PUT / DELETE with iCalendar VEVENTs).
// Auth is HTTP Basic over HTTPS using the same mail account as lib/mailer.
//
// Config (env):
// Config (DB, editable via /einstellungen — see lib/config.js):
// CALDAV_URL full URL of the calendar collection (must end with /)
// MAIL_USER login (shared with mail)
// MAIL_PASSWORD password (shared with mail)
@@ -14,15 +14,18 @@
// Europe/Berlin. Wall-clock input from the UI is converted with wallToUtc().
const crypto = require('crypto');
const config = require('./config');
const TZ = 'Europe/Berlin';
// Read fresh on every call so an edit on the /einstellungen page takes effect
// immediately (values live in the DB now, not in process.env/.env).
function cfg() {
return {
url: (process.env.CALDAV_URL || '').trim(),
user: process.env.MAIL_USER || '',
pass: process.env.MAIL_PASSWORD || '',
alarmMin: Number(process.env.CALDAV_ALARM_MIN) || 60,
url: (config.get('CALDAV_URL') || '').trim(),
user: config.get('MAIL_USER') || '',
pass: config.get('MAIL_PASSWORD') || '',
alarmMin: Number(config.get('CALDAV_ALARM_MIN')) || 60,
};
}