Feat: Add push provider for webpush#1606
Feat: Add push provider for webpush#1606p1gp1g wants to merge 19 commits intosimplex-chat:stablefrom
Conversation
Once ntf servers will be able to send webpush requests they won't be tight to an application developer like for iOS where ntf servers have to know a secret. They will all have their own VAPID key. So it will be possible for users to choose what servers they want to use.
Only ntf servers uses extras, and they aren't passed with smp encoded strings. smpEncoding was breaking connections to SMP servers
| , filepath ==1.4.* | ||
| , hourglass ==0.2.* | ||
| , http-client ==0.7.* | ||
| , http-client-tls ==0.3.6.* |
There was a problem hiding this comment.
What existing UnifiedPush servers implementations do and do not support HTTP/2?
It looks like most of them do?
We don't have to comply with RFC8030 if most servers support HTTP/2.
In any case, we should move these dependencies to another section to not be included in client build.
There was a problem hiding this comment.
This may happen with many self-hosted services, for instance with Nextcloud servers, and it's better to comply with the RFC.
Maybe http2 can be tested once per device token, and if it doesn't we use http1 as a fallback ? But that can be done in a second step
There was a problem hiding this comment.
that's ok, and not a point of contention - I just didn't want yet another dependency. But not a big deal - if it's important, we would simply exclude it from the client build as I wrote
|
I've split in 3 PR at this moment: TODO: |
This pull request adds webpush support to the ntf server.
The implementation requires a VAPID key (RFC8292) to add an authentication layer to webpush. And because FCM accepts webpush requests authenticated with VAPID, it allows the feature to be used for Android with the Play Services (cf. PR on simplex-chat).
Web push requests are encrypted following RFC8291.
For this, it:
This PR is already long enough, but as a 2nd step, this can be improved by:
IPAddressDeny=":: ::1 ::ffff:0:0/96 2001:2::/48 2001:db8::/32 3fff::/20 fc00::/7 fe80::/10 0.0.0.0 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 100.64.0.0/10 127.0.0.0/8 169.254.0.0/16 192.0.2.0/24 198.51.100.0/24 203.0.113.0/24 198.18.0.0/15 240.0.0.0/4 255.255.255.255"PS: There might be non-idiomic syntaxes, this is the first time I do things in haskell
PPS: If you want/need, you can contact me on SX, I'll share a contact address 👍