1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge pull request #394 from YunoHost-Apps/redact-admin-password

Make sure to redact admin password
This commit is contained in:
Kayou 2021-05-25 19:17:31 +02:00 committed by GitHub
commit a0ab162495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,11 +147,16 @@ exec_occ() {
# Set write access for the following commands # Set write access for the following commands
chown -R $app: "$final_path" "$datadir" 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 # Install Nextcloud using a temporary admin user
exec_occ maintenance:install \ exec_occ maintenance:install \
--database "mysql" --database-name $db_name \ --database "mysql" --database-name $db_name \
--database-user $db_name --database-pass "$db_pwd" \ --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" \ --data-dir "$datadir" \
|| ynh_die --message="Unable to install Nextcloud" || ynh_die --message="Unable to install Nextcloud"