Files
codex-proxy-rs/deploy/config.example.yaml
T
zyycnandCodex 29c8b679ba refactor(architecture): complete dependency boundary audit
Harden WebSocket ownership and capacity semantics, split the transport into focused modules, and move admin queries, quota observations, and upstream adapters behind explicit consumer-owned ports.

Parse frontend payloads at the API boundary, centralize SSE and store ownership, add latest-request-wins queries with inferred view types, and enforce dependency direction through lint and AST tests.

Co-authored-by: Codex <noreply@openai.com>
2026-07-17 09:03:33 +08:00

109 lines
2.9 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
# 所有账号合计最多保留 64 个 Idle/Busy/Connecting slot。
max_total: 64
# 限制并发 TCP/TLS/WebSocket opening,避免多账号冷启动风暴。
max_connecting: 16
# 首个真实输出的绝对超时,单位毫秒;0 表示禁用。
initial_event_timeout_ms: 20000
wire_profile:
# 该画像来自 Desktop 制品与 bundled Codex Core 的联合审计。
# appcast 成功检查后会自动同步 Desktop 版本和 Build;其余字段保持此处配置。
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