Conversation
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
in order to avoid occ vs. ooc typo Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…age instructions Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
9d33492 to
12e129b
Compare
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
… and spacing Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…tions for better error handling and output clarity in order to differentiate between error and fatal error Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…proved scope clarity Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…teps in configure.sh for improved clarity Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…on to prevent errors Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…app function for consistency Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…tion for consistency Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…disabling process Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…ility Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…g consistency Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…eport failed app enables do not exit on first app enable failure. output cumulated app enabling errors and exit Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
12e129b to
6359d8b
Compare
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…ommand for consistency Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…handling Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
14ecedf to
2c6df09
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors several shell scripts to introduce consistent logging, modularize configuration steps, and improve error handling with colorized output.
- Introduced
log_*andexecute_occ_commandutility functions for unified logging and OCC calls. - Broke monolithic scripts into smaller, well-named functions for each configuration task.
- Updated apps-enable/disable scripts to track failures and provide clearer fatal error messages.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| readme.md | Removed an extraneous blank line. |
| configure.sh | Added logging functions, modularized OCC commands, and improved error handling. |
| configure-user-oidc.sh | Replaced fail with log_fatal and added usage comments. |
| configure-object-store.sh | Replaced fail with log_fatal and standardized error messages. |
| apps-enable.sh | Renamed ooc to execute_occ_command, added failure tracking, unified logging. |
| apps-disable.sh | Replaced fail with log_fatal for consistent fatal error handling. |
| @@ -1,185 +1,302 @@ | |||
| #!/bin/sh | |||
There was a problem hiding this comment.
Consider adding set -euo pipefail after the shebang to ensure the script exits on errors and catches unset variables early.
| # Check if required dependencies are available | ||
| # Usage: check_dependencies | ||
| check_dependencies() { | ||
| if ! which php >/dev/null 2>&1; then |
There was a problem hiding this comment.
Using which can be non‐portable; consider command -v php >/dev/null 2>&1 for POSIX compliance.
| if ! which php >/dev/null 2>&1; then | |
| if ! command -v php >/dev/null 2>&1; then |
| # Usage: verify_nextcloud_installation | ||
| verify_nextcloud_installation() { | ||
| log_info "Verifying HiDrive Next installation status..." | ||
| _main_status="$( execute_occ_command status 2>/dev/null | grep 'installed: ' | sed -r 's/^.*installed: (.+)$/\1/' )" |
There was a problem hiding this comment.
sed -r is not portable on macOS (BSD sed); use sed -E for extended regex support.
| _main_status="$( execute_occ_command status 2>/dev/null | grep 'installed: ' | sed -r 's/^.*installed: (.+)$/\1/' )" | |
| _main_status="$( execute_occ_command status 2>/dev/null | grep 'installed: ' | sed -E 's/^.*installed: (.+)$/\1/' )" |
| if ! execute_occ_command app:enable "${app_name}" | ||
| then | ||
| fail "Enabling app \"${app_name}\" failed." | ||
| echo "ERROR: Enabling app \"${app_name}\" failed." |
There was a problem hiding this comment.
[nitpick] This error branch uses a plain echo while other failures use log_fatal; consider unifying to a consistent logging function for maintainability.
| echo "ERROR: Enabling app \"${app_name}\" failed." | |
| log_error "Enabling app \"${app_name}\" failed." |
No description provided.