|
@@ -13,6 +13,38 @@ if [[ "$JIGASI_XMPP_PASSWORD" == "$OLD_JIGASI_XMPP_PASSWORD" ]]; then
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+# set random jigasi nickname for the instance if is not set
|
|
|
|
+[ -z "${JIGASI_INSTANCE_ID}" ] && export JIGASI_INSTANCE_ID="jigasi-$(date +%N)"
|
|
|
|
+
|
|
|
|
+# check for AUTOSCALER_URL, AUTOSCALER_SIDECAR_KEY_FILE and AUTOSCALER_SIDECAR_KEY_ID as indicator that sidecar should be enabled
|
|
|
|
+if [ -n "$AUTOSCALER_URL" ]; then
|
|
|
|
+ if [ -z "$AUTOSCALER_SIDECAR_KEY_FILE" ]; then
|
|
|
|
+ export AUTOSCALER_SIDECAR_KEY_FILE="/etc/jitsi/autoscaler-sidecar/asap.pem"
|
|
|
|
+ fi
|
|
|
|
+ if [ -z "$AUTOSCALER_SIDECAR_KEY_ID" ]; then
|
|
|
|
+ # assume key id is equal to the base real path of the key file minus .pem
|
|
|
|
+ export AUTOSCALER_SIDECAR_KEY_ID="$(basename "$(realpath "$AUTOSCALER_SIDECAR_KEY_FILE")" | tr -d '.pem')"
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ if [ -f "$AUTOSCALER_SIDECAR_KEY_FILE" ]; then
|
|
|
|
+ echo "AUTOSCALER_URL found, enabling autoscaler sidecar"
|
|
|
|
+
|
|
|
|
+ export JIGASI_VERSION="$(dpkg -s jigasi | grep Version | awk '{print $2}' | sed 's/..$//')"
|
|
|
|
+
|
|
|
|
+ [ -z "$AUTOSCALER_SIDECAR_PORT" ] && export AUTOSCALER_SIDECAR_PORT="6000"
|
|
|
|
+ [ -z "$AUTOSCALER_SIDECAR_INSTANCE_ID" ] && export AUTOSCALER_SIDECAR_INSTANCE_ID="$JIGASI_INSTANCE_ID"
|
|
|
|
+ [ -z "$AUTOSCALER_SIDECAR_REGION" ] && export AUTOSCALER_SIDECAR_REGION="docker"
|
|
|
|
+ [ -z "$AUTOSCALER_SIDECAR_GROUP_NAME" ] && export AUTOSCALER_SIDECAR_GROUP_NAME="docker-jigasi"
|
|
|
|
+
|
|
|
|
+ mkdir -p /etc/jitsi/autoscaler-sidecar
|
|
|
|
+ tpl /defaults/autoscaler-sidecar.config > /etc/jitsi/autoscaler-sidecar/config
|
|
|
|
+ else
|
|
|
|
+ echo "No key file at $AUTOSCALER_SIDECAR_KEY_FILE, leaving autoscaler sidecar disabled"
|
|
|
|
+ fi
|
|
|
|
+else
|
|
|
|
+ echo "No AUTOSCALER_URL defined, leaving autoscaler sidecar disabled"
|
|
|
|
+fi
|
|
|
|
+
|
|
tpl /defaults/logging.properties > /config/logging.properties
|
|
tpl /defaults/logging.properties > /config/logging.properties
|
|
tpl /defaults/sip-communicator.properties > /config/sip-communicator.properties
|
|
tpl /defaults/sip-communicator.properties > /config/sip-communicator.properties
|
|
|
|
|