refactor(templates): wrap shell variables in double quotes to handle spaces and special characters safely
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
0e4bf5ed1a
commit
156e36e97f
@@ -21,7 +21,7 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
|
||||
fi
|
||||
|
||||
ACME_SERVER=""
|
||||
if [[ -n $LETSENCRYPT_ACME_SERVER ]]; then
|
||||
if [[ -n "$LETSENCRYPT_ACME_SERVER" ]]; then
|
||||
ACME_SERVER="--set-default-ca --server $LETSENCRYPT_ACME_SERVER"
|
||||
echo "Using custom ACME server: $LETSENCRYPT_ACME_SERVER"
|
||||
fi
|
||||
@@ -61,7 +61,7 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
|
||||
fi
|
||||
else
|
||||
# use self-signed certs
|
||||
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
|
||||
if [[ -f "/config/keys/cert.key" && -f "/config/keys/cert.crt" ]]; then
|
||||
echo "using keys found in /config/keys"
|
||||
else
|
||||
echo "generating self-signed keys in /config/keys, you can replace these with your own keys if required"
|
||||
@@ -122,7 +122,7 @@ fi
|
||||
tpl /defaults/nginx.conf > /config/nginx/nginx.conf
|
||||
|
||||
tpl /defaults/meet.conf > /config/nginx/meet.conf
|
||||
if [[ -f /config/nginx/custom-meet.conf ]]; then
|
||||
if [[ -f "/config/nginx/custom-meet.conf" ]]; then
|
||||
cat /config/nginx/custom-meet.conf >> /config/nginx/meet.conf
|
||||
fi
|
||||
|
||||
@@ -132,11 +132,11 @@ tpl /defaults/default > /config/nginx/site-confs/default
|
||||
|
||||
tpl /defaults/system-config.js > /config/config.js
|
||||
tpl /defaults/settings-config.js >> /config/config.js
|
||||
if [[ -f /config/custom-config.js ]]; then
|
||||
if [[ -f "/config/custom-config.js" ]]; then
|
||||
cat /config/custom-config.js >> /config/config.js
|
||||
fi
|
||||
|
||||
cp /defaults/interface_config.js /config/interface_config.js
|
||||
if [[ -f /config/custom-interface_config.js ]]; then
|
||||
if [[ -f "/config/custom-interface_config.js" ]]; then
|
||||
cat /config/custom-interface_config.js >> /config/interface_config.js
|
||||
fi
|
||||
|
||||
@@ -17,9 +17,9 @@ function stop_service() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [[ $DISABLE_HTTPS -ne 1 ]] && [[ $ENABLE_LETSENCRYPT -eq 1 ]] && [[ $ENABLE_JAAS_COMPONENTS -eq 1 ]] && [[ -n $EMAIL ]] && [[ -n $DOMAIN ]]; then
|
||||
if [[ "$DISABLE_HTTPS" -ne 1 ]] && [[ "$ENABLE_LETSENCRYPT" -eq 1 ]] && [[ "$ENABLE_JAAS_COMPONENTS" -eq 1 ]] && [[ -n "$EMAIL" ]] && [[ -n "$DOMAIN" ]]; then
|
||||
|
||||
if [ -f $JAAS_ACCOUNT_FILE ]; then
|
||||
if [ -f "$JAAS_ACCOUNT_FILE" ]; then
|
||||
echo "JaaS account already exists"
|
||||
stop_service
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user