Add script to generate Laravel App Key for Financial Freedom and update docker-compose file

This commit is contained in:
Christopher
2024-01-18 07:56:51 -06:00
parent a73726e490
commit e6e745eecc
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# About
This script generates the Laravel App Key for Financial Freedom. Adds the key to the docker-compose file and then deploys it.
# Run command
```bash
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-generate-financial-freedom-app-key/run.sh)"
```

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Access the Docker container and run the command
key=$(docker exec big-bear-financial-freedom php artisan key:generate --show)
# Check if the key was successfully retrieved
if [ -z "$key" ]; then
echo "Failed to retrieve key."
exit 1
fi
# File to be modified
file_path="/var/lib/casaos/apps/big-bear-financial-freedom/docker-compose.yml"
# Backup the original file (optional but recommended)
cp "$file_path" "${file_path}.bak"
# Use sed to replace the string
sed -i "s/base64:1234567890abcdefghijklmnopqrstuvwxyz/${key}/g" "$file_path"
# Reload the container with CasaOS CLI
casaos-cli app-management apply "big-bear-financial-freedom" --file="$file_path"
echo "Key replaced and container reloaded successfully."