mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
Classify final request outcomes into success, failure, cancellation, and caller-error buckets so availability reflects only eligible requests. Expose structured 15-minute health points with focused coverage. Redesign the health timeline, trend, wire-profile, and diagnostic surfaces with responsive shared interactions, and standardize configuration schema version 1. Co-authored-by: Codex <noreply@openai.com>
106 lines
2.7 KiB
YAML
106 lines
2.7 KiB
YAML
# Codex Proxy RS 应用配置模板。
|
|
#
|
|
# 使用:
|
|
# cp deploy/config.example.yaml deploy/config.yaml
|
|
# sudo chown "$(id -u):10001" deploy/config.yaml
|
|
# chmod 640 deploy/config.yaml
|
|
#
|
|
# 三个密码建议分别执行 `openssl rand -hex 24` 生成。
|
|
|
|
x-cpr:
|
|
schema_version: 1
|
|
|
|
server:
|
|
# 本地 cargo run 使用;Docker 内由 compose.yaml 固定覆盖为 0.0.0.0:8080。
|
|
host: '127.0.0.1'
|
|
port: 8080
|
|
|
|
api:
|
|
base_url: 'https://chatgpt.com/backend-api'
|
|
|
|
database:
|
|
# 本地连接地址;Docker 内由 compose.yaml 固定改用 postgres 服务名。
|
|
# 密码不要写进 URL。
|
|
url: 'postgres://codex_proxy@127.0.0.1:5432/codex_proxy'
|
|
# 必填:48 位十六进制字符。
|
|
password: &postgres_password ''
|
|
|
|
redis:
|
|
# 本地连接地址;Docker 内由 compose.yaml 固定改用 redis 服务名。
|
|
# 密码不要写进 URL。
|
|
url: 'redis://127.0.0.1:6379/'
|
|
# 必填:48 位十六进制字符。
|
|
password: &redis_password ''
|
|
|
|
runtime:
|
|
# 相对路径以 deploy/config.yaml 所在目录为基准。
|
|
data_directory: '../.runtime/data'
|
|
|
|
quota:
|
|
refresh_interval_minutes: 5
|
|
skip_exhausted: true
|
|
|
|
ws_pool:
|
|
enabled: true
|
|
max_age_ms: 3300000
|
|
max_per_account: 8
|
|
# 首个真实输出的绝对超时,单位毫秒;0 表示禁用。
|
|
initial_event_timeout_ms: 20000
|
|
|
|
wire_profile:
|
|
# 该画像来自 Desktop 制品与 bundled Codex Core 的联合审计。
|
|
# appcast 只报告新 Desktop 制品,不会自动改写这里的请求身份。
|
|
originator: 'Codex Desktop'
|
|
codex_version: '0.144.2'
|
|
desktop_version: '26.707.72221'
|
|
desktop_build: '5307'
|
|
# 固定参考主机画像;必须在重新抓包核验后再修改。
|
|
os_type: 'Mac OS'
|
|
os_version: '15.7.1'
|
|
arch: 'arm64'
|
|
terminal: 'unknown'
|
|
verified_at: '2026-07-15T02:25:50+08:00'
|
|
|
|
admin:
|
|
session_ttl_minutes: 1440
|
|
default_username: 'admin@cpr.local'
|
|
# 仅首次创建管理员时使用;至少 12 个字符且不能包含 `$`。
|
|
default_password: ''
|
|
|
|
logging:
|
|
level: 'info'
|
|
stdout: true
|
|
file:
|
|
enabled: true
|
|
# 相对路径以 deploy/config.yaml 所在目录为基准。
|
|
directory: '../.runtime/logs'
|
|
retention_days: 14
|
|
max_file_size_mb: 20
|
|
max_files: 20
|
|
|
|
telemetry:
|
|
enabled: true
|
|
|
|
|
|
# Compose 凭据桥接区。通常不需要修改。
|
|
services:
|
|
postgres-credentials:
|
|
environment:
|
|
POSTGRES_PASSWORD: *postgres_password
|
|
|
|
redis-credentials:
|
|
command:
|
|
- redis-server
|
|
- --appendonly
|
|
- 'yes'
|
|
- --requirepass
|
|
- *redis_password
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- --no-auth-warning
|
|
- -a
|
|
- *redis_password
|
|
- ping
|