-
-
Notifications
You must be signed in to change notification settings - Fork 50
Software title: OMV (openmediavault) #588
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
|
Warning Rate limit exceeded@igorpecovnik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 2 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
""" WalkthroughA new shell module named Possibly related PRs
Suggested labels
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 5
🧹 Nitpick comments (4)
tools/modules/software/module_omv.sh (3)
32-38: Consider documenting the purpose of each installation flag.The installation command uses several flags that might not be immediately clear to future maintainers.
Add comments explaining the purpose of each flag:
pkg_install --yes --auto-remove --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ + # Use default action for conffiles --option DPkg::Options::="--force-confdef" \ + # Keep the old version of the conffile --option DPkg::Options::="--force-confold" \ openmediavault
44-48: Consider enhancing the status check functionality.The current status check only verifies if the package is installed but doesn't check if the service is running.
Enhance the status check to include service status:
if pkg_installed openmediavault; then - echo "$title is installed." + echo "$title is installed." + if systemctl is-active --quiet openmediavault-engined.service; then + echo "OpenMediaVault service is running." + else + echo "OpenMediaVault service is not running." + fi else echo "$title is not installed." fi
1-1: Missing shebang in the script file.The file is missing a shebang line which defines the shell interpreter to be used.
Add a shebang to the beginning of the file:
+#!/bin/bash module_options+=(🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
tests/omv.conf (1)
7-10: Add more comprehensive testing for the module.The current test only verifies installation and service start. Consider adding more test cases that verify all module functionalities.
Enhance the test to cover more functionality:
./bin/armbian-config --api module_omv remove + # Verify removal worked + if ./bin/armbian-config --api module_omv status | grep -q "not installed"; then + echo "Removal confirmed" + else + echo "Removal failed" + exit 1 + fi ./bin/armbian-config --api module_omv install + # Verify installation worked + if ./bin/armbian-config --api module_omv status | grep -q "is installed"; then + echo "Installation confirmed" + else + echo "Installation failed" + exit 1 + fi sudo systemctl start openmediavault-engined.service sleep 5 sudo systemctl is-active --quiet openmediavault-engined.service + # Final verification + echo "OpenMediaVault test completed successfully"🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 6-10: editorconfig-checker: Wrong indentation type (spaces instead of tabs) detected on lines 6-10.
🛑 Comments failed to post (5)
tools/modules/software/module_omv.sh (3)
22-28: 🛠️ Refactor suggestion
Consider using a more secure approach for adding the GPG key.
The current implementation downloads and imports the GPG key in one pipeline, which has security implications:
- The data passes through multiple processes
- No validation is performed before importing the key
- No specific timeout for the GPG operation
Consider using a more secure approach:
- curl --max-time 60 -4 -fsSL "https://packages.openmediavault.org/public/archive.key" | \ - gpg --dearmor -o /usr/share/keyrings/openmediavault-archive-keyring.gpg + KEY_FILE=$(mktemp) + if curl --max-time 60 -4 -fsSL "https://packages.openmediavault.org/public/archive.key" -o "${KEY_FILE}"; then + gpg --dearmor -o /usr/share/keyrings/openmediavault-archive-keyring.gpg "${KEY_FILE}" + rm -f "${KEY_FILE}" + else + echo "Failed to download GPG key" + rm -f "${KEY_FILE}" + exit 1 + fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.KEY_FILE=$(mktemp) if curl --max-time 60 -4 -fsSL "https://packages.openmediavault.org/public/archive.key" -o "${KEY_FILE}"; then gpg --dearmor -o /usr/share/keyrings/openmediavault-archive-keyring.gpg "${KEY_FILE}" rm -f "${KEY_FILE}" else echo "Failed to download GPG key" rm -f "${KEY_FILE}" exit 1 fi echo "Adding OMV sources.list..." echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ https://packages.openmediavault.org/public sandworm main" | \ tee /etc/apt/sources.list.d/openmediavault.list🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh around lines 22 to 28, the current method of downloading and importing the GPG key uses a pipeline without validation or timeout for the GPG operation, which is insecure. To fix this, first download the key to a temporary file with curl using a timeout, then verify the key's integrity or fingerprint before importing it with gpg --dearmor, also applying a timeout or limiting the operation. Finally, move the verified key to /usr/share/keyrings/openmediavault-archive-keyring.gpg. This approach ensures the key is validated and the process is more secure.
41-41: 🛠️ Refactor suggestion
Add error handling for remove operation.
Similar to the installation process, the removal process doesn't check for failures.
Add error handling:
- pkg_remove openmediavault + if pkg_remove openmediavault; then + echo "OpenMediaVault removed successfully." + else + echo "Failed to remove OpenMediaVault." + exit 1 + fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.if pkg_remove openmediavault; then echo "OpenMediaVault removed successfully." else echo "Failed to remove OpenMediaVault." exit 1 fi🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh at line 41, the pkg_remove openmediavault command lacks error handling. Modify the script to check the exit status of the pkg_remove command and handle any failure appropriately, such as logging an error message and exiting or returning a failure code, similar to how errors are handled during the installation process.
33-38: 🛠️ Refactor suggestion
Add error handling for install operation.
The installation process doesn't check for failures and doesn't provide feedback to the user if installation fails.
Add error handling:
- pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ - --option DPkg::Options::="--force-confdef" \ - --option DPkg::Options::="--force-confold" \ - openmediavault + if pkg_install --yes --auto-remove --show-upgraded \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \ + --option DPkg::Options::="--force-confdef" \ + --option DPkg::Options::="--force-confold" \ + openmediavault; then + echo "OpenMediaVault installed successfully." + else + echo "Failed to install OpenMediaVault." + exit 1 + fi🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh around lines 33 to 38, the pkg_install command lacks error handling and does not inform the user if the installation fails. Modify the script to check the exit status of the pkg_install command immediately after it runs. If the command fails (non-zero exit code), output an error message to the user indicating the failure and exit the script or handle the error appropriately to prevent silent failures.tests/omv.conf (2)
5-11: 🛠️ Refactor suggestion
Add a waiting period before checking service status.
The test starts the OpenMediaVault service and immediately checks if it's active. However, services might take a moment to fully initialize.
Add a short waiting period between starting the service and checking its status:
testcase() {( set -e ./bin/armbian-config --api module_omv remove ./bin/armbian-config --api module_omv install sudo systemctl start openmediavault-engined.service + # Wait for service to fully initialize + sleep 5 sudo systemctl is-active --quiet openmediavault-engined.service )}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.testcase() {( set -e ./bin/armbian-config --api module_omv remove ./bin/armbian-config --api module_omv install sudo systemctl start openmediavault-engined.service # Wait for service to fully initialize sleep 5 sudo systemctl is-active --quiet openmediavault-engined.service )}🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 6-10: editorconfig-checker: Wrong indentation type (spaces instead of tabs) detected on lines 6-10.
🤖 Prompt for AI Agents (early access)
In tests/omv.conf around lines 5 to 11, after starting the openmediavault-engined.service, insert a short delay (e.g., using sleep for a few seconds) before running the command that checks if the service is active. This ensures the service has enough time to initialize before the status check.
5-11:
⚠️ Potential issueFix indentation: replace spaces with tabs per coding style.
The pipeline failure indicates that lines 6-10 use spaces for indentation instead of tabs.
Replace spaces with tabs in the indented lines:
testcase() {( - set -e - ./bin/armbian-config --api module_omv remove - ./bin/armbian-config --api module_omv install - sudo systemctl start openmediavault-engined.service - sudo systemctl is-active --quiet openmediavault-engined.service + set -e + ./bin/armbian-config --api module_omv remove + ./bin/armbian-config --api module_omv install + sudo systemctl start openmediavault-engined.service + sudo systemctl is-active --quiet openmediavault-engined.service )}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.testcase() {( set -e ./bin/armbian-config --api module_omv remove ./bin/armbian-config --api module_omv install sudo systemctl start openmediavault-engined.service sudo systemctl is-active --quiet openmediavault-engined.service )}🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 6-10: editorconfig-checker: Wrong indentation type (spaces instead of tabs) detected on lines 6-10.
🤖 Prompt for AI Agents (early access)
In tests/omv.conf around lines 5 to 11, the indentation uses spaces instead of tabs, which violates the coding style. Replace all leading spaces on lines 6 to 10 with tabs to fix the indentation and comply with the project's style guidelines.
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.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🧹 Nitpick comments (2)
tools/modules/software/module_omv.sh (2)
52-60: Include Help Description for thehelpCommand
The help block listsinstall,status, andremove, but doesn’t documenthelpitself. For completeness, add a line describing thehelpcommand.
Apply this diff:- echo -e "\tremove\t- Remove $title." - echo + echo -e "\tremove\t- Remove $title." + echo -e "\thelp\t- Show this help message." + echo
61-64: Quote Invocation Arguments
Although this works with fixed strings, it’s safer to quote expansions to prevent word-splitting edge cases.
Apply this diff:- ${module_options["module_omv,feature"]} ${commands[3]} + "${module_options["module_omv,feature"]}" "${commands[3]}"
🛑 Comments failed to post (4)
tools/modules/software/module_omv.sh (4)
1-12:
⚠️ Potential issueAdd a Shebang and Shell Directive
ShellCheck (SC2148) reports a missing shebang. To ensure the script runs under Bash and to avoid ambiguity about the target shell, add a shebang and a shell directive at the top of the file.
Apply this diff:+#!/usr/bin/env bash +# shellcheck shell=bash module_options+=(📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.#!/usr/bin/env bash # shellcheck shell=bash module_options+=( ["module_omv,author"]="@igorpecovnik" ["module_omv,maintainer"]="@igorpecovnik" ["module_omv,feature"]="module_omv" ["module_omv,example"]="install remove status help" ["module_omv,desc"]="Install OpenMediaVault (OMV)" ["module_omv,status"]="Active" ["module_omv,doc_link"]="https://www.openmediavault.org/" ["module_omv,group"]="NAS" ["module_omv,port"]="80" ["module_omv,arch"]="x86-64 arm64 armhf" )🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh at the very beginning of the file (lines 1 to 12), add a shebang line specifying the Bash shell (e.g., #!/bin/bash) as the first line to explicitly define the script interpreter and avoid ShellCheck SC2148 warnings. This ensures the script runs under Bash and clarifies the intended shell environment.
40-44:
⚠️ Potential issueFix Indentation to Use Tabs
EditorConfig enforcement caught spaces instead of tabs on these lines. Align these lines with tabs to match the rest of the file.
Apply this diff (replace leading spaces with a single tab):- if pkg_installed openmediavault; then - pkg_remove openmediavault - fi + if pkg_installed openmediavault; then + pkg_remove openmediavault + fiCommittable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 41-43: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh at lines 40 to 44, the indentation uses spaces instead of tabs, which violates the EditorConfig rules. Replace all leading spaces on these lines with tabs to ensure consistent indentation style throughout the file.
14-18: 🛠️ Refactor suggestion
Enable Immediate Failure on Errors
The module relies on command exit codes but doesn’t explicitly bail on failures. To make the script more robust and catch errors early, enable strict error handling at the start of the function.
Apply this diff:function module_omv() { + set -euo pipefail local title="openmediavault" local commands IFS=' ' read -r -a commands <<< "${module_options["module_omv,example"]}"🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh around lines 14 to 18, the function module_omv does not enable strict error handling, which can cause silent failures. Add "set -e" at the start of the function to make the script immediately exit on any command failure, ensuring errors are caught early and improving robustness.
19-39:
⚠️ Potential issueRemove Unsupported
--auto-removeFlag
apt-get installdoes not support--auto-remove. Passing this flag will cause an error. Remove it (and optionally the redundant--yessincepkg_installalready uses-y).
Apply this diff:-pkg_update - -echo "Installing OpenMediaVault packages..." -pkg_install --yes --auto-remove --show-upgraded \ +pkg_update +echo "Installing OpenMediaVault packages..." +pkg_install --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ openmediavault📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.case "$1" in "${commands[0]}") echo "Adding GPG key for OpenMediaVault..." curl --max-time 60 -4 -fsSL "https://packages.openmediavault.org/public/archive.key" | \ gpg --dearmor -o /usr/share/keyrings/openmediavault-archive-keyring.gpg echo "Adding OMV sources.list..." echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ https://packages.openmediavault.org/public sandworm main" | \ tee /etc/apt/sources.list.d/openmediavault.list pkg_update echo "Installing OpenMediaVault packages..." pkg_install --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ openmediavault ;;🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh between lines 19 and 39, the pkg_install command incorrectly includes the unsupported --auto-remove flag, which causes errors. Remove the --auto-remove flag from the pkg_install invocation, and optionally remove the redundant --yes flag since pkg_install already uses -y internally.
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.
Actionable comments posted: 2
🧹 Nitpick comments (4)
tools/modules/software/module_omv.sh (4)
41-45: Correct indentation & improve feedback on removal
Lines 42–44 use spaces instead of tabs (editorconfig-checker errors). Also, if OMV isn’t installed, users get no feedback.- if pkg_installed openmediavault; then - pkg_remove openmediavault - fi + if pkg_installed openmediavault; then + pkg_remove openmediavault + else + echo "openmediavault is not installed." + fi🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
46-52: Approve: status command logic is sound
Thestatussubcommand correctly checks installation and prints a clear message.Consider returning exit codes (
0if installed,1otherwise) for scripts that consume this output.
53-61: Refactor help output for readability
Multipleecho -ecalls can be consolidated into a heredoc.- echo -e "\nUsage: ${module_options["module_omv,feature"]} <command>" - echo -e "Commands: ${module_options["module_omv,example"]}" - echo "Available commands:" - echo -e "\tinstall\t- Install $title." - echo -e "\tstatus\t- Installation status $title." - echo -e "\tremove\t- Remove $title." - echo + cat <<EOF + +Usage: ${module_options["module_omv,feature"]} <command> +Commands: ${module_options["module_omv,example"]} + +Available commands: + install - Install $title. + status - Show installation status of $title. + remove - Remove $title. + +EOF
62-65: Simplify default fallback call
Instead of indirect expansion, use the function name directly for clarity.- ${module_options["module_omv,feature"]} ${commands[3]} + "${FUNCNAME[0]}" help
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/omv.conf(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/omv.conf
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
tools/modules/software/module_omv.sh
[error] 12-12: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
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.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
♻️ Duplicate comments (3)
tools/modules/software/module_omv.sh (3)
1-13: Add shebang and fix indentation errorsThe script lacks a shebang (SC2148) and line 12 uses spaces instead of tabs, causing editorconfig failures. Please add
#!/usr/bin/env bashat the top and convert the indentation on line 12 to tabs:+#!/usr/bin/env bash module_options+=( ... - ["module_omv,release"]="bookworm" + ["module_omv,release"]="bookworm" )🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
[error] 12-12: editorconfig-checker: Wrong indentation type (spaces instead of tabs)
27-29: Use dynamic release variable instead of hardcoded codenameThe APT source list hardcodes “sandworm” but the module’s default release is “bookworm”. To keep them in sync, capture the release and use it:
function module_omv() { local title="openmediavault" + local release="${module_options["module_omv,release"]}" ... - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ -https://packages.openmediavault.org/public sandworm main" | \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ +https://packages.openmediavault.org/public $release main" | \ tee /etc/apt/sources.list.d/openmediavault.list
34-39: Remove unsupportedpkg_installflags
pkg_installwrapsapt-get -y install, so flags like--auto-removeand--show-upgradedaren’t valid forapt-get installand will fail. Please remove them:- DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ - --option DPkg::Options::="--force-confdef" \ - --option DPkg::Options::="--force-confold" \ - openmediavault + DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \ + --option DPkg::Options::="--force-confdef" \ + --option DPkg::Options::="--force-confold" \ + openmediavault
🧹 Nitpick comments (2)
tools/modules/software/module_omv.sh (2)
54-61: Use portableprintfinstead ofecho -eRelying on
echo -eis not portable across all shells. Consider switching toprintffor escape sequences:- echo -e "\nUsage: ${module_options["module_omv,feature"]} <command>" - echo -e "Commands: ${module_options["module_omv,example"]}" + printf "\nUsage: %s <command>\n" "${module_options["module_omv,feature"]}" + printf "Commands: %s\n" "${module_options["module_omv,example"]}"
62-64: Quote variable expansions in the default caseUnquoted expansions may break if values contain spaces. Wrap them in quotes:
- ${module_options["module_omv,feature"]} ${commands[3]} + "${module_options["module_omv,feature"]}" "${commands[3]}"
🛑 Comments failed to post (1)
tools/modules/software/module_omv.sh (1)
42-44:
⚠️ Potential issueFix indentation in the remove block
Lines 42–44 use spaces instead of tabs, causing editorconfig-checker errors. Please replace these spaces with tabs to align with the rest of the file:
- if pkg_installed openmediavault; then - pkg_remove openmediavault - fi + if pkg_installed openmediavault; then + pkg_remove openmediavault + fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.if pkg_installed openmediavault; then pkg_remove openmediavault fi🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 42-44: editorconfig-checker: Wrong indentation type (spaces instead of tabs)
🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh around lines 42 to 44, the indentation uses spaces instead of tabs, causing editorconfig-checker errors. Replace the spaces at the start of these lines with tabs to match the file's indentation style and fix the formatting issue.
37102e7 to
bfbc4bb
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.
Actionable comments posted: 1
♻️ Duplicate comments (3)
tools/modules/software/module_omv.sh (3)
1-13: Duplicate: Add shebang and enforce shell interpreter
As flagged by ShellCheck SC2148, this script lacks a shebang. Add the following at the very top to specify the interpreter:+#!/usr/bin/env bash🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
26-29:⚠️ Potential issueHardcoded release codename mismatch
The OMV APT source usessandworm, but the module’s release is declared asbookworminmodule_options. This inconsistency may break repository setup.Use the dynamic release value:
-echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ -https://packages.openmediavault.org/public sandworm main" | \ +local release="${module_options["module_omv,release"]}" +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ +https://packages.openmediavault.org/public $release main" | \ tee /etc/apt/sources.list.d/openmediavault.list
34-39:⚠️ Potential issueRemove unsupported
pkg_installflags
pkg_installwrapsapt-get -y install, so flags like--auto-removeand--show-upgradedare invalid and will cause failures.Refactor to:
-DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ +DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \
🧹 Nitpick comments (1)
tools/json/config.software.json (1)
1485-1495: Nit: Consistent verb phrasing in description
The OMV002descriptioncurrently reads"OpenMediaVault remove". For consistency with other remove operations (e.g.,"Remove Home Assistant"), consider changing it to"Remove OpenMediaVault".
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (5)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/omv.conf
🚧 Files skipped from review as they are similar to previous changes (2)
- tools/include/markdown/OMV001-footer.md
- tools/include/markdown/OMV001-header.md
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
tools/modules/software/module_omv.sh
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
🔇 Additional comments (1)
tools/json/config.software.json (1)
1472-1484: Approve new install operation OMV001
The OMV001 entry correctly defines a stable install operation for OpenMediaVault, with all required fields (id,description,short,module,about,command,status,author,condition) and consistent formatting.
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
tools/modules/software/module_omv.sh (4)
42-44:⚠️ Potential issueFix indentation to use tabs
EditorConfig requires tabs for indentation in shell scripts, but this block uses spaces. Convert leading spaces to tabs:- if pkg_installed openmediavault; then - pkg_remove openmediavault - fi + if pkg_installed openmediavault; then + pkg_remove openmediavault + fi(Note: replace each group of spaces with a single tab character at line start.)
🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
1-13: 🛠️ Refactor suggestionAdd shebang and ensure proper script interpreter
ShellCheck SC2148 warns that the script has no shebang, making the target shell ambiguous. Add#!/usr/bin/env bashat the very top so the module runs under Bash.Apply this diff:
+#!/usr/bin/env bash module_options+=(🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
27-29:⚠️ Potential issueUse dynamic release variable instead of hardcoded codename
The APT source list line hardcodessandworm, which conflicts with themodule_omv,releasevalue (bookworm). To avoid mismatches, use the release variable:- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ - https://packages.openmediavault.org/public sandworm main" | \ - tee /etc/apt/sources.list.d/openmediavault.list + local release="${module_options["module_omv,release"]}" + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ + https://packages.openmediavault.org/public $release main" | \ + tee /etc/apt/sources.list.d/openmediavault.list
34-39:⚠️ Potential issueRemove unsupported flags from
pkg_installinvocation
pkg_installwrapsapt-get -y install, so flags like--auto-removeand--show-upgradedare invalid forapt-get installand will cause failures. Simplify to:- DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ - --option DPkg::Options::="--force-confdef" \ - --option DPkg::Options::="--force-confold" \ - openmediavault + DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \ + --option DPkg::Options::="--force-confdef" \ + --option DPkg::Options::="--force-confold" \ + openmediavault
🧹 Nitpick comments (3)
tools/modules/software/module_omv.sh (3)
15-19: Consider POSIX-compliant function declaration
Declaring functions with thefunctionkeyword is Bash-specific. Since we’re already targeting Bash (after adding shebang), this is fine, but if you ever source withsh, it will break. You could make it POSIX-compliant by using:module_omv() { ... }
55-63: Extend help output to include thehelpcommand
The help listing showsinstall,status, andremove, but omitshelpitself. For consistency, add a line:echo -e "\tremove\t- Remove $title." echo + echo -e "\thelp\t- Display this help message."
64-66: Handle unknown commands with error exit code
Currently, unknown commands fall through tohelp, but exit code remains zero. Consider exiting with a non-zero status to signal invalid input:*) ${module_options["module_omv,feature"]} ${commands[3]} + exit 1 ;;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (6)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/runtime/config.runtime.sh(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- tools/include/markdown/OMV001-footer.md
- tests/omv.conf
- tools/include/markdown/OMV001-header.md
- tools/json/config.software.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
tools/modules/software/module_omv.sh
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
🔇 Additional comments (2)
tools/modules/runtime/config.runtime.sh (1)
111-113:Details
✅ Verification successful
Link OMV UI to the Media submenu
Great addition: this ensures the OMV web interface appears under Software → Media → OMV002 with the correct URL. Please verify that theOMV002entry exists intools/json/config.software.jsonso the submenu update targets a valid ID.Run this script to confirm:
🏁 Script executed:
#!/bin/bash # Verify OMV002 exists in the software config JSON if grep -R '"id"[[:space:]]*:[[:space:]]*"OMV002"' tools/json/config.software.json; then echo "Found OMV002 entry in config.software.json" else echo "ERROR: OMV002 entry missing in config.software.json" >&2 exit 1 fiLength of output: 220
Confirmed OMV002 Submenu ID
TheOMV002entry is found intools/json/config.software.json, validating the Software → Media submenu link.tools/modules/software/module_omv.sh (1)
46-54: Installation status handling looks correct
The status command checks installation withpkg_installed, prints a clear message, and returns appropriate exit codes (0for installed,1for not installed`). This aligns with the module conventions.
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.
Actionable comments posted: 2
♻️ Duplicate comments (3)
tools/modules/software/module_omv.sh (3)
1-1: Add a shebang to specify the shell interpreter.SC2148 indicates the target shell is unknown. Please add at the very top:
#!/usr/bin/env bashto ensure consistent linting and execution.
🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
42-44: Fix indentation to use tabs.EditorConfig requires tabs for indentation, but these lines mix spaces and tabs, causing pipeline failures. Convert leading spaces to a single tab on lines 42–44.
🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
34-39:⚠️ Potential issueRemove unsupported apt-get install flags.
pkg_installwrapsapt-get -y install, so flags like--auto-removeand--show-upgradedare invalid and will break the command. Please simplify to:-DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ +DEBIAN_FRONTEND=noninteractive pkg_install \
🧹 Nitpick comments (3)
tools/modules/software/module_omv.sh (3)
1-2: Enable strict error handling.After the shebang, add:
set -euo pipefailto catch errors early and prevent use of uninitialized variables.
🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
54-60: Enhance help output with a help command description.The help block documents
install,status, andremovebut omitshelp. Consider adding:echo -e "\tremove\t- Remove $title." +echo -e "\thelp\t- Display help information."to make it self-documenting.
62-64: Quote variable expansions to prevent word splitting.In the default case, the invocation is unquoted. Use:
-${module_options["module_omv,feature"]} ${commands[3]} + "${module_options["module_omv,feature"]}" "${commands[3]}"to guard against unexpected whitespace.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (6)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/runtime/config.runtime.sh(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- tools/include/markdown/OMV001-footer.md
- tests/omv.conf
- tools/include/markdown/OMV001-header.md
🚧 Files skipped from review as they are similar to previous changes (2)
- tools/modules/runtime/config.runtime.sh
- tools/json/config.software.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
tools/modules/software/module_omv.sh
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
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.
Actionable comments posted: 0
♻️ Duplicate comments (3)
tools/modules/software/module_omv.sh (3)
42-44:⚠️ Potential issueFix indentation to use tabs
Lines 42–44 currently use spaces, which violates EditorConfig and fails the coding style check. Convert to tabs:- if pkg_installed openmediavault; then - DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault - fi + if pkg_installed openmediavault; then + DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault + fi🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
33-39: 🛠️ Refactor suggestionRemove unsupported flags from
pkg_installinvocation
pkg_installwrapsapt-get install -y, so flags like--yes,--auto-remove, and--show-upgradedare invalid or redundant and may cause failures. Simplify the call:- DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ - --option DPkg::Options::="--force-confdef" \ - --option DPkg::Options::="--force-confold" \ - openmediavault + DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \ + --option DPkg::Options::="--force-confdef" \ + --option DPkg::Options::="--force-confold" \ + openmediavault
26-29:⚠️ Potential issueReplace hardcoded release codename with dynamic variable
The APT source line still usessandworm, which conflicts with the configuredmodule_omv,release="bookworm". This will break on non-sandworm systems. Switch to the variable release:- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ - https://packages.openmediavault.org/public sandworm main" | \ + local release="${module_options["module_omv,release"]}" + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ + https://packages.openmediavault.org/public ${release} main" | \ tee /etc/apt/sources.list.d/openmediavault.list
🧹 Nitpick comments (2)
tools/modules/software/module_omv.sh (2)
1-2: Add ShellCheck directive to specify shell interpreter
ShellCheck (SC2148) warns about an unknown shell. Since this module is sourced rather than executed, a shebang isn’t required; however, adding a shell directive will satisfy linters.+ # shellcheck shell=bash🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
63-64: Quote variable expansions in default case
Although names don’t contain spaces today, it’s safer to quote expansions to avoid word splitting:- ${module_options["module_omv,feature"]} ${commands[3]} + "${module_options["module_omv,feature"]}" "${commands[3]}"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (6)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/runtime/config.runtime.sh(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- tests/omv.conf
- tools/modules/runtime/config.runtime.sh
- tools/include/markdown/OMV001-footer.md
- tools/include/markdown/OMV001-header.md
- tools/json/config.software.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 GitHub Actions: Coding style check
tools/modules/software/module_omv.sh
[error] 42-44: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
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.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
♻️ Duplicate comments (3)
tools/modules/software/module_omv.sh (3)
1-2: 🛠️ Refactor suggestionAdd interpreter directive and strict mode
The script currently lacks a shebang and strict error handling, making failures silent and diagnostics harder. Add this at the top to ensure bash is used and the script exits on errors, unset variables, or failed pipes:+#!/usr/bin/env bash +set -euo pipefail🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
44-46: 🛠️ Refactor suggestionFix indentation to tabs
EditorConfig enforces tabs for indentation. Lines 44–46 use spaces, triggering style-check failures. Convert the leading spaces to tabs to comply:- if pkg_installed openmediavault 2>/dev/null; then - DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault - fi + if pkg_installed openmediavault 2>/dev/null; then + DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault + fi🧰 Tools
🪛 GitHub Actions: Coding style check
[error] 44-46: Wrong indentation type (spaces instead of tabs) detected by editorconfig-checker.
35-40:⚠️ Potential issueRemove unsupported apt-get install flags
pkg_installwrapsapt-get -y install, so flags like--auto-removeand--show-upgradedwill cause errors. Simplify the invocation to only use valid options:-DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ - --option DPkg::Options::="--force-confdef" \ - --option DPkg::Options::="--force-confold" \ - openmediavault +DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \ + --option DPkg::Options::="--force-confdef" \ + --option DPkg::Options::="--force-confold" \ + openmediavault
🧹 Nitpick comments (1)
tools/modules/software/module_omv.sh (1)
55-63: Useprintffor portable help output
echo -ebehavior can vary between shells. For consistent formatting, preferprintf, for example:-echo -e "\nUsage: ${module_options["module_omv,feature"]} <command>" +printf "\nUsage: %s <command>\n" "${module_options["module_omv,feature"]}"Apply similar changes to all subsequent help lines.
🛑 Comments failed to post (1)
tools/modules/software/module_omv.sh (1)
64-67: 🛠️ Refactor suggestion
Quote subcommand argument
In the default case, wrap the subcommand in quotes to prevent word-splitting and globbing:-${module_options["module_omv,feature"]} ${commands[3]} +${module_options["module_omv,feature"]} "${commands[3]}"This ensures that any future subcommands containing spaces or special characters will be handled safely.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.*) ${module_options["module_omv,feature"]} "${commands[3]}" ;; esac🤖 Prompt for AI Agents (early access)
In tools/modules/software/module_omv.sh around lines 64 to 67, the default case executes a subcommand without quoting, which can cause word-splitting and globbing issues. To fix this, wrap the subcommand argument ${commands[3]} in double quotes to ensure it is treated as a single argument, preserving spaces and special characters safely.
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
tools/include/markdown/OMV001-header.md (1)
1-8: 💡 Verification agent🧩 Analysis chain
Enhance markdown structure and verify documentation
- Add an explicit heading to make this a standalone section:
+ # OpenMediaVault (OMV)
- Consider converting the feature list into bullet points for readability.
- Ensure the file ends with a newline.
- After updating, run the documentation generator to include this header in
README.md:
🏁 Script executed:
armbian-config --docLength of output: 127
🏁 Script executed:
#!/bin/bash echo "Checking tools/include/markdown/OMV001-header.md..." if [[ -f "tools/include/markdown/OMV001-header.md" ]]; then echo "✅ File exists" last_byte=$(tail -c1 "tools/include/markdown/OMV001-header.md" | od -An -t uC | tr -d ' ') if [[ "$last_byte" == "10" ]]; then echo "✅ Ends with a newline (ASCII 10)" else echo "❌ Does not end with a newline (last byte ASCII: $last_byte)" fi else echo "❌ tools/include/markdown/OMV001-header.md not found" fi echo echo "Searching for 'armbian-config' references..." rg -n "armbian-config" || echo "ℹ️ No occurrences of armbian-config found"Length of output: 8434
🏁 Script executed:
#!/bin/bash echo "1) Verifying newline at end of tools/include/markdown/OMV001-header.md" python3 - << 'EOF' import sys path = "tools/include/markdown/OMV001-header.md" try: with open(path, "rb") as f: data = f.read() print("✅ Ends with newline" if data.endswith(b"\n") else "❌ Does not end with newline") except Exception as e: print("Error reading file:", e) EOF echo echo "2) Searching for '# OpenMediaVault' in README.md" rg -n "# OpenMediaVault" README.md || echo "ℹ️ No such heading found in README.md" echo echo "3) Checking if 'armbian-config --doc' is supported in the CLI" rg -n "\-\-doc" bin/armbian-config || echo "ℹ️ '--doc' option not implemented in bin/armbian-config"Length of output: 681
Add explicit Markdown heading and improve feature readability
- Prepend a top-level heading to
tools/include/markdown/OMV001-header.md:+ # OpenMediaVault (OMV)
- Break out the “OMV supports…” sentence into a bullet list for clarity, e.g.:
- File systems: EXT4, XFS, BTRFS, etc. - Software RAID configurations - Scheduled backups - User and group management - Network protocols: SMB/CIFS, NFS, FTP, SSH - Plugin support: Docker, media servers, cloud sync, BitTorrent, etc.
- The file already ends with a newline—no change needed there.
- Regenerate the top‐level
README.mdto pick up this new header:bin/armbian-config --doc
- Confirm that
README.mdnow contains a “# OpenMediaVault (OMV)” section.
♻️ Duplicate comments (2)
tools/modules/software/module_omv.sh (2)
1-1: Add shebang for shell script interpreter
Without a shebang, the target shell is ambiguous (SC2148). Please add the following at the top of the file to ensure consistent execution:+#!/usr/bin/env bash🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
35-40: Remove unsupported flags from pkg_install
Flags like--auto-removeand--show-upgradedare invalid forapt-get installand will cause failures. Use the-y/--yesflag only:- DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ + DEBIAN_FRONTEND=noninteractive pkg_install --yes \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \
🧹 Nitpick comments (2)
tools/modules/software/module_omv.sh (2)
43-47: Cleanup repository and keyring on removal
After uninstalling OpenMediaVault, the APT source list and GPG key remain on the system. Consider removing them:if pkg_installed openmediavault 2>/dev/null; then DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault + rm -f /etc/apt/sources.list.d/openmediavault.list + rm -f /usr/share/keyrings/openmediavault-archive-keyring.gpg fi
55-63: Refactor help output for clarity and maintainability
Using a here‐document can simplify the help text and avoid multipleecho -ecalls:- echo -e "\nUsage: ${module_options["module_omv,feature"]} <command>" - echo -e "Commands: ${module_options["module_omv,example"]}" - echo "Available commands:" - echo -e "\tinstall\t- Install $title." - echo -e "\tstatus\t- Installation status $title." - echo -e "\tremove\t- Remove $title." - echo + cat <<EOF +Usage: ${module_options["module_omv,feature"]} <command> +Commands: ${module_options["module_omv,example"]} + install - Install $title. + status - Show installation status of $title. + remove - Remove $title. +EOF
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (6)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/runtime/config.runtime.sh(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/omv.conf
🚧 Files skipped from review as they are similar to previous changes (3)
- tools/modules/runtime/config.runtime.sh
- tools/include/markdown/OMV001-footer.md
- tools/json/config.software.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
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.
Actionable comments posted: 0
♻️ Duplicate comments (5)
tools/modules/software/module_omv.sh (5)
1-1: 🛠️ Refactor suggestionAdd shebang and shell directive
ShellCheck (SC2148) suggests specifying the target shell. Please add at the top of the file:+#!/usr/bin/env bash +# shellcheck shell=bash🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
15-19: 🛠️ Refactor suggestionExtract release codename into a variable
Declarereleaseonce frommodule_optionsto avoid scattering hardcoded strings:function module_omv() { + local release="${module_options["module_omv,release"]}" local title="openmediavault" local commands IFS=' ' read -r -a commands <<< "${module_options["module_omv,example"]}"
27-29: 🛠️ Refactor suggestionUse dynamic release variable in the APT source
Replace the hardcodedsandwormcodename with$release:- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ - https://packages.openmediavault.org/public sandworm main" | \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] \ + https://packages.openmediavault.org/public $release main" | \ tee /etc/apt/sources.list.d/openmediavault.list
34-39: 🛠️ Refactor suggestionRemove unsupported flags from pkg_install
pkg_installwrapsapt-get -y install; flags like--auto-removeand--show-upgradedaren’t valid here. Simplify to:- DEBIAN_FRONTEND=noninteractive pkg_install --yes --auto-remove --show-upgraded \ - --allow-downgrades --allow-change-held-packages \ - --no-install-recommends \ + DEBIAN_FRONTEND=noninteractive pkg_install \ + --allow-downgrades --allow-change-held-packages \ + --no-install-recommends \
42-45:⚠️ Potential issueFix indentation to use tabs
Theremovebranch is indented with spaces, violating EditorConfig. Convert to tabs:- if pkg_installed openmediavault 2>/dev/null; then - DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault - fi + if pkg_installed openmediavault 2>/dev/null; then + DEBIAN_FRONTEND=noninteractive pkg_remove openmediavault + fi
🧹 Nitpick comments (2)
tools/modules/software/module_omv.sh (2)
47-53: Standardize indentation in status check
Similarly, thestatusbranch uses space indent. Please convert each leading space to a single tab for consistency.
54-62: Use printf instead of echo -e for portability
Relying onecho -eis non-portable. Consider:- echo -e "Commands: ${module_options["module_omv,example"]}" - echo "Available commands:" - echo -e "\tinstall\t- Install $title." + printf "Commands: %s\n" "${module_options["module_omv,example"]}" + printf "Available commands:\n" + printf "\tinstall\t- Install %s.\n" "$title"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/include/images/OMV001.pngis excluded by!**/*.png
📒 Files selected for processing (6)
tests/omv.conf(1 hunks)tools/include/markdown/OMV001-footer.md(1 hunks)tools/include/markdown/OMV001-header.md(1 hunks)tools/json/config.software.json(1 hunks)tools/modules/runtime/config.runtime.sh(1 hunks)tools/modules/software/module_omv.sh(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tools/include/markdown/OMV001-footer.md
🚧 Files skipped from review as they are similar to previous changes (4)
- tests/omv.conf
- tools/modules/runtime/config.runtime.sh
- tools/include/markdown/OMV001-header.md
- tools/json/config.software.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
tools/modules/software/module_omv.sh (1)
tools/modules/functions/package.sh (4)
pkg_update(81-84)pkg_install(41-44)pkg_installed(54-58)pkg_remove(68-71)
🪛 Shellcheck (0.10.0)
tools/modules/software/module_omv.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OpenMediaVault install (bookworm)
🔇 Additional comments (1)
tools/modules/software/module_omv.sh (1)
11-11: Confirm correct architecture metadata
Good to see thearchentry usesamd64, matchingdpkg --print-architecture.
Description
OpenMediaVault (OMV) is a free and open-source NAS (Network-Attached Storage) operating system based on Debian Linux. It provides a web-based interface for managing storage devices, file sharing (via SMB, NFS, FTP, etc.), user permissions, and services like RAID, backups, and monitoring—making it ideal for home and small office servers.
Implementation Details
APT installation, to Bookworm only.
Testing Procedure
Checklist