diff --git a/scripts/install b/scripts/install index 5595ee1..99e7840 100644 --- a/scripts/install +++ b/scripts/install @@ -7,6 +7,9 @@ fi source _common.sh source /usr/share/yunohost/helpers +# Save the passord (not saved automatically by the core) +ynh_app_setting_set --app=$app --key=password --value="$password" + #================================================= # INSTALL DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ed0dab2..6a43c06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,11 @@ if [ -z "${path:-}" ]; then ynh_app_setting_set --app=$app --key=path --value=$path fi +if [ -z "${password:-}" ]; then + password=$(ynh_string_random --length=32) + ynh_app_setting_set --app=$app --key=password --value="$password" +fi + # Support full Unicode in MySQL databases ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"