🐛 Backend Database Cleanup & Log Update 🎉

This commit is contained in:
2025-06-01 14:27:24 +02:00
parent f398bf896a
commit 3287b4558b
7 changed files with 442 additions and 144 deletions

View File

@@ -19,8 +19,26 @@ ExecStart=/bin/bash -c '\
# Zone definieren (falls nicht vorhanden) \
firewall-cmd --permanent --new-zone=myp-backend 2>/dev/null || true; \
\
# Quell-Netzwerk definieren \
firewall-cmd --permanent --zone=myp-backend --add-source=192.168.0.0/24; \
# Erweiterte Netzwerk-Quellen definieren \
firewall-cmd --permanent --zone=myp-backend --add-source=192.168.0.0/16; \
firewall-cmd --permanent --zone=myp-backend --add-source=127.0.0.1/32; \
firewall-cmd --permanent --zone=myp-backend --add-source=::1/128; \
\
# Lokaler Hostname hinzufügen (falls auflösbar) \
LOCAL_HOSTNAME=$(hostname); \
if [ -n "$LOCAL_HOSTNAME" ]; then \
LOCAL_IP=$(getent hosts "$LOCAL_HOSTNAME" | awk "{print \$1}" | head -1 2>/dev/null || true); \
if [ -n "$LOCAL_IP" ]; then \
firewall-cmd --permanent --zone=myp-backend --add-source="$LOCAL_IP/32" 2>/dev/null || true; \
fi; \
fi; \
\
# Remote-Hostname m040tbaraspi001 hinzufügen (falls auflösbar) \
REMOTE_IP=$(getent hosts "m040tbaraspi001" | awk "{print \$1}" | head -1 2>/dev/null || true); \
if [ -n "$REMOTE_IP" ]; then \
firewall-cmd --permanent --zone=myp-backend --add-source="$REMOTE_IP/32" 2>/dev/null || true; \
logger "MYP Firewall: Remote-Hostname m040tbaraspi001 hinzugefügt: $REMOTE_IP"; \
fi; \
\
# HTTPS für API & Kiosk \
firewall-cmd --permanent --zone=myp-backend --add-port=443/tcp; \