diff --git a/install.sh b/install.sh index d5eb7ff..7c5f39d 100755 --- a/install.sh +++ b/install.sh @@ -86,9 +86,15 @@ echo -e "Create docker network\n" docker network create --driver=bridge --subnet=10.10.10.0/24 --gateway=10.10.10.1 matrix_server +# Randomly pick a DB password +PG_PASS=$(pwgen -s 28 -1) + +# Replace PG_PASS Password and DOMAIN in docker compose YAML +sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml" +sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml" + # Generate synapse file echo -e "Generating synapse file..\n" - docker compose run --rm -e SYNAPSE_SERVER_NAME=${DOMAIN} -e SYNAPSE_REPORT_STATS=yes synapse generate # Replace DB config in Synapse's homeserver.yaml @@ -113,18 +119,12 @@ turn_allow_guests: False turn_user_lifetime: 86400000 turn_shared_secret: "${TURN_STATIC_SECRET}" turn_uris: [ "turn:${DOMAIN}?transport=udp" ] +suppress_key_server_warning: true EOF -# Randomly pick a DB password -PG_PASS=$(pwgen -s 28 -1) - # Replace Password in homeserver.yaml sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/config/synapse/homeserver.yaml" -# Replace PG_PASS Password and DOMAIN in docker compose YAML -sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml" -sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml" - # Replace Sliding Sync key SLIDING_SYNC_KEY=$(openssl rand -hex 32) sed -i "s|SLIDING_SYNC_KEY|${SLIDING_SYNC_KEY}|g" "${BASE_DIR}/docker-compose.yaml" @@ -226,5 +226,4 @@ systemctl enable --now coturn # Finally, start services # Ensuring the DB dir is clean before bootstrapping -rm -rf ${BASE_DIR}/db/* systemctl enable --now matrix.service