From 8350b0836881314bc8e170c1518f8e2217fa7390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=BChne?= <42kdesigners@gmail.com> Date: Wed, 4 Nov 2026 16:13:06 +0100 Subject: [PATCH] =?UTF-8?q?v1.1.2:=20fertige=20Images=20aus=20der=20Gitea-?= =?UTF-8?q?Registry=20statt=20Build=20auf=20dem=20Ger=C3=A4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .gitea/workflows/images.yml baut amd64 + aarch64 (QEMU) bei v*-Tags und pusht nach gitea.bitfire.work/retr0/busch-radio-spotify-{arch} - config.yaml: image: gesetzt, armhf/armv7 entfernt (rust:alpine gibt es dort nicht, Build ging nie) - io.hass-Labels im Dockerfile, Doku angepasst Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CGNdWh2jLNNb3tb9v1WEuK --- .gitea/workflows/images.yml | 50 ++++++++++++++++++++++++++++++++ README.md | 16 +++++----- busch_radio_spotify/CHANGELOG.md | 7 +++++ busch_radio_spotify/DOCS.md | 8 ++--- busch_radio_spotify/Dockerfile | 5 ++++ busch_radio_spotify/build.yaml | 4 +-- busch_radio_spotify/config.yaml | 7 +++-- busch_radio_spotify/run.sh | 4 +-- 8 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/images.yml diff --git a/.gitea/workflows/images.yml b/.gitea/workflows/images.yml new file mode 100644 index 0000000..7f670ed --- /dev/null +++ b/.gitea/workflows/images.yml @@ -0,0 +1,50 @@ +name: Images + +# Baut die fertigen Add-on-Images (amd64 + aarch64) und legt sie in die Gitea-Registry. +# HA lädt sie dann nur noch herunter, statt 15 min (Pi: über 1 h) selbst zu bauen. +# +# Release-Reihenfolge (HA liest config.yaml vom main-Branch!): +# 1. Version in config.yaml erhöhen, auf einem Branch committen und dort v taggen +# 2. Dieser Workflow baut und pusht die Images (aarch64 per QEMU, dauert entsprechend) +# 3. Erst danach den Branch nach main bringen – sonst bieten HA-Instanzen ein Update an, +# dessen Image es noch nicht gibt. +on: + push: + tags: ["v*"] + workflow_dispatch: + +jobs: + images: + # LXC 113 auf dem Proxmox (Docker + QEMU-binfmt vom Host) + runs-on: linux-x64 + timeout-minutes: 300 + steps: + - uses: actions/checkout@v4 + - name: Bauen und hochladen + shell: bash + env: + # Eigenes Token (nur write:package) als Repo-Secret REGISTRY_TOKEN, sonst das automatische Workflow-Token + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN || gitea.token }} + REGISTRY_USER: ${{ secrets.REGISTRY_TOKEN && 'retr0' || gitea.actor }} + run: | + set -euo pipefail + V=$(sed -n 's/^version: "\(.*\)"/\1/p' busch_radio_spotify/config.yaml) + if [ "${GITHUB_REF_TYPE:-}" = "tag" ] && [ "${GITHUB_REF_NAME#v}" != "$V" ]; then + echo "Tag ${GITHUB_REF_NAME} passt nicht zu config.yaml-Version ${V}"; exit 1 + fi + REG=gitea.bitfire.work + R=$REG/retr0/busch-radio-spotify + echo "$REGISTRY_TOKEN" | docker login "$REG" -u "$REGISTRY_USER" --password-stdin + for a in amd64:linux/amd64 aarch64:linux/arm64; do + arch=${a%%:*}; plat=${a#*:} + echo "::group::$arch ($plat)" + DOCKER_BUILDKIT=1 docker build --pull --platform "$plat" \ + --build-arg BUILD_FROM=ghcr.io/hassio-addons/debian-base:9.5.0 \ + --build-arg BUILD_ARCH="$arch" --build-arg BUILD_VERSION="$V" \ + -t "$R-$arch:$V" -t "$R-$arch:latest" busch_radio_spotify + docker push -q "$R-$arch:$V" + docker push -q "$R-$arch:latest" + echo "::endgroup::" + done + docker logout "$REG" + # ponytail: aarch64 kompiliert librespot unter QEMU (langsam); Cross-Compile, falls Releases häufiger werden diff --git a/README.md b/README.md index 042292c..aabb76d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Das **Busch-Jäger Unterputz-Internetradio** kann nur Internetradio-Streams absp Dieses Home Assistant Add-on erstellt ein virtuelles Spotify Connect-Gerät und stellt das Audio als MP3- oder AAC-Stream über Icecast bereit. Als Spotify-Empfänger dient ab Version 1.1.0 **[Spotify Soloist](https://developer.spotify.com)**, Spotifys offizieller Client für Linux. -Ohne Soloist-API-Key (und auf 32-Bit-Geräten) läuft weiterhin **[librespot](https://github.com/librespot-org/librespot)** als Rückfall. +Ohne Soloist-API-Key läuft weiterhin **[librespot](https://github.com/librespot-org/librespot)** als Rückfall. > **Warum Soloist?** Spotify verweigert librespot seit 2025/26 bei vielen Konten die Audio-Schlüssel. > Im Log erscheint dann bei jedem Titel `error audio key 0 1` und es bleibt still @@ -40,7 +40,7 @@ Spotify-App → [Spotify Connect] → Soloist → PipeWire → pw-record ─┐ |---|---| | Home Assistant | OS, Supervised oder Container | | Spotify Premium | Pflicht für Spotify Connect und für den Soloist-API-Key | -| Architektur | Soloist: amd64 oder aarch64 (z. B. Raspberry Pi 4/5 mit 64-Bit-OS); 32-Bit nur librespot | +| Architektur | amd64 oder aarch64 (z. B. Raspberry Pi 4/5 mit 64-Bit-OS); 32-Bit wird nicht unterstützt | | Internet | Soloist wird beim Start von Spotify geladen und alle 12 h aktualisiert | | Busch-Jäger Radio | Muss benutzerdefinierte Stream-URLs unterstützen | @@ -54,7 +54,7 @@ Spotify-App → [Spotify Connect] → Soloist → PipeWire → pw-record ─┐ 2. Drei Punkte oben rechts → **Repositories** 3. URL eintragen: `https://gitea.bitfire.work/retr0/Busch-Radio-Spotify` 4. **Busch-Radio Spotify Bridge** erscheint im Store -5. Installieren (der erste Build dauert ~10–15 Minuten wegen Rust-Kompilierung) +5. Installieren (fertiges Image, dauert nur so lange wie der Download) ### 2. Add-on konfigurieren @@ -175,8 +175,9 @@ librespot: Spotify → librespot (dekodiert, PCM auf stdout) ### Hinweise zum Build -- amd64/aarch64 nutzen ein Debian-Basisimage (Soloist braucht glibc ≥ 2.38), 32-Bit bleibt Alpine -- librespot wird aus dem Quellcode kompiliert (Rust, ~10–15 Min.), statisch gelinkt – läuft auf beiden Basisimages +- Debian-Basisimage (Soloist braucht glibc ≥ 2.38); librespot wird aus dem Quellcode kompiliert und statisch gelinkt +- Die Images baut `.gitea/workflows/images.yml` bei jedem `v*`-Tag (aarch64 per QEMU) und legt sie in die Gitea-Registry; + HA lädt sie nur herunter. Reihenfolge beim Release: auf einem Branch taggen, Images abwarten, dann nach main - Soloist liegt in `/data/soloist/bin`; Builds laufen nach 90 Tagen ab, das Add-on lädt rechtzeitig neue und wechselt, sobald gerade nichts spielt - Der OAuth-Callback-Server bindet an `0.0.0.0` statt `127.0.0.1`, damit der Browser-Login aus dem Heimnetz funktioniert @@ -196,7 +197,7 @@ librespot: Spotify → librespot (dekodiert, PCM auf stdout) | Stream bricht bei Pause ab | Auf Version 1.0.11+ aktualisieren | | Songs wechseln zu schnell | Auf Version 1.0.10+ aktualisieren | | Neu autorisieren | Add-on stoppen → `/data/librespot-cache/credentials.json` löschen → neu starten | -| Build schlägt fehl | Logs im Add-on Store prüfen | +| Installation schlägt fehl | Erreicht HA `gitea.bitfire.work`? Logs im Add-on Store prüfen | --- @@ -205,7 +206,7 @@ librespot: Spotify → librespot (dekodiert, PCM auf stdout) ``` busch-radio-spotify/ ├── busch_radio_spotify/ # Home Assistant Add-on -│ ├── Dockerfile # Multi-Stage Build (Rust → Debian bzw. Alpine) +│ ├── Dockerfile # Multi-Stage Build (Rust → Debian) │ ├── config.yaml # Add-on Manifest & Optionen │ ├── build.yaml # Multi-Arch Konfiguration │ ├── DOCS.md # Add-on Dokumentation (in HA angezeigt) @@ -223,6 +224,7 @@ busch-radio-spotify/ │ ├── media_player.py │ ├── config_flow.py │ └── translations/ +├── .gitea/workflows/images.yml # Baut die fertigen Images ├── repository.yaml # HA Repository-Manifest └── README.md ``` diff --git a/busch_radio_spotify/CHANGELOG.md b/busch_radio_spotify/CHANGELOG.md index 7cf532d..81ec160 100644 --- a/busch_radio_spotify/CHANGELOG.md +++ b/busch_radio_spotify/CHANGELOG.md @@ -1,5 +1,12 @@ # Änderungsprotokoll +## 1.1.2 + +- **Fertige Images**: Das Add-on wird nicht mehr auf dem Gerät gebaut, sondern als fertiges Image aus der + Gitea-Registry geladen. Installation und Updates dauern Sekunden statt 15 Minuten (Pi: über eine Stunde) +- 32-Bit (armhf/armv7) aus der Architektur-Liste entfernt – der Build hat dort nie funktioniert, + weil es das Rust-Basisimage für 32-Bit-ARM nicht gibt + ## 1.1.1 - **Fix**: 1.1.0 brach auf amd64/aarch64 direkt nach dem Icecast-Start ab – im Debian-Image fehlte `ip` (iproute2) diff --git a/busch_radio_spotify/DOCS.md b/busch_radio_spotify/DOCS.md index 4ea4f41..22eaa03 100644 --- a/busch_radio_spotify/DOCS.md +++ b/busch_radio_spotify/DOCS.md @@ -3,7 +3,7 @@ Streamt Spotify-Musik als Internetradio-Stream für das Busch-Jäger Unterputz-Internetradio. Ein virtuelles Spotify Connect-Gerät nimmt Audio entgegen und stellt es per Icecast als HTTP-Stream bereit. -Empfänger ist **Spotify Soloist** (Spotifys offizieller Client); ohne API-Key oder auf 32-Bit-Geräten **librespot**. +Empfänger ist **Spotify Soloist** (Spotifys offizieller Client); ohne API-Key **librespot**. ``` Spotify-App → Soloist / librespot → ffmpeg → Icecast → Busch-Jäger Radio @@ -46,7 +46,7 @@ das Add-on prüft alle 12 Stunden auf neue und wechselt, sobald gerade nichts sp | `stream_port` | `8000` | HTTP-Port des Icecast-Streams | | `stream_mount` | `/stream` | URL-Pfad des Streams | | `icecast_password` | – | Internes Icecast-Passwort (bitte ändern) | -| `soloist_api_key` | leer | Soloist-API-Key; leer = librespot. Nur amd64/aarch64 | +| `soloist_api_key` | leer | Soloist-API-Key; leer = librespot | --- @@ -83,7 +83,7 @@ das Add-on prüft alle 12 Stunden auf neue und wechselt, sobald gerade nichts sp ## Technische Hinweise -- amd64/aarch64 laufen auf Debian (Soloist braucht glibc), 32-Bit auf Alpine (nur librespot) -- librespot wird beim Build aus dem Quellcode kompiliert (Rust) – der erste Build dauert ca. 10–15 Minuten +- Läuft auf amd64 und aarch64 (Debian-Basis, Soloist braucht glibc); 32-Bit wird nicht unterstützt +- Das Add-on kommt als fertiges Image aus der Gitea-Registry – Installation und Updates gehen in Sekunden - Audio wird nicht gespeichert – ausschließlich live gestreamt - Spotify Premium ist für Spotify Connect erforderlich diff --git a/busch_radio_spotify/Dockerfile b/busch_radio_spotify/Dockerfile index 4042b7f..5d350be 100644 --- a/busch_radio_spotify/Dockerfile +++ b/busch_radio_spotify/Dockerfile @@ -87,4 +87,9 @@ COPY oauth_helper.py /oauth_helper.py COPY soloist-fetch.sh /usr/local/bin/soloist-fetch RUN chmod a+x /run.sh /oauth_helper.py /usr/local/bin/soloist-fetch +ARG BUILD_ARCH +ARG BUILD_VERSION +LABEL io.hass.type="addon" io.hass.arch="${BUILD_ARCH}" io.hass.version="${BUILD_VERSION}" \ + io.hass.name="Busch-Radio Spotify Bridge" + CMD ["/run.sh"] diff --git a/busch_radio_spotify/build.yaml b/busch_radio_spotify/build.yaml index 063c65f..d86c7d4 100644 --- a/busch_radio_spotify/build.yaml +++ b/busch_radio_spotify/build.yaml @@ -1,8 +1,6 @@ --- # Multi-Architektur Build-Konfiguration für das HA Add-on. -# amd64/aarch64 auf Debian (glibc, für Spotify Soloist), 32-Bit bleibt Alpine (nur librespot). +# Debian (glibc, für Spotify Soloist). 32-Bit entfällt: rust:alpine gibt es dort nicht. build_from: aarch64: ghcr.io/hassio-addons/debian-base:9.5.0 amd64: ghcr.io/hassio-addons/debian-base:9.5.0 - armhf: ghcr.io/home-assistant/armhf-base:latest - armv7: ghcr.io/home-assistant/armv7-base:latest diff --git a/busch_radio_spotify/config.yaml b/busch_radio_spotify/config.yaml index edff6b9..be221b6 100644 --- a/busch_radio_spotify/config.yaml +++ b/busch_radio_spotify/config.yaml @@ -1,6 +1,6 @@ --- name: "Busch-Radio Spotify Bridge" -version: "1.1.1" +version: "1.1.2" slug: busch_radio_spotify description: > Streamt Spotify-Musik als Internet-Radio-Stream für das Busch-Jäger Unterputz-Internetradio. @@ -10,8 +10,9 @@ url: "https://gitea.bitfire.work/retr0/Busch-Radio-Spotify" arch: - aarch64 - amd64 - - armhf - - armv7 +# Fertige Images aus der Gitea-Registry (gebaut von .gitea/workflows/images.yml). +# HA lädt nur herunter statt selbst zu bauen. Tag = version. +image: "gitea.bitfire.work/retr0/busch-radio-spotify-{arch}" init: false homeassistant: "2023.1.0" diff --git a/busch_radio_spotify/run.sh b/busch_radio_spotify/run.sh index 3880c1c..82d7768 100644 --- a/busch_radio_spotify/run.sh +++ b/busch_radio_spotify/run.sh @@ -6,7 +6,7 @@ # 1. Icecast2 – HTTP-Stream-Server # 2. Spotify-Empfänger, je nach Modus: # soloist – Spotifys offizieller Client → PipeWire-Senke → pw-record (PCM auf stdout) -# librespot – Rückfall ohne API-Key bzw. auf 32-Bit (PCM auf stdout), +# librespot – Rückfall ohne API-Key (PCM auf stdout), # dazu OAuth-Einrichtungs-Assistent auf Port 5589 # 4. Silence-Injektor– Fügt Stille ein wenn Spotify pausiert (hält Stream aufrecht) # 5. ffmpeg – Kodiert PCM → MP3/AAC und schickt es als Icecast-Quelle @@ -53,7 +53,7 @@ else fi bashio::log.info "╔══════════════════════════════════════════════╗" -bashio::log.info "║ Busch-Radio Spotify Bridge v1.1.1 ║" +bashio::log.info "║ Busch-Radio Spotify Bridge v1.1.2 ║" bashio::log.info "╚══════════════════════════════════════════════╝" bashio::log.info "Gerätename : ${DEVICE_NAME}" bashio::log.info "Empfänger : ${MODUS}"