Maschinenraum/cp.uugrn.org: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
|||
| Zeile 1: | Zeile 1: | ||
= cp.uugrn.org = | |||
= | {| class="wikitable" | ||
|- | |||
! URL | |||
| https://cp.uugrn.org | | |||
| --------------------------- | | |||
| ! System | | |||
| Debian 13.6 (Trixie) | | |||
| - | | |||
| ! Anwendung | | |||
| CryptPad v2026.5.1 | | |||
| - | | |||
| ! Webserver | | |||
| nginx 1.30.4 | | |||
| - | | |||
| ! Node.js | | |||
| 24.18.1 | | |||
| - | | |||
| ! Sandbox | | |||
| https://sandboxcp.uugrn.org | | |||
| } | | |||
== | == Aufbau == | ||
CryptPad läuft als Benutzer <code>cryptpad</code> unter: | |||
<pre> | |||
/home/cryptpad/cryptpad | |||
</pre> | |||
Der öffentliche Zugriff erfolgt ausschließlich über nginx. | |||
CryptPad lauscht intern nur auf Loopback: | |||
<pre> | |||
[::1]:3000 | |||
[::1]:3003 | |||
</pre> | |||
Öffentlich erreichbar sind: | |||
<pre> | <pre> | ||
22/tcp SSH | |||
80/tcp HTTP | |||
443/tcp HTTPS | |||
</pre> | </pre> | ||
== Dienste == | |||
<pre> | <pre> | ||
systemctl status cryptpad | |||
systemctl status nginx | |||
systemctl status ssh | |||
systemctl status nftables | |||
systemctl status fail2ban | |||
</pre> | </pre> | ||
CryptPad neu starten: | |||
<pre> | <pre> | ||
systemctl restart cryptpad | |||
</pre> | </pre> | ||
nginx-Konfiguration prüfen und neu laden: | |||
<pre> | <pre> | ||
nginx -t | |||
systemctl reload nginx | |||
</pre> | |||
CryptPad-Logs: | |||
<pre> | <pre> | ||
journalctl -u cryptpad | |||
</pre> | </pre> | ||
== SSH == | |||
Administrativer Benutzer: | |||
<pre> | |||
adminBenutzer | |||
</pre> | </pre> | ||
Anmeldung: | |||
<pre> | |||
ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key adminBenutzer@cp.uugrn.org | |||
</pre> | |||
Root-Rechte: | |||
<pre> | |||
sudo -i | |||
</pre> | |||
SSH ist gehärtet: | |||
<pre> | <pre> | ||
PermitRootLogin no | |||
PasswordAuthentication no | |||
KbdInteractiveAuthentication no | |||
PubkeyAuthentication yes | |||
AllowGroups sshusers | |||
LoginGraceTime 30 | |||
MaxAuthTries 3 | |||
MaxStartups 10:30:30 | |||
PerSourceMaxStartups 3 | |||
</pre> | </pre> | ||
Prüfung: | |||
<pre> | <pre> | ||
sshd -t | |||
sshd -T | |||
</pre> | </pre> | ||
== Firewall == | |||
nftables-Konfiguration: | |||
<pre> | <pre> | ||
/etc/nftables.conf | |||
</pre> | </pre> | ||
Regeln anzeigen: | |||
<pre> | |||
nft list ruleset | |||
</pre> | |||
Eingehend erlaubt: | |||
<pre> | |||
22/tcp | |||
80/tcp | |||
443/tcp | |||
ICMP | |||
ICMPv6 | |||
DHCPv4 | |||
Loopback | |||
established/related | |||
</pre> | |||
Standard: | |||
<pre> | <pre> | ||
INPUT DROP | |||
FORWARD DROP | |||
OUTPUT ACCEPT | |||
</pre> | |||
== Fail2ban == | |||
Konfiguration: | |||
<pre> | |||
/etc/fail2ban/jail.d/sshd.local | |||
</pre> | </pre> | ||
SSH-Jail: | |||
<pre> | <pre> | ||
maxretry = 4 | |||
findtime = 10m | |||
bantime = 1h | |||
backend = systemd | |||
usedns = no | |||
</pre> | </pre> | ||
Status: | |||
<pre> | |||
fail2ban-client status sshd | |||
</pre> | |||
nftables enthält zusätzlich die von Fail2ban verwaltete Tabelle: | |||
<pre> | <pre> | ||
table inet f2b-table | |||
</pre> | |||
Nach einem manuellen Neustart von nftables auch Fail2ban neu starten: | |||
<pre> | |||
systemctl restart nftables | |||
systemctl restart fail2ban | |||
</pre> | |||
== Updates == | |||
Debian-Sicherheitsupdates werden automatisch über <code>unattended-upgrades</code> installiert. | |||
Nicht automatisch aktualisiert werden: | |||
* normale Debian-Updates | |||
* Node.js / NodeSource | |||
* nginx | |||
* CryptPad | |||
Automatische Neustarts sind deaktiviert. | |||
Updates prüfen: | |||
<pre> | |||
apt update | |||
apt list --upgradable | |||
</pre> | |||
Automatische Security-Updates testen: | |||
<pre> | |||
unattended-upgrade --dry-run | |||
</pre> | </pre> | ||
Neustartbedarf prüfen: | |||
<pre> | <pre> | ||
test -f /var/run/reboot-required && cat /var/run/reboot-required | |||
</pre> | |||
== CryptPad-Daten == | |||
Wichtige persistente Daten: | |||
<pre> | |||
/home/cryptpad/cryptpad/data | |||
/home/cryptpad/cryptpad/datastore | |||
/home/cryptpad/cryptpad/block | |||
/home/cryptpad/cryptpad/blob | |||
/home/cryptpad/cryptpad/config/config.js | |||
/home/cryptpad/cryptpad/customize | |||
</pre> | |||
== Backup == | |||
Backup-Skript: | |||
<pre> | |||
/root/sichercp | |||
</pre> | |||
Backups: | |||
<pre> | |||
/root/backups | |||
</pre> | |||
Aufbewahrung: | |||
<pre> | |||
180 Tage | |||
</pre> | |||
Aktuelle Backupgröße: etwa 133 MB. | |||
Gesichert werden: | |||
* CryptPad-Daten | |||
* <code>config.js</code> | |||
* Anpassungen unter <code>customize/</code> | |||
* nginx-Konfiguration | |||
* SSH-Konfiguration | |||
* nftables | |||
* Fail2ban | |||
* APT-Konfiguration | |||
* systemd-Konfiguration | |||
* Paket- und Versionsinformationen | |||
Nicht gesichert werden reproduzierbare Daten: | |||
<pre> | <pre> | ||
.git | |||
node_modules | |||
www | |||
www/common/onlyoffice/dist | |||
</pre> | </pre> | ||
Backup starten: | |||
<pre> | <pre> | ||
/root/sichercp | |||
</pre> | |||
Backups anzeigen: | |||
<pre> | <pre> | ||
ls -lh /root/backups | |||
</pre> | </pre> | ||
Das Backup liegt derzeit nur lokal auf dem Server. Ein zusätzliches externes Backup sollte eingerichtet werden, sobald ein geeignetes Ziel verfügbar ist. | |||
== Restore == | |||
Backup testweise entpacken: | |||
<pre> | <pre> | ||
BACKUP=$(ls -1t /root/backups/cp-backup-*.tar.gz | head -1) | |||
mkdir -p /root/restore-test | |||
tar \ | |||
--acls \ | |||
--xattrs \ | |||
--numeric-owner \ | |||
-C /root/restore-test \ | |||
-xzf "$BACKUP" | |||
</pre> | |||
Danach Daten und Konfiguration prüfen und das Testverzeichnis wieder entfernen: | |||
<pre> | |||
rm -rf /root/restore-test | |||
</pre> | </pre> | ||
Bei einem vollständigen Serverausfall: | |||
# Debian 13 installieren | |||
# Node.js, nginx und CryptPad in passender Version installieren | |||
# OnlyOffice und npm-Abhängigkeiten neu installieren | |||
# | # CryptPad stoppen | ||
# Backup zurückspielen | |||
# Rechte auf <code>cryptpad:cryptpad</code> prüfen | |||
< | |||
</ | |||
# nginx, SSH, nftables, Fail2ban und systemd-Konfiguration wiederherstellen | |||
# Dienste starten | |||
# CryptPad vollständig testen | |||
== CryptPad-Update == | |||
Vor jedem Update: | |||
# Release Notes lesen | |||
# Backup erstellen | |||
# CryptPad stoppen | |||
Update als Benutzer <code>cryptpad</code> durchführen: | |||
<pre> | |||
su - cryptpad | |||
cd /home/cryptpad/cryptpad | |||
git fetch --tags | |||
git checkout VERSION | |||
npm ci | |||
npm run install:components | |||
./install-onlyoffice.sh | |||
</pre> | </pre> | ||
Anschließend als root: | |||
<pre> | |||
systemctl start cryptpad | |||
systemctl status cryptpad | |||
</pre> | |||
Danach prüfen: | |||
<pre> | <pre> | ||
https://cp.uugrn.org/checkup/ | |||
</pre> | </pre> | ||
Zusätzlich Anmeldung, Pads, Datei-Upload und OnlyOffice testen. | |||
== Regelmäßige Kontrolle == | |||
<pre> | <pre> | ||
systemctl --failed | |||
systemctl status cryptpad nginx ssh nftables fail2ban | |||
nft list ruleset | |||
fail2ban-client status sshd | |||
apt list --upgradable | |||
df -h | |||
journalctl -p warning..alert --since today | |||
</pre> | </pre> | ||
Version vom 2. August 2026, 10:45 Uhr
cp.uugrn.org
| URL |
AufbauCryptPad läuft als Benutzer /home/cryptpad/cryptpad Der öffentliche Zugriff erfolgt ausschließlich über nginx. CryptPad lauscht intern nur auf Loopback: [::1]:3000 [::1]:3003 Öffentlich erreichbar sind: 22/tcp SSH 80/tcp HTTP 443/tcp HTTPS Dienstesystemctl status cryptpad systemctl status nginx systemctl status ssh systemctl status nftables systemctl status fail2ban CryptPad neu starten: systemctl restart cryptpad nginx-Konfiguration prüfen und neu laden: nginx -t systemctl reload nginx CryptPad-Logs: journalctl -u cryptpad SSHAdministrativer Benutzer: adminBenutzer Anmeldung: ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key adminBenutzer@cp.uugrn.org Root-Rechte: sudo -i SSH ist gehärtet: PermitRootLogin no PasswordAuthentication no KbdInteractiveAuthentication no PubkeyAuthentication yes AllowGroups sshusers LoginGraceTime 30 MaxAuthTries 3 MaxStartups 10:30:30 PerSourceMaxStartups 3 Prüfung: sshd -t sshd -T Firewallnftables-Konfiguration: /etc/nftables.conf Regeln anzeigen: nft list ruleset Eingehend erlaubt: 22/tcp 80/tcp 443/tcp ICMP ICMPv6 DHCPv4 Loopback established/related Standard: INPUT DROP FORWARD DROP OUTPUT ACCEPT Fail2banKonfiguration: /etc/fail2ban/jail.d/sshd.local SSH-Jail: maxretry = 4 findtime = 10m bantime = 1h backend = systemd usedns = no Status: fail2ban-client status sshd nftables enthält zusätzlich die von Fail2ban verwaltete Tabelle: table inet f2b-table Nach einem manuellen Neustart von nftables auch Fail2ban neu starten: systemctl restart nftables systemctl restart fail2ban UpdatesDebian-Sicherheitsupdates werden automatisch über Nicht automatisch aktualisiert werden:
Automatische Neustarts sind deaktiviert. Updates prüfen: apt update apt list --upgradable Automatische Security-Updates testen: unattended-upgrade --dry-run Neustartbedarf prüfen: test -f /var/run/reboot-required && cat /var/run/reboot-required CryptPad-DatenWichtige persistente Daten: /home/cryptpad/cryptpad/data /home/cryptpad/cryptpad/datastore /home/cryptpad/cryptpad/block /home/cryptpad/cryptpad/blob /home/cryptpad/cryptpad/config/config.js /home/cryptpad/cryptpad/customize BackupBackup-Skript: /root/sichercp Backups: /root/backups Aufbewahrung: 180 Tage Aktuelle Backupgröße: etwa 133 MB. Gesichert werden:
Nicht gesichert werden reproduzierbare Daten: .git node_modules www www/common/onlyoffice/dist Backup starten: /root/sichercp Backups anzeigen: ls -lh /root/backups Das Backup liegt derzeit nur lokal auf dem Server. Ein zusätzliches externes Backup sollte eingerichtet werden, sobald ein geeignetes Ziel verfügbar ist. RestoreBackup testweise entpacken: BACKUP=$(ls -1t /root/backups/cp-backup-*.tar.gz | head -1) mkdir -p /root/restore-test tar \ --acls \ --xattrs \ --numeric-owner \ -C /root/restore-test \ -xzf "$BACKUP" Danach Daten und Konfiguration prüfen und das Testverzeichnis wieder entfernen: rm -rf /root/restore-test Bei einem vollständigen Serverausfall:
CryptPad-UpdateVor jedem Update:
Update als Benutzer su - cryptpad cd /home/cryptpad/cryptpad git fetch --tags git checkout VERSION npm ci npm run install:components ./install-onlyoffice.sh Anschließend als root: systemctl start cryptpad systemctl status cryptpad Danach prüfen: https://cp.uugrn.org/checkup/ Zusätzlich Anmeldung, Pads, Datei-Upload und OnlyOffice testen. Regelmäßige Kontrollesystemctl --failed systemctl status cryptpad nginx ssh nftables fail2ban nft list ruleset fail2ban-client status sshd apt list --upgradable df -h journalctl -p warning..alert --since today |
|---|