added automatic Key Generation for Empty .env Keys
This commit is contained in:
11
bin/create_key.sh
Executable file
11
bin/create_key.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This generates an environmental variable safe key for use in various applications.
|
||||
KEY_LENGTH=$1
|
||||
|
||||
if [[ -z "$KEY_LENGTH" ]]; then
|
||||
KEY_LENGTH=32
|
||||
fi
|
||||
|
||||
KEY=$(head -c $KEY_LENGTH /dev/urandom | base64 | tr -d '=+/ ' | cut -c1-$KEY_LENGTH)
|
||||
echo $KEY
|
||||
Reference in New Issue
Block a user