feat: homelab deployment - NPM + IONOS DNS + monitoring + NAS backup
- Restructured docker-compose for Nginx Proxy Manager (no custom nginx) - Added domain wordly.art configuration - Added Prometheus + Grafana monitoring stack with pre-configured dashboards - Added PostgreSQL backup script to NAS (daily/weekly/monthly rotation) - Added alert rules for backend, system, and Docker metrics - Updated deployment guide for NPM + IONOS DNS homelab setup - Added marketing plan document - PDF translator and watermark support - Enhanced middleware, routes, and translator modules Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,13 +7,14 @@ Story 3.5: API Versioning
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from typing import Optional, Any
|
||||
|
||||
from fastapi import APIRouter, File, Form, UploadFile, HTTPException, Request
|
||||
from fastapi import APIRouter, File, Form, UploadFile, HTTPException, Request, Depends
|
||||
from fastapi.responses import FileResponse, JSONResponse
|
||||
|
||||
from config import config
|
||||
from utils import file_handler
|
||||
from middleware.api_key_auth import get_authenticated_user
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -249,6 +250,7 @@ async def translate_batch_documents(
|
||||
),
|
||||
target_language: str = Form(..., description="Target language code"),
|
||||
source_language: str = Form(default="auto", description="Source language code"),
|
||||
current_user: Optional[Any] = Depends(get_authenticated_user),
|
||||
):
|
||||
"""Translate multiple documents in batch"""
|
||||
from translators import excel_translator, word_translator, pptx_translator
|
||||
@@ -354,6 +356,7 @@ async def cleanup_translated_file(filename: str):
|
||||
@router.post("/extract-texts")
|
||||
async def extract_texts_from_document(
|
||||
file: UploadFile = File(..., description="Document file to extract texts from"),
|
||||
current_user: Optional[Any] = Depends(get_authenticated_user),
|
||||
):
|
||||
"""Extract all translatable texts from a document for client-side translation"""
|
||||
import uuid
|
||||
@@ -470,7 +473,7 @@ async def reconstruct_document(
|
||||
translations: str = Form(
|
||||
..., description="JSON array of {id, translated_text} objects"
|
||||
),
|
||||
target_language: str = Form(..., description="Target language code"),
|
||||
current_user: Optional[Any] = Depends(get_authenticated_user),
|
||||
):
|
||||
"""Reconstruct a document with translated texts. session_id must be a valid UUID."""
|
||||
import json
|
||||
@@ -625,7 +628,9 @@ async def configure_ollama(base_url: str = Form(...), model: str = Form(...)):
|
||||
|
||||
|
||||
@router.get("/metrics")
|
||||
async def get_metrics():
|
||||
async def get_metrics(
|
||||
current_user: Optional[Any] = Depends(get_authenticated_user),
|
||||
):
|
||||
"""Get system metrics and statistics for monitoring"""
|
||||
from middleware.cleanup import create_cleanup_manager
|
||||
from middleware.rate_limiting import RateLimitManager, RateLimitConfig
|
||||
|
||||
Reference in New Issue
Block a user