From ae18a546404361eabcd05e2b8eef6475f4f64c29 Mon Sep 17 00:00:00 2001 From: Lukas Pierchalla Date: Sun, 20 Sep 2026 11:19:38 +0200 Subject: [PATCH] update Dockerfile to install additional packages and modify entrypoint.sh to start DBus and gnome-keyring --- Dockerfile | 3 ++- entrypoint.sh | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f507398..d8a7529 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,8 @@ FROM python:3.13-slim-trixie ARG PUID=1000 ARG PGID=1000 -RUN apt-get update && apt-get install -y --no-install-recommends gosu \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + gosu dbus-x11 gnome-keyring libpam-gnome-keyring \ && rm -rf /var/lib/apt/lists/* RUN groupadd -g ${PGID} appgroup \ diff --git a/entrypoint.sh b/entrypoint.sh index 8f4d555..1b8e09a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,9 @@ #!/bin/sh set -e -# Berechtigungen für Volumes setzen (als root) chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true chmod 700 /tmp/sc-config 2>/dev/null || true -# config.toml immer schreiben — verhindert DBus/Keyring-Fehler mkdir -p "${SC_CONFIG_DIR:-/tmp/sc-config}" cat > "${SC_CONFIG_DIR:-/tmp/sc-config}/config.toml" <<'EOF' [auth] @@ -13,11 +11,19 @@ session_backend = "file" signing_key_backend = "file" EOF -# Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten +# DBus starten +dbus-daemon --session --fork --address="unix:path=/tmp/dbus-session" 2>/dev/null || true +export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-session + +# gnome-keyring als Secret Service starten (als appuser) +gosu appuser sh -c ' + echo -n "" | gnome-keyring-daemon --unlock --components=secrets 2>/dev/null + gnome-keyring-daemon --start --components=secrets 2>/dev/null || true +' + if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then shift exec gosu appuser python /app/scalable_sync.py "$@" fi -# Sonst: Befehl direkt als appuser ausführen (z. B. sc login) exec gosu appuser "$@" \ No newline at end of file