From fce39ab95f85c1dae38be87e48e9064547afba11 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 12 Feb 2019 09:59:56 +0100 Subject: [PATCH] change web_push.gen.keypair --- conf/generated_config.exs | 2 +- scripts/install | 9 ++++----- scripts/upgrade | 10 ++++------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/conf/generated_config.exs b/conf/generated_config.exs index aeba221..6b7eebe 100644 --- a/conf/generated_config.exs +++ b/conf/generated_config.exs @@ -70,4 +70,4 @@ config :pleroma, Pleroma.Repo, # object_url: "https://cdn-endpoint.provider.com/" # -import_config "prod.secret.web_push.exs" + diff --git a/scripts/install b/scripts/install index 4516549..20b8321 100755 --- a/scripts/install +++ b/scripts/install @@ -16,7 +16,6 @@ source /usr/share/yunohost/helpers ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. - read -p "Press any key..." ynh_clean_check_starting } # Exit if an error occurs during the execution of the script @@ -262,10 +261,6 @@ fi chown -R "$app":"$app" "$final_path" pushd $final_path/$app - #Generate key pair - sudo -u "$app" mix web_push.gen.keypair >> "config/prod.secret.web_push.exs" - ynh_replace_string "administrator@example.com" "$admin_email" "$final_path/$app/config/prod.secret.web_push.exs" - # App setup and db migration sudo -u "$app" MIX_ENV=prod mix local.hex --force sudo -u "$app" MIX_ENV=prod mix local.rebar --force @@ -274,6 +269,10 @@ pushd $final_path/$app # Add user sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" --password "$password" --moderator --admin -y + + #Generate key pair + sudo -u "$app" MIX_ENV=prod mix web_push.gen.keypair >> "config/prod.secret.exs" + ynh_replace_string "administrator@example.com" "$admin_email" "$final_path/$app/config/prod.secret.exs" popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 63db32c..5b275e3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -207,14 +207,12 @@ fi # Give permission to the final_path chown -R "$app":"$app" "$final_path" pushd $final_path/$app - if [ ! -f "$final_path/$app/config/prod.secret.web_push.exs" ] - then - #Generate key pair - sudo -u "$app" mix web_push.gen.keypair >> "config/prod.secret.web_push.exs" - ynh_replace_string "administrator@example.com" "$admin_email" "$final_path/$app/config/prod.secret.web_push.exs" - fi sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force + + #Generate key pair + sudo -u "$app" MIX_ENV=prod mix web_push.gen.keypair >> "config/prod.secret.exs" + ynh_replace_string "administrator@example.com" "$admin_email" "$final_path/$app/config/prod.secret.exs" popd ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.