translate all docs to English
Translate 8 documentation files from German to English: - docs/index.md (complete) - docs/getting-started/first-install.md (complete) - docs/getting-started/new-client.md (complete) - docs/getting-started/reinstall.md (complete) - docs/getting-started/sd-image.md (complete) - docs/deployment/dns.md (PTR, Hetzner, checklist sections) - docs/services/tailscale.md (code comments) - docs/services/forgejo.md (placeholder names)
This commit is contained in:
parent
c81b43530a
commit
a0da5be8fc
8 changed files with 386 additions and 386 deletions
|
|
@ -1,70 +1,70 @@
|
|||
# Neuinstallation (Reinstall)
|
||||
# Reinstallation
|
||||
|
||||
Diese Anleitung beschreibt die **Neuinstallation** eines bestehenden Hosts, z.B. nach Hardwarewechsel oder bei Problemen.
|
||||
This guide describes the **reinstallation** of an existing host, e.g. after a hardware change or in case of issues.
|
||||
|
||||
## Unterschied zur Erstinstallation
|
||||
## Difference from Initial Installation
|
||||
|
||||
| Aspekt | Erstinstallation | Neuinstallation |
|
||||
|--------|------------------|-----------------|
|
||||
| SOPS-Secrets | Noch nicht vorhanden | Bereits konfiguriert |
|
||||
| SSH-Host-Key | Neu generiert | **Muss wiederhergestellt werden!** |
|
||||
| Disk-IDs | Neu ermitteln | Oft geändert (neue Hardware) |
|
||||
| secrets.yaml | Wird erstellt | Bereits vorhanden |
|
||||
| Aspect | Initial Installation | Reinstallation |
|
||||
|--------|----------------------|----------------|
|
||||
| SOPS Secrets | Not yet present | Already configured |
|
||||
| SSH Host Key | Newly generated | **Must be restored!** |
|
||||
| Disk IDs | Newly determined | Often changed (new hardware) |
|
||||
| secrets.yaml | Will be created | Already exists |
|
||||
|
||||
## Wichtig: SSH-Host-Key Problem
|
||||
## Important: SSH Host Key Issue
|
||||
|
||||
Bei einer Neuinstallation wird ein **neuer SSH-Host-Key** generiert. Dieser stimmt nicht mehr mit dem Age-Key in `.sops.yaml` überein!
|
||||
During a reinstallation, a **new SSH host key** is generated. This key will no longer match the age key in `.sops.yaml`!
|
||||
|
||||
### Lösungsmöglichkeiten
|
||||
### Possible Solutions
|
||||
|
||||
**Option A: Alten Host-Key sichern und wiederherstellen** (empfohlen)
|
||||
**Option A: Back up and restore the old host key** (recommended)
|
||||
|
||||
**Option B: Neuen Key generieren und SOPS aktualisieren**
|
||||
**Option B: Generate a new key and update SOPS**
|
||||
|
||||
## Voraussetzungen
|
||||
## Prerequisites
|
||||
|
||||
- Backup des alten SSH-Host-Keys (falls Option A)
|
||||
- Zugriff auf `.sops.yaml` und die Admin-Age-Keys
|
||||
- Bootbares NixOS ISO
|
||||
- Backup of the old SSH host key (if using Option A)
|
||||
- Access to `.sops.yaml` and the admin age keys
|
||||
- Bootable NixOS ISO
|
||||
|
||||
## Schritt 1: Vorbereitung (vor der Installation)
|
||||
## Step 1: Preparation (before the installation)
|
||||
|
||||
### 1.1 Alten SSH-Host-Key sichern (Option A)
|
||||
### 1.1 Back Up the Old SSH Host Key (Option A)
|
||||
|
||||
Falls der alte Host noch läuft:
|
||||
If the old host is still running:
|
||||
|
||||
```bash
|
||||
# Auf dem alten Host
|
||||
# On the old host
|
||||
sudo cat /etc/ssh/ssh_host_ed25519_key > ~/ssh_host_ed25519_key.backup
|
||||
sudo cat /etc/ssh/ssh_host_ed25519_key.pub > ~/ssh_host_ed25519_key.pub.backup
|
||||
```
|
||||
|
||||
Dateien sicher auf den Entwicklungsrechner kopieren.
|
||||
Copy the files securely to the development machine.
|
||||
|
||||
### 1.2 Disk-IDs ermitteln
|
||||
### 1.2 Determine Disk IDs
|
||||
|
||||
**Bei neuer Hardware** ändern sich die Disk-IDs!
|
||||
**With new hardware**, the disk IDs will change!
|
||||
|
||||
```bash
|
||||
# Im NixOS Live-System
|
||||
# In the NixOS live system
|
||||
lsblk -o NAME,SIZE,MODEL,SERIAL
|
||||
ls -la /dev/disk/by-id/
|
||||
```
|
||||
|
||||
Die neue Disk-ID in `hosts/<hostname>/disks.sh` oder `disks.nix` eintragen:
|
||||
Enter the new disk ID in `hosts/<hostname>/disks.sh` or `disks.nix`:
|
||||
|
||||
```bash
|
||||
# Beispiel disks.sh
|
||||
# Example disks.sh
|
||||
DISK="/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_XXXXX"
|
||||
```
|
||||
|
||||
## Schritt 2: Installation durchführen
|
||||
## Step 2: Perform the Installation
|
||||
|
||||
### 2.1 NixOS ISO booten
|
||||
### 2.1 Boot the NixOS ISO
|
||||
|
||||
Von USB/CD booten, Root-Passwort setzen, per SSH verbinden.
|
||||
Boot from USB/CD, set a root password, and connect via SSH.
|
||||
|
||||
### 2.2 Repository klonen
|
||||
### 2.2 Clone the Repository
|
||||
|
||||
```bash
|
||||
sudo -i
|
||||
|
|
@ -73,30 +73,30 @@ git clone <GIT_REPO_URL> /tmp/nixos
|
|||
cd /tmp/nixos
|
||||
```
|
||||
|
||||
### 2.3 Disk-Konfiguration prüfen
|
||||
### 2.3 Verify the Disk Configuration
|
||||
|
||||
```bash
|
||||
# Aktuelle Disk-IDs anzeigen
|
||||
# Display current disk IDs
|
||||
ls -la /dev/disk/by-id/
|
||||
|
||||
# Mit Konfiguration vergleichen
|
||||
# Compare with the configuration
|
||||
cat hosts/<hostname>/disks.sh | grep DISK
|
||||
```
|
||||
|
||||
**Falls nötig:** Disk-ID in der Konfiguration anpassen.
|
||||
**If necessary:** Update the disk ID in the configuration.
|
||||
|
||||
### 2.4 Install-Script ausführen
|
||||
### 2.4 Run the Install Script
|
||||
|
||||
```bash
|
||||
bash scripts/install.sh -n <hostname>
|
||||
```
|
||||
|
||||
### 2.5 SSH-Host-Key wiederherstellen (Option A)
|
||||
### 2.5 Restore the SSH Host Key (Option A)
|
||||
|
||||
**Vor dem Reboot!**
|
||||
**Before rebooting!**
|
||||
|
||||
```bash
|
||||
# Host-Key vom Backup wiederherstellen
|
||||
# Restore the host key from backup
|
||||
cp /path/to/ssh_host_ed25519_key.backup /mnt/etc/ssh/ssh_host_ed25519_key
|
||||
cp /path/to/ssh_host_ed25519_key.pub.backup /mnt/etc/ssh/ssh_host_ed25519_key.pub
|
||||
chmod 600 /mnt/etc/ssh/ssh_host_ed25519_key
|
||||
|
|
@ -110,75 +110,75 @@ umount -Rl /mnt
|
|||
reboot
|
||||
```
|
||||
|
||||
## Schritt 3: Nach dem Reboot
|
||||
## Step 3: After the Reboot
|
||||
|
||||
### Bei Option A (Key wiederhergestellt)
|
||||
### Option A (Key Restored)
|
||||
|
||||
SOPS-Secrets sollten automatisch funktionieren. Testen:
|
||||
SOPS secrets should work automatically. Verify:
|
||||
|
||||
```bash
|
||||
sudo cat /run/secrets/tailscale/auth-key
|
||||
```
|
||||
|
||||
### Bei Option B (Neuer Key)
|
||||
### Option B (New Key)
|
||||
|
||||
Der Host kann die Secrets nicht entschlüsseln. Neuen Key konfigurieren:
|
||||
The host cannot decrypt the secrets. Configure the new key:
|
||||
|
||||
```bash
|
||||
# Neuen Age-Key ermitteln
|
||||
# Determine the new age key
|
||||
nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
|
||||
```
|
||||
|
||||
Auf dem Entwicklungsrechner:
|
||||
On the development machine:
|
||||
|
||||
```bash
|
||||
# .sops.yaml aktualisieren mit neuem Key
|
||||
# Update .sops.yaml with the new key
|
||||
vim .sops.yaml
|
||||
|
||||
# Secrets mit neuem Key neu verschlüsseln
|
||||
# Re-encrypt secrets with the new key
|
||||
sops updatekeys hosts/<hostname>/secrets.yaml
|
||||
```
|
||||
|
||||
Dann Konfiguration neu deployen:
|
||||
Then redeploy the configuration:
|
||||
|
||||
```bash
|
||||
NIX_SSHOPTS="-p 2299" nixos-rebuild switch --flake .#<hostname> \
|
||||
--target-host <user>@<IP> --sudo --ask-sudo-password
|
||||
```
|
||||
|
||||
## Häufige Probleme
|
||||
## Common Issues
|
||||
|
||||
### "No secret key available"
|
||||
|
||||
SOPS kann die Secrets nicht entschlüsseln. Ursache:
|
||||
- SSH-Host-Key stimmt nicht mit Age-Key in `.sops.yaml` überein
|
||||
SOPS cannot decrypt the secrets. Cause:
|
||||
- SSH host key does not match the age key in `.sops.yaml`
|
||||
|
||||
Lösung: Option B durchführen (neuen Key konfigurieren).
|
||||
Solution: Follow Option B (configure the new key).
|
||||
|
||||
### "Device not found" beim Partitionieren
|
||||
### "Device not found" during partitioning
|
||||
|
||||
Disk-ID in `disks.sh`/`disks.nix` ist falsch.
|
||||
The disk ID in `disks.sh`/`disks.nix` is incorrect.
|
||||
|
||||
```bash
|
||||
# Richtige ID finden
|
||||
# Find the correct ID
|
||||
ls -la /dev/disk/by-id/
|
||||
```
|
||||
|
||||
### Hardware-Config veraltet
|
||||
### Outdated Hardware Config
|
||||
|
||||
Bei neuer Hardware muss `hardware.nix` neu generiert werden:
|
||||
With new hardware, `hardware.nix` must be regenerated:
|
||||
|
||||
```bash
|
||||
# Install-Script generiert automatisch neu, falls Datei fehlt
|
||||
# The install script regenerates automatically if the file is missing
|
||||
rm hosts/<hostname>/hardware.nix
|
||||
bash scripts/install.sh -n <hostname>
|
||||
```
|
||||
|
||||
## Checkliste
|
||||
## Checklist
|
||||
|
||||
- [ ] Alten SSH-Host-Key gesichert (falls möglich)
|
||||
- [ ] Disk-IDs in Konfiguration geprüft/aktualisiert
|
||||
- [ ] Installation durchgeführt
|
||||
- [ ] SSH-Host-Key wiederhergestellt ODER neuen Key in SOPS konfiguriert
|
||||
- [ ] Secrets funktionieren (`sudo cat /run/secrets/...`)
|
||||
- [ ] Tailscale verbunden (`tailscale status`)
|
||||
- [ ] Old SSH host key backed up (if possible)
|
||||
- [ ] Disk IDs in configuration verified/updated
|
||||
- [ ] Installation completed
|
||||
- [ ] SSH host key restored OR new key configured in SOPS
|
||||
- [ ] Secrets are functional (`sudo cat /run/secrets/...`)
|
||||
- [ ] Tailscale connected (`tailscale status`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue