Add script to encode environment variables in .env file

This commit is contained in:
2024-05-02 21:42:04 +08:00
parent abe94f84dd
commit 783b8ae292
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
if [ -f .env ]; then
while IFS='=' read -r key value; do
if [[ $key != \#* ]] && [[ ! -z "$key" ]]; then
echo "SECRET_$key=$(echo -n "$value" | base64)";
fi
done < .env > .env_encoded
else
echo "Error: .env file not found."
fi