nina0 commited on
Commit
8ef179f
·
verified ·
1 Parent(s): f90d4ed

Deploy CPA-Manager-Plus Docker Space

Browse files
Files changed (2) hide show
  1. Dockerfile +8 -0
  2. README.md +55 -5
Dockerfile ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ FROM seakee/cpa-manager-plus:latest
2
+
3
+ ENV HTTP_ADDR=0.0.0.0:18317 \
4
+ USAGE_DATA_DIR=/data \
5
+ USAGE_DB_PATH=/data/usage.sqlite \
6
+ CPA_MANAGER_DATA_KEY_PATH=/data/data.key
7
+
8
+ EXPOSE 18317
README.md CHANGED
@@ -1,10 +1,60 @@
1
  ---
2
- title: CPA Manager Plus
3
- emoji: 📈
4
- colorFrom: green
5
- colorTo: blue
6
  sdk: docker
 
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: CPA-Manager-Plus
3
+ emoji: 📊
4
+ colorFrom: blue
5
+ colorTo: indigo
6
  sdk: docker
7
+ app_port: 18317
8
  pinned: false
9
  ---
10
 
11
+ # CPA-Manager-Plus on Hugging Face Spaces
12
+
13
+ This Space runs [seakee/cpa-manager-plus:latest](https://hub.docker.com/r/seakee/cpa-manager-plus) in Docker mode.
14
+
15
+ ## Open
16
+
17
+ - Panel URL: `/management.html`
18
+ - Health check: `/health`
19
+ - Runtime status: `/status`
20
+
21
+ ## First setup
22
+
23
+ CPA-Manager-Plus does not bundle CPA itself. CPA must already be running somewhere else.
24
+
25
+ On first startup, if `CPA_MANAGER_ADMIN_KEY` is not configured, the Manager Server generates an admin key and prints it to the Space logs once. Open `/management.html`, enter that admin key, then configure:
26
+
27
+ - `CPA URL`
28
+ - `CPA Management Key`
29
+ - request monitoring settings
30
+
31
+ After setup, use the Manager Server admin key to log in.
32
+
33
+ ## Optional Space Variables / Secrets
34
+
35
+ Variables:
36
+
37
+ - `CPA_UPSTREAM_URL`
38
+ - `USAGE_COLLECTOR_MODE` (optional, default `auto`)
39
+ - `USAGE_POLL_INTERVAL_MS` (optional, default `500`)
40
+ - `USAGE_CORS_ORIGINS` (optional, default `*`)
41
+
42
+ Secrets:
43
+
44
+ - `CPA_MANAGER_ADMIN_KEY`
45
+ - `CPA_MANAGEMENT_KEY`
46
+ - `CPA_MANAGER_DATA_KEY`
47
+
48
+ ## Data persistence
49
+
50
+ CPA-Manager-Plus stores configuration, encrypted credentials, and usage analytics under `/data`.
51
+
52
+ - SQLite database: `/data/usage.sqlite`
53
+ - encryption key file: `/data/data.key`
54
+ - Attach Hugging Face persistent storage if you want data to survive rebuilds and restarts.
55
+ - Without persistent storage, setup data and analytics may be lost after the container is rebuilt.
56
+
57
+ ## Notes
58
+
59
+ - Recommended CPA version: `>= 7.1.39`.
60
+ - Minimum CPA version for HTTP usage queue: `>= 6.10.8`.