Files
autoreg-skills-max/skills/lobehub-pool/references/session-2026-07-04-proxy-v2-cloud-login.md

80 lines
3.3 KiB
Markdown

# Session 2026-07-04: LobeHub Proxy v2 + Cloud Login Discovery
## Key Findings
### Cloud Email+Password Login Works
`POST https://app.lobehub.com/api/auth/sign-in/email` with `{"email":"...","password":"..."}` returns 200 with session token and user object. Requires FlareSolverr for CF bypass.
### 601 Cloud Accounts Exist
File: `/root/lobehub_cloud_accounts.json` on DO droplet ([REDACTED-IP]). Format:
```json
{
"email": "[REDACTED-EMAIL]",
"password": "HYGsTPaB@WhhoV",
"name": "annett.riebe",
"session_token": "",
"created_at": "2026-07-02T03:02:57Z",
"referral": "fQXk8Gr5"
}
```
Cloud passwords are DIFFERENT from self-hosted JWT tokens in `lobehub_accounts.json`.
### API Key Retrieval Blocked
- Cloud web UI only shows SSO buttons (Google/GitHub/Apple) — no email/password form
- Session cookies from API login are HTTP-only (`__Secure-better-auth.session_token`)
- Playwright `add_cookies()` fails with "Protocol error (Storage..." for HTTP-only cookies
- No known API endpoint for listing/creating API keys on Cloud
- Developer settings page (`/settings/developer`) requires valid browser session
### FlareSolverr on DO
- Endpoint: `http://localhost:8191/v1` (Docker container `flaresolverr`)
- Returns cf_clearance cookie + user agent
- cf_clearance alone (via Cookie header) is NOT enough — need full FlareSolverr session
- curl_cffi with impersonate='chrome124' + FlareSolverr cookies works for API calls
## Proxy v2 Architecture
### Why new proxy was needed
- Old `lobehub_final.py` used `node .../index.js generate text` directly — the node CLI was outdated
- New `lh` CLI (v0.0.38) works with `--json` flag returning clean JSON
- `lh` is a bash script — `subprocess.run(["lh", ...])` fails on Windows
- Fix: use `lh.cmd` (Windows batch wrapper) with full path
### Correct startup
```bash
bash --noprofile --norc -c 'exec python -u /c/Users/User/Desktop/tg_content_agent/lobehub_proxy_v2.py'
```
- `--noprofile --norc` avoids hacker banner corruption
- `exec` replaces bash process to prevent profile interference
- `python -u` required for unbuffered HTTP server output
### Windows paths
- Node: `C:\Users\User\.openagents\nodejs\node` (NOT `Program Files\nodejs`)
- lh.cmd: `C:\Users\User\AppData\Roaming\npm\lh.cmd`
- CLI: `C:\Users\User\AppData\Roaming\npm\node_modules\@lobehub\cli\dist\index.js`
### Zombie processes
Multiple background process restarts left 7 zombie listeners on port 20140. Cleanup:
```bash
for pid in $(netstat -ano | grep 20140 | grep LISTENING | awk '{print $5}'); do
taskkill //F //PID $pid 2>/dev/null
done
```
## DO Droplet Architecture (2026-07-04)
```
[REDACTED-IP] (gothbreach-abuse-1, 8GB)
├── lobehub (Docker, :3210) — self-hosted LobeHub Next.js app
├── lobe-postgres (Docker, :5432) — lobechat DB, 1098 users
├── lobe-redis (Docker, :6379)
├── lobe-rustfs (Docker, :9000-9001)
├── lobe-searxng (Docker, :8080)
├── flaresolverr (Docker, :8191) — CF bypass
└── teleraptor (Docker, :8001)
```
## Test Results
- `lh generate text "hi" --model anthropic/claude-opus-4.8 --max-tokens 10` → "Hi! How are you doing today"
- Proxy v2: `POST /v1/chat/completions` → 200, Claude Opus 4.8 responds
- Models endpoint: `GET /v1/models` → 18 models returned
- Health: `GET /health` → `{"status":"ok","accounts":601}`