update entrypoint.sh to create config.toml and adjust environment variables in scalable_sync.py
This commit is contained in:
@@ -6,6 +6,7 @@ services:
|
||||
SCALABLE_CLI_VERSION: "1.0.0"
|
||||
PUID: ${PUID}
|
||||
PGID: ${PGID}
|
||||
command: ["--daemon"]
|
||||
image: scalable-sync:latest
|
||||
hostname: scalable-sync
|
||||
container_name: scalable-sync
|
||||
|
||||
@@ -5,6 +5,14 @@ set -e
|
||||
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]
|
||||
session_backend = "file"
|
||||
signing_key_backend = "file"
|
||||
EOF
|
||||
|
||||
# Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten
|
||||
if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then
|
||||
shift
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ log = logging.getLogger("scalable-sync")
|
||||
|
||||
def sc(*args: str, timeout: int = 60) -> dict:
|
||||
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)
|
||||
if result.returncode != 0:
|
||||
log.error("sc failed: %s", result.stderr)
|
||||
|
||||
Reference in New Issue
Block a user