Commit fc91a2d
authored
Merge pull request #21 from coelacant1/testing
V2.1.6 - Bug fixes, username support, and validation improvements
### Added
- **Username Configuration** - Support for specifying SSH usernames per node
- Added `username` field to nodes.json configuration
- Username prompts in all node configuration flows (manual entry, saved nodes, IP ranges, VMID ranges)
- Default username is "root" with option to specify alternatives
- Display format changed to `username@ip` throughout GUI
- **Dependency Checking** - Runtime validation before remote execution
- `__check_remote_dependencies__()` function checks for sshpass and jq
- Helpful error messages with installation commands for all major distros
- Notes that sshpass is not required when using SSH keys
- **Syntax Validation** - Basic shell syntax checking added to validation suite
- New Check 1a. in `_RunChecks.sh` runs `bash -n` on all .sh files
- Catches structural errors and orphaned code blocks
- Shows file names and line numbers for syntax errors
- **Enhanced Source Verification** - Improved validation of shellcheck directives
- `VerifySourceCalls.py` now validates shellcheck comments have matching source statements
- Detects orphaned shellcheck directives within 5 lines
- Prevents mismatched documentation and code
### Changed
- **Remote Execution UI** - Scripts hidden in remote mode for better UX
- GUI.sh and CCPVE.sh hidden from root menu when in remote execution mode
- Prevents accidental execution of control scripts on remote nodes
- Scripts still shown in local mode and subdirectories
- **README.md** - Clarified dependency requirements
- Updated installation command to include `jq` and `sshpass`
- Documented that sshpass is only needed for password-based authentication
- Separated build-time tools from runtime dependencies
### Fixed
- **Critical: Orphaned Error Handler** - Fixed syntax error in `Host/HostInfo.sh`
- Removed orphaned error handler code block (lines 34-36)
- File had error message without matching source statement
- Bug prevented script execution on remote nodes
- **Username Hardcoding** - Removed hardcoded "root@" from all remote operations
- Updated all SSH/SCP operations in `RemoteExecutor.sh` to use configured username
- `__ssh_exec__`, `__scp_exec__`, `__scp_exec_recursive__`, `__scp_download__` now accept username parameter
- `ConfigManager.sh` tracks username per node in `NODE_USERNAMES` associative array
- **Missing Validation** - Syntax check gap closed
- `_RunChecks.sh` never validated basic syntax :C
- Now catches structural errors that bash -n would detect
- Prevents orphaned code and malformed control structures from entering repository
### Technical Details
- `nodes.json.template` - Added username field with "root" default
- `Utilities/ConfigManager.sh` - Added NODE_USERNAMES tracking and __get_node_username__() function
- `Utilities/RemoteExecutor.sh` - All remote operations parameterized with username
- `GUI.sh` - Dependency checking, username prompts, and script filtering
- `.check/VerifySourceCalls.py` - Enhanced shellcheck directive validation
- `.check/_RunChecks.sh` - Added Check 1a. for syntax validation
### Developer Notes
The orphaned error handler bug existed because:
- `bash -n` syntax check was not being run in validation suite
- `DeadCodeCheck.py` only checks unused functions/variables, not code structure
- `VerifySourceCalls.py` didn't validate orphaned error handlers
The fix adds syntax validation to prevent similar issues...File tree
13 files changed
+356
-91
lines changed- .check
- .site
- Host
- Utilities
13 files changed
+356
-91
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
149 | 158 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
155 | 181 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 182 | | |
163 | 183 | | |
164 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
129 | 156 | | |
130 | 157 | | |
131 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
8 | 70 | | |
9 | 71 | | |
10 | 72 | | |
| |||
0 commit comments