Skip to content

Comments

Dev - some installer improvements #172

Merged
dirkpetersen merged 5 commits intomainfrom
dev
Oct 17, 2025
Merged

Dev - some installer improvements #172
dirkpetersen merged 5 commits intomainfrom
dev

Conversation

@dirkpetersen
Copy link
Owner

  • never move user config and data during installation

Dirk Petersen and others added 5 commits October 17, 2025 12:26
CRITICAL FIX: Removed dangerous pattern where config and data directories
were deleted and then restored. If installation failed mid-process, users
would lose everything. Now config and data are NEVER touched during upgrades.

Changes:
- install_froster(): Only removes binaries, never touches config/data dirs
- backup_old_installation(): Renamed to clarify backups are reference only
- Error handler: Removed restore logic, now just informs user data is safe
- Added clear comments explaining config/data persist across upgrades

Safety improvements:
- Config dir (~/.config/froster/) is never deleted
- Data dir (~/.local/share/froster/) is never deleted
- froster-archives.json always persists across upgrades
- config.ini always persists across upgrades
- Backups still created for user reference, but not relied upon
- If install fails, user data remains untouched

Before: rm config → install → try to restore (fails = data loss)
After: leave config alone → install → config always safe

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added intelligent backup detection and restoration for users who were
affected by the previous installer that deleted config/data files.

New Functions:
- get_data_file_location(): Reads config.ini to find actual location of
  froster-archives.json (handles shared data directories)
- check_and_restore_from_backup(): Checks if both config and data are
  missing, searches for matching backups, and prompts user to restore

Recovery Logic:
- Only triggers if BOTH config.ini AND froster-archives.json are missing
- Searches backup directories for matching timestamped backups
- Finds most recent backup that contains BOTH files
- Prompts user with backup date and location
- Restores both files atomically (from same backup) if user confirms
- Maintains consistency between config and database

Safety Features:
- Only asks once (not per file) to maintain consistency
- Shows backup date formatted as YYYY-MM-DD HH:MM:SS
- User can decline and manually restore later
- Handles shared data directory configurations correctly
- No action taken if even one file exists (prevents inconsistent state)

This helps users recover from the previous installer bug where config
and data were deleted and restoration failed mid-install.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced 'froster update' command to offer automatic installation
instead of just displaying the curl command.

Changes:
- Added user prompt: "Would you like to update now? (yes/no)"
- If yes: Executes curl install command automatically
- If no: Shows manual update commands as before
- Displays success/failure status after update attempt
- Includes timestamp in curl URL to bypass caching

User experience improvements:
- One-step update process (no copy/paste required)
- Clear feedback on update success or failure
- Fallback instructions if automatic update fails
- User still has full control (can decline and update manually)

Before: User had to copy/paste curl command manually
After: User can update with a simple "yes" response

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updated 'froster update' to show the curl commands first, then ask if
user wants to execute them automatically.

Changes:
- Display curl commands BEFORE asking for confirmation
- User sees exactly what will be executed
- Better transparency and trust
- Commands displayed even if user chooses automatic update

User experience:
- Shows manual commands first (users can copy if needed)
- Then asks: "Would you like to update now?"
- If yes: Executes the displayed command automatically
- If no: User already has the command to run manually later

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Improvements since 0.21.0:
- Backup recovery for users affected by buggy installer
- Interactive update with automatic execution
- Display curl commands before update prompt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dirkpetersen dirkpetersen merged commit 233668e into main Oct 17, 2025
24 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.

1 participant