From c592a19f2deb8b7ec25f6bf2ba13370595c728a8 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Tue, 4 Apr 2017 07:32:33 +0200 Subject: [PATCH] Use rails secret to generate the secret key --- docker/init.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/init.sh b/docker/init.sh index be418b9e..81ab11b5 100644 --- a/docker/init.sh +++ b/docker/init.sh @@ -12,8 +12,9 @@ fi SECRET_KEY_FILE="$DATA_DIR/secret_key" if [ ! -f "$SECRET_KEY_FILE" ]; then + echo ">>> Creating a new secret key file..." install -m 0600 /dev/null "$SECRET_KEY_FILE" - SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 100 | head -n 1) + SECRET_KEY=$(bundle exec rails secret) echo "$key" > "$SECRET_KEY_FILE" chmod -w "$SECRET_KEY_FILE" else