Maschinenraum/cp.uugrn.org: Unterschied zwischen den Versionen

Aus UUGRN
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
;Admin Kontakt: sh[at]uugrn.org
= cp.uugrn.org =
;Hostname: cp.uugrn.org
;Aufgabe: Plattform für Echtzeit-Er-/Bearbeitung von Texten, Tabellen, Präsentationen, Kanban, Terminfindung…


==== Beschreibung ====
{| class="wikitable"
Ein CryptPad sind Inhalte, die gemeinsam und gleichzeitig (kollaborativ) erarbeitet werden können. Im Vergleich zu Etherpad sind die Inhalte verschlüsselt auf dem Server gespeichert. Die Software ermöglicht das Erstellen und Bearbeiten von Inhalten mit mehreren Personen gleichzeitig. Es gibt verschiedene Dokumenttypen.
|-
! URL


[https://gnulinux.ch/cryptpad-zusammen-an-dokumenten-arbeiten Anleitung an Dokumenten arbeiten]
| 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 |
| }                          |


===== Dokumentation und Unterstützung =====
== Aufbau ==


* [https://docs.cryptpad.org/en/admin_guide Adminguide], [https://docs.cryptpad.org/en/admin_guide/installation.html Installation], [https://docs.cryptpad.org/en/admin_guide/maintenance.html Wartung]
CryptPad läuft als Benutzer <code>cryptpad</code> unter:
* [https://forum.cryptpad.org/ Cryptpad Forum]
* [https://matrix.to/#/#cryptpad-admins:matrix.xwiki.com Cryptpad Matrix Kanal]


==== CryptPad aktualisieren ====
<pre>
/home/cryptpad/cryptpad
</pre>


Wartungsarbeiten über die Mailingliste, IRC und Matrix ankündigen.
Der öffentliche Zugriff erfolgt ausschließlich über nginx.


Prüfen, ob es eine Aktualisierung gibt: [https://github.com/cryptpad/cryptpad/releases Releasenotes] geben Hinweise zum Update von Version zu Version.
CryptPad lauscht intern nur auf Loopback:


Was steht an: [https://github.com/cryptpad/cryptpad/milestones Plan für künfünftige Veröffentlichtungen]. [https://cryptpad.fr/kanban/#/2/kanban/view/PLM0C3tFWvYhd+EPzXrbT+NxB76Z5DtZhAA5W5hG9wo/ Kanban der öffentlichen Roadmap].
<pre>
[::1]:3000
[::1]:3003
</pre>


Diagnoseseite prüfen: https://cp.uugrn.org/checkup/
Öffentlich erreichbar sind:


Prüfen was auf dem Server gerade los ist:
Liste aller laufenden Prozesse azeigen
<pre>
<pre>
ps aux
22/tcp  SSH
ps aux | grep nginx
80/tcp  HTTP
443/tcp  HTTPS
</pre>
</pre>


Aktive Verbindungen und Sockets anzeigen
== Dienste ==
 
<pre>
<pre>
ss -ant
systemctl status cryptpad
#nur hörende Verbindungen
systemctl status nginx
ss -lt
systemctl status ssh
# udp und tcp
systemctl status nftables
ss -anut
systemctl status fail2ban
</pre>
</pre>


Logs anzeigen allgemein und ausgaben zu Cryptpad prüfen
CryptPad neu starten:
 
<pre>
<pre>
journalctl -f
systemctl restart cryptpad
journalctl -u cryptpad -f
</pre>
</pre>


Aktive Verbindungen prüfen
nginx-Konfiguration prüfen und neu laden:
 
<pre>
<pre>
# Zugriffsprotokolldatei von NGINX
nginx -t
sudo tail -f /var/log/nginx/access.log
systemctl reload nginx
</pre>


# Welche IPs sind aktiv?
CryptPad-Logs:
sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head


# Zeigt alle Prozesse, die gerade eine aktive Verbindung zum TCP-Port 3000 haben
sudo lsof -i :3000 -i :3001 | grep ESTABLISHED
# alternativ
sudo lsof -i | egrep ':3000|:3001' | grep ESTABLISHED
# gibt es aktive Verbindungen auf den Ports 3000 und 3001
ss -antp | egrep ':3000|:3001' | grep ESTABLISHED
</pre>
Per ssh mit der Konsole des Servers bei Hetzner verbinden:
<pre>
<pre>
ssh  -4 -i ./.ssh/ssh-rsa-private-4096-key root@cp.uugrn.org
journalctl -u cryptpad
</pre>
</pre>


Sicherung anlegen (als root im Ordner /root) und Aktualisierung Debian:
== SSH ==
<pre>
# Prüfung und Installation von Debian Updates
apt update
apt upgrade
# Gegebenenfalls Neustart des Servers einplanen.
 
#Server stoppen
sudo systemctl stop cryptpad


#Sichern
Administrativer Benutzer:
tar czf ~/cryptpad-backup-$(date +%F).tar.gz /home/cryptpad/cryptpad


#Server wieder starten oder gleich das Update nachziehen
<pre>
sudo systemctl start cryptpad
adminBenutzer
</pre>
</pre>


---
Anmeldung:


Vor Update den CP-Dienst als root stoppen
<pre>
ssh -4 -i ~/.ssh/ssh-rsa-private-4096-key adminBenutzer@cp.uugrn.org
</pre>


sudo systemctl stop cryptpad
Root-Rechte:


<pre>
sudo -i
</pre>


Als Benutzer cryptpad, im Ordner /home/cryptpad/cryptpad arbeiten:
SSH ist gehärtet:
 
su cryptpad
 
cd /home/cryptpad/cryptpad
 
Installationshinweise bei den Releasenotes ansehen!


<pre>
<pre>
# Beispiel Autumn release (2025.9.0)
PermitRootLogin no
git fetch --depth 1 origin tag 2025.9.0
PasswordAuthentication no
git checkout 2025.9.0
KbdInteractiveAuthentication no
npm ci
PubkeyAuthentication yes
npm run install:components
AllowGroups sshusers
#./install-onlyoffice.sh


#Prüfen, gibt es Unterschiede an der Standardkonfigurationsdatei, die in die eigene Konfiguration übernommen werden müssen?
LoginGraceTime 30
diff config/config.example.js config/config.js
MaxAuthTries 3
MaxStartups 10:30:30
PerSourceMaxStartups 3
</pre>
</pre>


als Benutzer root
Prüfung:


<pre>
<pre>
# Server starten
sshd -t
sudo systemctl start cryptpad
sshd -T
 
# Nach Änderungen den Dienst neustarten
sudo systemctl restart cryptpad
 
# Status des Dienstes ansehen
sudo systemctl status cryptpad
</pre>
</pre>


Diagnoseseite prüfen: https://cp.uugrn.org/checkup/
== Firewall ==


CryptPad lässt sich auch mittels npm starten. Vorteil: es spuckt Informationen und ggf. Fehlermeldungen aus:
nftables-Konfiguration:
 
npm = Node Package Manager


<pre>
<pre>
# Cryptpad Dienst starten und Logausgaben prüfen
/etc/nftables.conf
cd /home/cryptpad/cryptpad
npm start
</pre>
</pre>


==== Admin Log ====
Regeln anzeigen:
* Betriebssystem: Debian
* Webserver: NGINX
* Produktiv seit: 06.01.2025
* URL: https://cp.uugrn.org/


==== Install Log ====
<pre>
nft list ruleset
</pre>


OS: Debian (13)
Eingehend erlaubt:
Hetzner cx22, 2 CPU, 40 GB SSD, 4 GB Ram


Installierte Software
<pre>
* cryptpad: v2026.5.1
22/tcp
* nginx (als reverse proxy)
80/tcp
 
443/tcp
Anleitung:
ICMP
* [https://docs.cryptpad.org/en/admin_guide/installation.html]
ICMPv6
* [https://gnulinux.ch/cryptpad-zusammen-an-dokumenten-arbeiten]
DHCPv4
 
Loopback
Diagnose: https://cp.uugrn.org/checkup/
established/related
</pre>


===== Vorbereitungen =====
Standard:


<pre>
<pre>
2 Domains werden benötigt, die beide auf den Server zeigen
INPUT    DROP
cp.uugrn.org sandboxcp.uugrn.org (für erweiterten Schutz gegen CSS)
FORWARD  DROP
OUTPUT  ACCEPT
</pre>


apt install -y curl
== Fail2ban ==


curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup.sh
Konfiguration:


bash nodesource_setup.sh
<pre>
 
/etc/fail2ban/jail.d/sshd.local
apt install -y nodejs
</pre>
</pre>


===== Benutzer anlegen =====
SSH-Jail:


<pre>
<pre>
useradd -m cryptpad -s /bin/bash
maxretry = 4
findtime = 10m
bantime = 1h
backend = systemd
usedns = no
</pre>
</pre>


CryptPad läuft unter dem Benutzer „cryptpad“.
Status:


Das Home-Verzeichnis ist /home/cryptpad/cryptpad.
<pre>
fail2ban-client status sshd
</pre>


===== CryptPad installieren =====
nftables enthält zusätzlich die von Fail2ban verwaltete Tabelle:


<pre>
<pre>
su - cryptpad
table inet f2b-table
</pre>


git clone https://github.com/cryptpad/cryptpad.git cryptpad
Nach einem manuellen Neustart von nftables auch Fail2ban neu starten:


cd cryptpad
<pre>
systemctl restart nftables
systemctl restart fail2ban
</pre>


npm ci
== Updates ==


npm run install:components
Debian-Sicherheitsupdates werden automatisch über <code>unattended-upgrades</code> installiert.


./install-onlyoffice.sh
Nicht automatisch aktualisiert werden:


# Beispielkonfiguration an den richtigen Ort kopieren
* normale Debian-Updates
cp config/config.example.js config/config.js
* Node.js / NodeSource
* nginx
* CryptPad


# Konfiguration anpassen
Automatische Neustarts sind deaktiviert.
nano config/config.js


# httpUnsafeOrigin: 'https://cp.uugrn.org',
Updates prüfen:
# httpSafeOrigin: 'https://sandboxcp.uugrn.org',


# cryptpad als Service eintragen
<pre>
# als Root
apt update
wget https://raw.githubusercontent.com/cryptpad/cryptpad/main/docs/cryptpad.service -O /etc/systemd/system/cryptpad.service
apt list --upgradable
</pre>


# Dienst aktivieren
Automatische Security-Updates testen:
systemctl enable --now cryptpad


systemctl start cryptpad # Starten des Dienstes
<pre>
systemctl status cryptpad # Info über den Dienst
unattended-upgrade --dry-run
systemctl stop cryptpad # Stoppen des Dienstes
systemctl restart cryptpad # Neustarten des Dienstes
ss -ant # hier kann man schauen, ob am Port 3000 und 3001 Verbindungen akzeptiert werden
</pre>
</pre>


===== NGINX installieren =====
Neustartbedarf prüfen:
 
<pre>
<pre>
apt update
test -f /var/run/reboot-required && cat /var/run/reboot-required
apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring
</pre>


curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
== CryptPad-Daten ==
  | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
# Signaturschlüssel installieren


mkdir -p /root/.gnupg
Wichtige persistente Daten:
chmod 700 /root/.gnupg
gpg --dry-run --quiet --no-keyring --import --import-options import-show \
  /usr/share/keyrings/nginx-archive-keyring.gpg
# Fingerprint vergleichen nginx 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62


echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian trixie nginx" \
<pre>
  | sudo tee /etc/apt/sources.list.d/nginx.list
/home/cryptpad/cryptpad/data
# Repo-Eintrag für stable
/home/cryptpad/cryptpad/datastore
/home/cryptpad/cryptpad/block
/home/cryptpad/cryptpad/blob
/home/cryptpad/cryptpad/config/config.js
/home/cryptpad/cryptpad/customize
</pre>


echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
== Backup ==
  | sudo tee /etc/apt/preferences.d/99nginx
# Pinning setzen: nginx Pakete bevorzugen


cat /etc/apt/sources.list.d/nginx.list
Backup-Skript:
# deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian trixie nginx


cat /etc/apt/preferences.d/99nginx
<pre>
# Package: *
/root/sichercp
# Pin: origin nginx.org
</pre>
# Pin: release o=nginx
# Pin-Priority: 900


apt update
Backups:
apt policy nginx
# Ausgabe nginx:
# Installed: ...
# Candidate: 1.xx.x-1~trixie
# Version table:
#    1.xx.x-1~trixie 900
#      900 https://nginx.org/packages/debian trixie/nginx amd64 Packages


apt update
<pre>
apt install nginx
/root/backups
</pre>


mkdir -p /etc/nginx
Aufbewahrung:
mkdir -p /var/log/nginx
chown root:adm /var/log/nginx
chmod 755 /var/log/nginx


openssl dhparam -out /etc/nginx/dhparam.pem 4096
<pre>
# Generierung dauert eine ganze Weile. Abwarten, bis beendet.
180 Tage
</pre>


dpkg -l | grep -E 'nginx|libnginx'
Aktuelle Backupgröße: etwa 133 MB.
# erwartet ii  nginx und ii  python3-certbot-nginx


systemctl enable --now nginx
Gesichert werden:
# Dienst aktivieren, sonst könnte es beim Neustart klemmen


systemctl status nginx --no-pager
* CryptPad-Daten
# Dienst aktiv und ohne Meldungen?
* <code>config.js</code>
* Anpassungen unter <code>customize/</code>
* nginx-Konfiguration
* SSH-Konfiguration
* nftables
* Fail2ban
* APT-Konfiguration
* systemd-Konfiguration
* Paket- und Versionsinformationen


systemctl restart nginx
Nicht gesichert werden reproduzierbare Daten:
</pre>


===== NGINX aktualisieren =====
<pre>
<pre>
cp -a /etc/nginx /etc/nginx.backup.$(date +%F-%H%M)
.git
apt update
node_modules
apt upgrade
www
nginx -t
www/common/onlyoffice/dist
systemctl reload nginx
nginx -v
journalctl -u nginx -b --no-pager
certbot certificates
certbot renew --dry-run
</pre>
</pre>


===== Let's Encrypt installieren und Zertifikat generieren =====
Backup starten:
 
<pre>
<pre>
sudo apt install certbot python3-certbot-nginx
/root/sichercp
sudo certbot --nginx certonly -d cp.uugrn.org -d sandboxcp.uugrn.org
</pre>
sudo systemctl enable certbot.timer


Certificate is saved at: /etc/letsencrypt/live/cp.uugrn.org/fullchain.pem
Backups anzeigen:
Key is saved at:        /etc/letsencrypt/live/cp.uugrn.org/privkey.pem
</pre>


<!--
===== Letsencrypt-Erneuerung einrichten =====
<pre>
<pre>
$ cat /etc/cron.weekly/certbot.sh
ls -lh /root/backups
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
certbot renew
service nginx reload
</pre>
</pre>
​-->


===== NGINX konfigurieren =====
Das Backup liegt derzeit nur lokal auf dem Server. Ein zusätzliches externes Backup sollte eingerichtet werden, sobald ein geeignetes Ziel verfügbar ist.
<pre>
wget https://raw.githubusercontent.com/cryptpad/cryptpad/main/docs/example.nginx.conf -O /etc/nginx/conf.d/cryptpad.conf


Anschließend die Datei bearbeiten.
== Restore ==
Domains eintragen und die Lets-Encrypt-Pfade.
</pre>


Es gibt auch eine erweiterte Beispieldatei: https://github.com/cryptpad/cryptpad/blob/main/docs/example-advanced.nginx.conf
Backup testweise entpacken:


<!--
<pre>
<pre>
server {
BACKUP=$(ls -1t /root/backups/cp-backup-*.tar.gz | head -1)


        listen      443 ssl;
mkdir -p /root/restore-test
        server_name  cp.uugrn.org;


        access_log  /var/log/nginx/cp.uugrn.org.access.log;
tar \
        error_log   /var/log/nginx/cp.uugrn.org.error.log;
  --acls \
  --xattrs \
  --numeric-owner \
  -C /root/restore-test \
   -xzf "$BACKUP"
</pre>


        ssl_certificate /etc/letsencrypt/live/cp.uugrn.org/fullchain.pem;
Danach Daten und Konfiguration prüfen und das Testverzeichnis wieder entfernen:
        ssl_certificate_key /etc/letsencrypt/live/cp.uugrn.org/privkey.pem;


        include /etc/letsencrypt/options-ssl-nginx.conf;
<pre>
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
rm -rf /root/restore-test
</pre>
</pre>
-->


===== Anpassungen als CryptPad Benutzer =====
Bei einem vollständigen Serverausfall:
<pre>
 
su - cryptpad
# Debian 13 installieren
 
# Node.js, nginx und CryptPad in passender Version installieren


cd ~/cryptpad
# OnlyOffice und npm-Abhängigkeiten neu installieren
mkdir customize
cp customize.dist/application_config.js customize/


# Zeilen aus der Datei www/common/application_config_internal.js kopieren und zutreffende in die application_config.js einfügen
# CryptPad stoppen


nano customize/application_config.js
# Backup zurückspielen
</pre>


Ohne Anmeldung dürfen Pads und Dokumente erstellt werden. Sie werden nach 90 Tagen automatisch gelöscht. Es kann auf geteilte Dokumente zugegriffen werden.
# Rechte auf <code>cryptpad:cryptpad</code> prüfen
<pre>
AppConfig.disableAnonymousStore = true;
AppConfig.disableAnonymousPadCreation = false;
</pre>


Nach einem Neustart von cryptpad und nginx sollte sich die Seite aufrufen lassen:
# nginx, SSH, nftables, Fail2ban und systemd-Konfiguration wiederherstellen
https://cp.uugrn.org/


===== Crontab als CryptPad Benutzer einrichten =====
# Dienste starten


Aufrufe zu node scripts/evict-inactive.js
# CryptPad vollständig testen


und node scripts/evict-archived.js
== CryptPad-Update ==


Räumen alte Dokumente weg, die Benutzer ohne Konto angelegt haben und schon älter als 90 Tage sind und archivierte Dokumente.
Vor jedem Update:


<pre>
# Release Notes lesen
su - cryptpad


cd ~/cryptpad
# Backup erstellen


crontab -e
# CryptPad stoppen


zwei Jobs ergänzen:
Update als Benutzer <code>cryptpad</code> durchführen:


30 1 1,15 * * (cd cryptpad; node scripts/evict-inactive.js > /dev/null)
<pre>
su - cryptpad
cd /home/cryptpad/cryptpad


30 1 7,22 * * (cd cryptpad; node scripts/evict-archived.js > /dev/null)
git fetch --tags
git checkout VERSION


npm ci
npm run install:components
./install-onlyoffice.sh
</pre>
</pre>


Anschließend als root:


Nun ein Benutzerkonto einrichten und in der Konfiguration als Administrator eintragen.
<pre>
systemctl start cryptpad
systemctl status cryptpad
</pre>


===== Benutzerkonto Administrator-Rechte geben =====
Danach prüfen:


1. öffentlichen Schlüssel kopieren. benutzereinstellungen.
2. Datei bearbeiten /home/cryptpad/cryptpad/config/config.js.
3. Diese stelle finden und wie im Beispiel Benutzer hinzufügen:
<pre>
<pre>
    adminKeys: [
https://cp.uugrn.org/checkup/
        "[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",
    ],
</pre>
</pre>
3. CryptPad Server neu starten.


Registrierung deaktivieren
Zusätzlich Anmeldung, Pads, Datei-Upload und OnlyOffice testen.
 
== Regelmäßige Kontrolle ==
 
<pre>
<pre>
https://cryptpad.mydomain.com/admin/#users
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>
Mehr https://docs.cryptpad.org/en/admin_guide/customization.html#restricting-guest-access

Version vom 2. August 2026, 10:45 Uhr

cp.uugrn.org

URL

Aufbau

CryptPad läuft als Benutzer cryptpad unter:

/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

Dienste

systemctl 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

SSH

Administrativer 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

Firewall

nftables-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

Fail2ban

Konfiguration:

/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

Updates

Debian-Sicherheitsupdates werden automatisch über unattended-upgrades installiert.

Nicht automatisch aktualisiert werden:

  • normale Debian-Updates
  • Node.js / NodeSource
  • nginx
  • CryptPad

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-Daten

Wichtige 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

Backup

Backup-Skript:

/root/sichercp

Backups:

/root/backups

Aufbewahrung:

180 Tage

Aktuelle Backupgröße: etwa 133 MB.

Gesichert werden:

  • CryptPad-Daten
  • config.js
  • Anpassungen unter customize/
  • nginx-Konfiguration
  • SSH-Konfiguration
  • nftables
  • Fail2ban
  • APT-Konfiguration
  • systemd-Konfiguration
  • Paket- und Versionsinformationen

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.

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"

Danach Daten und Konfiguration prüfen und das Testverzeichnis wieder entfernen:

rm -rf /root/restore-test

Bei einem vollständigen Serverausfall:

  1. Debian 13 installieren
  1. Node.js, nginx und CryptPad in passender Version installieren
  1. OnlyOffice und npm-Abhängigkeiten neu installieren
  1. CryptPad stoppen
  1. Backup zurückspielen
  1. Rechte auf cryptpad:cryptpad prüfen
  1. nginx, SSH, nftables, Fail2ban und systemd-Konfiguration wiederherstellen
  1. Dienste starten
  1. CryptPad vollständig testen

CryptPad-Update

Vor jedem Update:

  1. Release Notes lesen
  1. Backup erstellen
  1. CryptPad stoppen

Update als Benutzer cryptpad durchführen:

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 Kontrolle

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