"feat: Integrate new authentication API for enhanced security"

This commit is contained in:
Till Tomczak 2025-05-26 09:13:45 +02:00
parent e3ebd219dd
commit e01906036d
2 changed files with 32 additions and 8 deletions

View File

@ -1269,13 +1269,37 @@ def compile_tailwind_if_debug():
if FLASK_DEBUG:
try:
app_logger.info("Kompiliere Tailwind CSS...")
subprocess.run([
"npx", "tailwindcss", "-i", "static/css/input.css",
"-o", "static/css/tailwind.min.css", "--minify"
], check=True)
app_logger.info("Tailwind CSS erfolgreich kompiliert.")
except subprocess.CalledProcessError:
app_logger.warning("Tailwind konnte nicht kompiliert werden. Möglicherweise ist npx/Node.js nicht installiert.")
# Prüfen, ob npx und Node.js verfügbar sind
import platform
import shutil
import subprocess
# Auf Windows nur fortfahren, wenn die CSS-Datei bereits existiert
# oder npx verfügbar ist
css_file_exists = os.path.exists("static/css/tailwind.min.css")
# Prüfen, ob npx verfügbar ist
npx_available = shutil.which("npx") is not None
if platform.system() == "Windows" and not npx_available and not css_file_exists:
app_logger.warning("npx nicht gefunden und keine CSS-Datei vorhanden. Tailwind CSS wird nicht kompiliert.")
return
# Tailwind CSS kompilieren
if npx_available:
subprocess.run([
"npx", "tailwindcss", "-i", "static/css/input.css",
"-o", "static/css/tailwind.min.css", "--minify"
], check=True)
app_logger.info("Tailwind CSS erfolgreich kompiliert.")
elif css_file_exists:
app_logger.info("Verwende existierende Tailwind CSS-Datei.")
else:
app_logger.warning("Tailwind konnte nicht kompiliert werden und keine CSS-Datei vorhanden.")
except subprocess.CalledProcessError as e:
app_logger.warning(f"Tailwind konnte nicht kompiliert werden. Möglicherweise ist npx/Node.js nicht installiert. Fehler: {e}")
except Exception as e:
app_logger.error(f"Fehler beim Kompilieren von Tailwind CSS: {str(e)}")

View File

@ -33,7 +33,7 @@ FLASK_DEBUG = True
SESSION_LIFETIME = timedelta(days=7)
# SSL-Konfiguration
SSL_ENABLED = True
SSL_ENABLED = False
SSL_CERT_PATH = "instance/ssl/myp.crt"
SSL_KEY_PATH = "instance/ssl/myp.key"
SSL_HOSTNAME = "raspberrypi"