diff --git a/deploy.ps1 b/deploy.ps1 new file mode 100644 index 0000000..783b399 --- /dev/null +++ b/deploy.ps1 @@ -0,0 +1,27 @@ +# ReSekai Deploy Script +# Usage: .\deploy.ps1 + +$SERVER = "root@46.225.108.69" +$PROJECT_PATH = "/var/www/resekai/ReSekai" + +Write-Host "Deploying ReSekai to production..." -ForegroundColor Cyan + +# Build locally first +Write-Host "`nBuilding frontend..." -ForegroundColor Yellow +npm run build +if ($LASTEXITCODE -ne 0) { + Write-Host "Build failed!" -ForegroundColor Red + exit 1 +} + +# Deploy to server +Write-Host "`nDeploying to server..." -ForegroundColor Yellow +$CMD = "cd $PROJECT_PATH && git pull && npm run build && cd server && npm install && pm2 restart resekai-api" +ssh $SERVER $CMD + +if ($LASTEXITCODE -eq 0) { + Write-Host "`nDeployment successful!" -ForegroundColor Green +} else { + Write-Host "`nDeployment failed!" -ForegroundColor Red + exit 1 +} diff --git a/server/index.js b/server/index.js index 5c8fff2..dae8c48 100644 --- a/server/index.js +++ b/server/index.js @@ -1207,7 +1207,7 @@ app.post("/api/deepseek/chat", requireAuth, async (req, res) => { return res.status(500).json({ error: "DeepSeek API key not configured" }); } - const { temperature = 0.8, max_tokens = 1000 } = req.body; + const { messages, temperature = 0.8, max_tokens = 1000 } = req.body; const sanitizedMessages = sanitizeDeepSeekMessages(messages); const clampedMaxTokens = Math.min( max_tokens, @@ -1268,7 +1268,7 @@ app.post("/api/deepseek/chat/stream", requireAuth, async (req, res) => { return res.status(500).json({ error: "DeepSeek API key not configured" }); } - const { temperature = 0.8, max_tokens = 1000 } = req.body; + const { messages, temperature = 0.8, max_tokens = 1000 } = req.body; const sanitizedMessages = sanitizeDeepSeekMessages(messages); const clampedMaxTokens = Math.min( max_tokens,