mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-06-05 22:51:52 -04:00
Add script to generate Laravel App Key for Financial Freedom and update docker-compose file
This commit is contained in:
9
casaos-generate-financial-freedom-app-key/README.md
Normal file
9
casaos-generate-financial-freedom-app-key/README.md
Normal 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)"
|
||||
```
|
||||
24
casaos-generate-financial-freedom-app-key/run.sh
Normal file
24
casaos-generate-financial-freedom-app-key/run.sh
Normal 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."
|
||||
Reference in New Issue
Block a user