feat(proxy): global and per-account outbound proxy support - #155
Open
caigee-cmd wants to merge 1 commit into
Open
caigee-cmd wants to merge 1 commit into
caigee-cmd wants to merge 1 commit into
Conversation
Add outbound proxy routing across every account family. Global setting - New internal/proxy package: Parse/ValidateHTTPOnly, Redact, Preserve, Effective resolution, and a bounded LRU TransportCache (32 entries, evicts with CloseIdleConnections). - Global proxy stored in app_secrets as proxy_url, bootstrapped from QODER_PROXY_URL, editable on the System page. - proxy.ValidateHTTPOnly keeps the global value http(s)-only because Qoder child workers inherit it. direct / none explicitly bypass. Account override - New SQLite migration 019_account_proxy.sql adds accounts.proxy_url. - Account override wins over the global value; Qoder account-level proxies are http(s)-only, WorkBuddy / Trae also accept socks5. - Proxy credentials are redacted in console responses; redacted re-submits are resolved back to the stored value via proxy.Preserve. Runtime wiring - Qoder workers: ExecStarter pushes the effective proxy as HTTP(S)_PROXY and QODER_PROXY_URL; worker/src/daemon.mjs installs an undici ProxyAgent (or a plain Agent for direct/none) as the global dispatcher. Worker deps pin undici 6.21.2 and deploy/Dockerfile runs npm ci. - WorkBuddy / Trae in-process adapters pick a Go transport from a per-client proxy.TransportCache so CONNECT tunnels are reused. - Manager.ReloadProxyURL restarts only enabled child-process accounts that inherit the global proxy; a failed reload stays pending so an identical PATCH retries. Account proxy edits restart that account. - Console System page edits the global value; account create/edit forms edit the override. Docs: README / README_EN / deploy/README describe QODER_PROXY_URL. Console static assets rebuilt to match frontend/dist.
Owner
Author
|
Heads-up for review: this branch is CONFLICTING against
Resolution requires picking the WorkBuddy model-exposure direction (follow |
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.
Summary
Adds outbound proxy support across every account family: one global setting with a per-account override.
app_secretsasproxy_url, bootstrapped fromQODER_PROXY_URL, editable on the System page. Validated http(s)-only (proxy.ValidateHTTPOnly) because Qoder child workers inherit it.direct/noneexplicitly bypass.019_account_proxy.sqladdsaccounts.proxy_url. Override wins over global. Qoder account-level proxies are http(s)-only; WorkBuddy / Trae also acceptsocks5. Credentials are redacted in console responses, and redacted re-submits resolve back to the stored value (proxy.Preserve).ExecStarterpushes the effective proxy asHTTP(S)_PROXY+QODER_PROXY_URL;worker/src/daemon.mjsinstalls anundiciProxyAgent(or plainAgentfor direct/none) as the global dispatcher and overridesfetch. Worker pinsundici 6.21.2;deploy/Dockerfilerunsnpm ci.proxy.TransportCache(bounded LRU, 32 entries, evicts withCloseIdleConnections) so CONNECT tunnels are reused.Manager.ReloadProxyURLrestarts only enabled child-process accounts that inherit the global proxy; a failed reload stays pending so an identical PATCH retries. Editing an account proxy restarts that account.New package
internal/proxy:Parse,ValidateHTTPOnly,Redact,Preserve,Effective,NewTransport/NewClient, andTransportCache.Docs
README.md/README_EN.md/deploy/README.mddocumentQODER_PROXY_URL. Console static assets rebuilt to matchfrontend/dist.Testing
go build ./...,go vet ./...clean.go test ./...green (new tests ininternal/proxy,internal/accounts,internal/api,internal/providers/{trae,workbuddy}).Not merging now — opening for review.