Spaces:
Paused
Paused
Restore original upstream-image runtime from 6080143
Browse files- .gitattributes +0 -1
- BUILD_INFO.json +0 -9
- Dockerfile +4 -6
- README.md +0 -14
- UPSTREAM_VERSION +0 -1
- codex2api +0 -3
- entrypoint.sh +1 -6
.gitattributes
CHANGED
|
@@ -33,4 +33,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
codex2api filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
BUILD_INFO.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"upstream_repo": "https://github.com/james-6-23/codex2api.git",
|
| 3 |
-
"upstream_sha": "b1cd0f7fa56d98e9712ccae2942fc7b443e0929a",
|
| 4 |
-
"upstream_short_sha": "b1cd0f7fa56d",
|
| 5 |
-
"upstream_base_version": "v2.9.3",
|
| 6 |
-
"build_version": "v2.9.3+overdraft.b1cd0f7fa56d",
|
| 7 |
-
"workflow_run_id": "34080828022",
|
| 8 |
-
"workflow_run_attempt": "1"
|
| 9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile
CHANGED
|
@@ -2,17 +2,15 @@ FROM ghcr.io/james-6-23/codex2api:latest
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
# scheduled patch builder. UPSTREAM_VERSION records the exact tested source.
|
| 7 |
COPY --from=redis:7-alpine /usr/local/bin/redis-server /usr/local/bin/redis-server
|
| 8 |
COPY --from=redis:7-alpine /usr/local/bin/redis-cli /usr/local/bin/redis-cli
|
| 9 |
-
COPY --chmod=755 codex2api /usr/local/bin/codex2api
|
| 10 |
-
COPY UPSTREAM_VERSION /etc/codex2api-upstream-version
|
| 11 |
-
COPY BUILD_INFO.json /etc/codex2api-build-info.json
|
| 12 |
|
|
|
|
| 13 |
RUN apk add --no-cache libstdc++ tzdata ca-certificates
|
| 14 |
|
| 15 |
WORKDIR /app
|
|
|
|
| 16 |
COPY --chmod=755 entrypoint.sh /app/entrypoint.sh
|
| 17 |
|
| 18 |
EXPOSE 7860
|
|
@@ -20,4 +18,4 @@ EXPOSE 7860
|
|
| 20 |
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \
|
| 21 |
CMD wget -q -T 5 -O /dev/null http://127.0.0.1:7860/health || exit 1
|
| 22 |
|
| 23 |
-
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
+
# 从官方 Redis 镜像拷贝 redis-server / redis-cli
|
|
|
|
| 6 |
COPY --from=redis:7-alpine /usr/local/bin/redis-server /usr/local/bin/redis-server
|
| 7 |
COPY --from=redis:7-alpine /usr/local/bin/redis-cli /usr/local/bin/redis-cli
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# 安装运行 Redis 所需依赖
|
| 10 |
RUN apk add --no-cache libstdc++ tzdata ca-certificates
|
| 11 |
|
| 12 |
WORKDIR /app
|
| 13 |
+
|
| 14 |
COPY --chmod=755 entrypoint.sh /app/entrypoint.sh
|
| 15 |
|
| 16 |
EXPOSE 7860
|
|
|
|
| 18 |
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \
|
| 19 |
CMD wget -q -T 5 -O /dev/null http://127.0.0.1:7860/health || exit 1
|
| 20 |
|
| 21 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|
README.md
CHANGED
|
@@ -9,17 +9,3 @@ app_port: 7860
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 12 |
-
|
| 13 |
-
## Codex 额度透支接入
|
| 14 |
-
|
| 15 |
-
本 Space 保留原 `ghcr.io/james-6-23/codex2api:latest` 运行基座。自动构建仓库每六小时检测上游 GitHub `main`;发现新 commit 后会在 GitHub Actions 中应用超刷补丁、构建当前上游前端、运行定向测试并生成 Linux 服务文件。只有全部步骤通过才更新本 Space。
|
| 16 |
-
|
| 17 |
-
- 自动构建:<https://github.com/c935289832/codex2api-overdraft-builder/actions>
|
| 18 |
-
- `UPSTREAM_VERSION`:当前已测试并部署的上游 commit。
|
| 19 |
-
- `BUILD_INFO.json`:对应的工作流 run 和构建信息。
|
| 20 |
-
- 启动日志会打印实际运行的上游 commit。
|
| 21 |
-
|
| 22 |
-
- `CODEX_QUOTA_OVERDRAFT_ENABLED=true`:启用 95% 预激活、100% 探测和额度恢复状态机。
|
| 23 |
-
- `CODEX_BIND=0.0.0.0`、`CODEX_PORT=7860`:适配 Space 端口映射。
|
| 24 |
-
- 现有 PostgreSQL/Redis 变量保持不变;不要在 Space Secrets 中提交 token 到仓库。
|
| 25 |
-
- 若改用 SQLite,请设置 `DATABASE_DRIVER=sqlite`、`DATABASE_PATH=/data/codex2api.db` 并挂载 `/data` Persistent Storage。
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPSTREAM_VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
b1cd0f7fa56d98e9712ccae2942fc7b443e0929a
|
|
|
|
|
|
codex2api
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:86d4da3d6afe2f460f6a5ef6c575c7387c63f03a1dfa033cf9128259c8eded65
|
| 3 |
-
size 64168098
|
|
|
|
|
|
|
|
|
|
|
|
entrypoint.sh
CHANGED
|
@@ -5,8 +5,6 @@
|
|
| 5 |
|
| 6 |
# ---- defaults ----
|
| 7 |
export CODEX_PORT="${CODEX_PORT:-7860}"
|
| 8 |
-
export CODEX_BIND="${CODEX_BIND:-0.0.0.0}"
|
| 9 |
-
export CODEX_QUOTA_OVERDRAFT_ENABLED="${CODEX_QUOTA_OVERDRAFT_ENABLED:-true}"
|
| 10 |
export TZ="${TZ:-Asia/Shanghai}"
|
| 11 |
|
| 12 |
# codex2api standard mode
|
|
@@ -72,8 +70,5 @@
|
|
| 72 |
echo "[entrypoint] DATABASE_NAME=${DATABASE_NAME}"
|
| 73 |
echo "[entrypoint] REDIS_ADDR=${REDIS_ADDR}"
|
| 74 |
echo "[entrypoint] CODEX_PORT=${CODEX_PORT}"
|
| 75 |
-
if [ -f /etc/codex2api-upstream-version ]; then
|
| 76 |
-
echo "[entrypoint] $(tr '\n' ' ' < /etc/codex2api-upstream-version)"
|
| 77 |
-
fi
|
| 78 |
|
| 79 |
-
exec /usr/local/bin/codex2api
|
|
|
|
| 5 |
|
| 6 |
# ---- defaults ----
|
| 7 |
export CODEX_PORT="${CODEX_PORT:-7860}"
|
|
|
|
|
|
|
| 8 |
export TZ="${TZ:-Asia/Shanghai}"
|
| 9 |
|
| 10 |
# codex2api standard mode
|
|
|
|
| 70 |
echo "[entrypoint] DATABASE_NAME=${DATABASE_NAME}"
|
| 71 |
echo "[entrypoint] REDIS_ADDR=${REDIS_ADDR}"
|
| 72 |
echo "[entrypoint] CODEX_PORT=${CODEX_PORT}"
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
exec /usr/local/bin/codex2api
|