Commit 2dbef8
2026-06-03 09:05:11 claude: Host-Automatismen/Watcher-Doku + Notfall-Deaktivierung| home.md .. | |
| @@ 70,6 70,7 @@ | |
| - [[infrastruktur-uebersicht]] | |
| - [[operativer-einstieg]] | |
| - [[runbooks]] | |
| + | - [[host-automatismen]] |
| - [[storage-und-mounts]] | |
| - [[ct-102-pbs]] | |
| - [[ct-103-fileserver]] | |
| /dev/null .. host-automatismen.md | |
| @@ 0,0 1,100 @@ | |
| + | # Host-Automatismen & Watcher |
| + | |
| + | Automatisierte Jobs auf dem **Proxmox-Host** (`192.168.178.46`), die selbsttaetig Dateirechte/DNS anpassen. Hier dokumentiert, damit im Stoerungsfall klar ist, was sie tun und wie man sie abschaltet. |
| + | |
| + | > Alle Befehle als **root direkt auf dem Proxmox-Host** ausfuehren (nicht im Container). |
| + | |
| + | --- |
| + | |
| + | ## 1. webspace-perms — systemd Path-Watcher *(neu 2026-06-03)* |
| + | |
| + | **Zweck:** FileBrowser (CT 103) legt Uploads im Webspace mit Modus `640` ab → nginx (CT 111) darf sie nicht lesen → **403 Forbidden**. Dieser Watcher zieht neue Dateien automatisch auf `644` (Ordner `755`), ~1–2 s nach dem Upload. |
| + | |
| + | | | | |
| + | |---|---| |
| + | | Ueberwacht | `/mnt/storage/fileserver/webspace` (nur Top-Ordner) | |
| + | | Units | `/etc/systemd/system/webspace-perms.path` + `webspace-perms.service` | |
| + | | Wirkung | `chmod o+r` auf Files, `chmod o+rx` auf Dirs | |
| + | |
| + | **Status pruefen:** |
| + | ``` |
| + | systemctl status webspace-perms.path |
| + | ``` |
| + | **Voruebergehend deaktivieren:** |
| + | ``` |
| + | systemctl disable --now webspace-perms.path |
| + | ``` |
| + | **Komplett loeschen:** |
| + | ``` |
| + | systemctl disable --now webspace-perms.path |
| + | rm /etc/systemd/system/webspace-perms.path /etc/systemd/system/webspace-perms.service |
| + | systemctl daemon-reload |
| + | ``` |
| + | ⚠️ Nach Abschaltung sind neue Webspace-Uploads wieder 403, bis man manuell `chmod 644 /mnt/storage/fileserver/webspace/<datei>` auf dem **Host** ausfuehrt (im Container geht es nicht — unprivilegiertes LXC, Datei gehoert `nobody`). |
| + | |
| + | --- |
| + | |
| + | ## 2. cf-ddns — systemd Timer (Cloudflare DDNS) |
| + | |
| + | **Zweck:** aktualisiert alle 5 Min die A-Records (`ls-cloud.biz`, `sh0rt.biz`, `ls-x.cloud`) auf die aktuelle Public-IP. |
| + | |
| + | | | | |
| + | |---|---| |
| + | | Units | `/etc/systemd/system/cf-ddns.timer` + `cf-ddns.service` | |
| + | | Script | `/usr/local/bin/cf-ddns.sh` | |
| + | |
| + | **Deaktivieren:** |
| + | ``` |
| + | systemctl disable --now cf-ddns.timer |
| + | ``` |
| + | ⚠️ Bei Abschaltung zeigen nach einem IP-Wechsel alle Domains ins Leere → saemtliche externen Dienste nicht mehr erreichbar. |
| + | |
| + | --- |
| + | |
| + | ## 3. fix_media_acl — Cron (alle 5 Min) |
| + | |
| + | **Zweck:** setzt ACL-Maske `rwx` auf neue Media-/Download-Ordner, sonst koennen Sonarr/Radarr Dateien nicht verschieben. |
| + | |
| + | | | | |
| + | |---|---| |
| + | | Eintrag | root-crontab: `*/5 * * * * /usr/local/bin/fix_media_acl.sh` | |
| + | |
| + | **Deaktivieren:** `crontab -e` → Zeile mit `#` auskommentieren oder loeschen. |
| + | |
| + | --- |
| + | |
| + | ## 4. fix_series_structure — Cron (alle 30 Min) |
| + | |
| + | **Zweck:** korrigiert die Serien-Ordnerstruktur. Log: `/var/log/fix_series_structure.log` |
| + | |
| + | | | | |
| + | |---|---| |
| + | | Eintrag | root-crontab: `*/30 * * * * python3 /usr/local/bin/fix_series_structure.py` | |
| + | |
| + | **Deaktivieren:** `crontab -e` → Zeile auskommentieren/loeschen. |
| + | |
| + | --- |
| + | |
| + | ## 5. rom-chmod — Cron (alle 2 Min) |
| + | |
| + | **Zweck:** `chmod 644` auf EmulatorJS-ROMs (CT 114 Games), damit der Webserver sie ausliefern kann. |
| + | |
| + | | | | |
| + | |---|---| |
| + | | Datei | `/etc/cron.d/rom-chmod` | |
| + | | Inhalt | `*/2 * * * * root find /mnt/storage/fileserver/data/roms -type f ! -perm 644 -exec chmod 644 {} \;` | |
| + | |
| + | **Deaktivieren:** `rm /etc/cron.d/rom-chmod` (oder Zeile auskommentieren). |
| + | |
| + | --- |
| + | |
| + | ## Schnell-Uebersicht — alles auflisten |
| + | |
| + | ``` |
| + | systemctl list-units --type=path # Path-Watcher |
| + | systemctl list-timers # Timer (cf-ddns ...) |
| + | crontab -l # root-Crons |
| + | ls /etc/cron.d/ # System-Crons (rom-chmod ...) |
| + | ``` |
| + | |
| + | *Stand: 2026-06-03* |
