Add TTS proxy to fix CORS issues

- /api/tts proxies requests to Edge TTS and Kokoro
- Uses Docker container names for internal networking
- Removes URL config from settings (handled server-side)
- Fixes localStorage merge for new settings fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gemini Agent
2026-01-18 02:05:38 +00:00
parent f5de4749db
commit 611d57770e
3 changed files with 98 additions and 48 deletions

View File

@@ -269,50 +269,22 @@ export function SettingsPanel({
</section>
)}
{/* Edge TTS URL */}
{/* Edge TTS info */}
{ttsSettings.engine === "edge" && (
<section className="mb-8">
<h3 className="text-sm font-medium text-[var(--muted)] uppercase tracking-wide mb-4">
Edge TTS URL
</h3>
<input
type="text"
value={ttsSettings.edgeUrl}
onChange={(e) =>
onTTSSettingsChange({
...ttsSettings,
edgeUrl: e.target.value,
})
}
placeholder="http://localhost:5050"
className="w-full p-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]"
/>
<p className="text-xs text-[var(--muted)] mt-2">
Uses Microsoft neural voices. Fast and natural sounding.
<p className="text-sm text-[var(--muted)]">
Uses Microsoft neural voices via Edge TTS. Fast and natural sounding.
Requires the edge-tts Docker container running on the server.
</p>
</section>
)}
{/* Kokoro URL */}
{/* Kokoro info */}
{ttsSettings.engine === "kokoro" && (
<section className="mb-8">
<h3 className="text-sm font-medium text-[var(--muted)] uppercase tracking-wide mb-4">
Kokoro API URL
</h3>
<input
type="text"
value={ttsSettings.kokoroUrl}
onChange={(e) =>
onTTSSettingsChange({
...ttsSettings,
kokoroUrl: e.target.value,
})
}
placeholder="http://localhost:8880"
className="w-full p-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]"
/>
<p className="text-xs text-[var(--muted)] mt-2">
High quality but slower. Generates full audio before playing.
<p className="text-sm text-[var(--muted)]">
High quality local TTS. Slower as it generates full audio before playing.
Requires the kokoro Docker container running on the server.
</p>
</section>
)}