From 7a15acf224c193af725ab8c1901f7eea110540dc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 24 Jun 2019 12:51:05 +0200 Subject: [PATCH 1/2] install synapse/develop (and deps) from pip instead of getting dependencies from synapse/master and running synapse/develop from git download --- synapse/install.sh | 10 +++++----- synapse/start.sh | 4 ++-- synapse/stop.sh | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 synapse/install.sh diff --git a/synapse/install.sh b/synapse/install.sh old mode 100755 new mode 100644 index 0b1d581118..8a9bb82e19 --- a/synapse/install.sh +++ b/synapse/install.sh @@ -16,11 +16,7 @@ if [ -d $BASE_DIR/$SERVER_DIR ]; then fi cd $BASE_DIR - -mkdir -p installations/ -curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip -unzip -q synapse.zip -mv synapse-$SYNAPSE_BRANCH $SERVER_DIR +mkdir -p $SERVER_DIR cd $SERVER_DIR virtualenv -p python3 env source env/bin/activate @@ -37,7 +33,9 @@ python -m synapse.app.homeserver \ --config-path homeserver.yaml \ --generate-config \ --report-stats=no +pip install https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH # apply configuration +pushd env/bin/ cp -r $BASE_DIR/config-templates/$CONFIG_TEMPLATE/. ./ # Hashes used instead of slashes because we'll get a value back from $(pwd) that'll be @@ -49,3 +47,5 @@ sed -i.bak "s#{{FORM_SECRET}}#$(uuidgen)#g" homeserver.yaml sed -i.bak "s#{{REGISTRATION_SHARED_SECRET}}#$(uuidgen)#g" homeserver.yaml sed -i.bak "s#{{MACAROON_SECRET_KEY}}#$(uuidgen)#g" homeserver.yaml rm *.bak + +popd diff --git a/synapse/start.sh b/synapse/start.sh index f8da097f7d..2ff6ae69d0 100755 --- a/synapse/start.sh +++ b/synapse/start.sh @@ -3,8 +3,8 @@ set -e BASE_DIR=$(cd $(dirname $0) && pwd) cd $BASE_DIR -cd installations/consent -source env/bin/activate +cd installations/consent/env/bin/ +source activate LOGFILE=$(mktemp) echo "Synapse log file at $LOGFILE" ./synctl start 2> $LOGFILE diff --git a/synapse/stop.sh b/synapse/stop.sh index a7716744ef..08258e5a8c 100755 --- a/synapse/stop.sh +++ b/synapse/stop.sh @@ -3,6 +3,6 @@ set -e BASE_DIR=$(cd $(dirname $0) && pwd) cd $BASE_DIR -cd installations/consent -source env/bin/activate +cd installations/consent/env/bin/ +source activate ./synctl stop From 894a07484c6738ca7f1ad404f173f92e6ed1006a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 24 Jun 2019 12:51:51 +0200 Subject: [PATCH 2/2] generate signing keys without generating config file and then overwr. it --- synapse/install.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) mode change 100644 => 100755 synapse/install.sh diff --git a/synapse/install.sh b/synapse/install.sh old mode 100644 new mode 100755 index 8a9bb82e19..077258072c --- a/synapse/install.sh +++ b/synapse/install.sh @@ -27,12 +27,6 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py pip install --upgrade setuptools -pip install matrix-synapse[resources.consent] -python -m synapse.app.homeserver \ - --server-name localhost \ - --config-path homeserver.yaml \ - --generate-config \ - --report-stats=no pip install https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH # apply configuration pushd env/bin/ @@ -49,3 +43,5 @@ sed -i.bak "s#{{MACAROON_SECRET_KEY}}#$(uuidgen)#g" homeserver.yaml rm *.bak popd +# generate signing keys for signing_key_path +python -m synapse.app.homeserver --generate-keys --config-dir env/bin/ -c env/bin/homeserver.yaml