Fully dockerized deployment with automatic Let's Encrypt certificates via Traefik's static file provider (no docker.sock needed), bind-mounted data folders instead of named volumes, and domain/secrets kept out of git via .env + rendered templates. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
26 lines
915 B
Bash
Executable File
26 lines
915 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Renders *.template files into their real config counterparts using the
|
|
# values from .env. Run this after every edit of .env, before
|
|
# `docker compose up`.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
if [ ! -f .env ]; then
|
|
echo "Missing .env — copy .env.example to .env and edit it first." >&2
|
|
exit 1
|
|
fi
|
|
|
|
set -a
|
|
# shellcheck disable=SC1091
|
|
source .env
|
|
set +a
|
|
|
|
VARS='${DOMAIN} ${MATRIX_SUBDOMAIN} ${ELEMENT_SUBDOMAIN} ${ADMIN_SUBDOMAIN} ${TRAEFIK_SUBDOMAIN}'
|
|
|
|
envsubst "$VARS" < element/config/config.json.template > element/config/config.json
|
|
envsubst "$VARS" < synapse-admin/config/config.json.template > synapse-admin/config/config.json
|
|
envsubst "$VARS" < wellknown/well-known-matrix-client.json.template > wellknown/html/well-known-matrix-client.json
|
|
envsubst "$VARS" < traefik/dynamic/routes.yml.template > traefik/dynamic/routes.yml
|
|
|
|
echo "Rendered config for domain: ${DOMAIN}"
|