added automatic Key Generation for Empty .env Keys

This commit is contained in:
2025-12-03 20:38:40 +01:00
parent 61d94a264f
commit 14b3eb4559
9 changed files with 106 additions and 329 deletions

11
bin/create_key.sh Executable file
View 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