-
Notifications
You must be signed in to change notification settings - Fork 0
fix: cliproxyapi services #446
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
Changes from all commits
7da7256
dc31f5c
61a1cf7
9811f22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # AI | ||
| .claude | ||
| .devenv.nix | ||
| objectstore | ||
|
|
||
| # Nix | ||
| .devenv | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -9,10 +9,16 @@ in | |||
| config = { | ||||
| ProgramArguments = [ | ||||
| "${pkgs.bash}/bin/bash" | ||||
| "${./start.sh}" | ||||
| "${./scripts/start.sh}" | ||||
| ]; | ||||
| Environment = { | ||||
| PATH = "${lib.makeBinPath [ pkgs.gnused ]}:/opt/homebrew/bin:/usr/local/bin"; | ||||
| HOME = "/Users/shunkakinoki"; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding the
|
||||
| HOME = "/Users/shunkakinoki"; |
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.
The start.sh script uses mkdir and cp, which are provided by coreutils. The PATH for this systemd service doesn't include coreutils, which will likely cause the script to fail on Linux systems. For consistency with the launchd configuration and to ensure the script runs correctly, you should add pkgs.coreutils to the lib.makeBinPath list in the Environment setting for this service.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,26 +24,16 @@ export OBJECTSTORE_BUCKET="${OBJECTSTORE_BUCKET:-${AWS_S3_BUCKET:-}}" | |
| export OBJECTSTORE_ACCESS_KEY="${OBJECTSTORE_ACCESS_KEY:-${AWS_ACCESS_KEY_ID:-}}" | ||
| export OBJECTSTORE_SECRET_KEY="${OBJECTSTORE_SECRET_KEY:-${AWS_SECRET_ACCESS_KEY:-}}" | ||
|
|
||
| # Backup auth files to R2 before starting service | ||
| # This protects against race condition deletions | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| if [ -x "$SCRIPT_DIR/scripts/backup-auth.sh" ]; then | ||
| bash "$SCRIPT_DIR/scripts/backup-auth.sh" | ||
| fi | ||
|
|
||
| # Generate config from template with secrets injected | ||
| if [ -f "$TEMPLATE" ]; then | ||
| sed \ | ||
| -e "s|__OPENROUTER_API_KEY__|${OPENROUTER_API_KEY:-}|g" \ | ||
| -e "s|__CLIPROXY_MANAGEMENT_PASSWORD__|${CLIPROXY_MANAGEMENT_PASSWORD:-}|g" \ | ||
| -e "s|__ZAI_API_KEY__|${ZAI_API_KEY:-}|g" \ | ||
| "$TEMPLATE" >"$CONFIG" | ||
| fi | ||
|
|
||
| # Recover auth files from backup if they're missing | ||
| # This handles race condition where files get deleted during config reload | ||
| if [ -x "$SCRIPT_DIR/scripts/recover-auth.sh" ]; then | ||
| bash "$SCRIPT_DIR/scripts/recover-auth.sh" | ||
| # Also copy to objectstore config location (cliproxyapi uses this for persistence) | ||
| mkdir -p "$CONFIG_DIR/objectstore/config" | ||
| cp "$CONFIG" "$CONFIG_DIR/objectstore/config/config.yaml" | ||
|
Comment on lines
+34
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On Linux, Useful? React with 👍 / 👎. |
||
| fi | ||
|
|
||
| # Change to config dir so logs are created there | ||
|
|
||
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.
The
objectstoredirectory appears to be created within$HOME/.cli-proxy-api, which is typically outside the scope of this Git repository. Consequently, this.gitignoreentry may not have any effect. If this entry is intended for a local development workflow where anobjectstoredirectory is created at the repository root, consider adding a comment to clarify its purpose. Otherwise, it could be removed to avoid confusion.