Release v1.0.7: OAuth-Server korrekt auf 0.0.0.0 gebunden
Die bisherigen Patches zielten auf Muster, die in oauth/src/lib.rs nicht vorhanden sind. Der tatsächliche Bind-Aufruf ist TcpListener::bind(socket_address) – dieser wird jetzt direkt durch SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, port) ersetzt. Dadurch ist der OAuth-Callback-Server unter http://<ha-ip>:5588 erreichbar. Der Benutzer ersetzt nach der Spotify-Weiterleitung 127.0.0.1 durch die HA-IP in der Adressleiste. run.sh erkennt die HA-IP automatisch und zeigt eine klare Schritt-für-Schritt-Anleitung beim ersten Start. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,15 @@ bashio::log.info "Icecast läuft (PID: ${ICECAST_PID})"
|
||||
CREDENTIAL_CACHE="/data/librespot-cache"
|
||||
mkdir -p "${CREDENTIAL_CACHE}"
|
||||
|
||||
# ── IP-Adresse des Hosts ermitteln (für OAuth-Anleitung) ─────────────────────
|
||||
HA_IP=$(ip route get 1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="src") print $(i+1)}' | head -1)
|
||||
if [ -z "${HA_IP}" ]; then
|
||||
HA_IP=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||
fi
|
||||
if [ -z "${HA_IP}" ]; then
|
||||
HA_IP="<homeassistant-ip>"
|
||||
fi
|
||||
|
||||
# ── Librespot-Argumente zusammenstellen ───────────────────────────────────────
|
||||
# Zeroconf/mDNS funktioniert nicht zuverlässig in Containern, da Port 5353
|
||||
# vom Host (systemd-resolved/avahi) bereits belegt ist.
|
||||
@@ -162,9 +171,23 @@ else
|
||||
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
bashio::log.info "ERSTER START – Spotify-Autorisierung erforderlich!"
|
||||
bashio::log.info ""
|
||||
bashio::log.info "librespot gibt gleich eine URL aus. Öffne diese"
|
||||
bashio::log.info "im Browser und melde dich mit deinem Spotify-Konto an."
|
||||
bashio::log.info "Danach startet das Add-on automatisch durch."
|
||||
bashio::log.info "1) librespot gibt gleich eine 'Browse to:'-URL aus."
|
||||
bashio::log.info " Kopiere diese URL und öffne sie im Browser."
|
||||
bashio::log.info ""
|
||||
bashio::log.info "2) Melde dich mit deinem Spotify-Konto an"
|
||||
bashio::log.info " und erteile die Berechtigung."
|
||||
bashio::log.info ""
|
||||
bashio::log.info "3) Dein Browser wird danach weitergeleitet auf:"
|
||||
bashio::log.info " http://127.0.0.1:5588/login?code=..."
|
||||
bashio::log.info " Diese Seite schlägt fehl – das ist normal."
|
||||
bashio::log.info ""
|
||||
bashio::log.info "4) WICHTIG: Ersetze in der Adressleiste"
|
||||
bashio::log.info " '127.0.0.1' durch '${HA_IP}'"
|
||||
bashio::log.info " → http://${HA_IP}:5588/login?code=..."
|
||||
bashio::log.info " und drücke Enter."
|
||||
bashio::log.info ""
|
||||
bashio::log.info "5) Bei Erfolg siehst du: 'Autorisierung erfolgreich!'"
|
||||
bashio::log.info " Das Add-on startet danach automatisch."
|
||||
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user