-
-
Notifications
You must be signed in to change notification settings - Fork 312
Change copy command to install with permissions #1332
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
WalkthroughReplaces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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. Comment |
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
🧹 Nitpick comments (1)
install/production-filesystem/entrypoint.d/15-first-run-config.sh (1)
10-13: Good use ofinstallfor atomic permission handling.The change from
cptoinstallwith explicit mode and ownership is a solid improvement. It atomically handles permissions and ownership, addressing the issue where restrictive source modes (like 004) would cause access errors.However, the error message on line 11 still refers to "copy" when the operation is now "deploy" or "install". This is a minor textual accuracy issue that should be updated for clarity.
Consider updating the error message:
- >&2 echo "ERROR: Failed to copy default config to ${NETALERTX_CONFIG}/app.conf" + >&2 echo "ERROR: Failed to deploy default config to ${NETALERTX_CONFIG}/app.conf"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
install/production-filesystem/entrypoint.d/15-first-run-config.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1263
File: install/production-filesystem/entrypoint.sh:60-86
Timestamp: 2025-11-01T19:02:10.635Z
Learning: In the NetAlertX project (install/production-filesystem/entrypoint.sh), when fail-fast behavior is adopted for entrypoint checks in the future, be lenient during review because tests will be removed or changed to accommodate that behavior. The current continue-on-failure approach exists to support the existing test suite, but this is expected to change along with corresponding test adjustments.
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/scripts/setup.sh:103-116
Timestamp: 2025-09-20T14:09:29.159Z
Learning: In NetAlertX devcontainer setup, the netalertx user has write permissions to /var/log/nginx/ directory as it's explicitly chowned to netalertx:www-data in the Dockerfile, so setup.sh can write to nginx log files without sudo.
📚 Learning: 2025-11-01T19:02:10.635Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1263
File: install/production-filesystem/entrypoint.sh:60-86
Timestamp: 2025-11-01T19:02:10.635Z
Learning: In the NetAlertX project (install/production-filesystem/entrypoint.sh), when fail-fast behavior is adopted for entrypoint checks in the future, be lenient during review because tests will be removed or changed to accommodate that behavior. The current continue-on-failure approach exists to support the existing test suite, but this is expected to change along with corresponding test adjustments.
Applied to files:
install/production-filesystem/entrypoint.d/15-first-run-config.sh
📚 Learning: 2025-11-23T16:05:31.339Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1302
File: back/cron_script.sh:6-18
Timestamp: 2025-11-23T16:05:31.339Z
Learning: The `/back/cron_script.sh` file is legacy code maintained only for compatibility with other components. The active/production version is in `install/production-filesystem/services/scripts/cron_script.sh`. Changes to `/back` directory are typically outside the scope of PRs unless specifically addressing compatibility.
Applied to files:
install/production-filesystem/entrypoint.d/15-first-run-config.sh
📚 Learning: 2025-09-20T14:09:29.159Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/scripts/setup.sh:103-116
Timestamp: 2025-09-20T14:09:29.159Z
Learning: In NetAlertX devcontainer setup, the netalertx user has write permissions to /var/log/nginx/ directory as it's explicitly chowned to netalertx:www-data in the Dockerfile, so setup.sh can write to nginx log files without sudo.
Applied to files:
install/production-filesystem/entrypoint.d/15-first-run-config.sh
📚 Learning: 2025-10-26T15:39:36.707Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1235
File: install/production-filesystem/services/scripts/check-first-run-config.sh:0-0
Timestamp: 2025-10-26T15:39:36.707Z
Learning: In NetAlertX startup scripts, critical initialization failures (e.g., unable to create config directory or copy default config files) should exit with non-zero status to fail fast and provide clear error messages, rather than continuing in a broken state.
Applied to files:
install/production-filesystem/entrypoint.d/15-first-run-config.sh
📚 Learning: 2025-10-26T16:45:41.247Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1235
File: install/production-filesystem/services/scripts/check-ramdisk.sh:0-0
Timestamp: 2025-10-26T16:45:41.247Z
Learning: In NetAlertX check scripts (install/production-filesystem/services/scripts/check-*.sh), not all checks should exit with non-zero status. Some checks, like check-ramdisk.sh, are warning-only and exit 0 even when issues are detected, allowing the application to start despite suboptimal configuration.
Applied to files:
install/production-filesystem/entrypoint.d/15-first-run-config.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: docker_dev
🔇 Additional comments (1)
install/production-filesystem/entrypoint.d/15-first-run-config.sh (1)
10-13: Verify that netalertx user and group are created before this entrypoint script executes.The
installcommand with-o netalertx -g netalertxrequires the netalertx user and group to exist. Confirm these are created during Dockerfile construction or in an earlier entrypoint.d script (scripts numbered before 15).
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
🧹 Nitpick comments (1)
install/production-filesystem/entrypoint.d/20-first-run-db.sh (1)
100-102: Fix indentation inconsistency in the new column definition.Line 101 uses tabs while the surrounding column definitions use spaces, creating inconsistent formatting within the Devices table schema.
devSourcePlugin TEXT, - devFQDN TEXT, + devFQDN TEXT, "devCustomProps" TEXT);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
install/production-filesystem/entrypoint.d/15-first-run-config.sh(1 hunks)install/production-filesystem/entrypoint.d/20-first-run-db.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- install/production-filesystem/entrypoint.d/15-first-run-config.sh
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-29T23:18:27.559Z
Learnt from: CR
Repo: jokob-sk/NetAlertX PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T23:18:27.559Z
Learning: Applies to front/plugins/*/script.py : Plugin device imports must define `database_column_definitions` when creating/updating devices; watched fields trigger notifications
Applied to files:
install/production-filesystem/entrypoint.d/20-first-run-db.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: docker_dev
🔇 Additional comments (3)
install/production-filesystem/entrypoint.d/20-first-run-db.sh (3)
266-266: Update view column definitions to includedevFQDN.The view comments at lines 266, 282, and 284 enumerate the columns returned by each view. These hardcoded lists do not include the newly added
devFQDNcolumn from the Devices table, and should be updated for accuracy. Confirm whether these comments are auto-generated or manually maintained—if auto-generated, they will need regeneration.Also applies to: 282-282, 284-284
100-102: Verify database column definition metadata for the newdevFQDNcolumn.Per the retrieved learnings, plugin device imports must define
database_column_definitionswhen creating or updating devices. Confirm thatdevFQDNhas been registered in the appropriate plugin or backend configuration.
1-468: Verify migration strategy for existing deployed databases.This file only executes on first-run initialization. If NetAlertX is already deployed with existing databases, they will not automatically receive the new
devFQDNcolumn. Confirm that a migration script exists to add this column to existing Devices tables, or document the upgrade path clearly.
Switches config initialization from cp to install to handle permissions atomically and prevent access errors caused by restrictive source file mode 004.
Summary by CodeRabbit
Bug Fixes
New Features
✏️ Tip: You can customize this high-level summary in your review settings.