Commit Graph
48 Commits
Author SHA1 Message Date
chiyi 40cc67d354 更新grok协议 2026-07-12 22:59:52 +08:00
chiyiandClaude Opus 4.8 cd3f98bd61 grok修复: x-statsig-id 改用 goja 跑原版签名器, 自愈跨 reship
手抄的字节算法每次 grok 换 web build 就失效(403 anti-bot), 天天死。
改为内嵌 goja 执行 grok 自己的签名器 chunk + 合成 DOM/WAAPI 垫片, 由 grok
自己的代码做所有随 build 轮换的字节索引/曲线选择, 我们只提供稳定的浏览器原语。

- statsig_engine.go: goja 引擎池 + 构建无关地自动定位当前签名器 chunk
- statsig_shim.js(//go:embed): document/getComputedStyle(WAAPI 采样)/
  crypto.subtle/TextEncoder/base64 垫片 + Turbopack bootstrap
- client.go: statsigID 优先走引擎, 任何失败回退旧静态算法; ensureChallenge
  捕获 seed+curves 并按 reship(chunk 列表变化)重建引擎池
- 旧静态 computeStatsigTail 降级为兜底; 其离线回归测试改 Skip(ground truth
  无法离线重生), 新增 40 并发签名测试

已验证: 动态定位当前 build → conversations/new 返回 200 + conversationId。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 05:41:38 +01:00
chiyi 4c060729b9 grok修复 2026-07-10 15:33:01 +08:00
chiyi 3a2c9710c3 更新runway 2api风控 2026-07-10 13:25:42 +08:00
chiyi 8d792e66e0 加回 nano-banana-2 与 nano-banana-pro 并存 2026-07-10 12:02:14 +08:00
chiyi 2afb4e7857 nano-banana-2 升级为 nano-banana-pro (workflow_gemini_image / gemini-3-pro-image-preview, 支持 2K/4K) 2026-07-10 11:19:51 +08:00
chiyi a636f79cd8 更新 2026-07-10 10:59:14 +08:00
chiyi 21cca6513b 更新下载超时延长 2026-07-09 19:38:30 +08:00
chiyi 65ca95a736 Merge branch 'devin/1783580774-grok-statsig-selfheal' 2026-07-09 19:25:03 +08:00
chiyi 33b5fc3b0e fix(runway): retry the /v1/tasks submit on transient errors
A dropped proxy connection (EOF) or 5xx on the task-create failed the whole generation. submitTask now retries transient (ErrTemporaryUpstream) submits up to 3x with backoff, honoring ctx. Applies to both Nano Banana image and Gen-4 video. Validated: 10/10 4K images (19-24MB PNG each) generated across 10 accounts.
2026-07-09 17:06:43 +08:00
chiyi cc6a2b1c54 fix(runway): raise the tls-client timeout so large artifact downloads don't cancel
Runway (Nano Banana 2) used a 30s whole-request timeout that includes reading the response body, so downloading a rendered image/video artifact off a slow CDN aborted with 'request canceled (Client.Timeout or context cancellation while reading body)'. Raised to 300s; genCtx still bounds the overall generation.
2026-07-09 16:55:02 +08:00
chiyi fba6772584 fix(imagine,krea,leonardo): poll for the full genCtx budget instead of a short hardcoded cap
imagine/krea capped polling at 4min and leonardo at 5min while the caller's genCtx budget is 8min, so slow-but-valid generations were killed early with 'generation timed out'. Now the poll deadline tracks ctx.Deadline() minus 60s download headroom (fallback to the old fixed cap if ctx has no deadline). chatgpt already ties its budget to the deadline (pollBudget) and runway/grok honor ctx, so no change needed there.
2026-07-09 16:52:16 +08:00
chiyi 5198b08bdf fix(adobe): poll until the genCtx deadline instead of a shorter hardcoded cap
pollImage/pollVideo capped themselves at 3min/10min while the caller's genCtx budget is 8min (image) / 12min (video), so slow-but-valid generations were killed early with 'adobe generation timed out'. Now the loop honors ctx.Err() and uses the full budget.
2026-07-09 16:49:21 +08:00
chiyi 622bc9ba9a feat(providers): account calls (auth/refresh/credits) egress on the local IP
Now only the generate/video submit uses proxy.url; cookie-exchange/login, token refresh, credit-balance and project/session bootstrap all go direct. Also splits adobe GenerateVideo (submit=proxy, poll/download=local). Verified live: adobe gpt 1K cookie-exchange via local IP, submit 23.244.30.102 (proxy) vs local 76.209.9.65, 2.0MB PNG. Build+vet pass.
2026-07-09 16:36:04 +08:00
chiyi 2987053b10 feat(grok): account calls (credits/subscription/session) egress on the local IP
Only the conversations/new generate submit still uses proxy.url; FetchCreditsBalance, FetchSubscription and FetchSession now go direct.
2026-07-09 16:32:21 +08:00
chiyi 57e3ee4cef feat(grok): route only the conversations/new submit through the proxy
Reference-frame upload, the mp4 download and OpenAsset (/content) streaming now egress on the local IP; only the generate submit uses proxy.url. Verified live: submit egress 98.97.26.37 (proxy) vs upload/download 76.209.9.65 (local), 3.47MB video generated OK.
2026-07-09 16:26:18 +08:00
chiyi 6c2a942a88 feat(providers): route only the generate submit through the proxy
Extends the adobe split to leonardo, krea, imagine, runway (image+video) and chatgpt: reference-image upload, polling and result download egress on the local IP; only the generate/task-create submit uses proxy.url. chatgpt keeps its anti-bot-guarded submit+upload phase on the proxy and moves only the existing second (poll/resolve/download) session to local. custom is already direct. Build+vet pass; adobe verified live, the other providers are code-complete but not yet live-tested (no dev accounts).
2026-07-09 16:21:31 +08:00
chiyi db3219416e feat(adobe): route only the image-generate submit through the proxy
Reference-image upload, job polling and result download now run on the local IP; only the generate submit egresses via proxy.url. Verified live: submit egress 74.244.159.228 (proxy) vs upload/poll/download 76.209.9.65 (local), 1K adobe gpt image generated OK.
2026-07-09 16:08:33 +08:00
chiyi 48cfbff592 fix(grok): self-heal x-statsig-id from live homepage seed+curves
Derive the 49-byte header seed and the salt F per-session from the grok homepage (browser-free tls-client GET), instead of hardcoding constants that go stale on every grok web rebuild (403 anti-bot). F is reproduced natively in Go (curve keyframe sampling: cubic-bezier easing, color lerp, rotation matrix, JS-exact number->hex). Static constants remain as env-overridable fallback. Adds offline regression test against server-verified ground-truth triples.
2026-07-09 15:07:12 +08:00
chiyi f3803d01cf 更新adobe协议 2026-07-08 20:17:33 +08:00
chiyi 98b5f5a5c3 chatgot更新换号重试 2026-07-08 13:13:25 +08:00
chiyi e45ff5ef9a 恢复gpt 2026-07-08 09:22:26 +08:00
chiyi 5e809d375b 更新调度 2026-07-07 13:22:34 +08:00
chiyi 67354c3b8c 增加随机指纹 2026-07-07 12:03:52 +08:00
chiyi b103e6d35e 忽略原本的id 2026-07-06 12:54:03 +08:00
chiyi 713cca8f67 优化chatgpt检查 2026-07-06 10:57:41 +08:00
chiyi e05db36f63 优化错误检查 2026-07-06 10:37:46 +08:00
chiyi e517c56225 更新chatgpt协议 2026-07-06 10:21:44 +08:00
chiyi c96bee4094 增加积分 2026-07-05 22:45:27 +08:00
chiyi b83007edb6 修复下载问题 2026-07-04 19:45:29 +08:00
chiyi 34e69adefc grok修复 2026-07-03 23:33:04 +08:00
chiyi c6a8ca440a 修复grok视频参考图 2026-07-03 23:10:04 +08:00
chiyi f9e72c0168 修复bug 2026-07-03 18:12:46 +08:00
chiyi 53dc178804 更新尺寸兼容 2026-07-03 10:27:49 +08:00
chiyi 4e2844ff51 grok修复恢复时间 2026-07-03 02:10:30 +08:00
chiyi 273892f98f 更新缩略图 2026-07-03 00:15:41 +08:00
chiyi 7a168a1dd8 adobe限流不封号 2026-07-02 16:59:27 +08:00
chiyi dde178f8f7 增加上传重试 2026-07-02 15:38:54 +08:00
chiyi 39b149b206 更新openai风控协议 2026-07-02 13:57:08 +08:00
chiyi c99c134713 增加重试 2026-07-02 12:03:03 +08:00
chiyi ab94165af2 修复视频bug 2026-07-02 11:50:50 +08:00
chiyi 41bd120404 修复grok 403 2026-07-02 11:04:47 +08:00
chiyiandClaude Opus 4.8 8ec4562f81 feat: 易支付积分充值 + 站内公告 + OpenAI 视频修复 + grok/adobe 失败处理
充值/订单(易支付 mapi):
- 订单表 + 30 分钟自动取消;支付弹窗(二维码/跳转监控、倒计时、轮询、5s 倒计时关闭)
- 系统设置可配:开关/商户ID/密钥/支付地址(根地址拼 /mapi)/支付方式/最低额/积分比例(默认 1元=100积分)
- 异步通知 MD5 验签、幂等到账;用户累计充值;前台/后台订单页(筛选+搜索+分页,前后台分风格);用户管理累计充值列

站内公告:
- Markdown 公告,登录用户首次访问/刷新弹出;内容哈希做版本,改了就重新推;管理员不弹;空内容=下线

OpenAI 视频(/v1/videos)修复:
- /content 拿不到视频:grok 资源 URL 需鉴权,改为用生成账号 token 取流;adobe/runway 公开 URL 直代理(不存 RustFS)
- size→分辨率用短边判定(1280x720 = 720p,之前误判 1080p 被拒)

失败处理:
- grok 429「Too many requests」/403 anti-bot 改判临时错误(不再误封号),真额度耗尽才算 quota
- adobe 视频 408 / system under load 归为临时错误 → tempAsDead 封号

其它:
- 充值默认关闭;签到格子浅色可见;登录验证码按钮浅色可读;并发/账户信息展示
- 创作记录/画图台只显示画图台作品(排除 API);日志页 API 视频预览显示 —
- 视频去画中画/下载/投屏(全局);图片缩略图改背景图规避 Edge 视觉搜索
- 订单/兑换码/配置/日志菜单文案与图标;充值版块样式

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 01:32:33 +08:00
chiyiandClaude Opus 4.8 1137d0bd1d feat: 画图台并发重构 + 品牌定制 + 用户备注 + provider/UI 多项修复
画图台(并发出图):
- 不再锁定 UI:点「生成」开独立任务,可连续多次并发
- 结果网格一行5个、最多10张,进行中/成功/失败状态回显,刷新保留进行中
- 生图张数 1/2/3/4,各自独立计费出卡
- 点图=参考图(单张替换/多张替换末位);首尾帧模型点视频=抓末帧设为首帧,否则放大
- /logs 新增 statuses=pending,success 服务端过滤(status IN 专用 SQL)

品牌定制(设置→网站):
- 自定义 Logo 图片 + 子标题(公开页头部 + 管理侧栏)
- 邮件验证码标题改用站点名:{title} 邮箱验证码

提示词复制:
- 去掉复制按钮,点提示词文字即复制(预览/后台日志/图片管理/画图记录),统一弹「指令已复制」
- 新增 utils/clipboard.js:execCommand 回退,非安全上下文(http/IP)也能复制

用户管理:列表加「备注」列,新建/编辑可填改备注(默认空)

provider 修复:
- grok 401 正确判死封号(markTokenFailure 漏了 grok 池)
- grok 视频支持 15s
- custom 上游报错去敏感(抹掉上游 URL/IP,改英文短描述)
- custom 去掉额度耗尽锁定:429/欠费当临时错误,账号保持 active

UI/其它:
- 展示位弹窗浅色主题适配(tab 选中高亮、输入框边框)— 主题变量 + 中心补丁
- 自定义模型:时长可填任意秒数 + 15s 预设
- 首页设置/卡密弹窗去固定高度与滚动条
- 顶部菜单「记录」→「图片」
- 下线 Flow provider(代码移除)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 01:11:22 +08:00
chiyiandClaude Opus 4.8 3ef84bb9b3 feat: 自定义 OpenAI 兼容上游聚合 + 权重/并发调度
- custom provider:把任意 v1 端点当账号(base_url+key),按 model id 路由,
  直连不走代理;支持 images/generations、images/edits、Sora 式异步视频
- 调度器全局权重优先 + 每账号并发感知(上游账号可配并发,其余系统固定)
- 后台:添加/编辑上游、自定义模型表单(每档普通/代理价,留空=不支持)、
  账号权重/并发列与导入权重
- grok-video / nano-banana-2(runway) 写入硬编码目录(开源自带);
  去掉 540p,Adobe 视频最低 720p
- UI:SelectMenu 与输入框等高、测试耗时改用秒

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:59:46 +08:00
chiyiandClaude Opus 4.8 17cd289dfd feat: add Grok (grok.com) video provider; runway nano-banana image; unify runway/grok pool policy
- grok provider: imagine text/image-to-video (media.post.create → conversations/new),
  GetGrokCreditsConfig credit query (remaining = 100 - used) + weekly reset, spoofed
  x-statsig-id (no Cloudflare clearance needed), /api/auth/session email lookup,
  6 reference images, 10 concurrent jobs/account, no token refresh (dead = dead)
- runway: nano-banana-2 image flow (Nano Banana 2); drop pre-deduct + post-success
  reconcile; out-of-credits/403 → dead (no revive); 10-ratio support
- imagine: drop post-success credit reconcile (consistent with krea)
- account gate: per-account N-concurrency (grok=10, others=1)
- admin: provider health lists all 7 providers; frontend import auto-detects Grok SSO
- docs: README (CN/EN) updated to 7 providers + Grok

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 04:01:06 +08:00
chiyiandClaude Opus 4.8 8633addf64 docs: expand repo structure with subdirectories; drop stray adobe.zip
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 00:02:14 +08:00
chiyiandClaude Opus 4.8 606caaf047 Initial open-source release (MIT): image2api AI gateway
Full Go backend + Vue 3 frontend, OpenAI-compatible API, multi-provider
account pools, billing/admin, Docker one-command deploy with auto HTTPS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:59:04 +08:00