init server_name to be the sld

This commit is contained in:
Girish Ramakrishnan
2020-04-08 18:32:30 -07:00
parent 1492b16fdd
commit 6a21388e95
2 changed files with 5 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# lxml - required for previews
RUN pip install --upgrade pip && \
pip install --upgrade setuptools && \
pip install matrix-synapse==${VERSION} psycopg2-binary python-ldap matrix-synapse-ldap3 lxml
pip install matrix-synapse==${VERSION} psycopg2-binary python-ldap matrix-synapse-ldap3 lxml publicsuffix2
RUN curl -sL https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64 -o /usr/bin/yq && \
chmod +x /usr/bin/yq

View File

@@ -23,11 +23,14 @@ if [[ ! -f /app/data/configs/homeserver.yaml ]]; then
mv /app/data/configs/${CLOUDRON_APP_DOMAIN}.signing.key /app/data/configs/signing.key
# this is set at installation time and not changed after
server_name=$(python -c "from publicsuffix2 import get_sld; print(get_sld('${CLOUDRON_APP_DOMAIN}'));")
yq w -i /app/data/configs/homeserver.yaml server_name "${CLOUDRON_APP_DOMAIN}"
yq w -i /app/data/configs/homeserver.yaml registration_shared_secret "$(pwgen -1s 64)"
fi
echo "==> Configuring synapse"
yq w -i /app/data/configs/homeserver.yaml server_name "${CLOUDRON_APP_DOMAIN}"
yq w -i /app/data/configs/homeserver.yaml public_baseurl "${CLOUDRON_APP_ORIGIN}"
# tls