MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / ensureFallbackManagementHTML

Function ensureFallbackManagementHTML

internal/managementasset/updater.go:299–316  ·  view source on GitHub ↗
(ctx context.Context, client *http.Client, localPath string)

Source from the content-addressed store, hash-verified

297}
298
299func ensureFallbackManagementHTML(ctx context.Context, client *http.Client, localPath string) bool {
300 data, downloadedHash, err := downloadAsset(ctx, client, defaultManagementFallbackURL)
301 if err != nil {
302 log.WithError(err).Warn("failed to download fallback management control panel page")
303 return false
304 }
305
306 log.Warnf("management asset downloaded from fallback URL without digest verification (hash=%s) — "+
307 "enable verified GitHub updates by keeping disable-auto-update-panel set to false", downloadedHash)
308
309 if err = atomicWriteFile(localPath, data); err != nil {
310 log.WithError(err).Warn("failed to persist fallback management control panel page")
311 return false
312 }
313
314 log.Infof("management asset updated from fallback page successfully (hash=%s)", downloadedHash)
315 return true
316}
317
318func resolveReleaseURL(repo string) string {
319 repo = strings.TrimSpace(repo)

Callers 1

Calls 2

downloadAssetFunction · 0.85
atomicWriteFileFunction · 0.70

Tested by

no test coverage detected