Files
schul-laptops/docs/architektur.md
Herb 9cd471d66e Konventions-Geruest anlegen (CLAUDE.md, docs, Obsidian-Vault)
Projekt-CLAUDE.md mit Status, Entscheidungslog E-001..E-006,
Architektur mit Mermaid-Diagrammen, COCKPIT/CHANGELOG als Vault-Start.
Alt-Doku (CLAUDE_KONTEXT.md, ZUSAMMENFASSUNG_TODO.md) darin aufgegangen.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 13:11:35 +02:00

2.9 KiB
Raw Permalink Blame History

Architektur

Stand: 2026-07-13

Ueberblick

Zwei getrennte Wege: laufende Updates (haeufig, automatisch, uebers Netz) und Komplett-Reimage (~1×/Jahr, von der externen Platte, ohne Netz).

flowchart LR
    subgraph Herb["Herb (laptop03 = Master)"]
        REPO["~/projekte/schul-laptops<br/>(git)"]
    end

    subgraph Hetzner["Hetzner 46.225.114.15 (nur Git!)"]
        GITEA["Gitea<br/>admin/schul-laptops (public)"]
        NGINX["Nginx<br/>git.lehrstun.de:443"]
        NGINX --> GITEA
    end

    subgraph Laptop["Schul-Laptop (laptop0116)"]
        TIMER["systemd-Timer<br/>Boot + alle 30 min"]
        PULL["schul-pull.sh →<br/>ansible-pull local.yml"]
        TIMER --> PULL
        CHECK["reimage-check.service<br/>(frueh im Boot)"]
        GRUB["GRUB-Eintrag<br/>Schul-Neuinstallation<br/>(Clonezilla toram)"]
        CHECK -- "Platte + neueres Image" --> GRUB
    end

    REPO -- "git push (SSH :2222)" --> GITEA
    PULL -- "HTTPS 443 (Standard)" --> NGINX
    PULL -. "Fallback: SSH :2222<br/>Deploy-Key (read-only)" .-> GITEA

    subgraph Platte["Externe Platte DEZNTRSICHERUNG"]
        IMG["schule-laptop-JJJJ-MM-TT/<br/>(mehrere, neuestes gewinnt)"]
    end

    GRUB -- "Mini-Menue: AUFSPIELEN (auto) /<br/>IMAGE ERSTELLEN / Abbrechen" --> IMG

Ablauf Reimage (ohne Stick)

sequenceDiagram
    participant P as Platte (DEZNTRSICHERUNG)
    participant L as Laptop (altes System)
    participant C as Clonezilla (toram, aus /boot/clonezilla)

    Note over L: Platte anstecken, einschalten
    L->>P: reimage-check: neuestes Image > /etc/schul-image-version?
    L->>L: grub-reboot "Schul-Neuinstallation" + Reboot
    C->>L: Hostname aus altem /etc/hostname lesen
    Note over C: Mini-Menue, "AUFSPIELEN" startet nach ~20 s
    C->>L: ocs-sr restoredisk (Batch, ohne Nachpruefung)
    C->>L: Hostname, SSH-Host-Keys, Machine-ID,<br/>Versionsdatei schreiben; Admin-Key loeschen (ausser laptop03)
    Note over L: Poweroff → naechster Boot: fertig, Pull laeuft weiter

Komponenten im Repo

Pfad Zweck
local.yml ansible-pull-Playbook (Updates, Pakete, Selbstverwaltung der Mechanik)
group_vars/all.yml Paketliste u.a. Variablen
files/schul-pull.sh Pull-Wrapper: HTTPS zuerst, SSH-Fallback, Journal-Log
files/ansible-pull.service/.timer systemd-Units (Boot + 30 min, RandomizedDelay)
files/first-boot-setup.sh Einmalig nach Erstinstallation: Hostname etc.
files/reimage-check.* Boot-Check: Platte erkannt → Reboot in Clonezilla
files/clonezilla/ Mini-Menue + ocs-sr-Batch-Skripte (Restore/Save)
playbooks/, inventory.yml, update-ips.sh Legacy-Push (nur Heimnetz)

Sicherheit

  • Repo public (nur Lesen), enthaelt keine Secrets.
  • Privater Gitea-Admin-Key existiert nur auf laptop03 (E-005).
  • Deploy-Key (Fallback) ist read-only und liegt unter /root/.ssh/ (600).
  • laptop03: reimage-check deaktiviert — der Master ueberschreibt sich nie selbst.