(ctx context.Context, client *http.Client, localPath string)
| 297 | } |
| 298 | |
| 299 | func 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 | |
| 318 | func resolveReleaseURL(repo string) string { |
| 319 | repo = strings.TrimSpace(repo) |
no test coverage detected