Super simple and small Web Push and Notification service
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

29 lignes
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 > $@