[FEAT] Push notification integration into core (#1393)

* push notification integration into core

added missing component

fixed bell working on all pages
- made pubkey global template env var
- had to move `get_push_notification_pubkey` to `helpers.py` because of circular reference with `tasks.py`

formay

trying to fix mypy

added py-vapid to requirements

Trying to fix stub mypy issue

* removed key files

* webpush key pair is saved in db `webpush_settings`

* removed lnaddress extension changes

* support for multi user account subscriptions, subscriptions are stored user based

fixed syntax error

fixed syntax error

removed unused line

* fixed subscribed user storage with local storage, no get request required

* method is singular now

* cleanup unsubscribed or expired push subscriptions

fixed flake8 errors

fixed poetry errors

* updating to latest lnbits

formatting, rebase error

fix

* remove unused?

* revert

* relock

* remove

* do not create settings table use adminsettings

mypy

fix

* cleanup old code

* catch case when client tries to recreate existing webpush subscription e.g. on cleared local storage

* show notification bell on user related pages only

* use local storage with one key like array, some refactoring

* fixed crud import

* fixed too long line

* removed unused imports

* ruff

* make webpush editable

* fixed privkey encoding

* fix ruff

* fix migration

---------

Co-authored-by: schneimi <admin@schneimi.de>
Co-authored-by: schneimi <dev@schneimi.de>
Co-authored-by: dni  <office@dnilabs.com>
This commit is contained in:
schneimi 2023-09-11 15:48:49 +02:00 committed by GitHub
parent 8f0c1f6a80
commit fb98576431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 571 additions and 21 deletions

45
poetry.lock generated
View file

@ -703,6 +703,19 @@ files = [
{file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"},
]
[[package]]
name = "http-ece"
version = "1.1.0"
description = "Encrypted Content Encoding for HTTP"
optional = false
python-versions = "*"
files = [
{file = "http_ece-1.1.0.tar.gz", hash = "sha256:932ebc2fa7c216954c320a188ae9c1f04d01e67bec9cdce1bfbc912813b0b4f8"},
]
[package.dependencies]
cryptography = ">=2.5"
[[package]]
name = "httpcore"
version = "0.15.0"
@ -1329,6 +1342,19 @@ files = [
{file = "psycopg2_binary-2.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:b4d7679a08fea64573c969f6994a2631908bb2c0e69a7235648642f3d2e39a68"},
]
[[package]]
name = "py-vapid"
version = "1.9.0"
description = "Simple VAPID header generation library"
optional = false
python-versions = "*"
files = [
{file = "py-vapid-1.9.0.tar.gz", hash = "sha256:0664ab7899742ef2b287397a4d461ef691ed0cc2f587205128d8cf617ffdb919"},
]
[package.dependencies]
cryptography = ">=2.5"
[[package]]
name = "pycparser"
version = "2.21"
@ -1615,6 +1641,23 @@ files = [
[package.extras]
cli = ["click (>=5.0)"]
[[package]]
name = "pywebpush"
version = "1.14.0"
description = "WebPush publication library"
optional = false
python-versions = "*"
files = [
{file = "pywebpush-1.14.0.tar.gz", hash = "sha256:6c36e1679268219e693ba940db2bf254c240ca02664de102b7269afc3c545731"},
]
[package.dependencies]
cryptography = ">=2.6.1"
http-ece = ">=1.1.0"
py-vapid = ">=1.7.0"
requests = ">=2.21.0"
six = ">=1.15.0"
[[package]]
name = "pyyaml"
version = "6.0.1"
@ -2272,4 +2315,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools"
[metadata]
lock-version = "2.0"
python-versions = "^3.10 | ^3.9"
content-hash = "3b1b73b1df182fae17e692b1ebd6d35a8791ca62df3ece145b05ae7f4465ae16"
content-hash = "d294784e932335e91b4d096f406664b1240d2e20a7820060524bd6ef651d30ec"