mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 21:00:42 -07:00
Connects the desktop app to Voicebox Cloud without the user ever handling an API key. One button in Settings → General opens the system browser to voicebox.sh, the user authorizes while signed in, and the credential lands back in the app automatically. Backend (FastAPI): - /cloud/login/start opens the browser to the cloud authorize page with a state we mint; the existing loopback server catches the redirect at /cloud/callback and exchanges the one-time code (server-to-server, over TLS) for a voicebox_ API key, verifies it against the API, and stores it. - /cloud/status and /cloud/disconnect back the settings UI. - state round-trip guards against login-CSRF; the key never crosses a browser URL and is never exposed to the frontend (status returns a prefix only). - CloudSettings singleton row; config gains VOICEBOX_CLOUD_URL / VOICEBOX_CLOUD_API_URL (default the prod hosts, overridable for dev). Frontend (React): - CloudSection in Settings → General: "Log in with browser", polls status, shows the connected device + a dashboard link. API keys are the advanced path only, surfaced in the web dashboard. The key is stored in the local app DB for now; OS keychain is a marked follow-up.
55 lines
1.1 KiB
Python
55 lines
1.1 KiB
Python
"""Database package — ORM models, session management, and migrations.
|
|
|
|
Re-exports all public symbols so that ``from .database import get_db``
|
|
and ``from .database import Generation as DBGeneration`` continue to work
|
|
without changing any importers.
|
|
"""
|
|
|
|
from .models import (
|
|
Base,
|
|
AudioChannel,
|
|
Capture,
|
|
CaptureSettings,
|
|
ChannelDeviceMapping,
|
|
CloudSettings,
|
|
EffectPreset,
|
|
Generation,
|
|
GenerationSettings,
|
|
GenerationVersion,
|
|
MCPClientBinding,
|
|
ProfileChannelMapping,
|
|
ProfileSample,
|
|
Project,
|
|
Story,
|
|
StoryItem,
|
|
VoiceProfile,
|
|
)
|
|
from .session import engine, SessionLocal, _db_path, init_db, get_db
|
|
|
|
__all__ = [
|
|
# Models
|
|
"Base",
|
|
"AudioChannel",
|
|
"Capture",
|
|
"CaptureSettings",
|
|
"ChannelDeviceMapping",
|
|
"CloudSettings",
|
|
"EffectPreset",
|
|
"Generation",
|
|
"GenerationSettings",
|
|
"GenerationVersion",
|
|
"MCPClientBinding",
|
|
"ProfileChannelMapping",
|
|
"ProfileSample",
|
|
"Project",
|
|
"Story",
|
|
"StoryItem",
|
|
"VoiceProfile",
|
|
# Session
|
|
"engine",
|
|
"SessionLocal",
|
|
"_db_path",
|
|
"init_db",
|
|
"get_db",
|
|
]
|