Docs / Hosting OwnBase

Notifications while the browser is closed

Someone using OwnBase in a browser can turn on Account settings → Notifications → Notify me when OwnBase is closed. Their browser then gets a notification for any message that would have notified them in the app, and for reminders that come due, with every tab closed. It works on desktop browsers and Android. On an iPhone or iPad it works only after Share → Add to Home Screen, opened from the home screen. The desktop app notifies on its own and does not use this.

What it needs:

  • HTTPS. A browser runs the service worker that receives pushes only on an https:// address or on localhost. A workspace opened at http://192.168.x.x cannot use it, and the switch says so. A workspace hosted from the desktop app works too when its public address is HTTPS, such as a Cloudflare Tunnel's.
  • Outbound HTTPS to the browsers' push services. The server sends each push to the service the person's browser chose, such as fcm.googleapis.com (Chrome, Edge on Android), updates.push.services.mozilla.com (Firefox), wns2-*.notify.windows.com (Edge on Windows) or web.push.apple.com (Safari). A firewall that blocks them stops pushes and nothing else.

What the server sends: a payload encrypted for that one browser (RFC 8291), so the push service passes it on without being able to read it, signed with a key pair the server makes on first use and keeps with the workspace's settings (RFC 8292). The payload holds the notification's title and words and the ids of the conversation and message a click opens. A device set to show nothing about messages under What notifications show gets only "New message". Each push also names a contact for the push services, https://ownbase.site unless --push-contact (or OWNBASE_PUSH_CONTACT) gives a mailto: or https: address of your own.

Who is pushed to: the same rule the app notifies by (mentions, direct messages, each conversation's level, muted conversations and threads, Do Not Disturb), and only people with no connection open, since an open app notifies by itself. A subscription belongs to one sign-in, so signing out, ending that session from Devices, changing the password or deactivating the account removes it. A browser that unsubscribed is forgotten when its push service answers 404 or 410.

Limits: one message pushes to at most 250 people; one person gets at most one push per conversation every 5 seconds; at most 2,000 pushes wait to go, and past that the oldest are dropped; 16 go at once, each with 10 seconds to answer. A push service that answers 429 or 5xx is tried three more times, waiting 2, 8 and 32 seconds (or longer when it says so), and then given up. A push service on a private or loopback address is refused when the browser subscribes, unless --allow-private-hooks is set. The metrics count pushes sent, failed and dropped (see Metrics for Prometheus). An isolated copy of a workspace pushes to nobody.

This page is made from docs/DEPLOYMENT.md.