diff --git a/scripts/_common.sh b/scripts/_common.sh index 07ee630..963edc0 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -42,21 +42,11 @@ install_sources() { test -e $code_dir/bin/python3 || python3 -m venv $code_dir # Install synapse in virtualenv + local pip3=$code_dir/bin/pip3 - # We set all necessary environement variable to create a python virtualenvironnement. - u_arg='u' - set +$u_arg; - source $code_dir/bin/activate - set -$u_arg; - - pip3 install --upgrade setuptools wheel pip - pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml jinja2 - pip3 install --upgrade -r $YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt - - # This function was defined when we called "source $code_dir/bin/activate". With this function we undo what "$code_dir/bin/activate" does - set +$u_arg; - deactivate - set -$u_arg; + $pip3 install --upgrade setuptools wheel pip + $pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml jinja2 + $pip3 install --upgrade -r $YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt fi # Apply patch for LDAP auth if needed diff --git a/scripts/install b/scripts/install index e52d5b9..19ec431 100644 --- a/scripts/install +++ b/scripts/install @@ -172,19 +172,8 @@ chown $app:$app -R $install_dir ynh_script_progression --message="Creating Synapse config..." --weight=3 -# Go in virtualenvironnement -u_arg='u' -set +$u_arg; -source $code_dir/bin/activate -set -$u_arg; - # Generate config -python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --server-name $server_name --report-stats=no -c homeserver.yml - -# This function was defined when we called "source $code_dir/bin/activate". With this function we undo what "$code_dir/bin/activate" does -set +$u_arg; -deactivate -set -$u_arg; +$code_dir/bin/python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --server-name $server_name --report-stats=no -c homeserver.yml # Get random values from config registration_shared_secret=$(egrep "^registration_shared_secret:" homeserver.yml | cut -d'"' -f2) diff --git a/scripts/upgrade b/scripts/upgrade index b53de36..671f89f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -364,19 +364,8 @@ if [ -z "$registration_shared_secret" ] || [ "$form_secret" == "form_secret: " ] then ynh_script_progression --message="Generating synapse secret..." --weight=1 - # Go in virtualenvironnement - u_arg='u' - set +$u_arg; - source $code_dir/bin/activate - set -$u_arg; - # Generate config and keys - python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $server_name --report-stats=no -c homeserver.yml - - # This function was defined when we called "source $code_dir/bin/activate". With this function we undo what "$code_dir/bin/activate" does - set +$u_arg; - deactivate - set -$u_arg; + $code_dir/bin/python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $server_name --report-stats=no -c homeserver.yml # Get random values from config registration_shared_secret=$(egrep "^registration_shared_secret:" homeserver.yml | cut -d'"' -f2)