diff --git a/Dockerfile b/Dockerfile index e40c37d..c181aac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ RUN addgroup --system app && adduser --system --ingroup app app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app ./app +COPY THIRD_PARTY_NOTICES.md ./THIRD_PARTY_NOTICES.md +RUN test -s /app/app/static/favicon.ico && test -s /app/THIRD_PARTY_NOTICES.md USER app EXPOSE 5000 HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/health', timeout=2)"] diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..2b1cffb --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,15 @@ +# Third-Party Notices + +## Lucide `volume-2` icon + +The application favicon is based on the Lucide `volume-2` icon and has been modified with the Sonos-Web color palette and background. + +Source: https://lucide.dev/icons/volume-2 + +ISC License + +Copyright (c) 2026 Lucide Icons and Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/app/static/favicon.ico b/app/static/favicon.ico new file mode 100644 index 0000000..6d709fe Binary files /dev/null and b/app/static/favicon.ico differ diff --git a/app/templates/index.html b/app/templates/index.html index 1312666..da63484 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,6 +1,6 @@ -Sonos Steuerung +Sonos Steuerung

Sonos NestControl

Räume werden gesucht …

Gruppe erstellen

Mitglieder
diff --git a/tests/test_app.py b/tests/test_app.py index 5f5e4c8..21bade3 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,4 +1,5 @@ import math +import struct import threading from pathlib import Path from types import SimpleNamespace @@ -217,6 +218,25 @@ def test_api_never_discovers_real_devices(monkeypatch, zone): discover.assert_called_once() +def test_favicon_is_linked_and_served(service): + client = create_app({"TESTING": True}, service).test_client() + page = client.get("/") + assert b'rel="icon" type="image/x-icon" href="/static/favicon.ico"' in page.data + assert b'sizes="16x16 32x32 48x48 64x64"' in page.data + favicon = client.get("/static/favicon.ico") + assert favicon.status_code == 200 + assert favicon.mimetype in {"image/vnd.microsoft.icon", "image/x-icon"} + reserved, image_type, image_count = struct.unpack_from(" 0 + assert image_offset >= 6 + image_count * 16 + assert image_offset + byte_count <= len(favicon.data) + + @pytest.mark.parametrize("name,value", [ ("SONOS_OPERATION_TIMEOUT", 0), ("SONOS_OPERATION_TIMEOUT", math.inf), ("SONOS_DISCOVERY_TIMEOUT", -1), ("SONOS_DISCOVERY_TIMEOUT", math.nan),