mirror of
https://github.com/plausible/analytics.git
synced 2024-11-26 23:27:54 +03:00
Crash early if secret_key_base is not configured correctly
This commit is contained in:
parent
0d71ec3acd
commit
be26662f36
@ -20,7 +20,17 @@ if base_url.scheme not in ["http", "https"] do
|
||||
}`"
|
||||
end
|
||||
|
||||
secret_key_base = System.fetch_env!("SECRET_KEY_BASE")
|
||||
secret_key_base =
|
||||
case System.get_env("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 ->
|
||||
key
|
||||
end
|
||||
|
||||
db_url =
|
||||
System.get_env(
|
||||
|
Loading…
Reference in New Issue
Block a user