-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·57 lines (46 loc) · 2.18 KB
/
Copy pathstop.sh
File metadata and controls
executable file
·57 lines (46 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# stop.sh — tear down all matrix-easy-deploy services (data is preserved)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/scripts/lib.sh"
IFS=' ' read -ra DOCKER_COMPOSE <<< "$(docker_compose_cmd)"
# Load .env so Docker Compose can substitute variables (e.g. POSTGRES_PASSWORD)
MAS_ENABLED="false"
HOOKSHOT_ENABLED="false"
WHATSAPP_BRIDGE_ENABLED="false"
SLACK_BRIDGE_ENABLED="false"
if [[ -f "${SCRIPT_DIR}/.env" ]]; then
load_deploy_env "${SCRIPT_DIR}/.env"
fi
load_runtime_desired_state "${SCRIPT_DIR}"
# Stop MAS when it was previously installed
if [[ -f "${SCRIPT_DIR}/modules/mas/config.yaml" ]]; then
info "Stopping Matrix Authentication Service (MAS)…"
(cd "${SCRIPT_DIR}/modules/mas" && "${DOCKER_COMPOSE[@]}" down)
fi
build_core_compose_stop_profiles
build_core_compose_args "${SCRIPT_DIR}"
# Stop WhatsApp bridge when its module was previously installed
if [[ -f "${SCRIPT_DIR}/modules/whatsapp-bridge/whatsapp/config.yaml" ]]; then
info "Stopping WhatsApp bridge…"
(cd "${SCRIPT_DIR}/modules/whatsapp-bridge" && "${DOCKER_COMPOSE[@]}" down)
fi
# Stop Slack bridge when its module was previously installed
if [[ -f "${SCRIPT_DIR}/modules/slack-bridge/slack/config.yaml" ]]; then
info "Stopping Slack bridge…"
(cd "${SCRIPT_DIR}/modules/slack-bridge" && "${DOCKER_COMPOSE[@]}" down)
fi
# Stop Hookshot when its module was previously installed
if [[ -f "${SCRIPT_DIR}/modules/hookshot/hookshot/config.yml" ]]; then
info "Stopping Hookshot…"
(cd "${SCRIPT_DIR}/modules/hookshot" && "${DOCKER_COMPOSE[@]}" down)
fi
info "Stopping calls services (coturn + LiveKit)…"
build_calls_compose_args "${SCRIPT_DIR}"
(cd "${SCRIPT_DIR}/modules/calls" && "${DOCKER_COMPOSE[@]}" "${CALLS_COMPOSE_ARGS[@]}" down)
info "Stopping core services…"
(cd "${SCRIPT_DIR}/modules/core" && "${DOCKER_COMPOSE[@]}" "${CORE_COMPOSE_ARGS[@]}" "${CORE_COMPOSE_PROFILES[@]}" down --remove-orphans)
info "Stopping Caddy…"
build_caddy_compose_args "${SCRIPT_DIR}"
(cd "${SCRIPT_DIR}/caddy" && "${DOCKER_COMPOSE[@]}" "${CADDY_COMPOSE_ARGS[@]}" down)
success "All services stopped. Your data is intact in Docker volumes."