mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 12:41:04 +00:00
19 lines
871 B
Bash
19 lines
871 B
Bash
#!/bin/sh
|
|
# Renders /app/config.json from config.json.tmpl at container start.
|
|
#
|
|
# The homeserver URL and server_name differ per environment, and config.json is
|
|
# read by the browser rather than the build, so baking it into the image would
|
|
# mean one image per environment. Dropped into /docker-entrypoint.d, which the
|
|
# upstream nginx entrypoint runs (in lexical order) before starting nginx —
|
|
# no ENTRYPOINT override, so the image's own startup work still happens.
|
|
set -eu
|
|
|
|
: "${MATRIX_PUBLIC_BASEURL:?MATRIX_PUBLIC_BASEURL is required}"
|
|
: "${MATRIX_SERVER_NAME:?MATRIX_SERVER_NAME is required}"
|
|
: "${ELEMENT_PUBLIC_URL:?ELEMENT_PUBLIC_URL is required}"
|
|
|
|
envsubst '${MATRIX_PUBLIC_BASEURL} ${MATRIX_SERVER_NAME} ${ELEMENT_PUBLIC_URL}' \
|
|
< /app/config.json.tmpl > /app/config.json
|
|
|
|
echo "element-config: homeserver ${MATRIX_PUBLIC_BASEURL} (${MATRIX_SERVER_NAME})"
|