Skip to content

Commit 3ec461a

Browse files
fix(installer): improve private-index recovery guidance (#536)
* fix(installer): improve private-index recovery guidance Co-authored-by: Copilot <[email protected]> * fix(installer): guard pip index bridge Co-authored-by: Copilot <[email protected]> * fix(installer): satisfy blocker checks Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 09ce9c2 commit 3ec461a

6 files changed

Lines changed: 105 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,31 @@ pip config set global.index-url https://<your-index-host>/simple/
186186
> install`, or `conductor update` — those need `UV_DEFAULT_INDEX` (or
187187
> `uv.toml`). Configure both if you use both toolchains.
188188
189+
If pip already works through the required mirror, you can bridge its configured
190+
URL into uv without copying or printing credentials:
191+
192+
```bash
193+
# macOS / Linux
194+
pip_index="$(pip config get global.index-url 2>/dev/null || true)"
195+
if [ -n "$pip_index" ]; then
196+
export UV_DEFAULT_INDEX="internal=${pip_index}"
197+
curl -sSfL https://aka.ms/conductor/install.sh | sh
198+
else
199+
printf '%s\n' 'No pip global.index-url; use the approved mirror URL above.'
200+
fi
201+
```
202+
203+
```powershell
204+
# Windows
205+
$pipIndex = pip config get global.index-url 2>$null
206+
if ($pipIndex) {
207+
$env:UV_DEFAULT_INDEX = "internal=$pipIndex"
208+
irm https://aka.ms/conductor/install.ps1 | iex
209+
} else {
210+
Write-Host "No pip global.index-url; use the approved mirror URL above."
211+
}
212+
```
213+
189214
If the index requires credentials, uv accepts them inline in the URL or via
190215
`UV_INDEX_INTERNAL_USERNAME` / `UV_INDEX_INTERNAL_PASSWORD` — where `INTERNAL`
191216
is the index name from the `internal=` prefix (or the `name` key) above,
@@ -204,10 +229,12 @@ the index:
204229
since unlike a policy block they can genuinely heal.
205230

206231
If the error mentions a certificate, your network is inspecting TLS — trust
207-
your organization's root CA via `SSL_CERT_FILE`, or set `UV_NATIVE_TLS=1` to
208-
use the system trust store. If it mentions a proxy (`407`), set `HTTPS_PROXY` /
209-
`NO_PROXY` as well as the index URL. Do not work around the block by disabling
210-
security tooling; ask your IT or platform team for the approved index endpoint.
232+
your organization's root CA via `SSL_CERT_FILE`, or set `UV_SYSTEM_CERTS=1` to
233+
use the system trust store. For uv versions older than 0.11, use the legacy
234+
`UV_NATIVE_TLS=1` setting. If the error mentions a proxy (`407`), set
235+
`HTTPS_PROXY` / `NO_PROXY` as well as the index URL. Do not work around the
236+
block by disabling security tooling; ask your IT or platform team for the
237+
approved index endpoint.
211238

212239
### Use the Conductor skill in Claude Code or Copilot CLI
213240

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**Private-index installer recovery guidance** now safely bridges an existing
2+
pip mirror into uv and recommends current system-certificate settings.

‎install.ps1‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,17 @@ function Write-IndexGuidance {
418418
Write-Host ""
419419
Write-Host ' setx UV_DEFAULT_INDEX "internal=https://<your-index-host>/simple/"' -ForegroundColor Cyan
420420
Write-Host ""
421+
Write-Host " If pip already works through your organization's mirror, reuse its"
422+
Write-Host " configured URL without printing credentials into this installer log:"
423+
Write-Host ""
424+
Write-Host ' $pipIndex = pip config get global.index-url 2>$null' -ForegroundColor Cyan
425+
Write-Host ' if ($pipIndex) {' -ForegroundColor Cyan
426+
Write-Host ' $env:UV_DEFAULT_INDEX = "internal=$pipIndex"' -ForegroundColor Cyan
427+
Write-Host ' irm https://aka.ms/conductor/install.ps1 | iex' -ForegroundColor Cyan
428+
Write-Host ' } else {' -ForegroundColor Cyan
429+
Write-Host ' Write-Host "No pip global.index-url; use the approved mirror URL above."' -ForegroundColor Cyan
430+
Write-Host ' }' -ForegroundColor Cyan
431+
Write-Host ""
421432
}
422433
Write-Host " Notes:"
423434
Write-Host " * uv does not read pip's configuration. Setting"
@@ -428,7 +439,8 @@ function Write-IndexGuidance {
428439
Write-Host " set UV_INDEX_INTERNAL_USERNAME / UV_INDEX_INTERNAL_PASSWORD, or"
429440
Write-Host " embed them in the URL."
430441
Write-Host " * If the error mentions a certificate, the network is inspecting TLS."
431-
Write-Host " Trust your organization CA via SSL_CERT_FILE, or set UV_NATIVE_TLS=1."
442+
Write-Host " Trust your organization CA via SSL_CERT_FILE, or set UV_SYSTEM_CERTS=1."
443+
Write-Host " On uv older than 0.11, use the legacy UV_NATIVE_TLS=1 setting."
432444
Write-Host " * If the error mentions a proxy (407), set HTTPS_PROXY / NO_PROXY."
433445
Write-Host ""
434446
Write-Host " Details: https://github.com/microsoft/conductor#installing-behind-a-proxy-or-private-package-index"

‎install.sh‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,15 @@ print_index_guidance() {
316316
printf ' curl -sSfL https://aka.ms/conductor/install.sh | sh\n\n' >&2
317317
printf ' Add the same export to your shell profile so future installs and\n' >&2
318318
printf " 'conductor update --apply' inherit it.\n\n" >&2
319+
printf " If pip already works through your organization's mirror, reuse its\n" >&2
320+
printf ' configured URL without printing credentials into this installer log:\n\n' >&2
321+
printf ' pip_index="$(pip config get global.index-url 2>/dev/null || true)"\n' >&2
322+
printf ' if [ -n "$pip_index" ]; then\n' >&2
323+
printf ' export UV_DEFAULT_INDEX="internal=${pip_index}"\n' >&2
324+
printf ' curl -sSfL https://aka.ms/conductor/install.sh | sh\n' >&2
325+
printf ' else\n' >&2
326+
printf '%s\n' " printf '%s\\n' 'No pip global.index-url; use the approved mirror URL above.'" >&2
327+
printf ' fi\n\n' >&2
319328
fi
320329
printf ' Notes:\n' >&2
321330
printf " * uv does not read pip's configuration. Setting\n" >&2
@@ -326,7 +335,8 @@ print_index_guidance() {
326335
printf ' set UV_INDEX_INTERNAL_USERNAME / UV_INDEX_INTERNAL_PASSWORD, or\n' >&2
327336
printf ' embed them in the URL.\n' >&2
328337
printf ' * If the error mentions a certificate, the network is inspecting TLS.\n' >&2
329-
printf ' Trust your organization CA via SSL_CERT_FILE, or set UV_NATIVE_TLS=1.\n' >&2
338+
printf ' Trust your organization CA via SSL_CERT_FILE, or set UV_SYSTEM_CERTS=1.\n' >&2
339+
printf ' On uv older than 0.11, use the legacy UV_NATIVE_TLS=1 setting.\n' >&2
330340
printf ' * If the error mentions a proxy (407), set HTTPS_PROXY / NO_PROXY.\n\n' >&2
331341
printf ' Details: https://github.com/microsoft/conductor#installing-behind-a-proxy-or-private-package-index\n\n' >&2
332342
}

‎tests/test_integration/test_install_script_files.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ def test_install_scripts_name_the_uv_index_variable() -> None:
252252
)
253253

254254

255+
def test_install_scripts_recommend_current_system_certificate_setting() -> None:
256+
"""TLS guidance should lead with uv's current, non-deprecated setting."""
257+
for path in (INSTALL_SH, INSTALL_PS1):
258+
body = _guidance_body(path)
259+
assert "UV_SYSTEM_CERTS=1" in body, (
260+
f"{path.name}'s guidance must recommend uv's current system-certificate setting"
261+
)
262+
assert "legacy UV_NATIVE_TLS=1" in body, (
263+
f"{path.name}'s guidance should retain a compatibility note for uv older than 0.11"
264+
)
265+
266+
255267
def test_install_scripts_do_not_hardcode_a_private_index() -> None:
256268
"""Neither script may ship a specific organization's package mirror.
257269

‎tests/test_integration/test_install_scripts.py‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,42 @@ def test_blocked_package_index_reports_guidance_and_skips_retries(
381381
)
382382

383383

384+
def test_blocked_index_offers_credential_safe_pip_bridge(
385+
sandbox: Sandbox, wheels: WheelPair
386+
) -> None:
387+
"""Offer a bridge without reading or printing the configured index URL."""
388+
shim_env = _install_uv_shim(sandbox, mode="network-always")
389+
390+
result = run_install_script(sandbox, source=wheels.new, force=True, extra_env=shim_env)
391+
392+
assert result.returncode != 0, f"install should have failed:\n{result.combined}"
393+
combined = result.combined
394+
assert "If pip already works" in combined
395+
if IS_WINDOWS:
396+
expected = (
397+
" $pipIndex = pip config get global.index-url 2>$null\n"
398+
" if ($pipIndex) {\n"
399+
' $env:UV_DEFAULT_INDEX = "internal=$pipIndex"\n'
400+
" irm https://aka.ms/conductor/install.ps1 | iex\n"
401+
" } else {\n"
402+
' Write-Host "No pip global.index-url; '
403+
'use the approved mirror URL above."\n'
404+
" }\n"
405+
)
406+
else:
407+
expected = (
408+
' pip_index="$(pip config get global.index-url 2>/dev/null || true)"\n'
409+
' if [ -n "$pip_index" ]; then\n'
410+
' export UV_DEFAULT_INDEX="internal=${pip_index}"\n'
411+
" curl -sSfL https://aka.ms/conductor/install.sh | sh\n"
412+
" else\n"
413+
" printf '%s\\n' "
414+
"'No pip global.index-url; use the approved mirror URL above.'\n"
415+
" fi\n"
416+
)
417+
assert expected in combined
418+
419+
384420
def test_ordinary_failure_still_retries_and_shows_no_index_guidance(
385421
sandbox: Sandbox, wheels: WheelPair
386422
) -> None:

0 commit comments

Comments
 (0)