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
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [[ ! -f /etc/saslauthd.conf ]] && [[ "$AUTH_TYPE" == "ldap" ]]; then
|
||||
if [[ ! -f "/etc/saslauthd.conf" ]] && [[ "$AUTH_TYPE" == "ldap" ]]; then
|
||||
tpl /defaults/saslauthd.conf > /etc/saslauthd.conf
|
||||
mkdir -pm777 /var/run/saslauthd
|
||||
adduser prosody sasl
|
||||
@@ -92,20 +92,20 @@ if [[ "$PROSODY_MODE" == "visitors" ]]; then
|
||||
[ -z "$VISITORS_XMPP_DOMAIN" ] && VISITORS_XMPP_DOMAIN="meet.jitsi"
|
||||
[ -z "$PROSODY_VISITOR_INDEX" ] && PROSODY_VISITOR_INDEX=0
|
||||
FULL_VISITORS_XMPP_DOMAIN="v$PROSODY_VISITOR_INDEX.$VISITORS_XMPP_DOMAIN"
|
||||
if [[ ! -f /config/certs/$FULL_VISITORS_XMPP_DOMAIN.crt ]]; then
|
||||
if [[ ! -f "/config/certs/$FULL_VISITORS_XMPP_DOMAIN.crt" ]]; then
|
||||
# echo for using all default values
|
||||
echo | prosodyctl --config $PROSODY_CFG cert generate $FULL_VISITORS_XMPP_DOMAIN
|
||||
fi
|
||||
elif [[ "$PROSODY_MODE" == "brewery" ]]; then
|
||||
echo "No need to generate certs for main XMPP domain in brewery mode"
|
||||
else
|
||||
if [[ ! -f /config/certs/$XMPP_DOMAIN.crt ]]; then
|
||||
if [[ ! -f "/config/certs/$XMPP_DOMAIN.crt" ]]; then
|
||||
# echo for using all default values
|
||||
echo | prosodyctl --config $PROSODY_CFG cert generate $XMPP_DOMAIN
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /config/certs/$XMPP_AUTH_DOMAIN.crt ]]; then
|
||||
if [[ ! -f "/config/certs/$XMPP_AUTH_DOMAIN.crt" ]]; then
|
||||
# echo for using all default values
|
||||
echo | prosodyctl --config $PROSODY_CFG cert generate $XMPP_AUTH_DOMAIN
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
if [[ -f /etc/saslauthd.conf ]]; then
|
||||
if [[ -f "/etc/saslauthd.conf" ]]; then
|
||||
exec s6-setuidgid root saslauthd -a ldap -O /etc/saslauthd.conf -c -m /var/run/saslauthd -n 5 -d
|
||||
else
|
||||
# if saslauthd should not be started,
|
||||
|
||||
@@ -81,7 +81,7 @@ else
|
||||
fi
|
||||
|
||||
# Register Jibri user if password is set
|
||||
if [[ -n $JIBRI_XMPP_PASSWORD ]]; then
|
||||
if [[ -n "$JIBRI_XMPP_PASSWORD" ]]; then
|
||||
echo "[register-setup] Registering Jibri user..."
|
||||
OUTPUT=$(prosodyctl --config $PROSODY_CFG shell user create $JIBRI_XMPP_USER@$XMPP_AUTH_DOMAIN $JIBRI_XMPP_PASSWORD 2>&1)
|
||||
if [ $? -eq 0 ]; then
|
||||
@@ -94,7 +94,7 @@ fi
|
||||
# Register Jibri recorder and Jigasi transcriber in client mode only
|
||||
if [[ "$PROSODY_MODE" == "client" ]]; then
|
||||
if [[ "$(echo "$ENABLE_RECORDING" | tr '[:upper:]' '[:lower:]')" == "true" ]] || [[ "$ENABLE_RECORDING" == "1" ]]; then
|
||||
if [[ -n $JIBRI_RECORDER_PASSWORD ]]; then
|
||||
if [[ -n "$JIBRI_RECORDER_PASSWORD" ]]; then
|
||||
echo "[register-setup] Registering Jibri recorder user..."
|
||||
OUTPUT=$(prosodyctl --config $PROSODY_CFG shell user create $JIBRI_RECORDER_USER@$XMPP_HIDDEN_DOMAIN $JIBRI_RECORDER_PASSWORD 2>&1)
|
||||
if [ $? -eq 0 ]; then
|
||||
@@ -106,7 +106,7 @@ if [[ "$PROSODY_MODE" == "client" ]]; then
|
||||
fi
|
||||
|
||||
if [[ "$(echo "$ENABLE_TRANSCRIPTIONS" | tr '[:upper:]' '[:lower:]')" == "true" ]] || [[ "$ENABLE_TRANSCRIPTIONS" == "1" ]]; then
|
||||
if [[ -n $JIGASI_TRANSCRIBER_PASSWORD ]]; then
|
||||
if [[ -n "$JIGASI_TRANSCRIBER_PASSWORD" ]]; then
|
||||
[ -z "$JIGASI_TRANSCRIBER_USER" ] && JIGASI_TRANSCRIBER_USER="transcriber"
|
||||
echo "[register-setup] Registering Jigasi transcriber user..."
|
||||
OUTPUT=$(prosodyctl --config $PROSODY_CFG shell user create $JIGASI_TRANSCRIBER_USER@$XMPP_HIDDEN_DOMAIN $JIGASI_TRANSCRIBER_PASSWORD 2>&1)
|
||||
@@ -120,7 +120,7 @@ if [[ "$PROSODY_MODE" == "client" ]]; then
|
||||
fi
|
||||
|
||||
# Register Jigasi user if password is set
|
||||
if [[ -n $JIGASI_XMPP_PASSWORD ]]; then
|
||||
if [[ -n "$JIGASI_XMPP_PASSWORD" ]]; then
|
||||
echo "[register-setup] Registering Jigasi user..."
|
||||
OUTPUT=$(prosodyctl --config $PROSODY_CFG shell user create $JIGASI_XMPP_USER@$XMPP_AUTH_DOMAIN $JIGASI_XMPP_PASSWORD 2>&1)
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user