BUG/feat: own favicon (💌) — currently shows Shlink's #17

Closed
opened 2026-06-17 08:15:02 +00:00 by mAi · 2 comments
Collaborator

Bug

The app has no own favicon, so the browser's request for /favicon.ico (not one of the app's claimed paths: / /compose /c/ /static/ /health) falls through to the Shlink catch-all → the tab shows Shlink's favicon. m wants the app's own — suggests the love-letter emoji 💌 (already the brand mark, '💌 Grußkarte').

Fix (two parts)

App (worker):

  • Add a 💌 favicon. Simplest: an SVG favicon with the emoji at web/static/favicon.svg (<svg ...><text>💌</text></svg>), embedded via the existing web/embed.go static FS. Optionally a PNG apple-touch-icon for iOS home-screen.
  • Add <link rel="icon" href="/static/favicon.svg" type="image/svg+xml"> (+ apple-touch-icon link) to all page templates (landing, compose, postcard, notfound, passwordprompt) — /static/ is already app-claimed, so this serves correctly.
  • Add an app route for the bare /favicon.ico (serve the svg/ico) so a direct /favicon.ico hit is answered by the app, not Shlink. (Browsers request /favicon.ico directly regardless of the link tag.)

Routing (otto-head, on deploy):

  • Add Path(\/favicon.ico`)(and/favicon.svg, /apple-touch-icon.pngif added) to the Traefik **app router** path list inpostcards-app.yml/postcards-shlink.yml` for both post.msbls.de and sendmy.cards, so favicon requests stop falling through to Shlink. otto-head handles this Traefik change at deploy.

Constraints

  • Keep it clean/lightweight; 💌 emoji is the mark. Works on both domains. No feature regression.

DoD

  • Tab shows the 💌 favicon (not Shlink's) on sendmy.cards across landing/compose/card pages.
  • /favicon.ico answered by the app (not Shlink).
  • build/vet/test green; commit references this issue. otto-head updates the Traefik app-router paths + deploys.
## Bug The app has **no own favicon**, so the browser's request for `/favicon.ico` (not one of the app's claimed paths: `/ /compose /c/ /static/ /health`) **falls through to the Shlink catch-all** → the tab shows **Shlink's favicon**. m wants the app's own — suggests the **love-letter emoji 💌** (already the brand mark, '💌 Grußkarte'). ## Fix (two parts) **App (worker):** - Add a 💌 favicon. Simplest: an SVG favicon with the emoji at `web/static/favicon.svg` (`<svg ...><text>💌</text></svg>`), embedded via the existing `web/embed.go` static FS. Optionally a PNG `apple-touch-icon` for iOS home-screen. - Add `<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">` (+ apple-touch-icon link) to **all** page templates (landing, compose, postcard, notfound, passwordprompt) — `/static/` is already app-claimed, so this serves correctly. - Add an app route for the bare **`/favicon.ico`** (serve the svg/ico) so a direct `/favicon.ico` hit is answered by the app, not Shlink. (Browsers request `/favicon.ico` directly regardless of the link tag.) **Routing (otto-head, on deploy):** - Add `Path(\`/favicon.ico\`)` (and `/favicon.svg`, `/apple-touch-icon.png` if added) to the Traefik **app router** path list in `postcards-app.yml` / `postcards-shlink.yml` for **both** post.msbls.de and sendmy.cards, so favicon requests stop falling through to Shlink. otto-head handles this Traefik change at deploy. ## Constraints - Keep it clean/lightweight; 💌 emoji is the mark. Works on both domains. No feature regression. ## DoD - Tab shows the 💌 favicon (not Shlink's) on sendmy.cards across landing/compose/card pages. - `/favicon.ico` answered by the app (not Shlink). - build/vet/test green; commit references this issue. otto-head updates the Traefik app-router paths + deploys.
mAi self-assigned this 2026-06-17 08:15:02 +00:00
mAi removed their assignment 2026-06-17 08:15:17 +00:00
Author
Collaborator

Done — own 💌 favicon

The app now serves its own love-letter favicon instead of falling through to Shlink's.

  • Added web/static/favicon.svg — a warm envelope-with-heart in the app's accent palette (renders cleanly down to 16px).
  • <link rel="icon" href="/static/favicon.svg" type="image/svg+xml"> in all page templates: landing, compose, postcard, notfound, passwordprompt, expired, admin, admin_login, admin_confirm.
  • New GET /favicon.ico route (handleFavicon) serves the embedded SVG with Content-Type: image/svg+xml + a 1-day cache header, so the legacy path no longer falls through to Shlink. Registered unconditionally (independent of the admin feature).
  • New route test TestFaviconServedByApp (200 + image/svg+xml + SVG body).

Matches your note: Traefik already routes /favicon.ico to the app on both domains, so no Traefik change needed — the app now answers it.

build / vet / test green.

Commit: 3ae968445b

## Done ✅ — own 💌 favicon The app now serves its own love-letter favicon instead of falling through to Shlink's. - Added `web/static/favicon.svg` — a warm envelope-with-heart in the app's accent palette (renders cleanly down to 16px). - `<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">` in **all** page templates: landing, compose, postcard, notfound, passwordprompt, expired, admin, admin_login, admin_confirm. - New `GET /favicon.ico` route (`handleFavicon`) serves the embedded SVG with `Content-Type: image/svg+xml` + a 1-day cache header, so the legacy path no longer falls through to Shlink. Registered unconditionally (independent of the admin feature). - New route test `TestFaviconServedByApp` (200 + `image/svg+xml` + SVG body). Matches your note: Traefik already routes `/favicon.ico` to the app on both domains, so no Traefik change needed — the app now answers it. build / vet / test green. Commit: https://mgit.msbls.de/m/postcards/commit/3ae968445befd70116929bf5f2ed1adbfab8bd2f
Author
Collaborator
## ✅ Live — merged `3ae9684` (merge `9a8eda4`), deployed. Own 💌 favicon: /favicon.ico + /static/favicon.svg now served by the app (200 image/svg+xml, no longer Shlink's), link tags in all templates. Traefik /favicon.ico already routed to the app. Not closing — m closes.
mAi closed this issue 2026-06-23 15:48:03 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/postcards#17
No description provided.