diff --git a/client/components/tables/BackupsTable.vue b/client/components/tables/BackupsTable.vue index 380394bd9..a8fbade61 100644 --- a/client/components/tables/BackupsTable.vue +++ b/client/components/tables/BackupsTable.vue @@ -171,7 +171,7 @@ export default { this.$axios .$get('/api/backups') .then((data) => { - this.$emit('loaded', data.backupLocation) + this.$emit('loaded', data) this.setBackups(data.backups || []) }) .catch((error) => { diff --git a/client/pages/config/backups.vue b/client/pages/config/backups.vue index dc14e4e14..7b64cbb23 100644 --- a/client/pages/config/backups.vue +++ b/client/pages/config/backups.vue @@ -16,11 +16,11 @@
- - {{ $strings.ButtonSave }} + + {{ $strings.ButtonSave }} {{ $strings.ButtonCancel }} -

{{ $strings.MessageBackupsLocationEditNote }}

+

{{ canEditBackup ? $strings.MessageBackupsLocationEditNote : $strings.MessageBackupsLocationNoEditNote }}

@@ -92,6 +92,7 @@ export default { newServerSettings: {}, showCronBuilder: false, showEditBackupPath: false, + backupPathEnvSet: false, backupLocation: '', newBackupLocation: '', savingBackupPath: false @@ -115,6 +116,10 @@ export default { timeFormat() { return this.serverSettings.timeFormat }, + canEditBackup() { + // Prevent editing of backup path if an environment variable is set + return !this.backupPathEnvSet + }, scheduleDescription() { if (!this.cronExpression) return '' const parsed = this.$parseCronExpression(this.cronExpression) @@ -127,9 +132,10 @@ export default { } }, methods: { - backupsLoaded(backupLocation) { - this.backupLocation = backupLocation - this.newBackupLocation = backupLocation + backupsLoaded(data) { + this.backupLocation = data.backupLocation + this.newBackupLocation = data.backupLocation + this.backupPathEnvSet = data.backupPathEnvSet }, cancelEditBackupPath() { this.newBackupLocation = this.backupLocation diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 74064ad55..b9b9b5def 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -605,6 +605,7 @@ "MessageAppriseDescription": "To use this feature you will need to have an instance of Apprise API running or an api that will handle those same requests.
The Apprise API Url should be the full URL path to send the notification, e.g., if your API instance is served at http://192.168.1.1:8337 then you would put http://192.168.1.1:8337/notify.", "MessageBackupsDescription": "Backups include users, user progress, library item details, server settings, and images stored in /metadata/items & /metadata/authors. Backups do not include any files stored in your library folders.", "MessageBackupsLocationEditNote": "Note: Updating the backup location will not move or modify existing backups", + "MessageBackupsLocationNoEditNote": "Note: The backup location is set through an environment variable and cannot be changed here.", "MessageBackupsLocationPathEmpty": "Backup location path cannot be empty", "MessageBatchQuickMatchDescription": "Quick Match will attempt to add missing covers and metadata for the selected items. Enable the options below to allow Quick Match to overwrite existing covers and/or metadata.", "MessageBookshelfNoCollections": "You haven't made any collections yet", diff --git a/server/controllers/BackupController.js b/server/controllers/BackupController.js index 30defb0e2..df33aa1d8 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, + backupPathEnvSet: this.backupManager.backupPathEnvSet }) } diff --git a/server/managers/BackupManager.js b/server/managers/BackupManager.js index 2749cc7ca..88772c586 100644 --- a/server/managers/BackupManager.js +++ b/server/managers/BackupManager.js @@ -29,6 +29,10 @@ class BackupManager { return global.ServerSettings.backupPath } + get backupPathEnvSet() { + return !!process.env.BACKUP_PATH + } + get backupSchedule() { return global.ServerSettings.backupSchedule }