f2d90b38 commited on
Commit
602a98a
·
verified ·
1 Parent(s): 414eef2

Upload 5 files

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -0
  2. config.yaml +78 -0
  3. start.sh +2 -0
Dockerfile CHANGED
@@ -20,6 +20,7 @@ ENV CONFIG_PATH=/data/config.yaml
20
  ENV AUTH_DIR=/data/auth
21
 
22
  COPY nginx.conf.template /etc/nginx/templates/default.conf.template
 
23
  COPY public /usr/share/nginx/html
24
  COPY start.sh /start.sh
25
  RUN chmod +x /start.sh
 
20
  ENV AUTH_DIR=/data/auth
21
 
22
  COPY nginx.conf.template /etc/nginx/templates/default.conf.template
23
+ COPY config.yaml /app/config.yaml
24
  COPY public /usr/share/nginx/html
25
  COPY start.sh /start.sh
26
  RUN chmod +x /start.sh
config.yaml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Server host/interface to bind to. Default is empty ("") to bind all interfaces (IPv4 + IPv6).
2
+ # Use "127.0.0.1" or "localhost" to restrict access to local machine only.
3
+ host: ""
4
+
5
+ # Server port
6
+ port: 8317
7
+
8
+ # TLS settings for HTTPS. When enabled, the server listens with the provided certificate and key.
9
+ tls:
10
+ enable: false
11
+ cert: ""
12
+ key: ""
13
+
14
+ # Management API settings
15
+ remote-management:
16
+ # Whether to allow remote (non-localhost) management access.
17
+ # When false, only localhost can access management endpoints (a key is still required).
18
+ allow-remote: true
19
+
20
+ # Management key. If a plaintext value is provided here, it will be hashed on startup.
21
+ # All management requests (even from localhost) require this key.
22
+ # Leave empty to disable the Management API entirely (404 for all /v0/management routes).
23
+ secret-key: "CHANGE_ME"
24
+
25
+ # Disable the bundled management control panel asset download and HTTP route when true.
26
+ disable-control-panel: false
27
+
28
+ # GitHub repository for the management control panel. Accepts a repository URL or releases API URL.
29
+ panel-github-repository: "https://github.com/router-for-me/Cli-Proxy-API-Management-Center"
30
+
31
+ # Authentication directory (supports ~ for home directory)
32
+ auth-dir: "~/.cli-proxy-api"
33
+
34
+ # API keys for authentication
35
+ api-keys:
36
+ - "your-api-key-1"
37
+ - "your-api-key-2"
38
+ - "your-api-key-3"
39
+
40
+ # Enable debug logging
41
+ debug: false
42
+
43
+ # When true, disable high-overhead HTTP middleware features to reduce per-request memory usage under high concurrency.
44
+ commercial-mode: false
45
+
46
+ # When true, write application logs to rotating files instead of stdout
47
+ logging-to-file: false
48
+
49
+ # Maximum total size (MB) of log files under the logs directory. When exceeded, the oldest log
50
+ # files are deleted until within the limit. Set to 0 to disable.
51
+ logs-max-total-size-mb: 0
52
+
53
+ # When false, disable in-memory usage statistics aggregation
54
+ usage-statistics-enabled: false
55
+
56
+ # Proxy URL. Supports socks5/http/https protocols. Example: socks5://user:pass@192.168.1.1:1080/
57
+ proxy-url: ""
58
+
59
+ # When true, unprefixed model requests only use credentials without a prefix (except when prefix == model name).
60
+ force-model-prefix: false
61
+
62
+ # Number of times to retry a request. Retries will occur if the HTTP response code is 403, 408, 500, 502, 503, or 504.
63
+ request-retry: 3
64
+
65
+ # Maximum wait time in seconds for a cooled-down credential before triggering a retry.
66
+ max-retry-interval: 30
67
+
68
+ # Quota exceeded behavior
69
+ quota-exceeded:
70
+ switch-project: true # Whether to automatically switch to another project when a quota is exceeded
71
+ switch-preview-model: true # Whether to automatically switch to a preview model when a quota is exceeded
72
+
73
+ # Routing strategy for selecting credentials when multiple match.
74
+ routing:
75
+ strategy: "round-robin" # round-robin (default), fill-first
76
+
77
+ # When true, enable authentication for the WebSocket API (/v1/ws).
78
+ ws-auth: false
start.sh CHANGED
@@ -27,6 +27,8 @@ fi
27
 
28
  if [ ! -f "${CONFIG_PATH}" ]; then
29
  for candidate in \
 
 
30
  /CLIProxyAPI/config.yaml \
31
  /CLIProxyAPI/config.yml \
32
  /CLIProxyAPI/config.example.yaml \
 
27
 
28
  if [ ! -f "${CONFIG_PATH}" ]; then
29
  for candidate in \
30
+ /app/config.yaml \
31
+ /app/config.yml \
32
  /CLIProxyAPI/config.yaml \
33
  /CLIProxyAPI/config.yml \
34
  /CLIProxyAPI/config.example.yaml \