"feat: Integrate new authentication API for enhanced security"
This commit is contained in:
@@ -1269,13 +1269,37 @@ def compile_tailwind_if_debug():
|
|||||||
if FLASK_DEBUG:
|
if FLASK_DEBUG:
|
||||||
try:
|
try:
|
||||||
app_logger.info("Kompiliere Tailwind CSS...")
|
app_logger.info("Kompiliere Tailwind CSS...")
|
||||||
|
|
||||||
|
# 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([
|
subprocess.run([
|
||||||
"npx", "tailwindcss", "-i", "static/css/input.css",
|
"npx", "tailwindcss", "-i", "static/css/input.css",
|
||||||
"-o", "static/css/tailwind.min.css", "--minify"
|
"-o", "static/css/tailwind.min.css", "--minify"
|
||||||
], check=True)
|
], check=True)
|
||||||
app_logger.info("Tailwind CSS erfolgreich kompiliert.")
|
app_logger.info("Tailwind CSS erfolgreich kompiliert.")
|
||||||
except subprocess.CalledProcessError:
|
elif css_file_exists:
|
||||||
app_logger.warning("Tailwind konnte nicht kompiliert werden. Möglicherweise ist npx/Node.js nicht installiert.")
|
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:
|
except Exception as e:
|
||||||
app_logger.error(f"Fehler beim Kompilieren von Tailwind CSS: {str(e)}")
|
app_logger.error(f"Fehler beim Kompilieren von Tailwind CSS: {str(e)}")
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ FLASK_DEBUG = True
|
|||||||
SESSION_LIFETIME = timedelta(days=7)
|
SESSION_LIFETIME = timedelta(days=7)
|
||||||
|
|
||||||
# SSL-Konfiguration
|
# SSL-Konfiguration
|
||||||
SSL_ENABLED = True
|
SSL_ENABLED = False
|
||||||
SSL_CERT_PATH = "instance/ssl/myp.crt"
|
SSL_CERT_PATH = "instance/ssl/myp.crt"
|
||||||
SSL_KEY_PATH = "instance/ssl/myp.key"
|
SSL_KEY_PATH = "instance/ssl/myp.key"
|
||||||
SSL_HOSTNAME = "raspberrypi"
|
SSL_HOSTNAME = "raspberrypi"
|
||||||
|
Reference in New Issue
Block a user