fix(cliproxyapi): recover missing auth files from git-tracked dotfiles - #469
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughReworks README to add a Git-backed automatic recovery section and clarifies object-store sync semantics. Adds macOS-only rsync (--ignore-existing) merges from git-tracked dotfiles into the local auth cache during startup/backup. Adjusts backup step numbering and changes the launchctl restart sequence in the Makefile. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Launch as launchd/Makefile
participant StartScript as start.sh
participant LocalAuth as Local auth cache (objectstore)
participant Dotfiles as Git-tracked dotfiles (~/dotfiles)
participant R2 as Remote object store (R2)
rect `#f0f7ff`
Launch->>StartScript: trigger service start
end
rect `#ffffff`
StartScript->>LocalAuth: check auth dir presence
alt auth missing or incomplete (Darwin)
StartScript->>Dotfiles: if dotfiles dir exists, rsync --ignore-existing -> LocalAuth
Dotfiles-->>LocalAuth: copy missing files (no overwrite)
StartScript->>LocalAuth: report recovered file count
else auth present or non-Darwin
StartScript-->>LocalAuth: no dotfiles merge
end
end
rect `#fff7f0`
StartScript->>R2: synchronize with R2/objectstore as configured (startup/change-time)
R2-->>LocalAuth: provide object-backed files (cache)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a critical enhancement to Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Mesa DescriptionTL;DRAutomatically recover missing What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request enhances the auth file recovery mechanism by merging missing files from git-tracked dotfiles on service start and during backup syncs. The changes in the shell scripts correctly implement this using rsync --ignore-existing, and the README is updated to document the new feature. My review includes suggestions to improve the robustness of file counting in the scripts, address a minor grammatical error in the documentation, and a recommendation to refactor duplicated code for better maintainability.
| **Solution:** | ||
| - Both `start.sh` and `backup-auth.sh` merge missing files from dotfiles | ||
| - Uses `rsync --ignore-existing` to never overwrite newer files from R2 | ||
| - Git-tracked dotfiles acts as a third backup location that survives R2 deletions |
There was a problem hiding this comment.
| before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | ||
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | ||
| after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') |
There was a problem hiding this comment.
Using ls -1 | wc -l to count files can be unreliable as it also counts directories and can misbehave with filenames containing newlines. For better robustness and to ensure you're only counting files, it's recommended to use find. This will give a more accurate count of recovered files.
| before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | |
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | |
| after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | |
| before_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') | |
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | |
| after_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') |
| if [ "$(uname)" = "Darwin" ]; then | ||
| if [ ! -d "$AUTH_DIR" ] || [ -z "$(ls -A "$AUTH_DIR" 2>/dev/null)" ]; then | ||
| if [ -d "$HOME/dotfiles/objectstore/auths" ] && [ -n "$(ls -A "$HOME/dotfiles/objectstore/auths" 2>/dev/null)" ]; then | ||
| @rsync@ -a "$HOME/dotfiles/objectstore/auths/" "$AUTH_DIR/" | ||
| echo "✅ Bootstrapped from dotfiles (objectstore was empty)" >&2 | ||
| DOTFILES_AUTH_DIR="$HOME/dotfiles/objectstore/auths" | ||
| if [ -d "$DOTFILES_AUTH_DIR" ] && [ -n "$(ls -A "$DOTFILES_AUTH_DIR" 2>/dev/null)" ]; then | ||
| # Count files before merge | ||
| before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | ||
|
|
||
| # Merge missing files from dotfiles (never overwrite existing) | ||
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | ||
|
|
||
| # Count files after merge | ||
| after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | ||
|
|
||
| if [ "$after_count" -gt "$before_count" ]; then | ||
| echo "✅ Restored $((after_count - before_count)) missing auth file(s) from dotfiles" >&2 | ||
| fi | ||
| fi | ||
| fi |
There was a problem hiding this comment.
This logic block for merging files from dotfiles is nearly identical to the one in home-manager/services/cliproxyapi/scripts/backup-auth.sh. To improve maintainability and reduce code duplication (DRY principle), consider extracting this logic into a shared function. You could place it in a common script file that both start.sh and backup-auth.sh can source.
| before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | ||
|
|
||
| # Merge missing files from dotfiles (never overwrite existing) | ||
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | ||
|
|
||
| # Count files after merge | ||
| after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') |
There was a problem hiding this comment.
Using ls -1 | wc -l to count files can be unreliable as it also counts directories and can misbehave with filenames containing newlines. For better robustness and to ensure you're only counting files, it's recommended to use find. This will give a more accurate count of restored files.
| before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | |
| # Merge missing files from dotfiles (never overwrite existing) | |
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | |
| # Count files after merge | |
| after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') | |
| before_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') | |
| # Merge missing files from dotfiles (never overwrite existing) | |
| @rsync@ -a --ignore-existing "$DOTFILES_AUTH_DIR/" "$AUTH_DIR/" | |
| # Count files after merge | |
| after_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') |
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="home-manager/services/cliproxyapi/README.md">
<violation number="1" location="home-manager/services/cliproxyapi/README.md:128">
P3: Documentation inaccuracy: `rsync --ignore-existing` does not check if files are "newer" - it simply skips files that already exist regardless of modification time. Consider rewording to "never overwrite files that already exist" for accuracy.</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
|
|
||
| **Solution:** | ||
| - Both `start.sh` and `backup-auth.sh` merge missing files from dotfiles | ||
| - Uses `rsync --ignore-existing` to never overwrite newer files from R2 |
There was a problem hiding this comment.
P3: Documentation inaccuracy: rsync --ignore-existing does not check if files are "newer" - it simply skips files that already exist regardless of modification time. Consider rewording to "never overwrite files that already exist" for accuracy.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/services/cliproxyapi/README.md, line 128:
<comment>Documentation inaccuracy: `rsync --ignore-existing` does not check if files are "newer" - it simply skips files that already exist regardless of modification time. Consider rewording to "never overwrite files that already exist" for accuracy.</comment>
<file context>
@@ -116,10 +116,20 @@ If auth files are lost locally, they are automatically recovered from:
+
+**Solution:**
+- Both `start.sh` and `backup-auth.sh` merge missing files from dotfiles
+- Uses `rsync --ignore-existing` to never overwrite newer files from R2
+- Git-tracked dotfiles acts as a third backup location that survives R2 deletions
+- Recovery is automatic and logged when files are restored
</file context>
| - Uses `rsync --ignore-existing` to never overwrite newer files from R2 | |
| - Uses `rsync --ignore-existing` to only copy files that don't already exist (never overwrites) |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
home-manager/services/cliproxyapi/scripts/start.sh (1)
52-72: LGTM! Recovery logic is well-implemented.The macOS-specific recovery mechanism is correctly implemented with appropriate guards and clear reporting. The use of
rsync --ignore-existingaligns with the stated goal of never overwriting newer R2 files while recovering deletions.Optional: Consider more robust file counting
The file counting approach using
ls -1 | wc -l | tr -d ' 'works for typical auth files but could be more robust.🔎 Alternative approach using find
- before_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') + before_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l)- after_count=$(ls -1 "$AUTH_DIR" 2>/dev/null | wc -l | tr -d ' ') + after_count=$(find "$AUTH_DIR" -maxdepth 1 -type f 2>/dev/null | wc -l)This approach handles edge cases better (filenames with newlines, only counts files not directories), though the current implementation is adequate for auth file scenarios.
home-manager/services/cliproxyapi/scripts/backup-auth.sh (1)
35-48: LGTM! Consistent implementation across scripts.The dotfiles recovery logic in STEP 2 mirrors the implementation in
start.sh, ensuring consistent behavior. The comment explaining "No circular loop risk" is particularly helpful.Note: The file counting approach mentioned in the
start.shreview applies here as well, though it's optional given the low-risk auth file naming patterns.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
home-manager/services/cliproxyapi/README.mdhome-manager/services/cliproxyapi/scripts/backup-auth.shhome-manager/services/cliproxyapi/scripts/start.sh
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{sh,bash}
📄 CodeRabbit inference engine (CLAUDE.md)
Use shfmt with 2-space indentation for shell scripts
**/*.{sh,bash}: Use 2 spaces for indentation in shell scripts
Add proper shebang lines to shell scripts
Follow shellcheck recommendations in shell scripts
Document complex commands in shell scripts
Use consistent variable naming in shell scripts
Files:
home-manager/services/cliproxyapi/scripts/start.shhome-manager/services/cliproxyapi/scripts/backup-auth.sh
**/*.{js,jsx,ts,tsx,json,jsonc,md}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Use Biome for code formatting as configured in biome.json
Files:
home-manager/services/cliproxyapi/README.md
⏰ 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). (14)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: nix-linux
- GitHub Check: nix-nixos
- GitHub Check: nix-darwin
- GitHub Check: lua-neovim
- GitHub Check: lua-neovim-test
- GitHub Check: lua-hammerspoon
- GitHub Check: shell-test
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: shell-lint
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
🔇 Additional comments (3)
home-manager/services/cliproxyapi/scripts/backup-auth.sh (1)
50-50: LGTM! Appropriate STEP renumbering.Renumbering from "STEP 2b" to "STEP 3" maintains sequential clarity after inserting the new dotfiles recovery step.
home-manager/services/cliproxyapi/README.md (2)
119-119: LGTM! Clear explanation of dotfiles role.The updated description accurately captures the dual role of dotfiles as both a write destination and a read-only recovery source, which aligns with the implementation.
122-131: LGTM! Comprehensive documentation of the recovery feature.The new section clearly explains the problem, solution, and benefits of the automatic recovery mechanism. All technical details accurately reflect the implementation in both scripts.
Previously, auth files could be lost if deleted from R2 (e.g., by cliproxyapi internals). The bootstrap logic only restored files when the local objectstore was completely empty. Changes: - start.sh: Always merge missing files from dotfiles using rsync --ignore-existing (never overwrites newer R2 files) - backup-auth.sh: Same recovery logic before syncing to R2 - README.md: Document the new automatic recovery feature This ensures git-tracked dotfiles act as a reliable third backup location that survives R2 deletions.
dc09af4 to
8904ae6
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
home-manager/services/cliproxyapi/scripts/start.sh (1)
52-72: Code duplication withbackup-auth.shcould be extracted to a shared helper.The dotfiles merge logic (check directory, count before/after, rsync, log restoration) is duplicated between this file and
backup-auth.sh. Consider extracting it into a shared function in a common script that both cansource.That said, the implementation is correct and the
find-based file counting from the past review has been incorporated.🔎 Example shared helper approach
Create a shared script (e.g.,
common.sh):# Merge missing auth files from dotfiles (macOS only) # Usage: merge_dotfiles_auth "$DOTFILES_AUTH_DIR" "$AUTH_DIR" merge_dotfiles_auth() { local src="$1" dst="$2" if [ ! -d "$src" ] || [ -z "$(ls -A "$src" 2>/dev/null)" ]; then return 0 fi local before after before=$(find "$dst" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') @rsync@ -a --ignore-existing "$src/" "$dst/" after=$(find "$dst" -maxdepth 1 -type f 2>/dev/null | wc -l | tr -d ' ') if [ "$after" -gt "$before" ]; then echo "✅ Restored $((after - before)) missing auth file(s) from dotfiles" >&2 fi }Then in both scripts:
source "$(dirname "$0")/common.sh" # ... if [ "$(uname)" = "Darwin" ]; then merge_dotfiles_auth "$HOME/dotfiles/objectstore/auths" "$AUTH_DIR" fi
🧹 Nitpick comments (1)
home-manager/services/cliproxyapi/scripts/start.sh (1)
58-58: Minor:ls -Afor non-empty check has edge cases.Using
ls -Ato check for a non-empty directory is a common idiom but can misbehave with filenames containing newlines. A more robust alternative:[ -n "$(find "$DOTFILES_AUTH_DIR" -maxdepth 1 -mindepth 1 -print -quit 2>/dev/null)" ]This is a minor nit given the controlled context (auth files unlikely to have unusual names).
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
home-manager/services/cliproxyapi/README.mdhome-manager/services/cliproxyapi/scripts/backup-auth.shhome-manager/services/cliproxyapi/scripts/start.sh
🚧 Files skipped from review as they are similar to previous changes (2)
- home-manager/services/cliproxyapi/scripts/backup-auth.sh
- home-manager/services/cliproxyapi/README.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{sh,bash}
📄 CodeRabbit inference engine (CLAUDE.md)
Use shfmt with 2-space indentation for shell scripts
**/*.{sh,bash}: Use 2 spaces for indentation in shell scripts
Add proper shebang lines to shell scripts
Follow shellcheck recommendations in shell scripts
Document complex commands in shell scripts
Use consistent variable naming in shell scripts
Files:
home-manager/services/cliproxyapi/scripts/start.sh
🧠 Learnings (1)
📚 Learning: 2025-11-25T09:34:32.423Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/formatting.mdc:0-0
Timestamp: 2025-11-25T09:34:32.423Z
Learning: Applies to **/*.{sh,bash} : Use consistent variable naming in shell scripts
Applied to files:
home-manager/services/cliproxyapi/scripts/start.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). (13)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: nix-linux
- GitHub Check: nix-darwin
- GitHub Check: nix-nixos
- GitHub Check: shell-test
- GitHub Check: shell-lint
- GitHub Check: lua-neovim
- GitHub Check: lua-neovim-test
- GitHub Check: lua-hammerspoon
🔇 Additional comments (1)
home-manager/services/cliproxyapi/scripts/start.sh (1)
52-72: LGTM on the recovery logic.The implementation correctly:
- Guards the logic for macOS only
- Uses
rsync --ignore-existingto avoid overwriting newer R2 files- Counts files using
find(as suggested in prior review)- Only logs when files are actually restored
The comments clearly explain the intent. This should reliably recover auth files deleted from R2.
kickstart -k only restarts the process but doesn't reload the plist file, so updated nix store paths aren't picked up. Using unload/load ensures the service uses the new script after a nix switch.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="Makefile">
<violation number="1" location="Makefile:619">
P2: Missing `|| true` on `launchctl load` command. Unlike the `unload` command above and all other launchctl targets in this file, this will cause the target (and parent targets like `make switch`) to fail if the plist doesn't exist or can't be loaded.</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
| @timeout 5 launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.cliproxyapi || true | ||
| @launchctl unload ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist 2>/dev/null || true | ||
| @sleep 1 | ||
| @launchctl load ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist |
There was a problem hiding this comment.
P2: Missing || true on launchctl load command. Unlike the unload command above and all other launchctl targets in this file, this will cause the target (and parent targets like make switch) to fail if the plist doesn't exist or can't be loaded.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 619:
<comment>Missing `|| true` on `launchctl load` command. Unlike the `unload` command above and all other launchctl targets in this file, this will cause the target (and parent targets like `make switch`) to fail if the plist doesn't exist or can't be loaded.</comment>
<file context>
@@ -614,7 +614,9 @@ launchctl-brew-upgrader: ## Restart brew-upgrader launchd agent.
- @timeout 5 launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.cliproxyapi || true
+ @launchctl unload ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist 2>/dev/null || true
+ @sleep 1
+ @launchctl load ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist
@echo "✅ cliproxyapi restarted"
</file context>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Makefile (1)
617-619: LGTM! The unload/load pattern correctly picks up updated nix store paths.The change from
kickstart -ktounload+loadis appropriate for this PR's objective. Unlikekickstart, this approach forces launchd to re-read the plist file from disk, ensuring updated nix store paths and scripts are picked up after deployment.The error suppression on
unload(2>/dev/null || true) provides good idempotency.Optional: Add timeout to load command for consistency
Consider adding a timeout to the
loadcommand for consistency with other launchctl targets and to prevent indefinite hangs:@launchctl unload ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist 2>/dev/null || true @sleep 1 -@launchctl load ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist +@timeout 5 launchctl load ~/Library/LaunchAgents/org.nix-community.home.cliproxyapi.plist || echo "⚠️ Load timed out or failed"Additionally, verify that the 1-second sleep is sufficient for the unload operation to complete on all target systems.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
Makefile
⏰ 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). (14)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: nix-darwin
- GitHub Check: nix-nixos
- GitHub Check: nix-linux
- GitHub Check: cubic · AI code reviewer
- GitHub Check: shell-test
- GitHub Check: shell-lint
- GitHub Check: lua-neovim-test
- GitHub Check: lua-neovim
- GitHub Check: lua-hammerspoon
Changes
rsync --ignore-existingstart.sh(on service start) andbackup-auth.sh(on file changes)Problem
Auth files could be lost if deleted from R2 (e.g., by cliproxyapi internals or manual deletion). The previous bootstrap logic only restored files when the local objectstore was completely empty, leaving partial losses unrecovered.
Solution
rsync --ignore-existingto merge missing files from git-tracked dotfilesTesting
cliproxyapi --claude-loginworks after recovery🤖 Generated with Claude Code
Summary by cubic
Automatically recover missing auth files from git-tracked dotfiles to prevent data loss after R2 deletions. Recovery runs on service start and during backup sync, and never overwrites newer files.
Written for commit 19aad36. Summary will update automatically on new commits.