mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 19:04:43 +00:00
Our custom `docker-entrypoint.sh` starts nginx by directly calling `nginx -g "daemon off;"`. However, we need the `docker-entrypoint.sh` built-in in the nginx docker image to convert `default.conf.template` to the actual nginx config file. Without going through nginx's `docker-entrypoint.sh`, the resultant docker image fallback to the default nginx configuration, which doesn't forward traffic to webdav backend server. This patch fixes this by calling the nginx's `docker-entrypoint.sh` at the end of our custom `docker-entrypoint.sh`. Fix: The first issue in https://github.com/johannesjo/super-productivity/issues/4545#issuecomment-2974843258
34 lines
1.2 KiB
Bash
Executable file
34 lines
1.2 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
# Generate ./assets/sync-config-default-override.json from environment variables
|
|
JSON="{}"
|
|
JSON_PATH=./assets/sync-config-default-override.json
|
|
if [ -n "${WEBDAV_BASE_URL}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".webDav.baseUrl |= \"$WEBDAV_BASE_URL\"")
|
|
fi
|
|
if [ -n "${WEBDAV_USERNAME}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".webDav.userName |= \"$WEBDAV_USERNAME\"")
|
|
fi
|
|
if [ -n "${WEBDAV_SYNC_FOLDER_PATH}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".webDav.syncFolderPath |= \"$WEBDAV_SYNC_FOLDER_PATH\"")
|
|
fi
|
|
if [ "$JSON" != "{}" ]; then
|
|
# Change syncProvider if previous variables are set
|
|
JSON=$(echo "$JSON" | jq '.syncProvider |= "WebDAV"')
|
|
fi
|
|
if [ -n "${SYNC_INTERVAL}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".syncInterval |= $(expr $SYNC_INTERVAL \* 60000)")
|
|
fi
|
|
if [ -n "${IS_COMPRESSION_ENABLED}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".isCompressionEnabled |= $IS_COMPRESSION_ENABLED")
|
|
fi
|
|
if [ -n "${IS_ENCRYPTION_ENABLED}" ]; then
|
|
JSON=$(echo "$JSON" | jq ".isEncryptionEnabled |= $IS_ENCRYPTION_ENABLED")
|
|
fi
|
|
if [ "$JSON" != "{}" ]; then
|
|
# Write the resultant json
|
|
echo "$JSON" >$JSON_PATH
|
|
fi
|
|
|
|
# go back to nginx's built-in entrypoint script
|
|
exec /docker-entrypoint.sh nginx -g "daemon off;"
|