Commit Graph
1 Commits
Author SHA1 Message Date
yetone 4bfac12683 plugins: downloads take a proxy of their own, apart from the vendors' (JonahFu on X)
JonahFu on X: GitHub is unreachable without a proxy, while API requests
may go direct, so plugin downloads' proxy should be set apart from the
one model requests take.

Before: plugin downloads already followed the global proxy (fetches
through http.DefaultClient and netproxy.Func, bun add and git through
netproxy.Env), so nothing ignored it; there was only no way to give
them a different one.

Now Settings › Network has a Plugin downloads row under Proxy: Same as
above (the default, unset: downloads follow the global proxy as
before), Direct, or Custom with its login, remembered as
pluginProxyCustom as Proxy's Custom is. The CLI takes it as
`magpie settings set pluginProxy <url|direct|"">`. It covers the plugins
list and Discover's lists (fetchJSONFrom), a user's own npm registry
(fetchRegistry), Bun's download (getURLFrom), bun add/update/remove and
the git commands of GitHub-installed plugins (dlEnv). The plugin host
(bun run) keeps the global proxy: its requests are the vendors'. Both
fields belong to this computer (KeepOwn) and are left out of
auto-backups, since a proxy URL may hold a password. Settings' Proxy
row and the new one are drawn by one helper (proxyRow); the core's
script budget is met by cutting the proxy rows' comments, no raise.

Run (mote, through mote-run): gofmt -l clean; go vet of the touched
packages (darwin), GOOS=linux -tags nogui ./..., GOOS=windows of the
touched packages; go test -count=1 internal/settings, settingsapi,
backup, netproxy, plugin, gui, cli all ok (gui after the comment cut;
its first run had TestCoreScriptBudget 1,352 bytes over). GUI, chromium
and webkit: settings-plugin-proxy (new, 5 languages x 2 widths),
settings-proxy-remember, settings-proxy-auth, proxy-test,
settings-sections, proxy-login-fields and the i18n files: 102 pass, 0
fail. plugin-proxy-page, proxy-own-wording, account-proxy,
provider-proxy, routing-proxy, provider-many-keys-proxy and
signin-proxy: 104 pass, 2 fail, both signin-proxy's "a subscription
with no proxy offers the global one" at 380px in Chromium, red the same
way on origin/main b596da773 (filed #5866).

Again at this commit, rebased on b596da773: gofmt, the three go vets,
the seven packages' go test (all ok, TestCoreScriptBudget included) and
settings-plugin-proxy, -remember and -auth (50 pass, 0 fail).

Broken by hand: fetchJSONFrom without netproxy.Downloads ->
TestPluginDownloadsTakeTheirOwnProxy red (the list went direct and hit
testenv's offline guard); bunCommand always taking env() -> red (bun
add's HTTPS_PROXY ""); the GUI row saving key "proxy" ->
settings-plugin-proxy 10 of 10 red in chromium.

Not tried: a real install behind a real proxy with GitHub blocked; the
Library's (skills, MCP) downloads and plugin icons (loaded by the
webview through usemagpie.ai) still follow the global proxy; Windows.
2026-11-10 11:44:17 +08:00