feat(desktop, network): Chat-Funktion hinzugefügt und P2P-Sync verbessert
Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+29
-16
@@ -1,29 +1,42 @@
|
||||
#!/bin/bash
|
||||
echo "==========================================="
|
||||
echo "Meldestelle - Netzwerk-Setup für POC"
|
||||
echo "Meldestelle - Netzwerk-Optimierung (Firewall)"
|
||||
echo "==========================================="
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Bitte mit sudo ausführen: sudo ./setup-firewall-linux.sh"
|
||||
exit
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Erkennung der Firewall (firewalld für Fedora/KDE, ufw für Ubuntu)
|
||||
if command -v firewall-cmd &> /dev/null; then
|
||||
echo "[Fedora/firewalld] Öffne Ports 8090 (TCP), 8080 (TCP) und 5353 (UDP)..."
|
||||
firewall-cmd --permanent --add-port=8090/tcp
|
||||
# Ports:
|
||||
# 8080 (P2P Sync), 8090 (Chat WS), 5353 (mDNS)
|
||||
# 8500 (Consul UI - optional), 8600 (Consul DNS - optional)
|
||||
|
||||
open_ports_firewalld() {
|
||||
echo "[Fedora/firewalld] Konfiguriere..."
|
||||
firewall-cmd --permanent --add-port=8080/tcp
|
||||
firewall-cmd --permanent --add-port=8090/tcp
|
||||
firewall-cmd --permanent --add-service=mdns
|
||||
# Optional: Consul Ports falls nötig
|
||||
# firewall-cmd --permanent --add-port=8500/tcp
|
||||
firewall-cmd --reload
|
||||
echo "Fertig!"
|
||||
elif command -v ufw &> /dev/null; then
|
||||
echo "[Ubuntu/ufw] Öffne Ports 8090 (TCP), 8080 (TCP) und 5353 (UDP)..."
|
||||
ufw allow 8090/tcp
|
||||
ufw allow 8080/tcp
|
||||
ufw allow 5353/udp
|
||||
echo "Fertig!"
|
||||
else
|
||||
echo "Keine bekannte Firewall (ufw/firewalld) gefunden. Bitte Ports manuell prüfen."
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Das System ist nun bereit für den Meldestelle-POC."
|
||||
open_ports_ufw() {
|
||||
echo "[Ubuntu/ufw] Konfiguriere..."
|
||||
ufw allow 8080/tcp comment 'Meldestelle Sync'
|
||||
ufw allow 8090/tcp comment 'Meldestelle Chat'
|
||||
ufw allow 5353/udp comment 'mDNS Discovery'
|
||||
ufw reload
|
||||
echo "Fertig!"
|
||||
}
|
||||
|
||||
if command -v firewall-cmd &> /dev/null; then
|
||||
open_ports_firewalld
|
||||
elif command -v ufw &> /dev/null; then
|
||||
open_ports_ufw
|
||||
else
|
||||
echo "Keine unterstützte Firewall (ufw/firewalld) gefunden."
|
||||
echo "Bitte öffnen Sie manuell: 8080/tcp, 8090/tcp und 5353/udp."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user