1
0
Fork 0
This repository has been archived on 2025-01-12. You can view files and clone it, but cannot push or open issues or pull requests.
pterodactyl-panel-docker/services/php/install.sh

50 lines
1.8 KiB
Bash
Raw Normal View History

2017-12-23 15:11:21 -08:00
#!/bin/ash
2018-02-17 21:59:12 -08:00
##
# This is an install script to quickly set up Pterodactyl Panel. Do NOT use on an
# already configured environment, or things can go horribly wrong!
##
if [ "$(whoami)" != "pterodactyl" ]; then
echo "Rerunning script as webserver user."
exec su -c /usr/local/bin/install pterodactyl
fi
echo "Are you sure you want to continue the install script? (Y/n)"
read -n1 run
if [ "$run" = "y" ] || [ "$run" = "Y" ]; then
2018-02-17 21:59:12 -08:00
echo "Running install script."
2017-12-23 15:11:21 -08:00
echo "Waiting 15 seconds for MariaDB to be ready."
sleep 15
2018-02-17 21:59:12 -08:00
echo "Configure trusted proxies (this will enable reverse proxy functionality)? (Y/n)"
read -n1 configureTP
if [ "$configureTP" = "y" ] || [ "$configureTP" = "Y" ] || [ "$run" = "" ]; then
echo "Please enter a value (comma separated list of allowed IPs, * to allow all) for TRUSTED_PROXIES: [*]"
read -n1 configureTPval
if [ "$configureTPval" = "" ]; then
configureTPval="*"
2019-07-29 12:56:11 +02:00
fi
grep -q 'TRUSTED_PROXIES.*' .env && sed -i .env -e 's/TRUSTED_PROXIES.*/TRUSTED_PROXIES='$configureTPval'/' || printf "\nTRUSTED_PROXIES=$configureTPval\n" >> .env
fi
2017-12-23 15:11:21 -08:00
php artisan key:generate --force
2018-02-17 21:59:12 -08:00
echo "Running configuration scripts."
php artisan p:environment:setup --cache=redis --session=redis --queue=redis \
--redis-host=redis --redis-pass="" --redis-port=6379
2018-02-17 20:20:35 -08:00
php artisan p:environment:database --host=db --port=3306 --database=pterodactyl \
--username=pterodactyl --password=pterodactyl
2018-02-17 21:59:12 -08:00
php artisan p:environment:mail
echo "Running migrations."
2017-12-23 15:11:21 -08:00
php artisan migrate --force
php artisan db:seed --force
2018-02-17 21:59:12 -08:00
echo "Running user creation script."
php artisan p:user:make --admin=1
echo "Setup complete. Please restart the container to load changes."
2017-12-23 15:11:21 -08:00
else
2018-02-17 21:59:12 -08:00
echo "Exiting."
2017-12-23 15:11:21 -08:00
fi