[PR #3122] [MERGED] Prevent backup path edits when ENV is set #3874

Closed
opened 2026-04-25 00:17:24 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3122
Author: @nichwall
Created: 7/5/2024
Status: Merged
Merged: 7/5/2024
Merged by: @advplyr

Base: masterHead: backup_field_prevent_edits_with_env


📝 Commits (5)

  • 37f62d2 Add: report whether backup path environment is set
  • d46de54 Fix: bad variable name
  • 4d24817 Prevent editing backup path in web interface when env variable set
  • a168848 Fix: name of backupPathEnvSet variable
  • 7c0b4e3 Update backups config page to use backupPathEnvSet returned from endpoint, remove from ServerConfig

📊 Changes

5 files changed (+20 additions, -8 deletions)

View changed files

📝 client/components/tables/BackupsTable.vue (+1 -1)
📝 client/pages/config/backups.vue (+12 -6)
📝 client/strings/en-us.json (+1 -0)
📝 server/controllers/BackupController.js (+2 -1)
📝 server/managers/BackupManager.js (+4 -0)

📄 Description

This PR prevents the backup path from being edited in the web interface if the BACKUP_PATH environment variable is set. This is done to help prevent users from thinking their backup settings are not being applied correctly if they are not looking at the debug logs on server start as mentioned here https://github.com/advplyr/audiobookshelf/issues/2973#issuecomment-2179518347.

I changed the response for a GET request to /api/backups to include an additional value of whether this field can be editable, and set this value in the server settings in the same places where the ENV variable is checked.

Tested with setting and removing the ENV variable to make sure that the field is then editable.

View with environment variable not set:
backups_no_env

View with environment variable set:
backups_env


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3122 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 7/5/2024 **Status:** ✅ Merged **Merged:** 7/5/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `backup_field_prevent_edits_with_env` --- ### 📝 Commits (5) - [`37f62d2`](https://github.com/advplyr/audiobookshelf/commit/37f62d22b624f49b31e7f3b1f7caeff0688deec5) Add: report whether backup path environment is set - [`d46de54`](https://github.com/advplyr/audiobookshelf/commit/d46de541d6712246eef89cb18b6bbdc92ea14424) Fix: bad variable name - [`4d24817`](https://github.com/advplyr/audiobookshelf/commit/4d24817ced6b30d52b38be2a27ff7191330dc189) Prevent editing backup path in web interface when env variable set - [`a168848`](https://github.com/advplyr/audiobookshelf/commit/a1688488e5d3ff324c9aa650b7caa252da53c58f) Fix: name of `backupPathEnvSet` variable - [`7c0b4e3`](https://github.com/advplyr/audiobookshelf/commit/7c0b4e35d758c46639a1dddd494d27423ec36caa) Update backups config page to use backupPathEnvSet returned from endpoint, remove from ServerConfig ### 📊 Changes **5 files changed** (+20 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `client/components/tables/BackupsTable.vue` (+1 -1) 📝 `client/pages/config/backups.vue` (+12 -6) 📝 `client/strings/en-us.json` (+1 -0) 📝 `server/controllers/BackupController.js` (+2 -1) 📝 `server/managers/BackupManager.js` (+4 -0) </details> ### 📄 Description This PR prevents the backup path from being edited in the web interface if the `BACKUP_PATH` environment variable is set. This is done to help prevent users from thinking their backup settings are not being applied correctly if they are not looking at the debug logs on server start as mentioned here https://github.com/advplyr/audiobookshelf/issues/2973#issuecomment-2179518347. I changed the response for a `GET` request to `/api/backups` to include an additional value of whether this field can be editable, and set this value in the server settings in the same places where the ENV variable is checked. Tested with setting and removing the ENV variable to make sure that the field is then editable. View with environment variable not set: ![backups_no_env](https://github.com/advplyr/audiobookshelf/assets/5686638/534941ca-a30d-4f31-bed3-b8d64172f7ee) View with environment variable set: ![backups_env](https://github.com/advplyr/audiobookshelf/assets/5686638/debc6bc0-e42b-483b-85d2-273b419d1596) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:24 +02:00
adam closed this issue 2026-04-25 00:17:24 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3874