mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-07 17:23:05 +02:00
Add web push
This commit is contained in:
+10
@@ -67,6 +67,7 @@ from app.routers import (
|
||||
health,
|
||||
messages,
|
||||
packets,
|
||||
push,
|
||||
radio,
|
||||
read_state,
|
||||
repeaters,
|
||||
@@ -102,6 +103,14 @@ async def lifespan(app: FastAPI):
|
||||
await db.connect()
|
||||
logger.info("Database connected")
|
||||
|
||||
# Initialize VAPID keys for Web Push (generates on first run)
|
||||
from app.push.vapid import ensure_vapid_keys
|
||||
|
||||
try:
|
||||
await ensure_vapid_keys()
|
||||
except Exception:
|
||||
logger.warning("Failed to initialize VAPID keys for Web Push", exc_info=True)
|
||||
|
||||
# Ensure default channels exist in the database even before the radio
|
||||
# connects. Without this, a fresh or disconnected instance would return
|
||||
# zero channels from GET /channels until the first successful radio sync.
|
||||
@@ -185,6 +194,7 @@ app.include_router(packets.router, prefix="/api")
|
||||
app.include_router(read_state.router, prefix="/api")
|
||||
app.include_router(settings.router, prefix="/api")
|
||||
app.include_router(statistics.router, prefix="/api")
|
||||
app.include_router(push.router, prefix="/api")
|
||||
app.include_router(ws.router, prefix="/api")
|
||||
|
||||
# Serve frontend static files in production
|
||||
|
||||
Reference in New Issue
Block a user