fix: LDM Password is now generated at Installation

This commit is contained in:
Torben Brenner 2022-10-25 15:30:14 +02:00 committed by p.delpy@dkfz-heidelberg.de
parent 5af65800b9
commit 0e10205f1a
1 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,19 @@ Cmnd_Alias BRIDGEHEAD${PROJECT^^} = \\
bridgehead ALL= NOPASSWD: BRIDGEHEAD${PROJECT^^} bridgehead ALL= NOPASSWD: BRIDGEHEAD${PROJECT^^}
EOF EOF
log "INFO" "Now generating a password for the local datamangement. Please safe the password for your ETL process!"
generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
log "INFO" "Your generated credentials are:\n user: $PROJECT\n password: $generated_passwd"
parsed_passwd=$(docker run --rm -it httpd:latest htpasswd -nb $PROJECT $generated_passwd)
mkdir /etc/systemd/system/bridgehead@${PROJECT}.service.d
cat <<EOF > /etc/systemd/system/bridgehead@${PROJECT}.service.d/environment.conf
[Service]
Environment=bc_auth_users=${parsed_passwd}
EOF
log "INFO" "Register system units for bridgehead and bridgehead-update" log "INFO" "Register system units for bridgehead and bridgehead-update"
cp -v \ cp -v \
lib/systemd/bridgehead\@.service \ lib/systemd/bridgehead\@.service \