Maschinenraum/cp.uugrn.org: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
```text | |||
= cp.uugrn.org = | = cp.uugrn.org = | ||
{| class="wikitable" | {| class="wikitable" | ||
! Bereich | ! Bereich | ||
! Wert | |||
|- | |||
| - | | URL | ||
| URL | | https://cp.uugrn.org | ||
| https://cp.uugrn.org | |- | ||
| - | | Sandbox | ||
| Sandbox | | https://sandboxcp.uugrn.org | ||
| https://sandboxcp.uugrn.org | |- | ||
| - | | Betriebssystem | ||
| Betriebssystem | | Debian 13.6 (Trixie) | ||
| Debian 13.6 (Trixie) | |- | ||
| - | | CryptPad | ||
| CryptPad | | v2026.5.1 | ||
| v2026.5.1 | |- | ||
| - | | nginx | ||
| nginx | | 1.30.4 | ||
| 1.30.4 | |- | ||
| - | | Node.js | ||
| Node.js | | 24.18.1 | ||
| 24.18.1 | |- | ||
| - | | Installation | ||
| Installation | | /home/cryptpad/cryptpad | ||
| /home/cryptpad/cryptpad | |- | ||
| - | | Benutzer | ||
| | | cryptpad | ||
| cryptpad | |} | ||
| } | |||
CryptPad dient zur verschlüsselten gemeinsamen Bearbeitung von Dokumenten. Der öffentliche Zugriff erfolgt über nginx. CryptPad selbst ist nur über Loopback erreichbar. | CryptPad dient zur verschlüsselten gemeinsamen Bearbeitung von Dokumenten. Der öffentliche Zugriff erfolgt über nginx. CryptPad selbst ist nur über Loopback erreichbar. | ||
__TOC__ | |||
== Betrieb == | == Betrieb == | ||
=== Dienste === | |||
* CryptPad: systemctl status cryptpad | * CryptPad: systemctl status cryptpad | ||
* nginx: systemctl status nginx | * nginx: systemctl status nginx | ||
* SSH: systemctl status ssh | * SSH: systemctl status ssh | ||
* | * nftables: systemctl status nftables | ||
* Fail2ban: systemctl status fail2ban | * Fail2ban: systemctl status fail2ban | ||
* Fehlerhafte Dienste: systemctl --failed | * Fehlerhafte Dienste: systemctl --failed | ||
| Zeile 51: | Zeile 51: | ||
* Stoppen: systemctl stop cryptpad | * Stoppen: systemctl stop cryptpad | ||
* Neustarten: systemctl restart cryptpad | * Neustarten: systemctl restart cryptpad | ||
* Log | * Log: journalctl -u cryptpad -f | ||
nginx: | nginx: | ||
* Konfiguration prüfen: nginx -t | * Konfiguration prüfen: nginx -t | ||
* | * Neu laden: systemctl reload nginx | ||
Diagnose: | CryptPad-Diagnose: | ||
* https://cp.uugrn.org/checkup/ | * https://cp.uugrn.org/checkup/ | ||
| Zeile 68: | Zeile 68: | ||
Anmeldung: | Anmeldung: | ||
* ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key | * ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key adminBenutzer@cp.uugrn.org | ||
* anschließend sudo -i | * anschließend sudo -i | ||
Härtung: | SSH-Härtung: | ||
* direkter Root-Login deaktiviert | * direkter Root-Login deaktiviert | ||
* Passwort-Login deaktiviert | * Passwort-Login deaktiviert | ||
* ausschließlich Public-Key-Authentifizierung | * ausschließlich Public-Key-Authentifizierung | ||
* | * Zugriff nur für Mitglieder der Gruppe sshusers | ||
* LoginGraceTime 30 | * LoginGraceTime 30 | ||
* MaxAuthTries 3 | * MaxAuthTries 3 | ||
| Zeile 91: | Zeile 91: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Port | ! Port | ||
! Dienst | |||
|- | |||
| - | | 22/tcp | ||
| 22/tcp | | SSH | ||
| SSH | |- | ||
| - | | 80/tcp | ||
| 80/tcp | | HTTP | ||
| HTTP | |- | ||
| - | | 443/tcp | ||
| 443/tcp | | HTTPS | ||
| HTTPS | |} | ||
| } | |||
CryptPad lauscht intern auf Loopback, unter anderem auf Port 3000 und 3003. | CryptPad lauscht intern auf Loopback, unter anderem auf Port 3000 und 3003. | ||
| Zeile 109: | Zeile 108: | ||
* Konfiguration: /etc/nftables.conf | * Konfiguration: /etc/nftables.conf | ||
* Regeln | * Regeln: nft list ruleset | ||
* Tabellen | * Tabellen: nft list tables | ||
Standardrichtlinien: | Standardrichtlinien: | ||
| Zeile 118: | Zeile 117: | ||
* OUTPUT ACCEPT | * OUTPUT ACCEPT | ||
Fail2ban schützt zusätzlich den SSH-Dienst. | |||
SSH- | |||
* Konfiguration: /etc/fail2ban/jail.d/sshd.local | |||
* 4 Fehlversuche innerhalb von 10 Minuten | * 4 Fehlversuche innerhalb von 10 Minuten | ||
* Sperrdauer 1 Stunde | * Sperrdauer 1 Stunde | ||
* | * Status: fail2ban-client status sshd | ||
Nach einem Neustart von nftables auch Fail2ban neu starten: | |||
Nach einem | |||
# systemctl restart nftables | # systemctl restart nftables | ||
# systemctl restart fail2ban | # systemctl restart fail2ban | ||
== Updates == | == Updates == | ||
Debian-Sicherheitsupdates werden automatisch | Debian-Sicherheitsupdates werden automatisch über unattended-upgrades installiert. | ||
Manuell aktualisiert werden: | |||
* normale Debian-Updates | * normale Debian-Updates | ||
| Zeile 162: | Zeile 142: | ||
Automatische Neustarts sind deaktiviert. | Automatische Neustarts sind deaktiviert. | ||
Prüfung: | |||
* apt update | * apt update | ||
| Zeile 168: | Zeile 148: | ||
* unattended-upgrade --dry-run | * unattended-upgrade --dry-run | ||
Neustartbedarf: | |||
* test -f /var/run/reboot-required && cat /var/run/reboot-required | * test -f /var/run/reboot-required && cat /var/run/reboot-required | ||
| Zeile 174: | Zeile 154: | ||
== CryptPad aktualisieren == | == CryptPad aktualisieren == | ||
Vor | Vor jedem Update die Release Notes der Zielversion lesen und ein Backup erstellen. | ||
# Wartung ankündigen | |||
# /root/sichercp | |||
# systemctl stop cryptpad | # systemctl stop cryptpad | ||
# su - cryptpad | # su - cryptpad | ||
# cd /home/cryptpad/cryptpad | # cd /home/cryptpad/cryptpad | ||
# git fetch --depth 1 origin tag VERSION | # git fetch --depth 1 origin tag VERSION | ||
# git checkout VERSION | # git checkout VERSION | ||
# npm ci | # npm ci | ||
# npm run install:components | # npm run install:components | ||
# ./install-onlyoffice.sh | # ./install-onlyoffice.sh | ||
# exit | # exit | ||
# systemctl start cryptpad | # systemctl start cryptpad | ||
Danach prüfen: | |||
* systemctl status cryptpad | * systemctl status cryptpad | ||
| Zeile 234: | Zeile 191: | ||
* 180 Tage | * 180 Tage | ||
Gesichert werden: | Gesichert werden insbesondere: | ||
* data/ | * data/ | ||
| Zeile 258: | Zeile 215: | ||
* OnlyOffice-Distribution | * OnlyOffice-Distribution | ||
Backup | Aktuelle Backupgröße: etwa 133 MB. | ||
Backup erstellen: | |||
* /root/sichercp | * /root/sichercp | ||
| Zeile 266: | Zeile 225: | ||
* ls -lh /root/backups/ | * ls -lh /root/backups/ | ||
Die Backups liegen derzeit | '''Hinweis:''' Die Backups liegen derzeit ausschließlich lokal auf dem Server. Gegen einen vollständigen Verlust der VM besteht damit kein Schutz. | ||
== Restore == | == Restore == | ||
| Zeile 273: | Zeile 232: | ||
# BACKUP=$(ls -1t /root/backups/cp-backup-*.tar.gz | head -1) | # BACKUP=$(ls -1t /root/backups/cp-backup-*.tar.gz | head -1) | ||
# mkdir -p /root/restore-test | # mkdir -p /root/restore-test | ||
# tar --acls --xattrs --numeric-owner -C /root/restore-test -xzf "$BACKUP" | # tar --acls --xattrs --numeric-owner -C /root/restore-test -xzf "$BACKUP" | ||
| Zeile 286: | Zeile 243: | ||
Bei vollständigem Serververlust: | Bei vollständigem Serververlust: | ||
# Debian 13 installieren | # Debian 13 installieren | ||
# Node.js 24 und nginx installieren | |||
# Node.js 24 | # passende CryptPad-Version installieren | ||
# npm-Abhängigkeiten und OnlyOffice installieren | |||
# npm-Abhängigkeiten und OnlyOffice installieren | # CryptPad stoppen | ||
# Daten aus dem Backup zurückspielen | |||
# CryptPad stoppen | # Besitzer cryptpad:cryptpad prüfen | ||
# Serverkonfiguration wiederherstellen | |||
# | # Dienste starten | ||
# CryptPad vollständig testen | |||
# Besitzer cryptpad:cryptpad prüfen | |||
# Serverkonfiguration wiederherstellen | |||
# Dienste starten | |||
# CryptPad vollständig testen | |||
== Wichtige Pfade == | == Wichtige Pfade == | ||
| Zeile 308: | Zeile 258: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Bereich | ! Bereich | ||
! Pfad | |||
|- | |||
| - | | CryptPad | ||
| CryptPad | | /home/cryptpad/cryptpad | ||
| /home/cryptpad/cryptpad | |- | ||
| - | | Konfiguration | ||
| Konfiguration | | /home/cryptpad/cryptpad/config/config.js | ||
| /home/cryptpad/cryptpad/config/config.js | |- | ||
| - | | Anpassungen | ||
| Anpassungen | | /home/cryptpad/cryptpad/customize/ | ||
| /home/cryptpad/cryptpad/customize/ | |- | ||
| - | | nginx | ||
| nginx | | /etc/nginx/ | ||
| /etc/nginx/ | |- | ||
| - | | SSH | ||
| SSH | | /etc/ssh/ | ||
| /etc/ssh/ | |- | ||
| - | | Firewall | ||
| Firewall | | /etc/nftables.conf | ||
| /etc/nftables.conf | |- | ||
| - | | Fail2ban | ||
| Fail2ban | | /etc/fail2ban/ | ||
| /etc/fail2ban/ | |- | ||
| - | | Backup-Skript | ||
| Backup-Skript | | /root/sichercp | ||
| /root/sichercp | |- | ||
| - | | Backups | ||
| Backups | | /root/backups/ | ||
| /root/backups/ | |} | ||
| } | |||
== Regelmäßige Kontrolle == | == Regelmäßige Kontrolle == | ||
| Zeile 355: | Zeile 304: | ||
* [https://github.com/cryptpad/cryptpad/releases CryptPad Releases] | * [https://github.com/cryptpad/cryptpad/releases CryptPad Releases] | ||
* [https://forum.cryptpad.org/ CryptPad Forum] | * [https://forum.cryptpad.org/ CryptPad Forum] | ||
``` | |||
Version vom 2. August 2026, 10:57 Uhr
```text
cp.uugrn.org
| Bereich | Wert |
|---|---|
| URL | https://cp.uugrn.org |
| Sandbox | https://sandboxcp.uugrn.org |
| Betriebssystem | Debian 13.6 (Trixie) |
| CryptPad | v2026.5.1 |
| nginx | 1.30.4 |
| Node.js | 24.18.1 |
| Installation | /home/cryptpad/cryptpad |
| Benutzer | cryptpad |
CryptPad dient zur verschlüsselten gemeinsamen Bearbeitung von Dokumenten. Der öffentliche Zugriff erfolgt über nginx. CryptPad selbst ist nur über Loopback erreichbar.
Betrieb
Dienste
- CryptPad: systemctl status cryptpad
- nginx: systemctl status nginx
- SSH: systemctl status ssh
- nftables: systemctl status nftables
- Fail2ban: systemctl status fail2ban
- Fehlerhafte Dienste: systemctl --failed
CryptPad:
- Starten: systemctl start cryptpad
- Stoppen: systemctl stop cryptpad
- Neustarten: systemctl restart cryptpad
- Log: journalctl -u cryptpad -f
nginx:
- Konfiguration prüfen: nginx -t
- Neu laden: systemctl reload nginx
CryptPad-Diagnose:
SSH
Administrativer Benutzer: adminBenutzer
Anmeldung:
- ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key adminBenutzer@cp.uugrn.org
- anschließend sudo -i
SSH-Härtung:
- direkter Root-Login deaktiviert
- Passwort-Login deaktiviert
- ausschließlich Public-Key-Authentifizierung
- Zugriff nur für Mitglieder der Gruppe sshusers
- LoginGraceTime 30
- MaxAuthTries 3
- MaxStartups 10:30:30
- PerSourceMaxStartups 3
Prüfung:
- sshd -t
- sshd -T
Netzwerk und Firewall
| Port | Dienst |
|---|---|
| 22/tcp | SSH |
| 80/tcp | HTTP |
| 443/tcp | HTTPS |
CryptPad lauscht intern auf Loopback, unter anderem auf Port 3000 und 3003.
nftables:
- Konfiguration: /etc/nftables.conf
- Regeln: nft list ruleset
- Tabellen: nft list tables
Standardrichtlinien:
- INPUT DROP
- FORWARD DROP
- OUTPUT ACCEPT
Fail2ban schützt zusätzlich den SSH-Dienst.
- Konfiguration: /etc/fail2ban/jail.d/sshd.local
- 4 Fehlversuche innerhalb von 10 Minuten
- Sperrdauer 1 Stunde
- Status: fail2ban-client status sshd
Nach einem Neustart von nftables auch Fail2ban neu starten:
- systemctl restart nftables
- systemctl restart fail2ban
Updates
Debian-Sicherheitsupdates werden automatisch über unattended-upgrades installiert.
Manuell aktualisiert werden:
- normale Debian-Updates
- Node.js
- nginx
- CryptPad
Automatische Neustarts sind deaktiviert.
Prüfung:
- apt update
- apt list --upgradable
- unattended-upgrade --dry-run
Neustartbedarf:
- test -f /var/run/reboot-required && cat /var/run/reboot-required
CryptPad aktualisieren
Vor jedem Update die Release Notes der Zielversion lesen und ein Backup erstellen.
- Wartung ankündigen
- /root/sichercp
- systemctl stop cryptpad
- su - cryptpad
- cd /home/cryptpad/cryptpad
- git fetch --depth 1 origin tag VERSION
- git checkout VERSION
- npm ci
- npm run install:components
- ./install-onlyoffice.sh
- exit
- systemctl start cryptpad
Danach prüfen:
- systemctl status cryptpad
- journalctl -u cryptpad -n 100
- https://cp.uugrn.org/checkup/
Zusätzlich Anmeldung, Pads, Datei-Upload und OnlyOffice testen.
Backup
Backup-Skript:
- /root/sichercp
Backup-Verzeichnis:
- /root/backups/
Aufbewahrung:
- 180 Tage
Gesichert werden insbesondere:
- data/
- datastore/
- block/
- blob/
- config/config.js
- customize/
- onlyoffice-conf/
- nginx-Konfiguration
- SSH-Konfiguration
- nftables
- Fail2ban
- APT-Konfiguration
- systemd-Konfiguration
- Paket- und Versionsinformationen
Nicht gesichert werden reproduzierbare Daten:
- .git/
- node_modules/
- www/
- OnlyOffice-Distribution
Aktuelle Backupgröße: etwa 133 MB.
Backup erstellen:
- /root/sichercp
Backups anzeigen:
- ls -lh /root/backups/
Hinweis: Die Backups liegen derzeit ausschließlich lokal auf dem Server. Gegen einen vollständigen Verlust der VM besteht damit kein Schutz.
Restore
Backup 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"
Nach der Kontrolle:
- rm -rf /root/restore-test
Notfall-Restore
Bei vollständigem Serververlust:
- Debian 13 installieren
- Node.js 24 und nginx installieren
- passende CryptPad-Version installieren
- npm-Abhängigkeiten und OnlyOffice installieren
- CryptPad stoppen
- Daten aus dem Backup zurückspielen
- Besitzer cryptpad:cryptpad prüfen
- Serverkonfiguration wiederherstellen
- Dienste starten
- CryptPad vollständig testen
Wichtige Pfade
| Bereich | Pfad |
|---|---|
| CryptPad | /home/cryptpad/cryptpad |
| Konfiguration | /home/cryptpad/cryptpad/config/config.js |
| Anpassungen | /home/cryptpad/cryptpad/customize/ |
| nginx | /etc/nginx/ |
| SSH | /etc/ssh/ |
| Firewall | /etc/nftables.conf |
| Fail2ban | /etc/fail2ban/ |
| Backup-Skript | /root/sichercp |
| Backups | /root/backups/ |
Regelmäßige Kontrolle
- Dienste: systemctl --failed
- Ports: ss -lntup
- Firewall: nft list ruleset
- Fail2ban: fail2ban-client status sshd
- Updates: apt list --upgradable
- Speicherplatz: df -h
- Warnungen: journalctl -p warning..alert --since today
Dokumentation
```