Skip to content

V2.0 - Proxmox Scripts Update#19

Merged
coelacant1 merged 17 commits intomainfrom
testing
Nov 25, 2025
Merged

V2.0 - Proxmox Scripts Update#19
coelacant1 merged 17 commits intomainfrom
testing

Conversation

@coelacant1
Copy link
Copy Markdown
Owner


name: V2.0 - Proxmox Scripts Update
about: Major refactor introducing unified utility frameworks, testing system, and remote cluster management
title: "[PR] V2.0 - Unified Utility Framework and Remote Cluster Management"
labels: enhancement
assignees: 'coelacant1'

Description

Version 2.0 is an architectural refactor that provides comprehensive utility frameworks, standardizes script behavior across the entire codebase, and adds remote cluster management capabilities.

Key Improvements:

Unified Utility Framework

  • ArgumentParser.sh - Standardized argument parsing with built-in validation, automatic help text generation, and support for common types (vmid, string, integer, boolean, range)
  • BulkOperations.sh - Unified framework for bulk VM/LXC operations with consistent error handling, progress reporting, and operation summaries
  • Operations.sh (formerly ProxmoxAPI.sh) - Centralized Proxmox API wrapper functions for VM/LXC operations, disk management, and pool operations
  • Network.sh - Network utility functions for IP validation, manipulation, and network configuration
  • TestFramework.sh - Comprehensive testing framework with unit testing, integration testing, and automated testing

Remote Cluster Management

  • Execute scripts on single or multiple Proxmox nodes without re-downloading the repository
  • Temporary multi-remote mode supporting IP ranges (192.168.1.100-200) or VMID ranges
  • Dual log output with separate .log and .debug.log files for structured logging (local and remote)
  • Debug flag support (./GUI.sh -d) for detailed remote execution logging
  • Interrupt handling (Ctrl+C) cleanly cancels remaining nodes during remote operations

Comprehensive Testing System

  • Test suites for all major utility frameworks (_TestArgumentParser.sh, _TestBulkOperations.sh, _TestNetwork.sh, _TestOperations.sh, _TestStateManager.sh)
  • RunAllTests.sh for automated test execution across all utilities
  • Integration test examples demonstrating proper framework usage
  • Unit testing capabilities with assertion functions and result reporting

Script Compliance Standards

  • All scripts refactored with consistent headers: shebang -> documentation -> Function Index -> set -euo pipefail -> code
  • Standardized set -euo pipefail for robust error handling (fixed duplicates and misplaced commands)
  • All bulk operation scripts (80+ files) migrated to use ArgumentParser and BulkOperations frameworks
  • Consistent error handling and user feedback across entire codebase
  • Automated source dependency verification with VerifySourceCalls.py

Quality Assurance Tools

  • Enhanced .check/_RunChecks.sh with better validation and reporting
  • UpdateUtilityDocumentation.py for automatic utility function documentation
  • VerifySourceCalls.py with fix mode for adding/removing dependencies and shellcheck directives
  • _ScriptComplianceChecklist.md for code quality verification

Cross-Platform GUI Improvements

  • Auto-detects package manager (apt, dnf, yum, zypper, pacman) for any Linux distribution
  • Polymorphic menu system with centralized common operations (settings, help, back, exit)
  • Branch management accessible from all menus
  • Simplified navigation with consistent input prompts
  • Parameter history with readline shortcuts

New Utility Scripts

  • VirtualMachines/Operations/BulkHibernate.sh, BulkSuspend.sh, BulkResume.sh
  • VirtualMachines/Hardware/BulkToggleTabletPointer.sh
  • VirtualMachines/Storage/BulkConfigureDisk.sh
  • Storage/AddStorage.sh (NFS, SMB/CIFS, PBS support)
  • Storage/RemoveStorage.sh (safe removal with usage checks)

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update
  • Other (please describe):

Breaking Changes:

  • Renamed utilities: ProxmoxAPI.sh -> Operations.sh, Queries.sh -> Cluster.sh, NetworkHelper.sh -> Network.sh
  • Removed BatchRunCLI.sh (functionality integrated into GUI.sh)
  • Function renames: __prompt_yes_no__ -> __prompt_user_yn__

How Has This Been Tested?

Test Infrastructure:

  • Created comprehensive test suites for all major utility frameworks
  • RunAllTests.sh executes automated tests for ArgumentParser, BulkOperations, Network, Operations, StateManager, and RemoteExec utilities
  • Integration test examples demonstrate proper framework usage patterns

Testing Performed:

  • All utility test suites pass successfully
  • ArgumentParser validation for common types (vmid, string, integer, boolean, range)
  • BulkOperations framework with 80+ refactored scripts tested for consistency
  • Remote execution tested on single and multiple Proxmox nodes
  • Cross-platform GUI tested on multiple Linux distributions (Debian, Ubuntu, Fedora, Arch)
  • Source dependency verification with VerifySourceCalls.py
  • Script header standardization across entire codebase

Test Configuration:

  • Proxmox VE 9.x cluster with 5 nodes and Proxmox VE 8.4.X cluster with 20 nodes
  • Remote execution from Arch workstation
  • Test VMs and LXC containers for bulk operation validation
  • Various storage backends (local, Ceph, NFS, SMB) for storage script testing

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code where necessary.
  • I have made corresponding changes to the documentation.
  • My changes do not generate new warnings or errors.
  • I have tested this code.

Additional Compliance:

  • All scripts follow standardized header format (per CONTRIBUTING.md)
  • ArgumentParser integration for non-interactive scripts
  • Proper utility sourcing with shellcheck directives
  • Function documentation with @function, @description, @param tags
  • Communication functions (__info__, __ok__, __err__) instead of plain echo
  • set -euo pipefail for error handling
  • Updated Utilities/_Utilities.md with comprehensive function documentation
  • All source dependencies verified with VerifySourceCalls.py
  • Test coverage for all new frameworks

Related Issues

This pull request adds significant improvements and addresses several architectural concerns:

  • Standardizes script behavior and error handling
  • Reduces code duplication through utility frameworks
  • Adds remote cluster management capabilities
  • Adds testing infrastructure for quality assurance
  • Adds cross-platform compatibility for GUI execution

Related to ongoing work documented in CHANGELOG.md sections [2.0.0] through [2.1.5].

Documentation Updates

  • README.md - Updated with V2.0 features, remote execution guide, and cross-platform information
  • CONTRIBUTING.md - Enhanced with ArgumentParser standards (Section 3.10) and compliance requirements
  • CHANGELOG.md - Comprehensive V2.0.0 entry with detailed changes (lines 8-397)
  • Utilities/_Utilities.md - Expanded with function documentation for all utility frameworks
  • Script Headers - Headers updated to reflect current state of scripts

coelacant1 and others added 17 commits October 14, 2025 16:39
### Added
- **VirtualMachines/Backup/** - New directory structure for VM backup operations
  - BulkBackup.sh - Relocated and enhanced bulk VM backup functionality
- **VirtualMachines/Configuration/** - New directory for VM configuration scripts
  - VMAddTerminalTTYS0.sh - Relocated terminal configuration script
- **VirtualMachines/Operations/BulkMigrate.sh** - New script for VM migration operations
- **VirtualMachines/Operations/-BulkHibernate.sh** - New script for bulk VM hibernation (in development)
- **.docs/** - New documentation directory structure
- **.gitignore** - Added Git ignore file for repository hygiene
- **CHANGELOG.md** - Comprehensive changelog with detailed version history and verbose commit descriptions

### Changed
- Major refactoring of VirtualMachines directory structure with improved organization
- Updated multiple VM management scripts:
  - Utilities/Queries.sh - Enhanced query functionality
  - VirtualMachines/BulkAddIPToNote.sh - Improved IP note management
  - CloudInit scripts: BulkAddSSHKey.sh, BulkChangeDNS.sh, BulkChangeIP.sh, BulkChangeUserPass.sh, BulkMoveCloudInit.sh, BulkTogglePackageUpgrade.sh
  - Hardware scripts: BulkChangeNetwork.sh, BulkSetCPUTypeCoreCount.sh, BulkSetMemoryConfig.sh, BulkUnmountISOs.sh
  - Operations scripts: BulkDelete.sh, BulkRemoteMigrate.sh, BulkReset.sh, BulkStart.sh, BulkStop.sh, BulkUnlock.sh
  - Options scripts: BulkEnableGuestAgent.sh, BulkToggleProtectionMode.sh, BulkToggleStartAtBoot.sh
  - Storage scripts: BulkChangeStorage.sh, BulkMoveDisk.sh, BulkResizeStorage.sh

### Removed
- VirtualMachines/Hardware/VMAddTerminalTTYS0.sh - Relocated to Configuration directory
- VirtualMachines/Operations/BulkBackup.sh - Relocated to Backup directory
… pointer), minor fixes,

### Added
- **RemoteManagement/ApacheGuacamole/RDP/BulkRemoveRDPConnection.sh** - New script for bulk removal of Guacamole RDP connections
  - Supports removal by substring search or VMID range
  - Includes safety confirmation prompts
  - Two operating modes: substring search and VMID range deletion
- **Storage/AddStorage.sh** - Comprehensive script for adding storage to Proxmox cluster
  - Supports NFS, SMB/CIFS, and Proxmox Backup Server (PBS) storage types
  - Configurable content types, mount options, and node targeting
  - Built-in validation and error handling
- **Storage/RemoveStorage.sh** - Safe storage removal script
  - Checks for storage usage before removal
  - Supports force removal option
  - Validates storage exists before attempting removal
- **VirtualMachines/Hardware/BulkConfigureCPU.sh** - New script for bulk CPU configuration
- **VirtualMachines/Hardware/BulkConfigureNetwork.sh** - New script for bulk network configuration
- **.check/VerifySourceCalls.py** - Enhanced with improved dependency detection and fix mode
  - Automatically adds missing source dependencies
  - Removes unused source includes
  - Adds proper shellcheck directives

### Changed
- **Major dependency cleanup** - Fixed source call dependencies across 42+ shell scripts
  - Removed unused source includes from multiple scripts
  - Added missing dependencies (Communication.sh, Prompts.sh) where needed
  - All scripts now pass VerifySourceCalls validation
- **Line ending normalization** - Converted CRLF to LF across all modified scripts for Unix compatibility
- **Utilities/Communication.sh** - Added new utility functions for better script communication
- **Utilities/Prompts.sh** - Enhanced prompt utilities with additional functionality
- **Utilities/Utilities.md** - Expanded documentation for utility functions
- **Resources/ChangeAllMACPrefix.sh** - Fixed missing source dependencies
- Updated multiple VM management scripts:
  - VirtualMachines/BulkAddIPToNote.sh - Removed unused dependencies
  - CloudInit scripts: BulkAddSSHKey.sh, BulkChangeDNS.sh, BulkChangeIP.sh, BulkChangeUserPass.sh, BulkMoveCloudInit.sh, BulkTogglePackageUpgrade.sh
  - Hardware scripts: BulkSetCPUTypeCoreCount.sh, BulkSetMemoryConfig.sh, BulkUnmountISOs.sh
  - Operations scripts: BulkDelete.sh, BulkMigrate.sh, BulkRemoteMigrate.sh, BulkReset.sh, BulkStart.sh, BulkStop.sh, BulkUnlock.sh
  - Options scripts: BulkEnableGuestAgent.sh, BulkToggleProtectionMode.sh, BulkToggleStartAtBoot.sh
  - Storage scripts: BulkChangeStorage.sh, BulkMoveDisk.sh, BulkResizeStorage.sh
  - Backup scripts: BulkBackup.sh
- **Networking/BulkPrintVMIDMacAddresses.sh** - Removed unused Prompts.sh and Queries.sh dependencies
- **Storage/Ceph/** - Cleaned up dependencies in Ceph cluster management scripts
  - RestartManagers.sh, RestartMetadata.sh, RestartMonitors.sh, RestartOSDs.sh
- **RemoteManagement/ApacheGuacamole/RDP/** - Fixed dependencies in multiple scripts
  - BulkAddSFTPServer.sh, BulkPrintRDPConfiguration.sh, BulkRemoveSFTPServer.sh
- **RemoteManagement/ConfigureOverSSH/** - Dependency cleanup in SSH configuration scripts

### Fixed
- **Storage/AddStorage.sh** - Fixed line ending formatting (CRLF → LF)
- **Storage/RemoveStorage.sh** - Fixed line ending formatting (CRLF → LF)
- **Storage/Ceph/SetScrubInterval.sh** - Added missing source dependencies and fixed formatting
- All scripts now have proper shellcheck source directives for IDE integration

### Removed
- **VirtualMachines/Hardware/BulkChangeNetwork.sh** - Deprecated (replaced by BulkConfigureNetwork.sh)
- **VirtualMachines/Operations/-BulkHibernate.sh** - Removed incomplete development script
… pointer), minor fixes,

### Added
- **RemoteManagement/ApacheGuacamole/RDP/BulkRemoveRDPConnection.sh** - New script for bulk removal of Guacamole RDP connections
  - Supports removal by substring search or VMID range
  - Includes safety confirmation prompts
  - Two operating modes: substring search and VMID range deletion
- **Storage/AddStorage.sh** - Comprehensive script for adding storage to Proxmox cluster
  - Supports NFS, SMB/CIFS, and Proxmox Backup Server (PBS) storage types
  - Configurable content types, mount options, and node targeting
  - Built-in validation and error handling
- **Storage/RemoveStorage.sh** - Safe storage removal script
  - Checks for storage usage before removal
  - Supports force removal option
  - Validates storage exists before attempting removal
- **VirtualMachines/Hardware/BulkConfigureCPU.sh** - New script for bulk CPU configuration
- **VirtualMachines/Hardware/BulkConfigureNetwork.sh** - New script for bulk network configuration
- **.check/VerifySourceCalls.py** - Enhanced with improved dependency detection and fix mode
  - Automatically adds missing source dependencies
  - Removes unused source includes
  - Adds proper shellcheck directives

### Changed
- **Major dependency cleanup** - Fixed source call dependencies across 42+ shell scripts
  - Removed unused source includes from multiple scripts
  - Added missing dependencies (Communication.sh, Prompts.sh) where needed
  - All scripts now pass VerifySourceCalls validation
- **Line ending normalization** - Converted CRLF to LF across all modified scripts for Unix compatibility
- **Utilities/Communication.sh** - Added new utility functions for better script communication
- **Utilities/Prompts.sh** - Enhanced prompt utilities with additional functionality
- **Utilities/Utilities.md** - Expanded documentation for utility functions
- **Resources/ChangeAllMACPrefix.sh** - Fixed missing source dependencies
- Updated multiple VM management scripts:
  - VirtualMachines/BulkAddIPToNote.sh - Removed unused dependencies
  - CloudInit scripts: BulkAddSSHKey.sh, BulkChangeDNS.sh, BulkChangeIP.sh, BulkChangeUserPass.sh, BulkMoveCloudInit.sh, BulkTogglePackageUpgrade.sh
  - Hardware scripts: BulkSetCPUTypeCoreCount.sh, BulkSetMemoryConfig.sh, BulkUnmountISOs.sh
  - Operations scripts: BulkDelete.sh, BulkMigrate.sh, BulkRemoteMigrate.sh, BulkReset.sh, BulkStart.sh, BulkStop.sh, BulkUnlock.sh
  - Options scripts: BulkEnableGuestAgent.sh, BulkToggleProtectionMode.sh, BulkToggleStartAtBoot.sh
  - Storage scripts: BulkChangeStorage.sh, BulkMoveDisk.sh, BulkResizeStorage.sh
  - Backup scripts: BulkBackup.sh
- **Networking/BulkPrintVMIDMacAddresses.sh** - Removed unused Prompts.sh and Queries.sh dependencies
- **Storage/Ceph/** - Cleaned up dependencies in Ceph cluster management scripts
  - RestartManagers.sh, RestartMetadata.sh, RestartMonitors.sh, RestartOSDs.sh
- **RemoteManagement/ApacheGuacamole/RDP/** - Fixed dependencies in multiple scripts
  - BulkAddSFTPServer.sh, BulkPrintRDPConfiguration.sh, BulkRemoveSFTPServer.sh
- **RemoteManagement/ConfigureOverSSH/** - Dependency cleanup in SSH configuration scripts

### Fixed
- **Storage/AddStorage.sh** - Fixed line ending formatting (CRLF → LF)
- **Storage/RemoveStorage.sh** - Fixed line ending formatting (CRLF → LF)
- **Storage/Ceph/SetScrubInterval.sh** - Added missing source dependencies and fixed formatting
- All scripts now have proper shellcheck source directives for IDE integration

### Removed
- **VirtualMachines/Hardware/BulkChangeNetwork.sh** - Deprecated (replaced by BulkConfigureNetwork.sh)
- **VirtualMachines/Operations/-BulkHibernate.sh** - Removed incomplete development script
### Overview
Version 2.0 introduces new utility frameworks that standardize script behavior across the codebase. Key additions include ArgumentParser for consistent argument handling, BulkOperations for unified bulk operations, ProxmoxAPI for centralized Proxmox interactions, and TestFramework for automated testing. All scripts have been refactored to use these utilities and follow consistent error handling patterns.

### Added
- **Utilities/ArgumentParser.sh** - New comprehensive argument parsing framework
  - Standardized argument handling across all scripts
  - Built-in validation for common types (vmid, string, integer, boolean, range)
  - Automatic help text generation and error messages
  - Support for optional and required parameters
- **Utilities/BulkOperations.sh** - Unified framework for bulk VM/LXC operations
  - Standardized operation patterns with consistent error handling
  - Built-in progress reporting and operation summaries
  - Automatic success/failure tracking with detailed statistics
  - Support for both range and pool-based operations
- **Utilities/ProxmoxAPI.sh** - Centralized Proxmox API wrapper functions
  - Consistent VM/LXC operations (start, stop, reset, migrate, etc.)
  - Standardized disk and hardware management functions
  - Pool and node management utilities
  - Improved error handling and validation
- **Utilities/NetworkHelper.sh** - Network utility functions for IP and network operations
  - IP address validation and manipulation
  - Network configuration helpers
  - DNS and network interface utilities
- **Utilities/StateManager.sh** - State management system for complex operations
  - Transaction-like state tracking for multi-step operations
  - Rollback capabilities for failed operations
  - Persistent state storage and recovery
- **Utilities/TestFramework.sh** - Comprehensive testing framework for shell scripts
  - Unit testing capabilities for utility functions
  - Integration testing support
  - Test assertion functions and result reporting
  - Automated test discovery and execution
- **Utilities/_TestArgumentParser.sh** - Test suite for ArgumentParser functionality
- **Utilities/_TestBulkOperations.sh** - Test suite for BulkOperations framework
- **Utilities/_TestNetworkHelper.sh** - Test suite for NetworkHelper utilities
- **Utilities/_TestProxmoxAPI.sh** - Test suite for ProxmoxAPI functions
- **Utilities/_TestRemoteExec.sh** - Test suite for remote execution utilities
- **Utilities/_TestStateManager.sh** - Test suite for StateManager functionality
- **Utilities/_TestIntegrationExample.sh** - Example integration test demonstrating framework usage
- **Utilities/RunAllTests.sh** - Automated test runner for all utility test suites
- **Utilities/_ScriptComplianceChecklist.md** - Comprehensive script compliance and quality checklist
- **VirtualMachines/Operations/BulkHibernate.sh** - New script for bulk VM hibernation
- **VirtualMachines/Operations/BulkSuspend.sh** - New script for bulk VM suspend operations
- **VirtualMachines/Operations/BulkResume.sh** - New script for bulk VM resume operations
- **VirtualMachines/Hardware/BulkToggleTabletPointer.sh** - New script for bulk tablet pointer device configuration
- **VirtualMachines/Storage/BulkConfigureDisk.sh** - New comprehensive disk configuration script

### Changed
- **Standardized script headers across entire codebase** - Fixed malformed headers
  - All scripts now follow consistent format: shebang -> documentation -> Function Index -> `set -euo pipefail` -> code
  - Removed duplicate `set -` commands that were scattered throughout script headers
  - Removed misplaced early `set -` commands that appeared before documentation blocks
  - Changed `set -u` to `set -euo pipefail` for proper error handling with pipefail and errexit
  - Fixed scripts where Function Index and documentation blocks were duplicated
  - Scripts with heredocs containing `set -euo pipefail` for remote execution are intentionally preserved
  - Affected all major script directories: Cluster/, Firewall/, HighAvailability/, Host/, LXC/, Networking/, RemoteManagement/, Security/, Storage/, VirtualMachines/
  - Improved consistency, maintainability, and error handling across all scripts
- **Refactored scripts to use new ArgumentParser and BulkOperations frameworks**
  - All bulk operation scripts now use consistent argument parsing
  - Unified error handling and reporting across all bulk operations
  - Standardized output format with operation summaries
  - Improved validation and user feedback
  - Scripts automatically generate consistent help text
- **Major refactoring of VM/LXC bulk operation scripts** - Converted to use new frameworks
  - VirtualMachines/Operations/: BulkMigrate.sh, BulkStart.sh, BulkStop.sh, BulkReset.sh, BulkDelete.sh, BulkClone.sh, BulkUnlock.sh, BulkRemoteMigrate.sh, BulkCloneCloudInit.sh
  - VirtualMachines/CloudInit/: BulkAddSSHKey.sh, BulkChangeDNS.sh, BulkChangeIP.sh, BulkChangeUserPass.sh, BulkMoveCloudInit.sh, BulkTogglePackageUpgrade.sh
  - VirtualMachines/Hardware/: BulkConfigureCPU.sh, BulkConfigureNetwork.sh, BulkSetCPUTypeCoreCount.sh, BulkSetMemoryConfig.sh, BulkUnmountISOs.sh
  - VirtualMachines/Options/: BulkEnableGuestAgent.sh, BulkToggleProtectionMode.sh, BulkToggleStartAtBoot.sh
  - VirtualMachines/Storage/: BulkChangeStorage.sh, BulkMoveDisk.sh, BulkResizeStorage.sh
  - VirtualMachines/Backup/: BulkBackup.sh
  - LXC/Operations/: BulkClone.sh, BulkStart.sh, BulkStop.sh, BulkReset.sh, BulkDelete.sh, BulkDeleteAllLocal.sh
  - LXC/Hardware/: BulkSetCPU.sh, BulkSetMemory.sh
  - LXC/Networking/: BulkAddSSHKey.sh, BulkChangeDNS.sh, BulkChangeIP.sh, BulkChangeNetwork.sh, BulkChangeUserPass.sh
  - LXC/Options/: BulkToggleProtectionMode.sh, BulkToggleStartAtBoot.sh
- **Enhanced Utilities/Communication.sh** - Improved messaging functions and formatting
- **Enhanced Utilities/Prompts.sh** - Better user interaction and input validation
- **Enhanced Utilities/Queries.sh** - Extended query capabilities for VM/LXC/node information
- **Enhanced Utilities/Conversion.sh** - Additional conversion and formatting utilities
- **Enhanced Utilities/Colors.sh** - Improved color output and terminal formatting
- **Enhanced Utilities/SSH.sh** - Better SSH connection handling and remote execution
- **Improved .check/_RunChecks.sh** - Enhanced validation and automated checking with better reporting
- **Updated .check/UpdateUtilityDocumentation.py** - Enhanced documentation generation for utilities
- **Updated .check/VerifySourceCalls.py** - Improved source dependency verification
- **Enhanced GUI.sh** - Better menu organization and user interface
- **Improved CONTRIBUTING.md** - Expanded contribution guidelines with framework usage documentation
- **Major expansion of Utilities/_Utilities.md** - Comprehensive documentation for all utility functions
  - Detailed function documentation with examples
  - Framework usage guides
  - Best practices and patterns

### Fixed
- **Consistent error handling** - All scripts now properly use `set -euo pipefail` for robust error detection
- **Source dependency issues** - Resolved missing or incorrect utility dependencies across all scripts
- **Function index accuracy** - All scripts now have accurate function index listings
- **Line ending consistency** - Normalized CRLF to LF across all scripts for Unix compatibility
- **Validation improvements** - Better input validation and error messages across all scripts

### Testing
- **Comprehensive test coverage** - Added test suites covering all major utility frameworks
- **Automated test execution** - RunAllTests.sh provides one-command testing for all utilities
- **Integration testing** - Example integration tests demonstrate proper framework usage
- **Test framework infrastructure** - New TestFramework.sh enables systematic testing of shell scripts
…roved scripting standards

### Added
- **CONTRIBUTING.md Section 3.10** - Comprehensive ArgumentParser usage guide
  - Declarative argument parsing patterns and examples
  - Custom validation patterns with `validate_custom_options()`
  - Decision guide table for when to use ArgumentParser vs manual parsing
  - Best practices for handling complex argument structures

### Changed
- **Full refactoring + implementation of ArgumentParser**
  - VirtualMachines/Hardware/BulkConfigureCPU.sh
  - VirtualMachines/Hardware/BulkConfigureNetwork.sh
  - VirtualMachines/Storage/BulkConfigureDisk.sh
  - Storage/AddStorage.sh
  - Storage/RemoveStorage.sh
  - Removed manual `usage()` and `parse_args()` functions
  - Added `validate_custom_options()` for logic validation
  - Now use `__parse_args__` declarative parsing
  - Fixed `__prompt_yes_no__` -> `__prompt_user_yn__` calls
- **ArgumentParser integration**
  - Host/Hardware/EnableCPUScalingGoverner.sh
  - RemoteManagement/ConfigureOverSSH/Proxmox/BulkDisableAutoStart.sh
  - RemoteManagement/ConfigureOverSSH/Proxmox/BulkUnmountISOs.sh
  - Storage/Ceph/SetScrubInterval.sh: (quality improvement with proper documentation/standards)
  - Removed manual `usage()` functions
  - Added ArgumentParser sourcing and `__parse_args__` calls
- **Storage/Ceph/SetScrubInterval.sh** - Updated to match current codebase
  - Added proper `@function`, `@description`, `@param` documentation tags
  - Replaced `echo` with `__info__`, `__ok__`, `__err__` communication functions
  - Added `__prompt_user_yn__` confirmations before operations
  - Added `readonly` constants for configuration values
  - User feedback with detailed status messages
- **README.md** - Corrected outdated references
  - Fixed `CCPVEOffline.sh` -> `GUI.sh` (correct script name)
  - Removed non-existent `Utilities.sh` reference
  - Enhanced Contributing section with links to CONTRIBUTING.md
  - Added ArgumentParser requirement highlights
  - Added compliance checklist references
- **CONTRIBUTING.md** - Enhanced with ArgumentParser standards
  - Updated Usage section header format to `ScriptName.sh` (no `./` prefix)
  - Clarified that GUI auto-generates usage from script comments
  - Added comprehensive Section 3.10 on argument parsing

### Fixed
- **Script header format consistency**
  - Usage section now shows `ScriptName.sh` without `./` prefix
  - All scripts properly source ArgumentParser.sh
  - Function documentation follows `@function`, `@description`, `@param` pattern
- **Prompt function calls** - Corrected `__prompt_yes_no__` -> `__prompt_user_yn__` in refactored scripts
- **Communication functions** - Ensured all user-facing messages use `__info__`, `__ok__`, `__err__` instead of plain `echo`
### Changed
- **Rest of Scripts Updated with ArgumentParser**
  - Migration of all non-interactive scripts (previously listed in TODO.md)

- **Standards Applied**
  - ArgumentParser.sh sourced with proper shellcheck directives
  - UPPERCASE variable names from ArgumentParser
  - Automatic --help support (or manual for hybrid scripts)
  - Removed manual usage() functions and validation loops
  - Proper exit codes (64 for usage errors)
  - Consistent error handling with __err__
  - Updated testing status comments

### Fixed
- **GUI.sh Critical Bug**
  - Added `bash` prefix to all script execution calls
  - Prevent immediate script closure issue
### Added
- **Logger integration in Utility Scripts** - Added structured logging support with safe fallback
  - New `__*_log__()` wrapper for logging events
- **Enhanced ArgumentParser.sh** - Improved argument validation, error handling, and help text generation
- **Enhanced TestFramework.sh** - Improved test assertions and result reporting

### Changed
- **Utility consolidation**
  - Renamed `ProxmoxAPI.sh` -> `Operations.sh`
  - Renamed `Queries.sh` -> `Cluster.sh`
  - Renamed `NetworkHelper.sh` -> `Network.sh`
  - Removed `BatchRunCLI.sh` - functionality integrated in GUI.sh
- **Source dependency cleanup** - Updated scripts with correct utility imports
  - Replaced `ProxmoxAPI.sh` -> `Operations.sh` across all VM/LXC bulk operations
  - Fixed `Queries.sh` → `Cluster.sh` references in storage scripts
  - Updated `NetworkHelper.sh` -> `Network.sh` references
- **Function standardization** - Unified prompt API across all scripts
  - Updated `__prompt_yes_no__` -> `__prompt_user_yn__`
  - Consistent user interaction patterns throughout codebase
- **Enhanced utilities** - Improvements to core libraries
  - BulkOperations.sh: Better error handling and progress reporting
  - Communication.sh: Enhanced messaging and logging
  - Prompts.sh: Improved input validation and dialogs
  - SSH.sh: Streamlined remote execution
  - GUI.sh: Better menu structure and user experience

### Fixed
- **Auto-confirm support** - Added `--yes` flag for non-interactive bulk deletion
- **Import corrections** - Fixed incorrect source dependencies and shellcheck directives
- **Storage improvements** - Enhanced validation and error handling in storage operations

### Removed
- BatchRunCLI.sh and associated test files
### Added
- **Polymorphic Menu System** - Centralized common menu operations (settings, help, back, exit) across all menus
- **Branch Management** - Switch branches, update scripts from GitHub, and view available branches via settings menu ('s') accessible from all menus

### Changed
- **CCPVE.sh Distribution Compatibility** - Auto-detects package manager (apt, dnf, yum, zypper, pacman) and supports non-root execution with automatic sudo usage
- **Standardized Input Prompts** - All menus now use consistent `read -rp "Choice: "` format
- **Simplified Navigation** - Pressing 'b' at root automatically returns to execution mode selection without intermediate menus

### Fixed
- **Navigation Flow** - Root directory 'b' press now returns to execution mode selection instead of exiting application
## [2.1.2] - 2025-11-14

Multi-remote execution improvements and debug logging support

### Added
- **Temporary Multi-Remote Mode** - Execute on IP ranges (172.20.83.100-200) or VMID ranges without saving connections
- **Dual Log Output** - Remote execution creates both output log (.log) and debug log (.debug.log) with structured logging
- **Debug Flag Support** - `./GUI.sh -d` enables DEBUG level logging on remote nodes
- **Interrupt Handling** - Ctrl+C during remote execution cleanly cancels remaining nodes

### Changed
- **Argument Parsing** - Fixed command-line flag processing to use `while` loop instead of `for` loop
- **Remote Execution Flow** - Automatically continues to next node without manual review prompts
- **Performance** - Optimized remote environment setup with parallel SSH operations (3x faster)

### Fixed
- **REMOTE_LOG_LEVEL Initialization** - ConfigManager.sh no longer overwrites command-line log level flags
- **Multi-Remote Exit Bug** - All nodes now execute successfully instead of exiting after first node
…ation

### Changed
- **Function naming standardization** - Renamed functions for consistency
  - `__get_cluster_lxc__` -> `__get_cluster_cts__` for consistent container terminology
  - `__prompt_yes_no__` -> `__prompt_user_yn__`
- **Test suite updates** - Updated test file to reflect renamed functions
  - `_TestQueries.sh`: Renamed `test_get_cluster_lxc` -> `test_get_cluster_cts`
- **BulkOperations.sh** - Removed internal wrapper functions
  - Removed `vm_wrapper` and `ct_wrapper` helper functions
- **Documentation cleanup** - Updated auto-generated utility documentation
  - Removed duplicate `__get_cluster_lxc__` documentation entries
  - Updated IP address examples for documentation
- **Testing documentation** - Enhanced test coverage documentation
  - Updated `_TestingStatus.md` with comprehensive test implementation status
  - Added test enhancement opportunities and integration test scenarios
  - Fixed issues in several scripts

### Removed
- **Deprecated function aliases** - Cleaned up backward compatibility aliases
  - Removed `__prompt_yes_no__` function (use `__prompt_user_yn__` instead)
  - Removed `__get_cluster_lxc__` function (use `__get_cluster_cts__` instead)
### Added
- **Script Notes Standard** - All scripts now include standardized notes section tracking validation status, change history, fixes, and known issues

### Changed
- **Errors/Issues fixed across scripts** - Scripts in Cluster, Firewall, HighAvailability, Host, LXC, Manuals, Networking, and Resources directories validated against V9.1.1 Proxmox VE documentation  - Security through VirtualMachines pending
- **CONTRIBUTING.md Section 3.12** - Replaced "Testing Notes" with "Script Notes" standard including format requirements and examples
…nd repository cleanup

### Added
- **PVE Documentation automation scripts** - Tools for managing Proxmox VE documentation
  - `UpdatePVEGuide.sh` - Downloads and converts latest Proxmox VE Administration Guide with version tracking
  - `HTMLToMarkdown.py` - Converts HTML documentation to markdown with chapter splitting
  - `GenerateContentDiff.sh` - Creates content-focused diffs between documentation versions
- **Minor version tracking** - Timestamp-based detection for documentation updates with VX-Y-Z_NN naming scheme
- **Version badge** - Added version badge to README.md displaying current release

### Changed
- **Check system** - Formatting check now counts as passed with recommendations instead of uncounted
- **GitIgnore configuration** - Added rules for downloaded documentation and generated content
- **Code cleanup** - Removed trailing whitespace from all markdown and shell script files
@coelacant1 coelacant1 self-assigned this Nov 25, 2025
@coelacant1 coelacant1 merged commit 918e79f into main Nov 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant