Adding OnlyOffice compose
This PR adds a compose.onlyoffice.yaml file and the corresponding configuration and description in README.md.
This commit is contained in:
42
onlyoffice-entrypoint.sh
Normal file
42
onlyoffice-entrypoint.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# OnlyOffice init — runs before the original CryptPad entrypoint.
|
||||
# Ensures oldest_needed_version in onlyoffice.properties matches
|
||||
# ONLYOFFICE_OLDEST before install-onlyoffice.sh / CryptPad reads it.
|
||||
|
||||
CONF_DIR="/cryptpad/onlyoffice-conf"
|
||||
PROPS="${CONF_DIR}/onlyoffice.properties"
|
||||
|
||||
# Wait for init-onlyoffice-dirs to chown the volumes. Swarm ignores
|
||||
# depends_on, so the init sidecar and this container start in parallel.
|
||||
waited=0
|
||||
while [ ! -w "${CONF_DIR}" ]; do
|
||||
if [ "${waited}" -ge 60 ]; then
|
||||
echo "[onlyoffice-entrypoint] timed out waiting for ${CONF_DIR} to become writable" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "[onlyoffice-entrypoint] waiting for ${CONF_DIR} to be writable (${waited}s)"
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -n "${ONLYOFFICE_OLDEST:-}" ]; then
|
||||
mkdir -p "${CONF_DIR}"
|
||||
touch "${PROPS}"
|
||||
if grep -q '^oldest_needed_version=' "${PROPS}"; then
|
||||
sed -i "s|^oldest_needed_version=.*|oldest_needed_version=${ONLYOFFICE_OLDEST}|" "${PROPS}"
|
||||
else
|
||||
echo "oldest_needed_version=${ONLYOFFICE_OLDEST}" >> "${PROPS}"
|
||||
fi
|
||||
echo "[onlyoffice-entrypoint] oldest_needed_version=${ONLYOFFICE_OLDEST}"
|
||||
else
|
||||
echo "[onlyoffice-entrypoint] ONLYOFFICE_OLDEST unset, leaving ${PROPS} untouched"
|
||||
fi
|
||||
|
||||
# Chain through the SSO entrypoint if compose.sso.yml mounted it.
|
||||
if [ -x /sso-entrypoint.sh ]; then
|
||||
exec /sso-entrypoint.sh "$@"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user