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

48 lines
1.7 KiB
Bash
Executable file

#!/bin/ash
##
# 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" ] || [ "$run" = "" ]; then
echo "Running install script."
echo "Waiting 15 seconds for MariaDB to be ready."
sleep 15
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="*"
printf "\n\nTRUSTED_PROXIES=$configureTPval" >> .env
fi
php artisan key:generate --force
echo "Running configuration scripts."
php artisan p:environment:setup --cache=redis --session=redis --queue=redis \
--redis-host=redis --redis-pass="" --redis-port=6379
php artisan p:environment:database --host=db --port=3306 --database=pterodactyl \
--username=pterodactyl --password=pterodactyl
php artisan p:environment:mail
echo "Running migrations."
php artisan migrate --force
php artisan db:seed --force
echo "Running user creation script."
php artisan p:user:make --admin=1
echo "Setup complete. Please restart the container to load changes."
else
echo "Exiting."
fi