From 84115e51b1b102c73131b6e8da6de30b34e49daa Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Sat, 31 Dec 2022 18:50:33 -0500 Subject: [PATCH] Fix admin user email address Add config rebuild to upgrade script --- manifest.json | 2 +- scripts/install | 2 +- scripts/upgrade | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 4061ad8..5aaee1e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "BookWyrm is a platform for social reading.", "fr": "BookWyrm est une plateforme de lecture sociale." }, - "version": "0.5.3~ynh1.0.5", + "version": "0.5.3~ynh1.0.7", "url": "https://github.com/bookwyrm-social/bookwyrm", "upstream": { "license": "AGPL-3.0-or-later", diff --git a/scripts/install b/scripts/install index b3265ef..fb59dc4 100755 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,7 @@ admin=$YNH_APP_ARG_ADMIN app=$YNH_APP_INSTANCE_NAME -admin_mail=$(ynh_user_get_info --username=$admin --key=mail) +admin_mail=$(ynh_user_get_info --username=$admin --key=username) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS diff --git a/scripts/upgrade b/scripts/upgrade index bab43e2..fc36670 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,8 +22,12 @@ language=$(ynh_app_setting_get --app=$app --key=language) admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$(ynh_app_setting_get --app=$app --key=db_user) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) port=$(ynh_app_setting_get --app=$app --key=port) +admin_mail=$(ynh_user_get_info --username=$admin --key=username) + #================================================= # CHECK VERSION #================================================= @@ -134,6 +138,23 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing service script..." --weight=1 + +ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env" +chmod 600 $final_path/.env +chown $app:www-data "$final_path/.env" + +set -a; source "$final_path/.env"; set +a + + +ynh_secure_remove --file="$final_path/venv" +mkdir "$final_path/venv" +python3 -m venv "$final_path/venv" +$final_path/venv/bin/pip3 install -r "$final_path/requirements.txt" + #================================================= # NGINX CONFIGURATION #=================================================