feat: enhance doctor.py with config validation, service detection, and management probing - #2
Closed
benzntech wants to merge 1 commit into
Closed
Conversation
…d management probing Key improvements based on real deployment findings: - Detect user-level systemd services (systemctl --user) as fallback - Detect CLIProxyAPI binary from common install paths when no service found - Validate config.yaml for auth-dir, management key, and key structure issues - Auto-fix auth-dir path when missing or empty - Auto-generate management key (--auto-gen-key) - Install system-level systemd service from user-level setup - Probe management endpoint to verify connectivity and auth (--probe-management --key) - Fix tilde (~) expansion in auth-dir paths - All diagnostics output as structured JSON (--json) for AI parsing Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Owner
|
感谢这次贡献。当前 |
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.
Summary
Enhanced
scripts/doctor.pywith diagnostics and auto-fix capabilities based on real-world deployment findings.Changes
Detection Improvements
systemctl --userservices (what the official installer creates)/root/cliproxyapi/,/usr/local/bin/,/opt/CLIProxyAPI/) when no systemd service is foundconfig.yamlnext to binary if not specified via-configflag~/.cli-proxy-apito full pathsConfig Validation & Auto-Fix
remote-management.secret-keyis emptyenabledvsallow-remotekey name mismatchNew CLI Flags
--auto-fix-config--auto-gen-key--install-system-service--probe-management--key <KEY>--jsonManagement Endpoint Probing
/v0/management/usagewith optional auth keyTesting
python3 -m py_compile scripts/doctor.py~/.cli-proxy-api→/root/.cli-proxy-api)Notes