Durchsicht: Robustheit bei Neuinstallationen

- auth.py: .env auch in schreibgeschütztem Ordner aktualisieren (Server-Login)
- Controller: ohne Spotify-Login warten statt abstürzen; Playlist darf fehlen;
  nicht abspielbare Wünsche überspringen statt hängen zu bleiben
- install-server.sh: alle SSH-Ports freigeben (kein Aussperren), curl und
  python3-systemd (fail2ban) installieren
- install-player.sh: Bluetooth per rfkill entsperren und Dienst starten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 19:55:00 +01:00
co-authored by Claude Opus 5.5
parent 1c31ac2b6d
commit b83da952ee
6 changed files with 129 additions and 13 deletions
+8 -1
View File
@@ -73,10 +73,17 @@ def env_setzen(pfad: Path, key: str, wert: str) -> None:
if not gefunden:
neu.append(f"{key}={wert}")
inhalt = "\n".join(neu) + "\n"
if not os.access(pfad.parent, os.W_OK):
# z. B. Server: /opt/audiofy gehört root, nur die .env selbst dem Dienst-Benutzer
fd = os.open(pfad, os.O_WRONLY | os.O_TRUNC)
with os.fdopen(fd, "w") as f:
f.write(inhalt)
return
tmp = pfad.with_name(pfad.name + ".tmp")
fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
with os.fdopen(fd, "w") as f:
f.write("\n".join(neu) + "\n")
f.write(inhalt)
os.replace(tmp, pfad)