PromucFlow_constructor/app/server/entrypoint.sh
Shrikant Sharat Kandula e0358abb19 Fix MongoDB URI missing authSource
Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
(cherry picked from commit 531280c42e)
2021-12-24 21:53:25 +05:30

17 lines
643 B
Bash
Executable File

#!/bin/sh
# Add an `authSource` query param to MongoDB URI, if missing.
if [ -n "$APPSMITH_MONGODB_URI" ]; then
if ! echo "$APPSMITH_MONGODB_URI" | grep -Fq "authSource="; then
if echo "$APPSMITH_MONGODB_URI" | grep -Fq '?'; then
APPSMITH_MONGODB_URI="$APPSMITH_MONGODB_URI&authSource=admin"
else
APPSMITH_MONGODB_URI="$APPSMITH_MONGODB_URI?authSource=admin"
fi
fi
fi
echo "$APPSMITH_MONGODB_URI"
# Ref -Dlog4j2.formatMsgNoLookups=true https://spring.io/blog/2021/12/10/log4j2-vulnerability-and-spring-boot
exec java -Djava.security.egd="file:/dev/./urandom" "$@" -Dlog4j2.formatMsgNoLookups=true -jar server.jar