Add the optional Immich integration and manual gallery push
Immich connections stay server-side with an encrypted API key, albums can be imported, and photos are only sent back when an event's push button is pressed: originals upload once, edited photos re-render, and edits hashes plus checksums skip anything already in Immich. This also lands the accompanying editor, cloud and administration work that was still uncommitted. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+12
-2
@@ -1,5 +1,6 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import { kv } from './db.mjs';
|
||||
import { open, seal } from './secrets.mjs';
|
||||
import {
|
||||
SMTP_APP_PASSWORD,
|
||||
SMTP_FROM,
|
||||
@@ -13,7 +14,16 @@ const SETTINGS_KEY = 'mailSettings';
|
||||
|
||||
function savedSettings() {
|
||||
const value = kv.get(SETTINGS_KEY);
|
||||
return value && typeof value === 'object' ? value : {};
|
||||
if (!value || typeof value !== 'object') return {};
|
||||
if (typeof value.appPassword === 'string' && value.appPassword) {
|
||||
try {
|
||||
return { ...value, appPassword: open(value.appPassword) };
|
||||
} catch (err) {
|
||||
console.error('[luminary] could not decrypt the saved SMTP password:', err.message);
|
||||
return { ...value, appPassword: '' };
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/** Never returns the app password; `hasPassword` is enough for the admin UI. */
|
||||
@@ -70,7 +80,7 @@ function validateSettings(input) {
|
||||
|
||||
export function saveMailSettings(input) {
|
||||
const next = validateSettings(input ?? {});
|
||||
kv.set(SETTINGS_KEY, next);
|
||||
kv.set(SETTINGS_KEY, { ...next, appPassword: seal(next.appPassword) });
|
||||
return mailStatus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user