Sicherheits-Fixes, Wikipedia-Bildcache, Tests, requirements.txt und Changelog

- highlight-Filter maskiert HTML (gespeichertes XSS, kaputtes Layout bei < und &)
- video_melden: 404 bei unbekannter Folge statt 500; X-Forwarded-For nur von
  eigenen Proxys (TRUSTED_PROXIES aus .env); Speichern in Transaktion mit Zeilensperre
- gd/wikipedia.py: Profilbilder lokal in media/wiki_thumbs, Prüfung alle 7 Tage,
  Neu-Download nur bei geänderter SHA1; neue Route /gd/team/<id>/bild/;
  ersetzt die doppelten Abfragen in views.py und serializers.py
- 27 Tests für gd und intern; Tests laufen auf SQLite im Arbeitsspeicher
- requirements.txt und Changelog.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
H4nSoloandClaude Opus 5.5 committed 2026-10-22 22:04:16 +02:00
1 parent d1964947ef
commit 08a72e8d5e
10 files changed
+668 -127

No files matched your search

+13
View File
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
import sys
from pathlib import Path
from dotenv import load_dotenv
@@ -34,6 +35,9 @@ ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', 'localhost').split(',')
CSRF_TRUSTED_ORIGINS = os.getenv('CSRF_TRUSTED_ORIGINS', '').split(',')
# JellyFin Application
# Eigene Reverse-Proxys (NginxProxyManager), deren X-Forwarded-For vertraut wird
TRUSTED_PROXIES = [ip.strip() for ip in os.getenv('TRUSTED_PROXIES', '').split(',') if ip.strip()]
JELLYFIN_URL = os.getenv('JELLYFIN_URL')
JELLYFIN_API_KEY = os.getenv('JELLYFIN_API_KEY')
@@ -118,6 +122,15 @@ DATABASES = {
}
}
# Tests laufen auf SQLite, da der MySQL-User keine Test-Datenbank anlegen darf
if 'test' in sys.argv:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators