fix(branding): app icon follows the Nav Icon upload (#773) #774
Reference in New Issue
Block a user
Delete Branch "fix/app-icon-follows-nav-icon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #773.
The app icon (
logo.png) is the 512x512 PWA / web-manifest icon (SiteManifest) and the navbar fallback (head_navbar.tmplonerror), but it had no Admin Branding control — so a fully branded instance still advertised the shipped default MokoGitea mark as its installable app icon.Change
routers/web/admin/branding.go: uploading the Nav Icon now writes the image to bothlogo-small.pngandlogo.pngin a singleio.MultiWriterpass; resetting the Nav Icon removes both, reverting to the built-in default.templates/admin/branding.tmpl: note that the Nav Icon also sets the app icon and recommend >=512x512px.Verification
go build ./routers/web/admin/: pass.Wiki reminder: docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. (non-blocking)
Code review (targeting
main): clean — approve on correctness.file.Seek(0, io.SeekStart)) between targets, so a failure on a later target (logo.png) can't leave an earlier one (logo-small.png) truncated. Every file handle isClose()d on all paths (copy-error path closes before return) — no leak.nav-iconalso targetslogo.png; favicon/login-logo remain isolated.failed/removedAny/ default flash precedence.name[:len(name)-4]is panic-safe (all target names end in.png).Verified
go build ./routers/web/admin/passes. No code blockers.⚠️ Do not merge yet — CI red is the offline-runner infra issue, not this change.