Session 2026-04-20: Medien-Konvertierung, Umami Analytics, Username/Privacy
- HEIC→JPEG, MOV/AVI→MP4 Konvertierung bei allen Upload-Endpoints (media_utils.py) - ffmpeg im Docker-Image, Video-Thumbnails (extract_video_thumb, poster-Attribut) - Google Analytics entfernt, Umami self-hosted eingebunden (index.html, datenschutz.js) - Admin-Panel Analytics-Tab: Stat-Cards, Sparkline 7 Tage, Top-Seiten (Umami-API-Proxy) - Admin-Panel Tab-Icons korrigiert (aus vorhandenem Phosphor-Sprite) - users.real_name Spalte: Username öffentlich, echter Name privat und optional - Registrierung: Label "Benutzername", Leerzeichen verboten, Profanity-Blockliste - Datenschutzerklärung: GA-Abschnitt durch Umami-Text ersetzt
This commit is contained in:
parent
9a78121a3e
commit
5141ba9969
20 changed files with 524 additions and 143 deletions
|
|
@ -7,6 +7,7 @@ from typing import Optional
|
|||
from database import db
|
||||
from auth import get_current_user, get_current_user_optional
|
||||
from routes.push import send_push_to_user
|
||||
from media_utils import convert_media, extract_video_thumb
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -76,10 +77,13 @@ def _save_upload(file: UploadFile, data: bytes) -> str:
|
|||
ext = os.path.splitext(file.filename or "")[1].lower() or ".jpg"
|
||||
if ext not in _FORUM_ALLOWED_EXT:
|
||||
raise HTTPException(415, "Dateityp nicht erlaubt.")
|
||||
data, ext = convert_media(data, file.filename or "")
|
||||
filename = f"{uuid.uuid4().hex}{ext}"
|
||||
path = os.path.join(FORUM_DIR, filename)
|
||||
with open(path, "wb") as f:
|
||||
f.write(data)
|
||||
if ext in {".mp4", ".webm"}:
|
||||
extract_video_thumb(path)
|
||||
return f"/media/forum/{filename}"
|
||||
|
||||
def _parse_foto_urls(raw) -> list:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue