huly-selfhost
huly-selfhost copied to clipboard
How to set up web push notifications?
The documentation for correctly setting up push notifications is sadly lacking or just incorrect. I tried everything and have managed to set up huly fully except for push notifications. I added my keys to mail container and there is no ses container or even mention of one in the repo itself.
Try placing it in services:front:environment instead. Yes, it seems to have been updated incorrectly.
Do you use Huly desktop application? The push notifications there don't work and in Network tab I see serviceWorker.js 404 Not found. All latest 0.6.4xx and 0.6.5xx versions. Do you guys have different situation?
Try placing it in
services:front:environmentinstead. Yes, it seems to have been updated incorrectly.
I'm getting crazy, this is non-sense :
-
https://github.com/hcengineering/huly-selfhost/blob/main/MIGRATION.md#v06424 -> They moved the push variables to ses, but...
-
https://github.com/hcengineering/huly-selfhost/blob/main/MIGRATION.md#v06471 -> Then they made us migrate mail from ses to dedicated mail microservice -> But the doc is still referencing http://ses:3335 as web push url, what does it mean ? -> Do I need to have an AWS SES service up and running (variables are needed for ses service to start) ? -> Then why is the ses service not documented anymore ? Is it not needed anymore ? -> Then why is @hcengineering still pushing 0.6.471+ versions of ses docker images on public registry ??? -> This has no mean...
Try placing it in
services:front:environmentinstead. Yes, it seems to have been updated incorrectly.I'm getting crazy, this is non-sense :
- https://github.com/hcengineering/huly-selfhost/blob/main/MIGRATION.md#v06424 -> They moved the push variables to ses, but...
- https://github.com/hcengineering/huly-selfhost/blob/main/MIGRATION.md#v06471 -> Then they made us migrate mail from ses to dedicated mail microservice -> But the doc is still referencing http://ses:3335 as web push url, what does it mean ? -> Do I need to have an AWS SES service up and running (variables are needed for ses service to start) ? -> Then why is the ses service not documented anymore ? Is it not needed anymore ? -> Then why is @hcengineering still pushing 0.6.471+ versions of ses docker images on public registry ??? -> This has no mean...
OKaaaaaaaaaaaaaaaay...
So you NEED ses service for push notif to work (cf migration guide) :
ses:
image: hardcoreeng/ses:${HULY_VERSION}
environment:
- PORT=3335
- [email protected]
- ACCESS_KEY=none
- SECRET_KEY=none
- PUSH_PUBLIC_KEY=${PUSH_PUBLIC_KEY}
- PUSH_PRIVATE_KEY=${PUSH_PRIVATE_KEY}
restart: unless-stopped
And you need SOURCE, ACCESS_KEY, SECRET_KEY set up even though you don't need SES features...
Please maintainers, decouple push notification features from SES service and fix the documentation until it's done properly !
We have moved web push notifications into notification service in 0.7.x and removed SES service. So there are the following in 0.7.x:
- Mail service that can be configured to send emails using SMTP or SES
- Notification service that is responsible for sending web push notifications
- The SES service has been removed
We are also planning to update the 0.6.x version and fix corresponding documentation.
Hey.
I was having trouble with notifications (still) in 0.6.502 : notif were not comming actually. Figured out PUSH_PUBLIC_KEY must also be provided to the front service, otherwise, it throws error in the JS console because the publiKey is an empty string when setting up push notif.
As a matter of fact, I did figure out because I investigated and tried to revoke browser autorization + disable/reactivate the push settings (Profile > Settings > Notifications > General > Push). That's where I'd find the console error.
@ArtyomSavchenko for 0.6.x, doc might get updated again to add this detail. Cheers !
PS: though I didn't confirm yet with my co-worker that it's working now. I'll be posting here once it's done.
based on @wafelmolt's comment
Step 1: Configure the Transactor Service Add WEB_PUSH_URL to transactor container:
transactor:
...
environment:
- WEB_PUSH_URL=http://ses:3335
...
Step 2: Configure the SES Service Add the ses container to your docker-compose.yaml file with the generated VAPID keys:
ses:
image: hardcoreeng/ses:v0.6.501
environment:
- PORT=3335
- [email protected]
- ACCESS_KEY=none
- SECRET_KEY=none
- PUSH_PUBLIC_KEY=${PUSH_PUBLIC_KEY}
- PUSH_PRIVATE_KEY=${PUSH_PRIVATE_KEY}
restart: unless-stopped
Step 3: Configure the Front Service Add PUSH_PUBLIC_KEY in front container
front:
...
environment:
...
- PUSH_PUBLIC_KEY=${PUSH_PUBLIC_KEY}
...
After this setup, notification permission must be granted manually in the browser. Notifications worked with this configuration.
Actually, I wonder if the public key is necessary on back side (SES).
Btw, I opened a PR(#169 ) for README update