Files
432539 fef45134d5 Initial commit: GPT 账号注册机 (open source)
只开源「GPT 账号注册机 / 管理」(account-manager):账号列表/导入导出、检测/批量检测、
拿 RT、协议/浏览器注册等注册机能力。批量直开 / 协议支付 / 提取链接 / 直卡直开 等其它功能
不含实现代码,仅通过 iframe 内嵌外链访问。真实机密均由 .gitignore 忽略,仅提供脱敏示例配置。
2026-08-05 14:54:32 +08:00

147 lines
6.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GPT 账号注册机 / 管理(开源版)
> 本仓库**只开源「GPT 账号注册机 / 管理」(GPT管理,account-manager**这一个功能。
> 批量直开、协议支付、提取链接、直卡直开等其它功能**不在本仓库内、不含任何实现代码**,
> 仅通过右侧 iframe 内嵌外链的方式访问(它们是独立 / 闭源的线上服务)。
An open-source **ChatGPT account registration & management tool**. Only the account
manager (`account-manager`) is open-sourced here. Other capabilities (card-flow /
protocol-pay / link-extract / direct-card) are **not** part of this repo and are only
reachable as embedded external links.
---
## 一、开源范围
### ✅ 本仓库包含(且仅包含):GPT管理 / 注册机
页面 `/account-manager/`,能力包括:
- **账号列表 / 分页 / 搜索 / 筛选**(只看已开通、按状态筛选等)
- **导入账号**:支持 `sub2api.json``email----password----clientId----refreshToken`、纯 access token 三种格式
- **导出**:批量导出 AT / SUB 格式 / 账密
- **检测 / 批量检测**:用 refresh_token 续期换 access_token,实时校验套餐(plan)与有效期
- **自动刷新 TOKEN**:对未知 / 过期 / 临近过期账号自动续期
- **拿 RT / 重拿 RT**:用 codex 客户端登录换取 refresh_token(触发手机验证时自动接码)
- **账号注册(注册机核心)**
- 协议注册(HTTP 直连)
- 浏览器注册(CloakBrowser 隐身 Chromium
- 批量补绑手机并拿 RT
- **设置**:代理池 / 接码(smscode·smsbower·herosms/ 邮箱池 / 浏览器(CloakBrowser license、注册口令)
### ❌ 本仓库不包含(仅 iframe 外链)
| 菜单 | 形态 | 说明 |
| --- | --- | --- |
| 直卡直开 | iframe 外链 | 独立线上服务,无源码 |
| 批量直开(试用3天) | iframe 外链 | 独立线上服务,无源码 |
| 协议支付(试用3天) | iframe 外链 | 独立线上服务,无源码 |
| 提取链接(试用3天) | iframe 外链 | 独立线上服务,无源码 |
这些菜单点击后只在右侧内容区加载一个指向外部 URL 的 `<iframe>`(见 `templates/embed.html`),
**本项目不含它们的任何业务实现**(没有 card-flow / protocol / pay / adobe 的后端、模板或静态资源)。
---
## 二、目录结构
```
opensource-gpt/
├─ app.py # 精简入口:只注册 account_manager 蓝图 + /embed/<target> 外链壳
├─ account_manager.py # 注册机 / GPT管理 后端(唯一开源真实功能)
├─ plan_check_session.py # 实时套餐校验(curl_cffi 子进程,account_manager 依赖)
├─ templates/
│ ├─ _sidebar.html # 共享侧边栏(一级平铺菜单)
│ ├─ account-manager.html # GPT管理页
│ └─ embed.html # 外链内嵌壳(shell + 一个铺满高度的 iframe,无业务代码)
├─ static/
│ ├─ app-shell.css # 统一设计系统(企业蓝)
│ ├─ account-manager.css # GPT管理页样式
│ └─ account-manager.js # GPT管理页前端逻辑
├─ account-manager/
│ ├─ node/ # 注册机所需 Node 脚本(见下)
│ └─ config/
│ ├─ settings.example.json # 脱敏示例配置(git 跟踪)
│ └─ proxies.example.json # 脱敏示例代理(git 跟踪)
├─ requirements.txt
├─ .gitignore # 忽略真实机密与运行期数据
├─ .env.example
└─ README.md
```
`account-manager/node/`(全部为注册机运行时依赖):
| 文件 | 作用 |
| --- | --- |
| `reg_runner.mjs` | 协议注册(HTTP 直连)入口 |
| `cloak_reg_runner.mjs` | 浏览器注册(CloakBrowser)入口 |
| `rt_runner.mjs` / `refetch_runner.mjs` | 拿 RT / 重拿 RT |
| `inbox_runner.mjs` | 查收邮箱验证码 |
| `get-rt.js` | 核心:登录换 refresh_token / access_token |
| `plus-mailbox.js` | 邮箱收件与验证码提取 |
| `smscode.js` / `smsbower.js` / `hero-sms.js` | 接码平台适配 |
| `fingerprint.js` | 指纹 / 随机资料生成 |
| `reg_password.mjs` | 统一注册口令解析(默认仅占位,请自行配置) |
| `package.json` / `package-lock.json` | Node 依赖清单 |
---
## 三、快速开始
依赖:**Python 3.11+**;如需「拿 RT / 查收 / 注册」还需 **Node.js 18+**
```bash
# 1) Python 依赖
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
# source .venv/bin/activate
pip install -r requirements.txt
# 2) Node 依赖(注册机相关功能需要)
cd account-manager/node
npm install
cd ../..
# 3) 配置(示例 -> 真实;真实配置已被 .gitignore 忽略)
copy account-manager\config\settings.example.json account-manager\config\settings.json
copy account-manager\config\proxies.example.json account-manager\config\proxies.json
# 按需填入你自己的:代理池 / 接码 apiKey / 邮箱池 / CloakBrowser license / 注册口令 等
# (邮箱池在页面「设置 → 邮箱池」里维护,会写入 config/mailbox.json,同样被忽略)
# 4) 启动(默认端口 5090
python app.py
```
打开 http://127.0.0.1:5090/ (自动跳转到 `/account-manager/`)。
可用环境变量(见 `.env.example`):`HOST``PORT``ACCOUNT_MGR_NODE`node 可执行路径)、`ACCOUNT_MGR_BASE`
---
## 四、注意事项 / 安全
- **切勿提交真实机密。** 以下均已在 `.gitignore` 中忽略,不会进入 git
- `account-manager/config/settings.json``proxies.json``mailbox.json`
- `.env``data/``*.jsonl``*.db``node_modules/``__pycache__/``*.log`
- 仓库仅提供 `*.example.json` **脱敏示例**(不含真实代理 / 接码 / 邮箱 / token / license / 注册口令)。
首次使用请复制示例为真实配置后再填写。
- `reg_password.mjs` 内的默认口令仅为占位(`ChangeMe#2026Pw!`),请在「设置 → 浏览器 → 注册密码」
或真实 `settings.json``regPassword` 中配置你自己的强口令。
---
## 五、关于 iframe 内嵌
内嵌能否成功取决于目标站点的证书是否可信,以及是否设置了 `X-Frame-Options` /
`Content-Security-Policy: frame-ancestors`。若目标站禁止被内嵌,`embed.html` 会提供
「在新标签页打开」的兜底入口。**本项目不修改这些外部服务,也不含其实现代码。**
---
## 六、开源地址 / 许可
- 开源地址:https://github.com/432539/gpt
- 许可(License):暂未指定。建议后续按需补充(如 MIT / Apache-2.0)。