# Grok-Register (VM `sze@100.78.69.20` / pop-os) Automated Grok (x.ai) account registration using [ReinerBRO/grok-register](https://github.com/ReinerBRO/grok-register), patched to use custom Cloudflare Worker DuckMail API. SSO tokens auto-push to grok2api. ## Current Configuration | Field | Value | |---|---| | VM | `sze@100.78.69.20` (Tailscale, Pop!_OS 24.04) | | Install path | `~/grok-register/` | | Python | 3.12.3 (system, pip `--user --break-system-packages`) | | Browser | Playwright Chromium 134.0.6998.35 (`~/.cache/ms-playwright/chromium-1161/`) | | Display | Xvfb spawned per-run by `pyvirtualdisplay` (no shared `:99`) | | DuckMail API | `https://duckmail-cloudflare-provider.lungw96.workers.dev` | | Email domain | `10xco.de` (fetched dynamically from `GET /domains`) | | grok2api push | `http://127.0.0.1:8000/admin/api/tokens/add` | | grok2api key | `@D8312p$` | | Config | `~/grok-register/config.json` | | SSO output | `~/grok-register/sso/sso_.txt` | | Logs | `~/grok-register/logs/run_.log` | | **Web UI** | `http://100.78.69.20:5000` (Tailscale only) | | Web UI service | `systemctl --user status grok-register-ui` | | Web UI source | `~/grok-register/web-ui/` | ## Web UI Dashboard at `http://100.78.69.20:5000` (Tailscale-only, no auth). Features: - Start/stop registration batches with configurable round count - Live log streaming via Server-Sent Events - Real-time stats: progress, success/fail counts, elapsed time, last email - grok2api token pool count (queried live from local grok2api) - Run history with token counts per run ```bash # Service management systemctl --user status grok-register-ui systemctl --user restart grok-register-ui journalctl --user -u grok-register-ui -f # Redeploy after editing web_ui.py or index.html systemctl --user restart grok-register-ui ``` ## Quick Commands (CLI) ```bash # Run 10 rounds (default from config.json) cd ~/grok-register && python3 DrissionPage_example.py # Run N rounds cd ~/grok-register && python3 DrissionPage_example.py --count 50 # Run infinite loop cd ~/grok-register && python3 DrissionPage_example.py --count 0 # Single test run cd ~/grok-register && python3 DrissionPage_example.py --count 1 ``` ## Patches Applied Two patches to `email_register.py` (upstream `ReinerBRO/grok-register`): 1. **Dynamic domain fetching**: `_fetch_email_domain()` calls `GET /domains` instead of hardcoding `@duckmail.sbs` 2. **Optional bearer auth**: Bearer token headers are only sent when `duckmail_bearer` is non-empty (CF Worker needs no auth) 3. **List-safe content extraction**: `wait_for_verification_code()` handles `text`/`html` fields that are arrays (CF Worker format) in addition to strings ## Troubleshooting | Issue | Fix | |---|---| | `127.0.0.1:浏览器连接失败` | Stale `Environment=DISPLAY=:99` in `~/.config/systemd/user/grok-register-ui.service` points at an Xvfb that lives inside the poeReg2api container — its socket isn't visible on the host. Remove the line and `systemctl --user daemon-reload && restart grok-register-ui`. The script then auto-spawns its own Xvfb via `pyvirtualdisplay`. | | `duckmail_bearer 未设置` | This error was removed by the patch; if it appears, the patch wasn't applied | | `expected string or bytes-like object, got 'list'` | The list-safe content patch wasn't applied to `wait_for_verification_code()` | | Chromium fails to start | Verify `~/.cache/ms-playwright/chromium-*/chrome-linux*/chrome --version` works | | Xvfb not found | `sudo apt install -y xvfb` | | Token push fails | Verify grok2api is running: `docker ps --filter name=grok2api` |