diff --git a/ente/rootfs/etc/cont-init.d/99-run.sh b/ente/rootfs/etc/cont-init.d/99-run.sh index de5a04df58..7f5f7e3e83 100755 --- a/ente/rootfs/etc/cont-init.d/99-run.sh +++ b/ente/rootfs/etc/cont-init.d/99-run.sh @@ -9,14 +9,14 @@ if [ -f "$MINIO_CRED_FILE" ]; then MINIO_PASS="$(sed -n '2p' "$MINIO_CRED_FILE")" # Regenerate if file is corrupted if [ -z "$MINIO_USER" ] || [ -z "$MINIO_PASS" ]; then - MINIO_USER="minio_$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 8 || true)" + MINIO_USER="minio_$(head -c 4 /dev/urandom | od -An -tx1 | tr -d ' \n')" MINIO_PASS="$(head -c 24 /dev/urandom | base64 | tr -d '\n')" printf '%s\n%s\n' "$MINIO_USER" "$MINIO_PASS" > "$MINIO_CRED_FILE" chmod 600 "$MINIO_CRED_FILE" fi else # Generate random credentials on first run - MINIO_USER="minio_$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 8 || true)" + MINIO_USER="minio_$(head -c 4 /dev/urandom | od -An -tx1 | tr -d ' \n')" MINIO_PASS="$(head -c 24 /dev/urandom | base64 | tr -d '\n')" printf '%s\n%s\n' "$MINIO_USER" "$MINIO_PASS" > "$MINIO_CRED_FILE" chmod 600 "$MINIO_CRED_FILE"