From e8c4305c872db7db09de4b5aebf71f8e2d451765 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 26 Feb 2021 04:16:57 +0100 Subject: [PATCH] switch from email to user --- manifest.json | 10 +++++----- scripts/install | 7 ++++--- scripts/upgrade | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 290da71..593a829 100644 --- a/manifest.json +++ b/manifest.json @@ -37,13 +37,13 @@ "example": "example.com" }, { - "name": "email", - "type": "string", + "name": "admin", + "type": "user", "ask": { - "en": "Choose an admin email (can be changed after installation)", - "fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)" + "en": "Choose an admin user", + "fr": "Choisissez l'administrateur" }, - "example": "johndoe@example.com" + "example": "johndoe" }, { "name": "is_public", diff --git a/scripts/install b/scripts/install index 2e5a514..0704a90 100644 --- a/scripts/install +++ b/scripts/install @@ -26,9 +26,10 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" -admin_email=$YNH_APP_ARG_EMAIL -admin_pass=$(ynh_string_random --length=24) +admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +admin_email=$(ynh_user_get_info --username=$admin --key="mail") +admin_pass=$(ynh_string_random --length=24) app=$YNH_APP_INSTANCE_NAME @@ -52,8 +53,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain +ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email -ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass ynh_app_setting_set --app=$app --key=datadir --value=$datadir #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3f1154e..1f76327 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -admin_email=$(ynh_app_setting_get --app=$app --key=admin_email) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port) @@ -38,6 +37,8 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." +ynh_app_setting_delete --app=$app --key=admin_pass + # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name="peertube_${app}"