feat: pull del modelo respeta HTTPS_PROXY (#7)

Co-authored-by: Hermes Agent <hermes@d0a1.es>
This commit was merged in pull request #7.
This commit is contained in:
hermes authored and Hermes committed 2026-09-12 20:58:59 +02:00
1 parent 912105f16f
commit 539cd4d181
4 files changed
+40 -8

No files matched your search

+10 -2
View File
@@ -122,17 +122,25 @@ while ($true) {
}
}
Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b
docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b'
exit 1
}