FastAPI + SQLAlchemy/Alembic + MariaDB backend with Jinja2/htmx/Alpine server-rendered frontend. Multi-user via Google OAuth, daily habit tracking, monthly/weekly history views, Web Push reminders via APScheduler, and PWA support (manifest, service worker, offline caching). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
20 lines
702 B
Python
20 lines
702 B
Python
"""Web Push용 VAPID 키쌍을 생성합니다. 출력값을 .env의 VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY에 붙여넣으세요.
|
|
|
|
사용법: python scripts/generate_vapid_keys.py
|
|
"""
|
|
|
|
from cryptography.hazmat.primitives import serialization
|
|
from py_vapid import Vapid02, b64urlencode
|
|
|
|
if __name__ == "__main__":
|
|
vapid = Vapid02()
|
|
vapid.generate_keys()
|
|
|
|
private_raw = vapid.private_key.private_numbers().private_value.to_bytes(32, "big")
|
|
public_raw = vapid.public_key.public_bytes(
|
|
serialization.Encoding.X962, serialization.PublicFormat.UncompressedPoint
|
|
)
|
|
|
|
print("VAPID_PUBLIC_KEY=" + b64urlencode(public_raw))
|
|
print("VAPID_PRIVATE_KEY=" + b64urlencode(private_raw))
|