generated from axodotdev/oss-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I'm using astral-sh/uv and a proxy to access GitHub and set the following environment variable:
$env:UV_INSTALLER_GITHUB_BASE_URL="https://gh-proxy.com/github.com"When I run:
uv self update -vvvIt fails with a DNS error:
DEBUG uv 0.8.3 (7e78f54e7 2025-07-24)
info: Checking for updates...
TRACE checkout waiting for idle connection: ("https", api.gh-proxy.com)
DEBUG starting new connection: <https://api.gh-proxy.com/>
TRACE Http::connect; scheme=Some("https"), host=Some("api.gh-proxy.com"), port=None
TRACE checkout dropped for ("https", api.gh-proxy.com)
TRACE checkout waiting for idle connection: ("https", api.gh-proxy.com)
DEBUG starting new connection: <https://api.gh-proxy.com/>
TRACE Http::connect; scheme=Some("https"), host=Some("api.gh-proxy.com"), port=None
TRACE checkout dropped for ("https", api.gh-proxy.com)
error: error sending request for url (<https://api.gh-proxy.com/repos/astral-sh/uv/releases>)
Caused by: client error (Connect)
Caused by: dns error
Caused by: 不知道这样的主机。 (os error 11001)
This happens because UV_INSTALLER_GITHUB_BASE_URL is used to construct an API URL by prepending api. to the domain part, resulting in https://api.gh-proxy.com
| Ok(format!("{}://api.{}{}", parsed.scheme(), domain, port)) |
This is incorrect for reverse proxy setups like https://gh-proxy.com/api.github.com.
Suggested Fix
Support an additional environment variable: {app_name}_INSTALLER_GITHUB_API_BASE_URL
If this is set, it should be used as-is as the base URL for GitHub API requests, without any transformation.
This gives users full control and avoids incorrect assumptions based on domain heuristics.
Metadata
Metadata
Assignees
Labels
No labels