sidecar network host

This commit is contained in:
2026-02-26 03:32:04 +00:00
parent 42abb97d7b
commit 466dc3adda
8 changed files with 310 additions and 420 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import { createTransport, type Transporter } from 'nodemailer';
import { homedir } from 'node:os';
import { join } from 'node:path';
const { MAIL_TRANSPORT } = process.env;
const { MAIL_TRANSPORT, DATA_PATH } = process.env;
const dataPath = DATA_PATH ?? join(process.cwd(), 'data');
type SmtpConfig = {
provider: 'resend' | 'smtp' | 'mailhog';
@@ -15,7 +16,7 @@ type SmtpConfig = {
fromEmail: string;
};
const settingsPath = `${homedir()}/.config/officer.dev/server-settings.json`;
const settingsPath = join(dataPath, 'server-settings', 'server-settings.json');
let cachedTransport: Transporter | null = null;
let cachedConfigHash: string | null = null;