From a4389c99c7a1f81f2fa7c312ad462f5403913d79 Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Thu, 4 Nov 2021 13:16:37 +0100 Subject: [PATCH] Don't enforce longer SECRET_KEY_BASE than Phoenix (#1441) Phoenix only requires SECRET_KEY_BASE to be longer than 32 characters. 32 characters even with hex encoding is 128 bits of entropy which is more than enough. Some secret generation tools only generate 32 characters/128 bits by default which makes this relatively arbitrary limit annoying. Let's change it to what Phoenix requires. --- config/runtime.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index 103537cd5..e2f0b5b02 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -28,8 +28,8 @@ case secret_key_base do nil -> raise "SECRET_KEY_BASE configuration option is required. See https://plausible.io/docs/self-hosting-configuration#server" - key when byte_size(key) < 64 -> - raise "SECRET_KEY_BASE must be at least 64 bytes long. See https://plausible.io/docs/self-hosting-configuration#server" + key when byte_size(key) < 32 -> + raise "SECRET_KEY_BASE must be at least 32 bytes long. See https://plausible.io/docs/self-hosting-configuration#server" _ -> nil