Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(docker): force application data path to /app/data

johaven8e9233ef7e03
diff --git a/docker/environment.yaml b/docker/environment.yaml
index 0c204c73..3964c51f 100644
--- a/docker/environment.yaml
+++ b/docker/environment.yaml
@@ -18,7 +18,6 @@ auth:
secret:
applications:
files:
- dataPath: /app/data
editors:
collabora:
enabled: false
diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh
index b42a4c37..c2ffe7d2 100644
--- a/scripts/docker-entrypoint.sh
+++ b/scripts/docker-entrypoint.sh
@@ -5,6 +5,9 @@ set -eu
: "${PGID:?PGID is not defined}"
: "${FORCE_PERMISSIONS:=false}"
+# The Docker image and its startup scripts use /app/data as the persistent data directory.
+export SYNCIN_APPLICATIONS_FILES_DATAPATH=/app/data
+
# Create syncin group if needed
group_name=$(getent group "${PGID}" | cut -d: -f1)
if [ -z "${group_name}" ]; then
@@ -22,11 +25,11 @@ fi
chown "${PUID}:${PGID}" /app
# Change application data ownership to syncin if needed
-CURRENT_UID=$(stat -c '%u' /app/data)
-CURRENT_GID=$(stat -c '%g' /app/data)
+CURRENT_UID=$(stat -c '%u' "${SYNCIN_APPLICATIONS_FILES_DATAPATH}")
+CURRENT_GID=$(stat -c '%g' "${SYNCIN_APPLICATIONS_FILES_DATAPATH}")
if [ "${CURRENT_UID}" != "${PUID}" ] || [ "${CURRENT_GID}" != "${PGID}" ] || [ "${FORCE_PERMISSIONS}" = "true" ]; then
- chown -R "${PUID}:${PGID}" /app/data
+ chown -R "${PUID}:${PGID}" "${SYNCIN_APPLICATIONS_FILES_DATAPATH}"
fi
umask 027
diff --git a/scripts/docker-sync-in-server.sh b/scripts/docker-sync-in-server.sh
index 438a7804..0a88daa7 100755
--- a/scripts/docker-sync-in-server.sh
+++ b/scripts/docker-sync-in-server.sh
@@ -38,7 +38,7 @@ if [ "${SKIP_INIT}" != "true" ]; then
fi
fi
touch .init
- chmod 750 /app/data
+ chmod 750 "${SYNCIN_APPLICATIONS_FILES_DATAPATH}"
fi
else
echo "SKIP_INIT invoked"
@@ -46,7 +46,7 @@ fi
if [ "${FORCE_PERMISSIONS}" = "true" ]; then
echo "FORCE_PERMISSIONS: Applying recursive permissions (Dirs: 750, Files: 640)..."
- chmod -R u=rwX,g=rX,o= /app/data
+ chmod -R u=rwX,g=rX,o= "${SYNCIN_APPLICATIONS_FILES_DATAPATH}"
fi
exec node server/main.js