Patch Paperclip backend to respect OPENAI_BASE_URL during connection validation

This commit is contained in:
Jannik committed 2026-10-01 18:58:44 +02:00
1 parent 4d64e09cd6
commit c1ebd84e11
1 file changed
+6
+6
View File
@@ -453,6 +453,12 @@ main() {
docker image prune -af 2>/dev/null || true
if [[ " ${ACTIVE_SERVICES[*]} " =~ " paperclip " ]]; then
# Patch the validation endpoint in the backend to respect OPENAI_BASE_URL
# This prevents the UI from rejecting OpenRouter/Mistral API keys during Onboarding!
log "Patching LLM validation endpoint in Paperclip container..."
docker exec -u root paperclip_app sed -i 's|"https://api.openai.com/v1/models"|process.env.OPENAI_BASE_URL ? process.env.OPENAI_BASE_URL + "/models" : "https://api.openai.com/v1/models"|g' /app/server/dist/routes/ai-connections.js || true
docker restart paperclip_app
log "Waiting for Paperclip to initialize (10s)..."
sleep 10
log "========================================================="