From b4e2f97dba3a4bcf7a992f5cf3fb149acd898855 Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 2 Jul 2026 15:40:18 -0400 Subject: [PATCH] docs: push notification setup in README, fix VAPID_SUBJECT example - .env.example: VAPID_SUBJECT without mailto: prefix (library adds it) - README: VAPID env vars in table, push notification setup section - README: add dm/ to project structure, keygen instructions - README: iOS tap-gesture requirement and Android battery optimization notes --- .env.example | 2 +- README.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index dc593f8..6776e83 100644 --- a/.env.example +++ b/.env.example @@ -20,6 +20,6 @@ LIVEKIT_API_SECRET= VAPID_PRIVATE_KEY= -VAPID_SUBJECT=mailto:admin@your.domain +VAPID_SUBJECT=admin@your.domain # Integrations GIPHY_API_KEY=your_giphy_api_key_here diff --git a/README.md b/README.md index 27470c4..902ab08 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ dumpsterChat/ │ ├── invite/ # Server invite links │ ├── bot/ # Bot framework, auth, commands │ ├── webhook/ # Incoming webhooks +│ ├── dm/ # Direct messages (conversations) │ ├── push/ # Push notification sender (VAPID) │ ├── permissions/ # Permission bitflags and checker │ ├── moderation/ # Mute, ban, kick, slowmode, audit log @@ -133,6 +134,21 @@ See `.env.example` for the full list. Key variables: | `LIVEKIT_*` | Voice/video server | No | | `GIPHY_API_KEY` | Giphy API key for GIF search | No | | `MINIO_*` | File upload storage | No | +| `VAPID_PUBLIC_KEY` | Web push public key | No (generate with `go run ./cmd/keygen`) | +| `VAPID_PRIVATE_KEY` | Web push private key | No | +| `VAPID_SUBJECT` | Contact for VAPID JWT (e.g. `admin@your.domain`) | No | + +### Push Notifications + +Web push uses VAPID keys. Generate a keypair: + +```bash +go run ./cmd/keygen +``` + +Copy the output into your `.env`. Set `VAPID_SUBJECT` to your email address **without** the `mailto:` prefix (the library adds it automatically). + +Users are prompted to enable notifications on login. On iOS, the prompt requires a tap gesture, so a banner appears instead of a silent auto-subscribe. On Android, notifications deliver through FCM when Chrome is running (even in background). Ensure Chrome battery optimization is set to Unrestricted for reliable delivery when the PWA is closed. ## Wiki