update entrypoint.sh to create config.toml and adjust environment variables in scalable_sync.py

This commit is contained in:
Lukas Pierchalla
2026-09-20 11:13:23 +02:00
parent 7d6b119953
commit 2e3e5e43cc
3 changed files with 10 additions and 1 deletions
+1
View File
@@ -6,6 +6,7 @@ services:
SCALABLE_CLI_VERSION: "1.0.0" SCALABLE_CLI_VERSION: "1.0.0"
PUID: ${PUID} PUID: ${PUID}
PGID: ${PGID} PGID: ${PGID}
command: ["--daemon"]
image: scalable-sync:latest image: scalable-sync:latest
hostname: scalable-sync hostname: scalable-sync
container_name: scalable-sync container_name: scalable-sync
+8
View File
@@ -5,6 +5,14 @@ set -e
chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true
chmod 700 /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]
session_backend = "file"
signing_key_backend = "file"
EOF
# Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten # Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten
if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then
shift shift
+1 -1
View File
@@ -59,7 +59,7 @@ log = logging.getLogger("scalable-sync")
def sc(*args: str, timeout: int = 60) -> dict: def sc(*args: str, timeout: int = 60) -> dict:
cmd = ["sc"] + list(args) cmd = ["sc"] + list(args)
env = {**os.environ, "HOME": "/home/sync", "SC_CONFIG_DIR": str(SC_CONFIG_DIR)} env = {**os.environ, "HOME": "/home/appuser", "SC_CONFIG_DIR": str(SC_CONFIG_DIR)}
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, env=env) result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, env=env)
if result.returncode != 0: if result.returncode != 0:
log.error("sc failed: %s", result.stderr) log.error("sc failed: %s", result.stderr)