system settings

This commit is contained in:
Alex Holliday committed 2025-11-19 00:00:08 +00:00
1 parent 986e8b926a
commit f40667615e
14 files changed
+244 -1

No files matched your search

+3
View File
@@ -56,3 +56,6 @@ export type { IRecoveryToken } from "./recovery/RecoveryToken.js";
export { Incident, ResolutionTypes } from "./incidents/Incident.js";
export type { IIncident, ResolutionType } from "./incidents/Incident.js";
export { SystemSettings } from "./system/SystemSettings.js";
export type { ISystemSettings } from "./system/SystemSettings.js";
@@ -0,0 +1,45 @@
import mongoose, { Schema, Document } from "mongoose";
export interface ISystemSettings extends Document {
systemEmailHost?: string;
systemEmailPort?: number;
systemEmailAddress?: string;
systemEmailPassword?: string;
systemEmailUser?: string;
systemEmailConnectionHost?: string;
systemEmailTLSServername?: string;
systemEmailSecure: boolean;
systemEmailPool: boolean;
systemEmailIgnoreTLS: boolean;
systemEmailRequireTLS: boolean;
systemEmailRejectUnauthorized: boolean;
}
const SystemSettingsSchema = new Schema<ISystemSettings>(
{
_id: { type: String, default: "global", immutable: true },
systemEmailHost: { type: String },
systemEmailPort: { type: Number },
systemEmailAddress: { type: String },
systemEmailPassword: { type: String },
systemEmailUser: { type: String },
systemEmailConnectionHost: { type: String, default: "localhost" },
systemEmailTLSServername: { type: String },
systemEmailSecure: { type: Boolean, default: false },
systemEmailPool: { type: Boolean, default: false },
systemEmailIgnoreTLS: { type: Boolean, default: false },
systemEmailRequireTLS: { type: Boolean, default: false },
systemEmailRejectUnauthorized: { type: Boolean, default: true },
},
{
timestamps: true,
collection: "system_settings",
}
);
SystemSettingsSchema.index({ _id: 1 }, { unique: true });
export const SystemSettings = mongoose.model<ISystemSettings>(
"SystemSettings",
SystemSettingsSchema
);