From 41d2c377623d58862c8ee3dc2dc70f1f8351fe4f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 17 Mar 2021 15:26:07 +0100 Subject: [PATCH] Make sure to redact admin password --- scripts/install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1e1621d..a627b88 100755 --- a/scripts/install +++ b/scripts/install @@ -147,11 +147,16 @@ exec_occ() { # Set write access for the following commands chown -R $app: "$final_path" "$datadir" +# Define password in an intermediate var +# The fact that it's called _password allows it to be +# picked up by Yunohost's auto-redact mecanism +admin_password="$(ynh_string_random --length=6)" + # Install Nextcloud using a temporary admin user exec_occ maintenance:install \ --database "mysql" --database-name $db_name \ --database-user $db_name --database-pass "$db_pwd" \ - --admin-user "admin" --admin-pass "$(ynh_string_random --length=6)" \ + --admin-user "admin" --admin-pass "$admin_password" \ --data-dir "$datadir" \ || ynh_die --message="Unable to install Nextcloud"