diff --git a/server/controllers/BackupController.js b/server/controllers/BackupController.js index 30defb0e..69eae30a 100644 --- a/server/controllers/BackupController.js +++ b/server/controllers/BackupController.js @@ -10,7 +10,8 @@ class BackupController { getAll(req, res) { res.json({ backups: this.backupManager.backups.map((b) => b.toJSON()), - backupLocation: this.backupManager.backupPath + backupLocation: this.backupManager.backupPath, + backupEnvSet: this.backupManager.backupPathEnvSet }) } diff --git a/server/managers/BackupManager.js b/server/managers/BackupManager.js index 2749cc7c..ae79569c 100644 --- a/server/managers/BackupManager.js +++ b/server/managers/BackupManager.js @@ -29,6 +29,10 @@ class BackupManager { return global.ServerSettings.backupPath } + get backupPathEnvSet() { + return global.ServerSettings.backupPathEnvSet + } + get backupSchedule() { return global.ServerSettings.backupSchedule } diff --git a/server/objects/settings/ServerSettings.js b/server/objects/settings/ServerSettings.js index 6ade11a9..d5519c52 100644 --- a/server/objects/settings/ServerSettings.js +++ b/server/objects/settings/ServerSettings.js @@ -26,6 +26,7 @@ class ServerSettings { this.rateLimitLoginWindow = 10 * 60 * 1000 // 10 Minutes // Backups + this.backupPathEnvSet = false this.backupPath = Path.join(global.MetadataPath, 'backups') this.backupSchedule = false // If false then auto-backups are disabled this.backupsToKeep = 2 @@ -188,6 +189,8 @@ class ServerSettings { Logger.info(`[ServerSettings] Using backup path from environment variable ${process.env.BACKUP_PATH}`) this.backupPath = process.env.BACKUP_PATH } + + this.backupPathEnvSet = !!settings.process.env.BACKUP_PATH || false } toJSON() { @@ -206,6 +209,7 @@ class ServerSettings { rateLimitLoginRequests: this.rateLimitLoginRequests, rateLimitLoginWindow: this.rateLimitLoginWindow, backupPath: this.backupPath, + backupPathEnvSet: this.backupPathEnvSet, backupSchedule: this.backupSchedule, backupsToKeep: this.backupsToKeep, maxBackupSize: this.maxBackupSize,