feat: add GitHub site initialization

This commit is contained in:
Coldsmile_7
2026-06-12 00:02:23 +08:00
parent d5f7e06e4e
commit db6d6de74a
6 changed files with 641 additions and 26 deletions
+4
View File
@@ -42,6 +42,10 @@ async function handleSaveSettings(request, response) {
settings.forEach((setting) => {
if (!setting.key) return;
const existing = db.prepare("SELECT encrypted FROM system_settings WHERE key = ?").get(String(setting.key));
const shouldKeepExistingSecret = Boolean(existing?.encrypted) && Boolean(setting.encrypted) && !String(setting.value ?? "");
if (shouldKeepExistingSecret) return;
setSetting(String(setting.key), String(setting.value ?? ""), Boolean(setting.encrypted));
});