mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6259] [MERGED] fix(panel): forward the panel's proxy to update.sh's own downloads #6200
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6200
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6259
Author: @kuzzrus
Created: 8/18/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @MHSanaei
Base:
main← Head:upstream-pr/panel-update-proxy📝 Commits (6)
d7e9c4ffix(panel): route update.sh's own downloads through the resolved proxybd98995test(panel): cover updateProxyEnvVars' ambient-proxy path02cc009fix: drop the panel-outbound fallback in updateProxyEnvVarsfbf4fe7Merge branch 'main' into upstream-pr/panel-update-proxy9734457Merge branch 'main' into upstream-pr/panel-update-proxycb5278eMerge branch 'main' into upstream-pr/panel-update-proxy📊 Changes
2 files changed (+64 additions, -6 deletions)
View changed files
📝
internal/web/service/panel/panel.go(+23 -6)📝
internal/web/service/panel/panel_test.go(+41 -0)📄 Description
Summary
startUpdatealready fetchesupdate.shitself through a proxy-aware HTTP client (NewProxiedHTTPClient), but the process that actually executesupdate.shnever receives a proxy hint of its own — soupdate.sh's owncurlcalls to GitHub always go out directly, even when the panel has a working proxy path configured.Why
This is most visible on the
systemd-runlaunch path:systemd-rundoes not inherit the caller's environment at all (only--setenvpasses through), so a host that needs a proxy to reach GitHub loses it for this one hop even though every other panel-outbound request (the version check, theupdate.shdownload itself) already goes through it correctly.curlalready honorshttps_proxy/all_proxynatively, so no changes toupdate.share needed — only the launcher needs to forward a proxy URL into the environment it hands to the detached process.updateProxyEnvVars()prefers an already-set ambient proxy env var (never silently overriding an admin's own proxy config) and only falls back to the panel's own configured panel outbound (PanelEgressProxyURL) when nothing is set, then forwards the result to both launch paths (--setenvforsystemd-run,cmd.Envfor thebash -lcfallback).Type of change
Areas affected
How was this tested?
internal/web/service/paneltransitively importsinternal/database(CGO/sqlite3), which I wasn't able to compile in my local environment. I addedTestUpdateProxyEnvVarsPrefersAmbientProxy, which exercises the ambient-proxy branch directly (it never touchesPanelEgressProxyURL/the database, so it needs no DB test scaffolding), and manually checked the new call againstNewProxiedHTTPClient's existing call pattern already used elsewhere in this same file. I was not able to rungo build/the full test suite myself — would appreciate CI or a maintainer confirming those, and ideally a real update run on a host that actually needs a proxy to reach GitHub.Screenshots / recordings
N/A — backend-only change.
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally. (same CGO blocker; should be green in CI)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.