Super simple and small Web Push and Notification service
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- PYTHON=python3
-
- .PHONY: run
- run: templates/S2_perm_sw.html templates/S4_server.py venv static/i-ico.png static/i-banner.png
- ($(VENVACT) && python templates/S4_server.py )
-
- VENVACT=. ./venv/bin/activate
-
- venv:
- $(PYTHON) -m venv venv && ( $(VENVACT) && pip install flask ecdsa pywebpush) || rm -rf venv
-
- # python S1_vapid.py
-
- templates/S2_perm_sw.html: src/S2_perm_sw.html keys/public_key.txt
- mkdir -p templates
- sed -e 's/YOUR-PUBLIC-KEY/'"$$(cat keys/public_key.txt)"'/' < src/S2_perm_sw.html > templates/S2_perm_sw.html
-
- templates/S4_server.py: src/S4_server.py keys/private_key.txt
- if [ -z "$(EMAIL)" ]; then echo Must specify EMAIL.; exit 1; fi
- mkdir -p templates
- sed -e 's/your@email.com/$(EMAIL)/' -e 's/YOUR-PRIVATE-KEY/'"$$(cat keys/private_key.txt)"'/' < src/S4_server.py > templates/S4_server.py
- # XXX - HOST_* and VAPID_SUBJECT
-
- keys/public_key.txt keys/private_key.txt: venv S1_vapid.py
- ( $(VENVACT) && python S1_vapid.py )
-
- static/i-ico.png:
- echo P6 1 1 255 255 0 0 | pnmtopng > $@
-
- static/i-banner.png:
- echo P6 1 1 255 0 0 255 | pnmtopng > $@
|