From ae323cdaa63fd172a708d4d9419ccb4373c96ead Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Fri, 2 Jun 2023 23:01:29 +0200 Subject: [PATCH] fix --- scripts/change_url | 2 +- scripts/upgrade | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 673e8a1..f6c7831 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -40,7 +40,7 @@ ynh_add_config --template="../conf/env.prod" --destination="$install_dir/config/ #================================================= source $install_dir/virtualenv/bin/activate -ynh_exec_warn_less python3 $install_dir/api/manage.py fix_federation_ids https://$old_domain https://$new_domain --no-dry-run --no-input +ynh_exec_warn_less ynh_exec_as $app $install_dir/venv/bin/funkwhale-manage fix_federation_ids https://$old_domain https://$new_domain --no-dry-run --no-input #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 1212289..7d66526 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,15 +59,13 @@ ynh_add_nginx_config ynh_script_progression --message="Installing Python dependencies..." --weight=1 pushd $install_dir -ynh_secure_remove --file="$install_dir/virtualenv" - python3 -m venv $install_dir/virtualenv - source $install_dir/virtualenv/bin/activate - pip install --upgrade pip - pip install --upgrade setuptools - ynh_exec_warn_less pip install wheel toml - # Workaround for error AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' - ynh_replace_string --match_string="pyOpenSSL~=20.0.1" --replace_string="pyOpenSSL~=21.0.0" --target_file="$install_dir/api/requirements/base.txt" - ynh_exec_warn_less pip install -r api/requirements.txt + ynh_secure_remove --file="$install_dir/virtualenv" + ynh_secure_remove --file="$install_dir/venv" + + python3 -m venv $install_dir/venv + source $install_dir/venv/bin/activate + ynh_exec_warn_less pip install --upgrade pip wheel toml + ynh_exec_warn_less pip install --editable ./api popd #================================================= @@ -86,13 +84,13 @@ chown $app:$app "$install_dir/config/.env" ynh_script_progression --message="Upgrading Funkwhale..." --weight=1 pushd $install_dir - source $install_dir/virtualenv/bin/activate + source $install_dir/venv/bin/activate - echo "yes" | ynh_exec_warn_less python api/manage.py collectstatic --clear --noinput + echo "yes" | ynh_exec_warn_less ynh_exec_as $app $install_dir/venv/bin/funkwhale-manage collectstatic --clear --noinput # needed for enabling the 'unaccent' extension ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" - ynh_exec_warn_less python api/manage.py migrate + ynh_exec_warn_less ynh_exec_as $app $install_dir/venv/bin/funkwhale-manage migrate ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" popd