Žiadny popis

chendeben b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
config b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
core b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
dashboard b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
docs b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
ops b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
platforms b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
scripts b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
tests b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
vendor b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
.env.example b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
.gitignore b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
AGENTS.md b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
README.md b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
SHARE_PACKAGE_NOTES.md b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
main.py b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
pyproject.toml b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred
uv.lock b52775c9a0 feat: ChatGPT auto-registration system with CPA integration 4 mesiacov pred

README.md

zhuce6 - ChatGPT 自动注册系统

自动注册 ChatGPT 账号并同步至 CPA (CLI Proxy API) 管理后端。

功能

  • 全自动 ChatGPT 账号注册(邮箱注册 + OTP 验证 + 账号创建)
  • 通过 chatgpt.com OAuth 流程获取 access_token,绕过手机号验证
  • Cloudflare Email Worker (cfmail) 临时邮箱支持
  • 注册账号自动同步至 CPA 后端
  • Dashboard 实时监控注册状态
  • 支持多线程并发注册
  • 代理池支持(直接代理或 Clash 配置)

环境要求

  • Python >= 3.11
  • Node.js >= 18(用于 sentinel 相关功能)
  • uv 包管理器

快速开始

1. 安装依赖

uv sync

2. 配置环境变量

复制示例配置并编辑:

cp .env.example .env

编辑 .env,至少配置以下内容:

# 运行模式
ZHUCE6_RUNTIME_MODE=full
ZHUCE6_REGISTER_ENABLED=true

# 注册代理(必须,建议使用海外代理)
ZHUCE6_REGISTER_PROXY=http://user:pass@host:port

# 注册线程数和间隔
ZHUCE6_REGISTER_THREADS=2
ZHUCE6_REGISTER_SLEEP_MIN=5
ZHUCE6_REGISTER_SLEEP_MAX=15

# 代理池(无代理池可禁用)
ZHUCE6_ENABLE_PROXY_POOL=0
ZHUCE6_PROXY_POOL_CONFIG=

# CPA 后端(可选)
ZHUCE6_BACKEND=cpa
ZHUCE6_CPA_MANAGEMENT_BASE_URL=http://127.0.0.1:8317/v0/management
ZHUCE6_CPA_MANAGEMENT_KEY=your_key

# cfmail Cloudflare 配置(用于通过启动检查,实际邮箱由 cfmail_accounts.json 控制)
ZHUCE6_CFMAIL_API_TOKEN=your_cf_api_token
ZHUCE6_CFMAIL_CF_ACCOUNT_ID=your_account_id
ZHUCE6_CFMAIL_CF_ZONE_ID=your_zone_id
ZHUCE6_CFMAIL_WORKER_NAME=your_worker_name
ZHUCE6_CFMAIL_ZONE_NAME=your_domain.com

3. 配置 cfmail 邮箱服务

创建 config/cfmail_accounts.json(参考 config/cfmail_accounts.example.json):

{
  "accounts": [
    {
      "name": "my-mail",
      "worker_domain": "your-email-api.example.com",
      "email_domain": "example.com",
      "admin_password": "your_admin_password",
      "enabled": true
    }
  ]
}

cfmail 需要一个已部署的 Cloudflare Email Worker 服务,用于创建临时邮箱和接收 OTP 验证码。

4. 启动服务

# 完整模式(Dashboard + 注册)
uv run python main.py run --mode full

# 仅 Dashboard
uv run python main.py run --mode dashboard

# 指定线程数
uv run python main.py run --mode full --register-threads 4

# 指定端口
uv run python main.py run --host 0.0.0.0 --port 8080

5. 访问 Dashboard

启动后访问 http://127.0.0.1:8000/zhuce6 查看注册状态。

API 端点:

  • GET /healthz - 健康检查
  • GET /api/runtime - 运行时状态
  • GET /api/summary - 注册统计
  • GET /api/health/dependencies - 依赖状态(cfmail / CPA / 代理池)

运行模式

模式 说明
full Dashboard + 后台任务 + 注册循环
dashboard 仅 Dashboard + 后台任务,不注册
lite Dashboard + 注册,禁用清理/验证等后台任务
register-loop 仅注册循环,无 Dashboard
burst-scheduler 批量注册调度器

其他命令

# 初始化配置向导
uv run python main.py init

# 检查环境
uv run python main.py doctor

# 停止所有进程
uv run python main.py stop

# 查看进程状态
uv run python main.py status

目录结构

config/          # 配置文件(cfmail 账号等)
core/            # 核心模块(注册循环、设置、邮箱等)
dashboard/       # Dashboard 前端
platforms/       # 平台实现(ChatGPT 注册逻辑)
ops/             # 运维操作(验证、清理、轮换等)
pool/            # 注册成功的凭证文件(自动生成)
state/           # 运行时状态文件(自动生成)
logs/            # 日志文件(自动生成)

注意事项

  • 注册代理建议使用住宅代理以降低风控风险
  • cfmail 邮箱域名建议使用 .com 等常见 TLD
  • 注册成功的凭证保存在 pool/ 目录,格式为 JSON
  • 如配置了 CPA 后端,凭证会自动同步