feat: wire media service into gateway — proxy, auth, app registration
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 3s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 06:04:28 -05:00
parent 69af4b84a5
commit c3caa4bb1c
4 changed files with 17 additions and 2 deletions

View File

@@ -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]