Load env variables at start of backend and rts (#9325)
Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
This commit is contained in:
parent
d96c4981ca
commit
94f5a87cdd
|
|
@ -1,11 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
NGINX_SSL_CMNT="#"
|
||||
ENV_PATH="/appsmith-stacks/configuration/docker.env"
|
||||
echo 'Load environment configuration'
|
||||
set -o allexport
|
||||
. "$ENV_PATH"
|
||||
set +o allexport
|
||||
|
||||
TEMPLATE_DIR="/opt/appsmith/templates"
|
||||
APP_TEMPLATE="$TEMPLATE_DIR/nginx-app-http.conf.template.sh"
|
||||
|
|
|
|||
33
deploy/docker/scripts/run-with-env.sh
Executable file
33
deploy/docker/scripts/run-with-env.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
ENV_PATH="/appsmith-stacks/configuration/docker.env"
|
||||
echo 'Load environment configuration'
|
||||
set -o allexport
|
||||
. "$ENV_PATH"
|
||||
set +o allexport
|
||||
|
||||
if [[ -z "${APPSMITH_MAIL_ENABLED}" ]]; then
|
||||
unset APPSMITH_MAIL_ENABLED # If this field is empty is might cause application crash
|
||||
fi
|
||||
|
||||
if [[ -z "${APPSMITH_OAUTH2_GITHUB_CLIENT_ID}" ]] || [[ -z "${APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET}" ]]; then
|
||||
unset APPSMITH_OAUTH2_GITHUB_CLIENT_ID # If this field is empty is might cause application crash
|
||||
unset APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET
|
||||
fi
|
||||
|
||||
if [[ -z "${APPSMITH_OAUTH2_GOOGLE_CLIENT_ID}" ]] || [[ -z "${APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET}" ]]; then
|
||||
unset APPSMITH_OAUTH2_GOOGLE_CLIENT_ID # If this field is empty is might cause application crash
|
||||
unset APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET
|
||||
fi
|
||||
|
||||
if [[ -z "${APPSMITH_GOOGLE_MAPS_API_KEY}" ]]; then
|
||||
unset APPSMITH_GOOGLE_MAPS_API_KEY
|
||||
fi
|
||||
|
||||
if [[ -z "${APPSMITH_RECAPTCHA_SITE_KEY}" ]] || [[ -z "${APPSMITH_RECAPTCHA_SECRET_KEY}" ]] || [[ -z "${APPSMITH_RECAPTCHA_ENABLED}" ]]; then
|
||||
unset APPSMITH_RECAPTCHA_SITE_KEY # If this field is empty is might cause application crash
|
||||
unset APPSMITH_RECAPTCHA_SECRET_KEY
|
||||
unset APPSMITH_RECAPTCHA_ENABLED
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[program:backend]
|
||||
directory=/opt/appsmith/backend
|
||||
command=java -Dserver.port=8080 -Djava.security.egd='file:/dev/./urandom' -jar server.jar
|
||||
command=/opt/appsmith/run-with-env.sh java -Dserver.port=8080 -Djava.security.egd='file:/dev/./urandom' -jar server.jar
|
||||
priority=15
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[program:editor]
|
||||
command=/opt/appsmith/run-nginx.sh
|
||||
command=/opt/appsmith/run-with-env.sh /opt/appsmith/run-nginx.sh
|
||||
priority=25
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[program:rts]
|
||||
directory=/opt/appsmith/rts
|
||||
command=node server.js
|
||||
command=/opt/appsmith/run-with-env.sh node server.js
|
||||
priority=20
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user