Spaces:
Paused
Paused
chore: remove debug self-test code
Browse files- Dockerfile +0 -3
- entrypoint.sh +1 -18
Dockerfile
CHANGED
|
@@ -4,9 +4,6 @@ FROM eceasy/cli-proxy-api:latest
|
|
| 4 |
RUN mkdir -p /CLIProxyAPI/auth /CLIProxyAPI/logs && \
|
| 5 |
chmod -R 777 /CLIProxyAPI/auth /CLIProxyAPI/logs
|
| 6 |
|
| 7 |
-
# 安装 curl 用于自测 (尝试 apk 和 apt-get)
|
| 8 |
-
RUN (apk add --no-cache curl || (apt-get update && apt-get install -y curl)) 2>/dev/null || echo "Failed to install curl"
|
| 9 |
-
|
| 10 |
# 复制配置文件和启动脚本
|
| 11 |
COPY config.yaml /CLIProxyAPI/config.yaml
|
| 12 |
COPY entrypoint.sh /CLIProxyAPI/entrypoint.sh
|
|
|
|
| 4 |
RUN mkdir -p /CLIProxyAPI/auth /CLIProxyAPI/logs && \
|
| 5 |
chmod -R 777 /CLIProxyAPI/auth /CLIProxyAPI/logs
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
# 复制配置文件和启动脚本
|
| 8 |
COPY config.yaml /CLIProxyAPI/config.yaml
|
| 9 |
COPY entrypoint.sh /CLIProxyAPI/entrypoint.sh
|
entrypoint.sh
CHANGED
|
@@ -50,24 +50,7 @@ echo "=== Final config.yaml ==="
|
|
| 50 |
cat "$CONFIG"
|
| 51 |
echo "========================="
|
| 52 |
|
| 53 |
-
# 启动后台自测
|
| 54 |
-
(
|
| 55 |
-
sleep 10
|
| 56 |
-
echo "=== [SELF-TEST] Testing management key authentication from localhost ==="
|
| 57 |
-
# 用 query param 方式测试
|
| 58 |
-
RESULT1=$(curl -s "http://127.0.0.1:8317/v0/management/config?key=sarky880309" 2>&1 | head -c 200)
|
| 59 |
-
echo "[SELF-TEST] Query param result: $RESULT1"
|
| 60 |
-
# 用 header 方式测试
|
| 61 |
-
RESULT2=$(curl -s -H "X-Management-Key: sarky880309" "http://127.0.0.1:8317/v0/management/config" 2>&1 | head -c 200)
|
| 62 |
-
echo "[SELF-TEST] Header result: $RESULT2"
|
| 63 |
-
# 用 Authorization Bearer 方式测试
|
| 64 |
-
RESULT3=$(curl -s -H "Authorization: Bearer sarky880309" "http://127.0.0.1:8317/v0/management/config" 2>&1 | head -c 200)
|
| 65 |
-
echo "[SELF-TEST] Bearer result: $RESULT3"
|
| 66 |
-
# 打印 config 文件中的 secret-key 当前值(检查是否被程序修改过)
|
| 67 |
-
echo "[SELF-TEST] Current secret-key in config:"
|
| 68 |
-
grep "secret-key" "$CONFIG"
|
| 69 |
-
echo "=== [SELF-TEST] Done ==="
|
| 70 |
-
) &
|
| 71 |
|
| 72 |
# 使用 --config 参数指定配置文件路径(官方云部署方式)
|
| 73 |
exec /CLIProxyAPI/CLIProxyAPI --config "$CONFIG"
|
|
|
|
| 50 |
cat "$CONFIG"
|
| 51 |
echo "========================="
|
| 52 |
|
| 53 |
+
# 启动后台自测已移除
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
# 使用 --config 参数指定配置文件路径(官方云部署方式)
|
| 56 |
exec /CLIProxyAPI/CLIProxyAPI --config "$CONFIG"
|