modavd update 不认 Windows 系统代理,和 components fetch 不一致

Offen
#23 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
cli, networking

Rechercherichtung

Compare the download code in internal/components (download.go, proxy.go) with internal/update/source.go, and read the two proxy sections of the README. The aim is one shared download path that both commands use, with the components proxy rules (environment variables first, then the Windows manual proxy). Done means the acceptance checks pass: modavd update check and modavd components fetch both use the Windows proxy when no environment variable is set, and the existing resume, timeout and verification tests pass for both. Start with the Windows proxy lookup, since it is the piece that needs domain knowledge.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug P3 platform:windows

现状

命令行里有两套下载代码,代理的行为不一样:

命令 代码 代理
modavd components fetch internal/components(download.go、proxy.go) 设了 HTTPS_PROXY / HTTP_PROXY / NO_PROXY 就照环境变量,否则用 Windows「Internet 选项」里手动设的代理
modavd update internal/update(source.go) 只认 HTTPS_PROXY / NO_PROXY,不读 Windows 的系统代理

README 里两处分别写了这两套规则。结果是:只在 Windows 里设了手动代理的用户,补全组件能下,从 GitHub 更新却连不上,要另外设环境变量。

#9 当初要求补全组件「不要另写一份下载代码」,当时为了先把功能做出来,单独写了一份,交回时说明过。

要做的

  1. 把下载(连接和停顿超时、断点续传、重定向上限、User-Agent、代理)收成一份,components 和 update 都用它。两边现有的核对(大小、SHA-256、zip 校验、清单)不变。
  2. 代理统一成 components 现在的规则:先看环境变量,没有再用 Windows 手动代理;PAC 照旧不支持,报错里提示设 HTTPS_PROXY。
  3. README 里两处代理说明合成一处。

验收

  • 只设 Windows 手动代理、不设环境变量时,modavd update check(从 GitHub)和 modavd components fetch 都走这个代理;
  • 设了 HTTPS_PROXY 时两者都照环境变量,NO_PROXY 生效;
  • 两边原有的测试(续传、超时、核对失败)全部通过。
Vorherrschende Sprache
Go
Sterne
0
Forks
1
Ø Merge
2 Std. 42 Min.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ModAVD/ModAVDManager

Alle Issues in ModAVD/ModAVDManager

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.