Commit 04a248c6 authored by Cameron Carney's avatar Cameron Carney

Changed PANEL_URL to APP_URL; Fixed CentOS missing Files

parent f9b47b86
......@@ -17,9 +17,9 @@ RUN \
&& apk add curl gettext nginx php7 php7 php7-bcmath php7-common php7-dom php7-fpm php7-gd \
php7-memcached php7-mbstring php7-openssl php7-pdo php7-phar php7-json php7-pdo_mysql \
php7-session php7-tokenizer php7-ctype php7-zlib php7-zip supervisor \
&& mkdir -p /var/www/html /run/nginx
RUN curl -Lo "${PANEL_VERSION}.tar.gz" https://github.com/Pterodactyl/Panel/archive/${PANEL_VERSION}.tar.gz \
&& mkdir -p /var/www/html /run/nginx \
\
&& curl -Lo "${PANEL_VERSION}.tar.gz" https://github.com/Pterodactyl/Panel/archive/${PANEL_VERSION}.tar.gz \
&& tar --strip-components=1 -xzvf ${PANEL_VERSION}.tar.gz \
&& rm "${PANEL_VERSION}.tar.gz" \
&& chmod -R 755 storage/* bootstrap/cache \
......
......@@ -27,7 +27,7 @@ __*Security Options*__
#### Panel Variables ####
---
* *PANEL_URL*: URL you want to use for the panel [required on startup].
* *APP_URL*: URL you want to use for the panel [required on startup].
* *TIMEZONE*:
......
......@@ -45,7 +45,7 @@ services:
- cache
- mysql
environment:
- PANEL_URL=http://localhost/
- APP_URL=http://localhost/
# SSL Encryption, useful if you dont run behind a reverse proxy
- SSL=false
......@@ -100,4 +100,4 @@ services:
#
# - /tmp/pterodactyl:/tmp/pterodactyl
#
# - /var/run/docker.sock:/var/run/docker.sock
\ No newline at end of file
# - /var/run/docker.sock:/var/run/docker.sock
......@@ -15,20 +15,20 @@ function init {
rm -rf ./storage
ln -s ${STORAGE_DIR} ./storage
# Always destroy .env symlink on startup
rm .env -rf
ln -s "${CONFIG_FILE}" .env
if [ ! -e "${CONFIG_FILE}" ] || [ ! -s "${CONFIG_FILE}" ]; then
echo "Missing Configuration file, Creating..."
cp .env.example "${CONFIG_FILE}"
php artisan optimize
php artisan config:cache
php artisan key:generate --force
updateConfiguration
fi
......@@ -39,26 +39,31 @@ function init {
# Runs the initial configuration on every startup
function initServer {
if [[ -z "${PANEL_URL}" ]]; then
echo "Missing environment variable 'PANEL_URL'! Please resolve it now and start the container back up..."
if [[ -z "${APP_URL}" ]]; then
echo "Missing environment variable 'APP_URL'! Please resolve it now and start the container back up..."
exit 1;
fi
echo "Starting Pterodactyl ${PANEL_VERSION} in ${STARTUP_TIMEOUT} seconds..."
sleep ${STARTUP_TIMEOUT}
if [[ "${STARTUP_TIMEOUT}" -gt "0" ]]; then
echo "Starting Pterodactyl ${PANEL_VERSION} in ${STARTUP_TIMEOUT} seconds..."
sleep ${STARTUP_TIMEOUT}
else
echo "Starting Pterodactyl ${PANEL_VERSION}..."
fi
# Since Nginx does not support URL's, lets just pull the domain out of the URL
export DOMAIN_NAME="$(echo $PANEL_URL | awk -F/ '{print $3}')"
export DOMAIN_NAME="$(echo $APP_URL | awk -F/ '{print $3}')"
# Checks if we have SSL enabled or not, and updates the configuration to what is desired.
if [ "${SSL}" == "true" ]; then
echo "Enabling SSL"
envsubst '${DOMAIN_NAME},${SSL_CERT},${SSL_CERT_KEY}' \
< /etc/nginx/templates/https.conf.tmpl > /etc/nginx/conf.d/default.conf
else
echo "Disabling SSL"
envsubst '${DOMAIN_NAME}' \
< /etc/nginx/templates/http.conf.tmpl > /etc/nginx/conf.d/default.conf
fi
......@@ -66,9 +71,9 @@ function initServer {
# Updates a configuration using variables from the .env file and shell variables
function updateConfiguration {
php artisan pterodactyl:env -n \
--url="${PANEL_URL}" \
--url="${APP_URL}" \
--dbhost="${DB_HOST}" \
--dbport="${DB_PORT}" \
--dbname="${DB_DATABASE}" \
......@@ -109,4 +114,4 @@ case "$1" in
echo -e "No internal command specified, executing as shell command...\n"
exec $@
;;
esac
\ No newline at end of file
esac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment