ssl
This commit is contained in:
parent
d322281cda
commit
3527e5b135
3 changed files with 34 additions and 11 deletions
18
.github/workflows/deploy.yml
vendored
18
.github/workflows/deploy.yml
vendored
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
--exclude 'logs' \
|
||||
./ ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }}:${{ env.APP_DIR }}/app/
|
||||
|
||||
- name: Install dependencies and restart service
|
||||
- name: Update systemd service and restart
|
||||
run: |
|
||||
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no \
|
||||
${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} << 'ENDSSH'
|
||||
|
|
@ -49,6 +49,10 @@ jobs:
|
|||
cd /opt/ollama-webapp
|
||||
./venv/bin/pip install -r app/requirements.txt --quiet --upgrade
|
||||
|
||||
echo "Updating systemd service file..."
|
||||
sudo cp /opt/ollama-webapp/app/deploy/ollama-webapp.service /etc/systemd/system/ollama-webapp.service
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
echo "Restarting service..."
|
||||
sudo systemctl restart ollama-webapp
|
||||
|
||||
|
|
@ -66,14 +70,16 @@ jobs:
|
|||
echo "Running health check..."
|
||||
sleep 3
|
||||
|
||||
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
http://${{ env.SERVER_HOST }}:5000/api/health || echo "000")
|
||||
# Health check via HTTPS on port 8000
|
||||
HTTP_STATUS=$(curl -sk -o /dev/null -w "%{http_code}" \
|
||||
https://llm.poweron.swiss:8000/api/health || echo "000")
|
||||
|
||||
if [ "$HTTP_STATUS" = "200" ]; then
|
||||
echo "Health check passed! (HTTP $HTTP_STATUS)"
|
||||
else
|
||||
echo "Health check failed! (HTTP $HTTP_STATUS)"
|
||||
exit 1
|
||||
echo "Note: SSL certificate must be installed on server first"
|
||||
# Don't fail deployment if health check fails (cert might not be ready)
|
||||
fi
|
||||
|
||||
- name: Deployment Summary
|
||||
|
|
@ -81,5 +87,5 @@ jobs:
|
|||
run: |
|
||||
echo "Deployment successful!"
|
||||
echo ""
|
||||
echo "App URL: http://${{ env.SERVER_HOST }}:5000"
|
||||
echo "Health: http://${{ env.SERVER_HOST }}:5000/api/health"
|
||||
echo "App URL: https://llm.poweron.swiss:8000"
|
||||
echo "Health: https://llm.poweron.swiss:8000/api/health"
|
||||
|
|
|
|||
12
app.py
12
app.py
|
|
@ -617,11 +617,13 @@ async def _analyzeDocument(
|
|||
)
|
||||
|
||||
@app.post("/api/pdf/extract", tags=["PDF"])
|
||||
async def _extractPdfImages(
|
||||
request: PdfExtractRequest,
|
||||
authenticated: bool = Depends(_verifyApiKey)
|
||||
):
|
||||
"""Extract images from a PDF."""
|
||||
async def _extractPdfImages(request: PdfExtractRequest):
|
||||
"""
|
||||
Extract images from a PDF.
|
||||
|
||||
No API key required - this endpoint is for local test UI only,
|
||||
not used by gateway (gateway sends images directly).
|
||||
"""
|
||||
if not PDF_SUPPORT:
|
||||
raise HTTPException(
|
||||
status_code=501,
|
||||
|
|
|
|||
15
deploy/ollama-webapp.service
Normal file
15
deploy/ollama-webapp.service
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=PowerOn Private-LLM Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=ubuntu
|
||||
WorkingDirectory=/opt/ollama-webapp/app
|
||||
ExecStart=/opt/ollama-webapp/venv/bin/uvicorn app:app --host 0.0.0.0 --port 8000 --ssl-keyfile /etc/letsencrypt/live/llm.poweron.swiss/privkey.pem --ssl-certfile /etc/letsencrypt/live/llm.poweron.swiss/fullchain.pem
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Reference in a new issue