Add mattermost.
This commit is contained in:
30
mattermost/domain.sh
Normal file
30
mattermost/domain.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_NAME="mattermost"
|
||||
APP_DIR="/var/excloud/apps"
|
||||
APP_UPSTREAM_PORT="${EXC_APP_UPSTREAM_PORT:-8065}"
|
||||
|
||||
DOMAIN="${1}"
|
||||
|
||||
if [ -z "${DOMAIN}" ]; then
|
||||
echo "Error: URL argument is required. Example:" >&2
|
||||
echo "domain.sh sub.example.com" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MATTERMOST_DIR="${APP_DIR}/${APP_NAME}"
|
||||
COMPOSE_FILE="${MATTERMOST_DIR}/docker-compose.yml"
|
||||
ENV_FILE="${MATTERMOST_DIR}/.env"
|
||||
|
||||
source /var/excloud/scripts/caddy-setup.sh
|
||||
|
||||
sed -i "s|MM_SERVICESETTINGS_SITEURL: .*|MM_SERVICESETTINGS_SITEURL: https://${DOMAIN}|" "${COMPOSE_FILE}"
|
||||
|
||||
if is_app_ready "$MATTERMOST_DIR"; then
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d --remove-orphans
|
||||
switch_domain "$DOMAIN" "$APP_UPSTREAM_PORT" "$MATTERMOST_DIR"
|
||||
else
|
||||
setup_initializing_page "$DOMAIN" "$APP_NAME" "$MATTERMOST_DIR"
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d --remove-orphans
|
||||
wait_and_switch_to_proxy "$DOMAIN" "$APP_UPSTREAM_PORT" "$MATTERMOST_DIR" &
|
||||
fi
|
||||
Reference in New Issue
Block a user