feat: wire brain service to platform gateway
- Gateway proxies /api/brain/* to brain-api:8200/api/* via pangolin network - User identity injected via X-Gateway-User-Id header - Brain app registered in gateway database (sort_order 9) - Added to GATEWAY_KEY_SERVICES for dashboard integration - Tested: health, config, list, create all working through gateway 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, SHELFMARK_URL, SPOTIZERR_URL, BUDGET_URL, TASKS_URL,
|
||||
MINIFLUX_URL, SHELFMARK_URL, SPOTIZERR_URL, BUDGET_URL, TASKS_URL, BRAIN_URL,
|
||||
)
|
||||
|
||||
|
||||
@@ -129,6 +129,13 @@ def init_db():
|
||||
conn.commit()
|
||||
print("[Gateway] Added tasks app")
|
||||
|
||||
# Ensure brain app exists
|
||||
brain = c.execute("SELECT id FROM apps WHERE id = 'brain'").fetchone()
|
||||
if not brain:
|
||||
c.execute("INSERT INTO apps VALUES ('brain', 'Brain', 'brain', '/brain', ?, 9, 1, NULL)", (BRAIN_URL,))
|
||||
conn.commit()
|
||||
print("[Gateway] Added brain app")
|
||||
|
||||
# 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