[PR #8553] [MERGED] Guardian: Added validation before copying file and fix build command error #7496

Closed
opened 2026-02-26 15:35:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/8553
Author: @HydroshieldMKII
Created: 10/21/2025
Status: Merged
Merged: 10/21/2025
Merged by: @tremor021

Base: mainHead: fix-guardian


📝 Commits (1)

  • fb08156 Added validation before copying file and fix build command error

📊 Changes

1 file changed (+4 additions, -3 deletions)

View changed files

📝 ct/guardian.sh (+4 -3)

📄 Description

✍️ Description

  1. Added validation before copying the .env on update since by default there is no .env and it is very optional.

the output was:

  ✔️   Stopped Services
  ✔️   Backed up Database
cp: cannot stat '/opt/guardian/.env': No such file or directory

[ERROR] in line 43: exit code 0: while executing command cp /opt/guardian/.env /opt
  1. Also fixed the build command on update, the environment variable was being interpreted as a command therefore failing

the output was:

line 64: DEPLOYMENT_MODE=standalone: command not found

[ERROR] in line 64: exit code 0: while executing command $STD DEPLOYMENT_MODE=standalone npm run build

Link: #

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 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/community-scripts/ProxmoxVE/pull/8553 **Author:** [@HydroshieldMKII](https://github.com/HydroshieldMKII) **Created:** 10/21/2025 **Status:** ✅ Merged **Merged:** 10/21/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `fix-guardian` --- ### 📝 Commits (1) - [`fb08156`](https://github.com/community-scripts/ProxmoxVE/commit/fb08156ff1552ea8dffee99648fcad9301b14fc3) Added validation before copying file and fix build command error ### 📊 Changes **1 file changed** (+4 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `ct/guardian.sh` (+4 -3) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description 1. Added validation before copying the .env on update since by default there is no .env and it is very optional. the output was: ``` ✔️ Stopped Services ✔️ Backed up Database cp: cannot stat '/opt/guardian/.env': No such file or directory [ERROR] in line 43: exit code 0: while executing command cp /opt/guardian/.env /opt ``` 2. Also fixed the build command on update, the environment variable was being interpreted as a command therefore failing the output was: ``` line 64: DEPLOYMENT_MODE=standalone: command not found [ERROR] in line 64: exit code 0: while executing command $STD DEPLOYMENT_MODE=standalone npm run build ``` ## 🔗 Related PR / Issue Link: # ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 15:35:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#7496
No description provided.