Merge branch 'develop' into feature/vuejs

This commit is contained in:
Dane Everitt 2018-12-16 14:20:35 -08:00
commit 21ffa08d66
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
54 changed files with 407 additions and 243 deletions

View file

@ -11,7 +11,7 @@ server {
listen 443 ssl http2;
server_name <domain>;
root /var/www/pterodactyl/public;
root /app/public;
index index.php;
access_log /var/log/nginx/pterodactyl.app-access.log;
@ -49,7 +49,7 @@ server {
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/pterodactyl.sock;
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";

View file

@ -3,19 +3,24 @@
cd /app
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
&& rmdir /app/storage/logs/ \
&& chmod 777 /var/log/panel/logs/ \
&& ln -s /var/log/panel/logs/ /app/storage/
## check for .env file and generate app keys if missing
if [ -f /app/var/.env ]; then
echo "external vars exist"
echo "external vars exist."
rm /app/.env
ln -s /app/var/.env /app/
else
echo "external vars don't exist"
echo "external vars don't exist."
rm /app/.env
touch /app/var/.env
## manually generate a key because key generate --force fails
echo -e "Generating key"
echo -e "Generating key."
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo -e "Generated app key: $APP_KEY"
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
@ -23,6 +28,25 @@ else
ln -s /app/var/.env /app/
fi
echo "Checking if https is required."
if [ -f /etc/nginx/conf.d/default.conf ]; then
echo "Using nginx config already in place."
else
echo "Checking if letsencrypt email is set."
if [ -z $LE_EMAIL ]; then
echo "No letsencrypt email is set Failing to http."
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
else
echo "writing ssl config"
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
echo "updating ssl config for domain"
sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/conf.d/default.conf
echo "generating certs"
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
fi
fi
## check for DB up before starting the panel
echo "Checking database status."
until nc -z -v -w30 $DB_HOST 3306
@ -34,13 +58,13 @@ do
done
## make sure the db is set up
echo -e "Migrating and Seeding DB"
echo -e "Migrating and Seeding D.B"
php artisan migrate --force
php artisan db:seed --force
## start cronjobs for the queue
echo -e "Starting cron jobs"
crond
echo -e "Starting cron jobs."
crond -L /var/log/crond -l 5
echo -e "Starting supervisord"
echo -e "Starting supervisord."
exec "$@"