Revert "feat: replace Web Push with ntfy for medication reminders"

This reverts commit 1cada42370.
This commit is contained in:
Frank Schwenk
2026-07-08 08:25:34 +02:00
parent 1cada42370
commit bff14167c9
17 changed files with 323 additions and 251 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
"""Generate VAPID key pair for Web Push. Run: python tools/gen_vapid.py"""
from __future__ import annotations
from py_vapid import Vapid
def main() -> None:
vapid = Vapid()
vapid.generate_keys()
private = vapid.private_pem.decode().strip()
public = vapid.public_key.decode().strip() if hasattr(vapid.public_key, "decode") else str(vapid.public_key)
print("Add these to your .env:\n")
print(f"VAPID_PRIVATE_KEY={private}")
print(f"VAPID_PUBLIC_KEY={public}")
if __name__ == "__main__":
main()
+8
View File
@@ -10,6 +10,14 @@ CREATE TABLE IF NOT EXISTS intake_log (
CREATE INDEX IF NOT EXISTS idx_intake_day ON intake_log(day);
CREATE INDEX IF NOT EXISTS idx_intake_slot_day ON intake_log(slot_id, day);
CREATE TABLE IF NOT EXISTS push_subscription (
id INTEGER PRIMARY KEY AUTOINCREMENT,
endpoint TEXT UNIQUE NOT NULL,
p256dh TEXT NOT NULL,
auth TEXT NOT NULL,
created_at TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS ai_cache (
key TEXT PRIMARY KEY,
content TEXT NOT NULL,