From e2f39df7d84c96885e807c2216b8b062dcc75ebe Mon Sep 17 00:00:00 2001 From: Marcel Hofer Date: Tue, 26 Feb 2019 20:44:53 +0100 Subject: [PATCH] remove obsolete code, use openssl instead of `cat /dev/urandom` --- data/Dockerfiles/sogo/bootstrap-sogo.sh | 9 ++---- data/web/sogo-auth.php | 37 ++++++------------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/data/Dockerfiles/sogo/bootstrap-sogo.sh b/data/Dockerfiles/sogo/bootstrap-sogo.sh index 51e1eea39..5290f9dc3 100755 --- a/data/Dockerfiles/sogo/bootstrap-sogo.sh +++ b/data/Dockerfiles/sogo/bootstrap-sogo.sh @@ -83,19 +83,16 @@ EOF done -mkdir -p /var/lib/sogo/GNUstep/Defaults/ - -# Force-remove lines from sogo.conf -sed -i '/SOGoIMAPServer/d' /etc/sogo/sogo.conf - if [[ "${ALLOW_ADMIN_EMAIL_LOGIN}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then TRUST_PROXY="YES" else TRUST_PROXY="NO" fi -RAND_PASS=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 24 | head -n 1) +# cat /dev/urandom seems to hang here occasionally and is not recommended anyway, better use openssl +RAND_PASS=$(openssl rand -base64 16 | tr -dc _A-Z-a-z-0-9) # Generate plist header with timezone data +mkdir -p /var/lib/sogo/GNUstep/Defaults/ cat < /var/lib/sogo/GNUstep/Defaults/sogod.plist diff --git a/data/web/sogo-auth.php b/data/web/sogo-auth.php index d9c105579..b08ca4e74 100644 --- a/data/web/sogo-auth.php +++ b/data/web/sogo-auth.php @@ -1,30 +1,5 @@