mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
104 lines
3.0 KiB
YAML
104 lines
3.0 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
|
|
#
|
|
# PostgreSQL 与 Redis 密码分别执行 `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 ''
|
|
# 可选:PostgreSQL 连接池预算;省略时 max_connections=10、acquire_timeout_seconds=5。
|
|
# pool:
|
|
# max_connections: 10
|
|
# acquire_timeout_seconds: 5
|
|
|
|
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:
|
|
# 上游地址、WebSocket 池、额度刷新和 OAuth 使用 Provider 内置默认值;模板只保留画像启动基线。
|
|
wire_profile:
|
|
# codex_version 是 npm CLI 的启动基线,并用于模型目录与请求 UA;Provider 每 24 小时更新它。
|
|
# Desktop appcast 同期只更新 Desktop 版本与构建号。
|
|
originator: 'Codex Desktop'
|
|
codex_version: '0.146.0'
|
|
desktop_version: '26.727.51351'
|
|
desktop_build: '6119'
|
|
os_type: 'Mac OS'
|
|
os_version: '15.7.1'
|
|
arch: 'arm64'
|
|
terminal: 'unknown'
|
|
verified_at: '2026-08-04T00:00:00+08:00'
|
|
|
|
xai:
|
|
# OAuth 端点、额度与模型目录策略由 xAI Provider 固定管理;这里只声明请求画像启动基线。
|
|
wire_profile:
|
|
# Provider 每 24 小时读取官方 npm metadata,仅在进程内更新 client_version。
|
|
client_identifier: 'grok-shell'
|
|
client_version: '0.2.118'
|
|
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
|