Skip to content

Fix: ALWAYS_FRESH_INSTALL behavior#1470

Merged
jokob-sk merged 1 commit intonetalertx:mainfrom
adamoutler:fix-fresh-install
Jan 29, 2026
Merged

Fix: ALWAYS_FRESH_INSTALL behavior#1470
jokob-sk merged 1 commit intonetalertx:mainfrom
adamoutler:fix-fresh-install

Conversation

@adamoutler
Copy link
Member

@adamoutler adamoutler commented Jan 29, 2026

This provides a fix for ALWAYS_FRESH_INSTALL and makes the 20-first-run-config.sh follow the same logic as 25-first-rundb.sh. Additionally, it provides a message on folder creation issues.

Summary by CodeRabbit

  • New Features

    • Added fresh installation mode, enabling users to completely reset and reconfigure their entire configuration environment when necessary.
  • Bug Fixes

    • Strengthened configuration directory creation with improved error handling, ensuring failures provide clear guidance and next steps to users.
    • Enhanced first-run deployment messaging with better formatting and clarity to guide users through initial setup.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Enhanced first-run configuration handling in the entrypoint script with strict shell execution, robust error handling for config directory creation, support for fresh install mode, and improved colored user-facing messages.

Changes

Cohort / File(s) Summary
First-Run Configuration Enhancement
install/production-filesystem/entrypoint.d/20-first-run-config.sh
Added strict shell execution (set -eu), color constants for output formatting, robust config directory creation with comprehensive error handling and permission management, support for ALWAYS_FRESH_INSTALL flag to wipe existing configuration, and revised user-facing messages with cyan coloring. Removed fallback mkdir logic in favor of pre-deployment directory setup.

Poem

🐰 Whisker-twitch and a hop of cheer,
The config path is crystal clear!
With colors bright and guards so tight,
Fresh starts bloom—oh what a sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: ALWAYS_FRESH_INSTALL behavior' directly relates to the main change: implementing proper ALWAYS_FRESH_INSTALL handling in the entrypoint script by adding wipe logic and improved config directory creation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@install/production-filesystem/entrypoint.d/20-first-run-config.sh`:
- Around line 10-39: The ALWAYS_FRESH_INSTALL block uses rm -rf
"${NETALERTX_CONFIG}"/* which is unsafe if NETALERTX_CONFIG is empty or “/”;
update the safety checks in that block to first verify NETALERTX_CONFIG is
non-empty and not equal to "/" (and fail with an explicit error if it is), and
then use a guarded expansion when invoking rm (e.g., the shell parameter
expansion guard or equivalent) so the delete becomes a no-op or aborts on
unset/empty; reference the ALWAYS_FRESH_INSTALL conditional and the
NETALERTX_CONFIG variable when making these changes.

@jokob-sk
Copy link
Collaborator

Thanks @adamoutler 🙏

@jokob-sk jokob-sk merged commit fe6598b into netalertx:main Jan 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants