feat: wire media service into gateway — proxy, auth, app registration
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import bcrypt
|
||||
|
||||
from config import (
|
||||
DB_PATH, TRIPS_URL, FITNESS_URL, INVENTORY_URL,
|
||||
MINIFLUX_URL, READER_URL, SHELFMARK_URL, SPOTIZERR_URL, BUDGET_URL, TASKS_URL, BRAIN_URL,
|
||||
MINIFLUX_URL, READER_URL, SHELFMARK_URL, SPOTIZERR_URL, BUDGET_URL, TASKS_URL, BRAIN_URL, MEDIA_URL,
|
||||
)
|
||||
|
||||
|
||||
@@ -140,6 +140,16 @@ def init_db():
|
||||
conn.commit()
|
||||
print("[Gateway] Added brain app")
|
||||
|
||||
# Ensure media/podcast app exists
|
||||
media = c.execute("SELECT id FROM apps WHERE id = 'media'").fetchone()
|
||||
if not media:
|
||||
c.execute("INSERT INTO apps VALUES ('media', 'Media', 'headphones', '/media', ?, 10, 1, NULL)", (MEDIA_URL,))
|
||||
conn.commit()
|
||||
print("[Gateway] Added media app")
|
||||
else:
|
||||
c.execute("UPDATE apps SET proxy_target = ? WHERE id = 'media'", (MEDIA_URL,))
|
||||
conn.commit()
|
||||
|
||||
# Seed admin user from env vars if no users exist
|
||||
import os
|
||||
user_count = c.execute("SELECT COUNT(*) FROM users").fetchone()[0]
|
||||
|
||||
Reference in New Issue
Block a user