Add proxy support for add account by token - #90
Merged
Conversation
dwgx
added a commit
that referenced
this pull request
Apr 29, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase #90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
dwgx
requested changes
Apr 29, 2026
Owner
There was a problem hiding this comment.
Thanks @smeinecke. The feature direction is right, but I cannot merge it as-is because proxy validation happens after the account is created.
Blocking issue: if proxy validation fails, the account has already been written to the store, leaving a stale account without the requested proxy binding. Please validate the proxy before calling the add-account path, or roll back the created account on validation failure.
Please also add/confirm tests for:
- invalid proxy input does not create an account
- valid proxy input creates the account and stores the proxy binding
- the no-proxy path still behaves as before
Contributor
Author
|
You're right. I'll fix this and rebase the branch. Thank you for the feedback! |
Owner
|
Oh, I'm very sorry I didn't realize just now that you are not Chinese. I used Chinese. Thank you for your Pull |
Add optional proxy input to dashboard single-account add form. Mirrors batch-import proxy binding — user can specify http://proxy:8080 or socks5://user:pass@host:port per account. Backend validates format via parseProxyUrl(), respects ALLOW_PRIVATE_PROXY_HOSTS config (validateHostFormat vs assertPublicUrlHost), calls setAccountProxy() + ensureLsForAccount(). UI clears proxy field on success. i18n for EN/zh-CN.
smeinecke
force-pushed
the
feat/add-account-proxy
branch
from
April 29, 2026 09:14
072d151 to
a4dc792
Compare
dwgx
added a commit
that referenced
this pull request
Apr 29, 2026
#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback #90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
4 tasks
smeinecke
added a commit
to smeinecke/WindsurfAPI
that referenced
this pull request
Apr 29, 2026
…ounts Move api_key/token presence check to top of POST /accounts handler - runs before proxy validation + account creation. Prevents proxy network checks when credentials are missing. Simplify account creation to ternary expression (api_key vs token path). No functional change to validation order from dwgx#90 (proxy still validated before account creation).
huanchen
pushed a commit
to huanchen/WindsurfAPI
that referenced
this pull request
May 3, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase dwgx#90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
huanchen
pushed a commit
to huanchen/WindsurfAPI
that referenced
this pull request
May 3, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from dwgx#88 are cleaned up nicely. Merging. I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there. Appreciated 🙏
huanchen
pushed a commit
to huanchen/WindsurfAPI
that referenced
this pull request
May 3, 2026
dwgx#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback dwgx#90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
dwgx
added a commit
that referenced
this pull request
May 9, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase #90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
dwgx
added a commit
that referenced
this pull request
May 9, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from #88 are cleaned up nicely. Merging. I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there. Appreciated 🙏
dwgx
added a commit
that referenced
this pull request
May 9, 2026
#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback #90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase #90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from #88 are cleaned up nicely. Merging. I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there. Appreciated 🙏
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback #90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase #90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from #88 are cleaned up nicely. Merging. I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there. Appreciated 🙏
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback #90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Merging — thanks @smeinecke. The fail-closed default (`ALLOW_PRIVATE_PROXY_HOSTS=` empty) preserves SSRF protection for public deployments while unblocking local/private-network testing for opt-in users. Follow-ups for v2.0.27 (will track in repo, no action needed from you): - Add a `test/ssrf.test.js` covering: default-OFF rejects 192.168/10.x/localhost, opt-in `ALLOW_PRIVATE_PROXY_HOSTS=1` allows them, IPv6 link-local still rejected. - Doc note: this switch should NOT be enabled on public-facing dashboards. - Will rebase #90 on top of this once you fix the account-create-before-proxy-validation ordering (see comments there).
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from #88 are cleaned up nicely. Merging. I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there. Appreciated 🙏
dwgx
added a commit
that referenced
this pull request
Jun 4, 2026
#91 — 从本地 Windsurf 桌面客户端读凭证: - 新增 src/dashboard/local-windsurf.js:扫 state.vscdb (sqlite) 抽 windsurfAuthStatus + sessions - 新增 GET /accounts/import-local:req.socket.remoteAddress 严格 loopback 校验 - 默认 UI 加「从本地 Windsurf 导入」按钮 + 列表展示 + 一键导入 - 用 node:sqlite 零依赖,Node 20 graceful 降级到 ~/.codeium/config.json fallback #90 follow-up — proxy 校验顺序修正: - /accounts POST 把 proxy 解析+校验提到 addAccount 之前,避免失败留僵尸账号 - 新增 4 条 test/account-add-proxy-ordering.test.js 锁住 测试:327/327 passing(+16 新);i18n guard ✓
dwgx
added a commit
that referenced
this pull request
Jun 29, 2026
Backfill contributors who were merged but never added to the thanks page, with weight tiers calibrated against existing entries: - #64 baily-zhang (S) — cascade transport canceled-session recovery - #163 you922 (A) — LS crash self-heal: exponential-backoff restart - #204 lovivi (B+) — glm-5.2 gpt_native tool dialect fix - #90 smeinecke (B+) — inline proxy on add-account form - #88 smeinecke (B+) — ALLOW_PRIVATE_PROXY_HOSTS opt-in for local proxy - #89 smeinecke (B) — login-flow i18n + error-code standardization Synced src -> docs via sync:contributors. Also gitignore .workflow-results/ (local audit artifacts, not source). dashboard tests 17/17.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么 / What changed
Added an optional proxy field to the "Add Account" form in the Account Pool dashboard. Users can now specify a proxy (in
protocol://[user:pass@]host:portformat) when adding an account via API Key or Auth Token, instead of having to configure it separately after the account is created.为什么 / Why
Previously, when adding an account to the pool, users had to:
This was inconvenient, especially when managing multiple accounts with different proxies. The batch import feature already supported specifying proxies inline, but the single account addition form did not. This change brings feature parity between batch import and single account addition.
测试 / Testing
Tested proxy validation:
not-a-proxy) returnsERR_PROXY_FORMAT_INVALIDhttp://192.168.1.1:8080) is blocked by default (returnsERR_PROXY_PRIVATE_IP)ALLOW_PRIVATE_PROXY_HOSTS=1is sethttp://proxy.example.com:8080) works correctlysocks5://user:pass@host:port) parses correctlyTested dashboard UI:
Verified proxy is applied immediately:
Checklist