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