CLIProxyAPI: fix update deleting config.yaml#15834
Open
austinpilz wants to merge 3 commits into
Open
Conversation
The completion message previously pointed to the bare host:port, which serves the proxy API rather than the admin UI. Provider authentication happens at /management.html.
CLEAN_INSTALL wipes /opt/cliproxyapi before extracting the new release tarball, and config.yaml isn't part of upstream's release asset, so every update deleted it. The service then failed to start with "failed to read config file: open /opt/cliproxyapi/config.yaml: no such file or directory" (reported in PIL-395). Back up config.yaml before the clean install and restore it after, matching the existing backup/restore pattern used by other scripts in this repo (fladder, rustypaste, etc.). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
Updating CLIProxyAPI breaks the service. Reported error:
update_script()inct/cliproxyapi.shrunsfetch_and_deploy_gh_releasewithCLEAN_INSTALL=1, which wipes/opt/cliproxyapibefore extracting the new release tarball.config.yamlis generated at install time by this script (it is not part of upstream's release asset), so every update deleted it and the service could never start again.This PR backs up
/opt/cliproxyapi/config.yamlbefore the clean install and restores it before restarting the service — the same backup/restore pattern already used elsewhere in this repo for scripts that pairCLEAN_INSTALL=1with a generated config file (e.g.fladder.sh,rustypaste.sh).Only
ct/cliproxyapi.shis touched; no unrelated changes.Supersedes #15833, which the template-check bot auto-closed for using a non-template body before I fixed it; GitHub won't relink a force-recreated branch to a closed PR, so opening fresh here with the corrected template.
🔗 Related Issue
Fixes #(none filed upstream — reported to me directly; logs included above)
✅ Prerequisites (X in brackets)
bash -n ct/cliproxyapi.shpasses; logic verified by tracingfetch_and_deploy_gh_release'sCLEAN_INSTALLpath inmisc/tools.functo confirm it deletesconfig.yaml, and confirming the backup/restore now runs around that call in the correct order (stop service → backup → clean install → restore → start service). I do not have a spare LXC to run a live end-to-end update against, so this has not been verified against a real running container — flagging this explicitly for reviewer awareness.cp/mvunder/tmp, scoped to this update run.🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.