Files
codex-proxy-rs/deploy/config.example.yaml
T
zyycnandCodex 99cf39c76d refactor: consolidate runtime configuration
Use deploy/config.yaml as the structured source for application settings and service credentials, with strict validation and runtime-relative paths.

Consolidate Compose assets under deploy, remove obsolete environment and smoke files, keep terminal logs readable while retaining JSON file output, and refresh the Codex Desktop fingerprint.

Co-authored-by: Codex <noreply@openai.com>
2026-07-14 00:46:57 +08:00

143 lines
3.5 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
tls:
force_http11: false
ws_pool:
enabled: true
max_age_ms: 3300000
max_per_account: 8
# 首个真实输出的绝对超时,单位毫秒;0 表示禁用。
initial_event_timeout_ms: 20000
fingerprint:
# PostgreSQL 中不存在当前指纹时,使用这里的数据初始化。
originator: 'Codex Desktop'
app_version: '26.707.51957'
build_number: '5175'
platform: 'darwin'
arch: 'arm64'
chromium_version: '146'
user_agent_template: 'Codex Desktop/{version} ({platform}; {arch})'
default_headers:
- name: 'Accept-Encoding'
value: 'gzip, deflate, br, zstd'
- name: 'Accept-Language'
value: 'en-US,en;q=0.9'
- name: 'sec-ch-ua-mobile'
value: '?0'
- name: 'sec-ch-ua-platform'
value: '"macOS"'
- name: 'sec-fetch-site'
value: 'same-origin'
- name: 'sec-fetch-mode'
value: 'cors'
- name: 'sec-fetch-dest'
value: 'empty'
header_order:
- authorization
- chatgpt-account-id
- originator
- x-openai-internal-codex-residency
- x-client-request-id
- x-codex-installation-id
- x-codex-turn-state
- openai-beta
- user-agent
- sec-ch-ua
- sec-ch-ua-mobile
- sec-ch-ua-platform
- accept-encoding
- accept-language
- sec-fetch-site
- sec-fetch-mode
- sec-fetch-dest
- content-type
- accept
- cookie
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