feat: web dashboard + Chrome extension for runtime account management#5
feat: web dashboard + Chrome extension for runtime account management#5danscMax wants to merge 3 commits into
Conversation
Add a localhost-only web dashboard and a Chrome extension to manage the DeepSeek account pool at runtime, layered on top of the existing file-based pool (no duplicate pool): - routes: GET /dashboard, GET /api/accounts, POST /api/accounts/import (cURL/HAR), POST /api/accounts/:id/check, DELETE /api/accounts/:id, GET /api/auth-status — localhost-only and CSRF-guarded - runtime add/delete writes/removes managed files in data/accounts/ then reloads the pool; secrets written 0600 and gitignored - live account check via GET /api/v0/users/current (no PoW), 15s timeout - scripts/auth_from_curl.js + auth_from_har.js import helpers - lib/parseAuth.js parses cURL/HAR auth captures
- dashboard: model picker, inline delete, copy, retry, auto-grow, and a per-account label with inline edit - chrome extension: icons, server-status indicator, dashboard button, label - parseAuth: handle Chrome "Copy as cURL (bash)" ANSI-C headers - server: GET /api/accounts exposes label; POST /api/accounts/:id/label sets it (localhost + CSRF guarded, persisted to the managed account file)
|
Привет! Этот PR добавляет веб-дашборд для управления аккаунтами в рантайме и заметно дорабатывает уже существующее Chrome-расширение (15 файлов, +1323/−203):
Понимаю, что PR крупный — рад разбить его на части или сначала обсудить в issue. Ветка пересобрана на актуальный |
… guard
The popup posts to /api/accounts/import from a chrome-extension:// (or
moz-extension://) origin, which isCrossOrigin treated as cross-site and 403'd
('Cross-origin request rejected') — breaking the one-click account import this
PR adds. Web pages cannot forge an extension Origin and the extension declares
an explicit host permission for this server, so these are trusted. Malicious
http(s) origins are still rejected.
|
Pushed a follow-up fix to this branch: the account-import popup posts from a |
Summary
Adds a localhost-only web dashboard and a Chrome extension for managing the DeepSeek account pool at runtime, built on top of the existing file-based pool (reuses
accounts[]/loadDeepSeekConfig— no second pool). Rebased onto currentmain, so it includes and builds on the recent account-pooling work.What's included
/dashboard): view accounts + statuses, import, check, delete.chrome-extension/): one-click capture of DeepSeek auth → import.GET /api/accounts,POST /api/accounts/import(cURL/HAR),POST /api/accounts/:id/check,DELETE /api/accounts/:id,GET /api/auth-status.scripts/auth_from_curl.js,scripts/auth_from_har.js,lib/parseAuth.js.How it integrates with the pool
Runtime-added accounts are stored as individual JSON files under a managed
data/accounts/dir;discoverAuthPaths()also scans that dir, so they load alongsideDEEPSEEK_AUTH_DIR/deepseek-auth.json. Add/delete write/remove a file and callloadDeepSeekConfig()to reload. No separate account store.Security
/api/accounts*routes are localhost-only and CSRF-guarded.0600;data/accounts/*.jsonis gitignored.Notes / limitations
/api/accounts/:id/checkdoes a realGET /api/v0/users/currentrequest (no PoW, 15s timeout)./checkround-trip. Flows needing a valid live account (successful import + OK check + email) were validated by code review only.Supersedes #2 (which mixed this with a parallel pool implementation; this is rebased clean on top of the current pool).