diff --git a/Dockerfile b/Dockerfile index daff725..e13c5f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/start.sh b/start.sh index 9f9761e..26f2c22 100755 --- a/start.sh +++ b/start.sh @@ -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