Super simple and small Web Push and Notification service
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

29 Zeilen
984 B

  1. PYTHON=python3
  2. .PHONY: run
  3. run: templates/S2_perm_sw.html templates/S4_server.py venv static/i-ico.png
  4. ($(VENVACT) && python templates/S4_server.py )
  5. VENVACT=. ./venv/bin/activate
  6. venv:
  7. $(PYTHON) -m venv venv && ( $(VENVACT) && pip install flask ecdsa pywebpush) || rm -rf venv
  8. # python S1_vapid.py
  9. templates/S2_perm_sw.html: src/S2_perm_sw.html keys/public_key.txt
  10. mkdir -p templates
  11. sed -e 's/YOUR-PUBLIC-KEY/'"$$(cat keys/public_key.txt)"'/' < src/S2_perm_sw.html > templates/S2_perm_sw.html
  12. templates/S4_server.py: src/S4_server.py keys/private_key.txt
  13. if [ -z "$(EMAIL)" ]; then echo Must specify EMAIL.; exit 1; fi
  14. mkdir -p templates
  15. 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
  16. # XXX - HOST_* and VAPID_SUBJECT
  17. keys/public_key.txt keys/private_key.txt: venv S1_vapid.py
  18. ( $(VENVACT) && python S1_vapid.py )
  19. static/i-ico.png:
  20. echo P6 1 1 255 255 0 0 | pnmtopng > $@