diff --git a/server/src/lib/configuration/ConfigurationParser.ts b/server/src/lib/configuration/ConfigurationParser.ts index a67632c3b..d92d163c4 100644 --- a/server/src/lib/configuration/ConfigurationParser.ts +++ b/server/src/lib/configuration/ConfigurationParser.ts @@ -24,14 +24,14 @@ export class ConfigurationParser { const validationErrors = this.parseTypes(configuration); if (validationErrors.length > 0) { validationErrors.forEach((e: string) => { console.log(e); }); - throw new Error("Malformed configuration. Please double-check your configuration file."); + throw new Error("Malformed configuration (schema). Please double-check your configuration file."); } const [newConfiguration, completionErrors] = complete(configuration); if (completionErrors.length > 0) { completionErrors.forEach((e: string) => { console.log(e); }); - throw new Error("Malformed configuration. Please double-check your configuration file."); + throw new Error("Malformed configuration (validator). Please double-check your configuration file."); } return newConfiguration; } diff --git a/server/src/lib/configuration/schema/NotifierConfiguration.ts b/server/src/lib/configuration/schema/NotifierConfiguration.ts index 497220ef5..a4e1b0ed0 100644 --- a/server/src/lib/configuration/schema/NotifierConfiguration.ts +++ b/server/src/lib/configuration/schema/NotifierConfiguration.ts @@ -28,6 +28,9 @@ export interface NotifierConfiguration { export function complete(configuration: NotifierConfiguration): [NotifierConfiguration, string] { const newConfiguration: NotifierConfiguration = (configuration) ? JSON.parse(JSON.stringify(configuration)) : {}; + if (Object.keys(newConfiguration).length == 0) + newConfiguration.filesystem = { filename: '/tmp/authelia-notification.txt' }; + const ERROR = "Notifier must have one of the following keys: 'filesystem', 'email' or 'smtp'"; if (Object.keys(newConfiguration).length != 1)