From 2282e240282649880d6b8d8d11cc378dc3d64d41 Mon Sep 17 00:00:00 2001 From: Pontus Leitzler Date: Sun, 13 Aug 2017 08:18:05 +0200 Subject: [PATCH] Use /dev/urandom to create random password (#2298) * Make sure generated password is random Use /dev/urandom to get a 32 char password * Make sure generated password is random Use /dev/urandom to generate 32 char password * Make sure generated password is random --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.rpi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc9ec311b..a063f2e10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN addgroup \ -u 1000 \ -G git \ git && \ - echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd + echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd ENV USER git ENV GITEA_CUSTOM /data/gitea diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 9f91ae90b..a9dc3adc1 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -23,7 +23,7 @@ RUN addgroup \ -u 1000 \ -G git \ git && \ - echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd + echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd ENV USER git ENV GITEA_CUSTOM /data/gitea diff --git a/Dockerfile.rpi b/Dockerfile.rpi index 8ecfd19a1..373b8025a 100644 --- a/Dockerfile.rpi +++ b/Dockerfile.rpi @@ -24,7 +24,7 @@ RUN addgroup \ -u 1000 \ -G git \ git && \ - echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd + echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd ENV USER git ENV GITEA_CUSTOM /data/gitea