-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·71 lines (60 loc) · 3.21 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·71 lines (60 loc) · 3.21 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
# start.sh — bring up all matrix-easy-deploy services
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/scripts/lib.sh"
source "${SCRIPT_DIR}/scripts/module_common.sh"
IFS=' ' read -ra DOCKER_COMPOSE <<< "$(docker_compose_cmd)"
# Ensure external Docker resources exist for direct apply/start workflows.
ensure_docker_network "caddy_net"
ensure_docker_volume "caddy_data"
ensure_homeserver_data_permissions "${SCRIPT_DIR}"
info "Starting Caddy…"
build_caddy_compose_args "${SCRIPT_DIR}"
(cd "${SCRIPT_DIR}/caddy" && "${DOCKER_COMPOSE[@]}" "${CADDY_COMPOSE_ARGS[@]}" up -d)
info "Starting core services…"
# Load .env if it exists so POSTGRES_PASSWORD and INSTALL_ELEMENT are available
INSTALL_ELEMENT="true" # default: assume Element is present if .env is missing
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}"
build_core_compose_start_profiles
build_core_compose_args "${SCRIPT_DIR}"
(cd "${SCRIPT_DIR}/modules/core" && "${DOCKER_COMPOSE[@]}" "${CORE_COMPOSE_ARGS[@]}" "${CORE_COMPOSE_PROFILES[@]}" up -d)
if [[ "${MAS_ENABLED:-false}" == "true" && -f "${SCRIPT_DIR}/modules/mas/config.yaml" ]]; then
bootstrap_mas_database "${SCRIPT_DIR}"
info "Starting Matrix Authentication Service (MAS)…"
(cd "${SCRIPT_DIR}/modules/mas" && "${DOCKER_COMPOSE[@]}" up -d)
elif [[ "${MAS_ENABLED:-false}" == "true" ]]; then
warn "MAS is enabled in deploy.yaml but config file is missing. Run 'bash apply.sh' first."
fi
info "Starting calls services (coturn + LiveKit)…"
build_calls_compose_args "${SCRIPT_DIR}"
(cd "${SCRIPT_DIR}/modules/calls" && "${DOCKER_COMPOSE[@]}" "${CALLS_COMPOSE_ARGS[@]}" up -d)
# Start Hookshot if it was installed as a module
if [[ "${HOOKSHOT_ENABLED:-false}" == "true" && -f "${SCRIPT_DIR}/modules/hookshot/hookshot/config.yml" ]]; then
info "Starting Hookshot…"
(cd "${SCRIPT_DIR}/modules/hookshot" && "${DOCKER_COMPOSE[@]}" up -d)
elif [[ "${HOOKSHOT_ENABLED:-false}" == "true" ]]; then
warn "Hookshot is enabled in deploy.yaml but config file is missing. Run 'bash apply.sh' and module setup first."
fi
# Start WhatsApp bridge if it was installed as a module
if [[ "${WHATSAPP_BRIDGE_ENABLED:-false}" == "true" && -f "${SCRIPT_DIR}/modules/whatsapp-bridge/whatsapp/config.yaml" ]]; then
info "Starting WhatsApp bridge…"
(cd "${SCRIPT_DIR}/modules/whatsapp-bridge" && "${DOCKER_COMPOSE[@]}" up -d)
elif [[ "${WHATSAPP_BRIDGE_ENABLED:-false}" == "true" ]]; then
warn "WhatsApp bridge is enabled in deploy.yaml but config file is missing. Run module setup first."
fi
# Start Slack bridge if it was installed as a module
if [[ "${SLACK_BRIDGE_ENABLED:-false}" == "true" && -f "${SCRIPT_DIR}/modules/slack-bridge/slack/config.yaml" ]]; then
info "Starting Slack bridge…"
(cd "${SCRIPT_DIR}/modules/slack-bridge" && "${DOCKER_COMPOSE[@]}" up -d)
elif [[ "${SLACK_BRIDGE_ENABLED:-false}" == "true" ]]; then
warn "Slack bridge is enabled in deploy.yaml but config file is missing. Run module setup first."
fi
success "All services started."