- .env.example: 新增 Gemini OAuth 环境变量配置示例 - config.example.yaml: 新增 Gemini OAuth 配置示例 - README.md: 更新部署文档 - docker-compose.yml: 添加 Gemini OAuth 环境变量传递
81 lines
3.2 KiB
Plaintext
81 lines
3.2 KiB
Plaintext
# =============================================================================
|
|
# Sub2API Docker Environment Configuration
|
|
# =============================================================================
|
|
# Copy this file to .env and modify as needed:
|
|
# cp .env.example .env
|
|
# nano .env
|
|
#
|
|
# Then start with: docker-compose up -d
|
|
# =============================================================================
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Server Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# Bind address for host port mapping
|
|
BIND_HOST=0.0.0.0
|
|
|
|
# Server port (exposed on host)
|
|
SERVER_PORT=8080
|
|
|
|
# Server mode: release or debug
|
|
SERVER_MODE=release
|
|
|
|
# Timezone
|
|
TZ=Asia/Shanghai
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# PostgreSQL Configuration (REQUIRED)
|
|
# -----------------------------------------------------------------------------
|
|
POSTGRES_USER=sub2api
|
|
POSTGRES_PASSWORD=change_this_secure_password
|
|
POSTGRES_DB=sub2api
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Redis Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# Leave empty for no password (default for local development)
|
|
REDIS_PASSWORD=
|
|
REDIS_DB=0
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Admin Account
|
|
# -----------------------------------------------------------------------------
|
|
# Email for the admin account
|
|
ADMIN_EMAIL=admin@sub2api.local
|
|
|
|
# Password for admin account
|
|
# Leave empty to auto-generate (will be shown in logs on first run)
|
|
ADMIN_PASSWORD=
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# JWT Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# Leave empty to auto-generate (recommended)
|
|
JWT_SECRET=
|
|
JWT_EXPIRE_HOUR=24
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Gemini OAuth (OPTIONAL, required only for Gemini OAuth accounts)
|
|
# -----------------------------------------------------------------------------
|
|
# Sub2API supports TWO Gemini OAuth modes:
|
|
#
|
|
# 1. Code Assist OAuth (需要 GCP project_id)
|
|
# - Uses: cloudcode-pa.googleapis.com (Code Assist API)
|
|
# - Auto scopes: cloud-platform + userinfo.email + userinfo.profile
|
|
# - OAuth Client: Can use built-in Gemini CLI client (留空即可)
|
|
# - Requires: Google Cloud Platform project with Code Assist enabled
|
|
#
|
|
# 2. AI Studio OAuth (不需要 project_id)
|
|
# - Uses: generativelanguage.googleapis.com (AI Studio API)
|
|
# - Default scopes: cloud-platform (+ userinfo.*)
|
|
# - OAuth Client: Leave empty to use built-in Gemini CLI client; or provide your own.
|
|
# - Requires: Create OAuth 2.0 Client in GCP Console
|
|
# - Setup Guide: https://ai.google.dev/gemini-api/docs/oauth
|
|
#
|
|
# Configuration:
|
|
# Use Gemini CLI's public OAuth credentials (same as official Google Gemini CLI tool):
|
|
GEMINI_OAUTH_CLIENT_ID=681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com
|
|
GEMINI_OAUTH_CLIENT_SECRET=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
|
|
# Optional; leave empty to auto-select scopes based on oauth_type
|
|
GEMINI_OAUTH_SCOPES=
|