# 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` 生成。 schema_version: 1 host: listen: # 本地 cargo run 使用;Docker 内由 CPR_SERVER_HOST/PORT 覆盖。 host: '127.0.0.1' port: 8080 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 drain_timeout_seconds: 30 worker_shutdown_timeout_seconds: 30 store: database: # Docker 内由 CPR_DATABASE_URL 覆盖;密码不要写进 URL。 url: 'postgres://codex_proxy@127.0.0.1:5432/codex_proxy' password: &postgres_password '' redis: # Docker 内由 CPR_REDIS_URL 覆盖;密码不要写进 URL。 url: 'redis://127.0.0.1:6379/' password: &redis_password '' admin: session_ttl_minutes: 1440 default_username: 'admin@cpr.local' # 仅首次创建管理员时使用;至少 12 个字符且不能包含 `$`。 default_password: '' api: # Docker 内由 CPR_WEB_DIST_DIR 覆盖。 asset_directory: '../frontend/dist' cors_allowed_origins: [] request_timeout_seconds: null request_id_header: 'x-request-id' openai: wire_profile: # 该画像来自 Desktop 制品与 bundled Codex Core 的联合审计。 originator: 'Codex Desktop' codex_version: '0.145.0' desktop_version: '26.721.31836' desktop_build: '5828' os_type: 'Mac OS' os_version: '15.7.1' arch: 'arm64' terminal: 'unknown' verified_at: '2026-07-25T00:00:00+08:00' xai: wire_profile: # 对照 grok2api 当前推荐构建核验;更新前应重新抓包确认。 client_identifier: 'grok-shell' client_version: '0.2.106' client_mode: 'headless' target_os: 'linux' target_arch: 'x86_64' verified_at: '2026-07-21T00:00:00+08:00' # Compose 凭据桥接区;密码仍只维护在 store 中。 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