Skip to content

Commit 72c0e52

Browse files
committed
dietpi-software: MinIO: fix for passwords < 8 characters
The admin password needs to be >= 8 characters long. Concatenate the global software password until it is.
1 parent 84db2c5 commit 72c0e52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dietpi/dietpi-software

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10250,6 +10250,9 @@ _EOF_
1025010250
if [[ ! -f '/etc/default/minio' ]]
1025110251
then
1025210252
G_DIETPI-NOTIFY 2 'Generating MinIO server config'
10253+
# Password needs to be >=8 characters long
10254+
local minio_pw=$GLOBAL_PW
10255+
until (( ${#minio_pw} >= 8 )); do minio_pw+=$GLOBAL_PW; done
1025310256
G_EXEC install -g minio-user -m 0640 /dev/null /etc/default/minio
1025410257
cat << _EOF_ > /etc/default/minio || exit 1
1025510258
# Docs: https://minio.community/community/minio-object-store/reference/minio-server/settings.html
@@ -10264,8 +10267,9 @@ MINIO_OPTS='--address :9004 --console-address :9001'
1026410267
MINIO_ROOT_USER='dietpi'
1026510268

1026610269
# Admin password
10267-
MINIO_ROOT_PASSWORD='$GLOBAL_PW'
10270+
MINIO_ROOT_PASSWORD='$minio_pw'
1026810271
_EOF_
10272+
unset -v minio_pw
1026910273
fi
1027010274

1027110275
# Console client config and alias

0 commit comments

Comments
 (0)