PWA & Web Push¶
Prerequisites¶
- Trusted HTTPS + stable
PIHERDER_PUBLIC_URL. - Web service running (VAPID auto-generated on startup).
VAPID (default)¶
On web startup PiHerder auto-generates a VAPID key pair once and stores it in Postgres (pushvapidconfig). Private key is Fernet-encrypted with PIHERDER_MASTER_KEY. No script required for normal use.
Logs: Web Push VAPID ready (source=generated) (or source=env if overriding).
Do not rotate keys casually
Changing the VAPID private key invalidates every device subscription; users must re-enable push.
Optional env pin¶
# Only if you intentionally pin keys after DB wipe
# VAPID_PUBLIC_KEY=...
# VAPID_PRIVATE_KEY=...
# VAPID_CONTACT=mailto:admin@yourdomain.com
Enable on a device¶
Android (Chrome)¶
- Install PWA if prompted.
- Account → Push notifications → Enable on this device.
- Send test notification (your devices only).
- Toggle event types and save.
iPhone / iPad (iOS 16.4+)¶
- Safari → Share → Add to Home Screen.
- Open the Home Screen icon (not a plain Safari tab).
- Account → Enable on this device.
Push does not work from a plain Safari tab.
When push fires¶
Only when a new open in-app notification is created (not on every fingerprint refresh).
In-app notifications without push¶
The bell inbox still works if VAPID is unavailable.