-
Notifications
You must be signed in to change notification settings - Fork 1
verbose configuration files #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
in order to avoid occ vs. ooc typo Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…age instructions Signed-off-by: Misha M.-Kupriyanov <[email protected]>
9d33492 to
12e129b
Compare
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
… and spacing Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…tions for better error handling and output clarity in order to differentiate between error and fatal error Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…proved scope clarity Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…teps in configure.sh for improved clarity Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…on to prevent errors Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…app function for consistency Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…tion for consistency Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…disabling process Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…ility Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…g consistency Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…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 <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
12e129b to
6359d8b
Compare
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…ommand for consistency Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
…handling Signed-off-by: Misha M.-Kupriyanov <[email protected]>
14ecedf to
2c6df09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |||
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/' )" |
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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." |
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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.