[PR #4528] [MERGED] [core] Refactor Config File function #5058

Closed
opened 2025-11-20 07:04:04 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/4528
Author: @michelroegl-brunner
Created: 5/16/2025
Status: Merged
Merged: 5/16/2025
Merged by: @tremor021

Base: mainHead: refactor_configfile


📝 Commits (2)

  • e5bb633 Refactor Config File function
  • 9690b87 Refactor Config File function

📊 Changes

2 files changed (+648 additions, -279 deletions)

View changed files

📝 misc/build.func (+72 -279)
misc/config-file.func (+576 -0)

📄 Description

✍️ Description

This PR refactors the configuration handling logic to improve flexibility and reduce file complexity.

Key Changes:

Interactive Configuration:
Replaces the use of default values with an interactive Whiptail prompt when required config options are missing. This ensures users explicitly provide necessary input instead of relying on hardcoded defaults.

Persistent Configuration:
Adds the ability to save user-provided settings to a config file, either after using the config file option or after completing the advanced settings flow. This improves usability and reduces repeated input.

Modular Code Structure:
Extracts the configuration-related logic from build.func into a separate file. This helps reduce the size of build.func and keeps it more maintainable. The new config script is sourced only when the config file option is used.

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/4528 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 5/16/2025 **Status:** ✅ Merged **Merged:** 5/16/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `refactor_configfile` --- ### 📝 Commits (2) - [`e5bb633`](https://github.com/community-scripts/ProxmoxVE/commit/e5bb633e02900d004bb53dfb3adf51552c05284d) Refactor Config File function - [`9690b87`](https://github.com/community-scripts/ProxmoxVE/commit/9690b876957744714826558f90e4d993a4d53bb2) Refactor Config File function ### 📊 Changes **2 files changed** (+648 additions, -279 deletions) <details> <summary>View changed files</summary> 📝 `misc/build.func` (+72 -279) ➕ `misc/config-file.func` (+576 -0) </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 This PR refactors the configuration handling logic to improve flexibility and reduce file complexity. Key Changes: Interactive Configuration: Replaces the use of default values with an interactive Whiptail prompt when required config options are missing. This ensures users explicitly provide necessary input instead of relying on hardcoded defaults. Persistent Configuration: Adds the ability to save user-provided settings to a config file, either after using the config file option or after completing the advanced settings flow. This improves usability and reduces repeated input. Modular Code Structure: Extracts the configuration-related logic from build.func into a separate file. This helps reduce the size of build.func and keeps it more maintainable. The new config script is sourced only when the config file option is used. ## 🔗 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) - [ ] 🐞 **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. - [X] 🔧 **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>
saavagebueno added the pull-request label 2025-11-20 07:04:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5058