Update install script
This commit is contained in:
parent
c2f53e02ab
commit
3e3338c4d2
2 changed files with 26 additions and 15 deletions
|
@ -30,19 +30,21 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- "db"
|
- "db"
|
||||||
environment:
|
environment:
|
||||||
- "panel_url="
|
- "author="
|
||||||
|
- "url="
|
||||||
- "timezone=" # See http://php.net/manual/en/timezones.php for timezones.
|
- "timezone=" # See http://php.net/manual/en/timezones.php for timezones.
|
||||||
- "email_driver=" # smtp, mail, mailgun, mandrill, postmark
|
- "driver=" # smtp, mail, mailgun, mandrill, postmark
|
||||||
- "panel_email=" # Required for all.
|
- "panel_email=" # Required for all.
|
||||||
- "email_name=" # Required for all. Spaces require quotes.
|
- "email_name=" # Required for all. Spaces require quotes.
|
||||||
- "email_user=" # Required for smtp, mandrill, mailgun, and postmark.
|
- "email_encryption=" # Required for all.
|
||||||
- "email_pass=" # Required for smtp.
|
- "email_username=" # Required for smtp, mandrill, mailgun, and postmark.
|
||||||
|
- "email_password=" # Required for smtp.
|
||||||
- "email_domain=" # Required for smtp and mailgun.
|
- "email_domain=" # Required for smtp and mailgun.
|
||||||
- "email_port=" # Required for smtp.
|
- "email_port=" # Required for smtp.
|
||||||
- "admin_email="
|
- "admin_email="
|
||||||
- "admin_first="
|
- "admin_first="
|
||||||
- "admin_last="
|
- "admin_last="
|
||||||
- "admin_pass="
|
- "admin_password=" # Passwords for the user must include mixed case, at least one number, and at least 8 characters.
|
||||||
- "admin_username="
|
- "admin_username="
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
|
@ -6,29 +6,38 @@ if [ ! -f .env ]; then
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
printf "\n\nREDIS_HOST=redis\n\nTRUSTED_PROXIES=*" >> .env
|
printf "\n\nREDIS_HOST=redis\n\nTRUSTED_PROXIES=*" >> .env
|
||||||
php artisan key:generate --force
|
php artisan key:generate --force
|
||||||
php artisan pterodactyl:env --dbhost=db --dbport=3306 --dbname=pterodactyl --dbuser=pterodactyl \
|
php artisan p:environment:setup --author="$author" --url="$url" --timezone="$timezone" \
|
||||||
--dbpass=pterodactyl --url="$panel_url" --timezone="$timezone" --driver=redis --session-driver=database --queue-driver=database
|
--cache=redis --session=redis --queue=redis --redis-host=redis --redis-pass="" --redis-port="6379" --disable-settings-ui
|
||||||
case "$email_driver" in
|
php artisan p:environment:database --host=db --port=3306 --database=pterodactyl \
|
||||||
|
--username=pterodactyl --password=pterodactyl
|
||||||
|
case "$driver" in
|
||||||
mail)
|
mail)
|
||||||
php artisan pterodactyl:mail --driver="$email_driver" --email="$panel_email" --from-name="$email_name"
|
php artisan p:environment:mail --driver="$driver" --email="$panel_email" --from="$from" \
|
||||||
|
--encryption="$encryption"
|
||||||
;;
|
;;
|
||||||
mandrill)
|
mandrill)
|
||||||
php artisan pterodactyl:mail --driver="$email_driver" --email="$panel_email" --username="$email_user" --from-name="$email_name"
|
php artisan p:environment:mail --driver="$driver" --email="$panel_email" --from="$from" \
|
||||||
|
--encryption="$encryption" --password="$email_password"
|
||||||
;;
|
;;
|
||||||
postmark)
|
postmark)
|
||||||
php artisan pterodactyl:mail --driver="$email_driver" --email="$panel_email" --username="$email_user" --from-name="$email_name"
|
php artisan p:environment:mail --driver="$driver" --email="$panel_email" --from="$from" \
|
||||||
|
--encryption="$encryption" --username="$email_username"
|
||||||
;;
|
;;
|
||||||
mailgun)
|
mailgun)
|
||||||
php artisan pterodactyl:mail --driver="$email_driver" --email="$panel_email" --username="$email_user" --host="$email_domain" --from-name="$email_name"
|
php artisan p:environment:mail --driver="$driver" --email="$panel_email" --from="$from" \
|
||||||
|
--encryption="$encryption" --host="$host" --password="$email_password"
|
||||||
;;
|
;;
|
||||||
smtp)
|
smtp)
|
||||||
php artisan pterodactyl:mail --driver="$email_driver" --email="$panel_email" --username="$email_user" --password="$email_pass" --host="$email_domain" --port="$email_port" --from-name="$email_name"
|
php artisan p:environment:mail --driver="$driver" --email="$panel_email" --from="$from" \
|
||||||
|
--encryption="$encryption" --host="$host" --port="$port" --username="$email_username" \
|
||||||
|
--password="$email_password"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
php artisan migrate --force
|
php artisan migrate --force
|
||||||
php artisan db:seed --force
|
php artisan db:seed --force
|
||||||
php artisan pterodactyl:user --email="$admin_email" --password="$admin_pass" \
|
php artisan p:user:make --email="$admin_email" --username="$admin_username" \
|
||||||
--admin=1 --firstname="$admin_first" --lastname="$admin_last" --username="$admin_username"
|
--name-first="$admin_first" --name-last="$admin_last" --password="$admin_password" \
|
||||||
|
--admin=1
|
||||||
echo "Setup complete."
|
echo "Setup complete."
|
||||||
else
|
else
|
||||||
echo ".env detected. Stopping install script."
|
echo ".env detected. Stopping install script."
|
||||||
|
|
Reference in a new issue