mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
107 lines
3.2 KiB
YAML
107 lines
3.2 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
|
||
# OpenAI 会话身份、系统更新状态和备份暂存区的统一根目录。
|
||
# 相对路径以 deploy/config.yaml 所在目录为基准。
|
||
runtime_data_dir: '../.runtime/data'
|
||
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 连接池预算;下列值与当前推荐默认一致。
|
||
# pool:
|
||
# max_connections: 20
|
||
# 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:
|
||
# 版本元组来自同一个官方 macOS Desktop ZIP;Provider 每 24 小时检查 appcast,
|
||
# 仅在包内 Core 核验和 Redis 条件覆盖都成功后原子更新。
|
||
originator: 'Codex Desktop'
|
||
codex_version: '0.151.0-alpha.7.2'
|
||
desktop_version: '26.825.51511'
|
||
desktop_build: '7377'
|
||
os_type: 'Mac OS'
|
||
os_version: '15.7.1'
|
||
arch: 'arm64'
|
||
terminal: 'unknown'
|
||
verified_at: '2026-08-31T00:00:00+08:00'
|
||
|
||
xai:
|
||
# OAuth 端点、额度与模型目录策略由 xAI Provider 固定管理;这里只声明请求画像启动基线。
|
||
wire_profile:
|
||
# Provider 每 24 小时读取官方 npm metadata,仅在进程内更新 client_version。
|
||
client_identifier: 'GrokShell'
|
||
client_version: '1.0.13'
|
||
client_mode: 'headless'
|
||
target_os: 'linux'
|
||
target_arch: 'x86_64'
|
||
verified_at: '2026-08-31T00: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
|