Merge branch 'develop' into develop

This commit is contained in:
GravityCube 2020-11-20 21:26:49 -03:00 committed by GitHub
commit 8fbcbcec45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 146 additions and 111 deletions

View file

@ -1,18 +1,14 @@
#!/bin/ash #!/bin/ash
## Ensure we are in /app
cd /app cd /app
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \ mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
&& rm -rf /app/storage/logs/ \ && chmod 777 /var/log/panel/logs/ \
&& chmod 777 /var/log/panel/logs/ \ && ln -s /var/log/panel/logs/ /app/storage/logs/
&& ln -s /var/log/panel/logs/ /app/storage/
## check for .env file and generate app keys if missing ## check for .env file and generate app keys if missing
if [ -f /app/var/.env ]; then if [ -f /app/var/.env ]; then
echo "external vars exist." echo "external vars exist."
rm -rf /app/.env rm -rf /app/.env
ln -s /app/var/.env /app/ ln -s /app/var/.env /app/
else else
echo "external vars don't exist." echo "external vars don't exist."
@ -46,10 +42,10 @@ else
echo "Checking if letsencrypt email is set." echo "Checking if letsencrypt email is set."
if [ -z $LE_EMAIL ]; then if [ -z $LE_EMAIL ]; then
echo "No letsencrypt email is set using http config." echo "No letsencrypt email is set using http config."
cp docker/default.conf /etc/nginx/conf.d/default.conf cp .github/docker/default.conf /etc/nginx/conf.d/default.conf
else else
echo "writing ssl config" echo "writing ssl config"
cp docker/default_ssl.conf /etc/nginx/conf.d/default.conf cp .github/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
echo "updating ssl config for domain" 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 sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/conf.d/default.conf
echo "generating certs" echo "generating certs"
@ -60,26 +56,19 @@ fi
## check for DB up before starting the panel ## check for DB up before starting the panel
echo "Checking database status." echo "Checking database status."
until nc -z -v -w30 $DB_HOST 3306 until nc -z -v -w30 $DB_HOST 3306
do do
echo "Waiting for database connection..." echo "Waiting for database connection..."
# wait for 5 seconds before check again # wait for 1 seconds before check again
sleep 5 sleep 1
done done
## make sure the db is set up ## make sure the db is set up
echo -e "Migrating and Seeding D.B" echo -e "Migrating and Seeding D.B"
php artisan migrate --force php artisan migrate --seed --force
php artisan db:seed --force
## start cronjobs for the queue ## start cronjobs for the queue
echo -e "Starting cron jobs." echo -e "Starting cron jobs."
crond -L /var/log/crond -l 5 crond -L /var/log/crond -l 5
## install yarn stuff
yarn install --production
yarn add cross-env
yarn run build:production
echo -e "Starting supervisord." echo -e "Starting supervisord."
exec "$@" exec "$@"

41
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Publish Docker Image
on:
push:
branches:
- 'develop'
tags:
- 'v*'
jobs:
push_to_registry:
name: Push Image to GitHub Packages
runs-on: ubuntu-latest
# Always run against a tag, even if the commit into the tag has [docker skip]
# within the commit message.
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
steps:
- uses: actions/checkout@v2
- uses: crazy-max/ghaction-docker-meta@v1
id: docker_meta
with:
images: ghcr.io/pterodactyl/panel
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Release Production Build
uses: docker/build-push-action@v2
if: "!contains(github.ref, 'develop')"
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Release Development Build
uses: docker/build-push-action@v2
if: "contains(github.ref, 'develop')"
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

View file

@ -1,10 +1,8 @@
name: "Release" name: Create Release
on: on:
push: push:
tags: tags:
- 'v*' - 'v*'
jobs: jobs:
release: release:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@ -13,7 +11,7 @@ jobs:
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: '12' node-version: '12'
- name: Create release branch and bump version - name: Create release branch and bump version
env: env:
REF: ${{ github.ref }} REF: ${{ github.ref }}
@ -32,7 +30,7 @@ jobs:
run: | run: |
yarn install yarn install
yarn run build:production yarn run build:production
- name: Create release archive - name: Create release archive
run: | run: |
rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.dusk.xml phpunit.xml Vagrantfile rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.dusk.xml phpunit.xml Vagrantfile
@ -63,25 +61,25 @@ jobs:
body_path: ./RELEASE_CHANGELOG body_path: ./RELEASE_CHANGELOG
draft: true draft: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
- name: Upload binary - name: Upload binary
id: upload-release-archive id: upload-release-archive
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: panel.tar.gz asset_path: panel.tar.gz
asset_name: panel.tar.gz asset_name: panel.tar.gz
asset_content_type: application/gzip asset_content_type: application/gzip
- name: Upload checksum - name: Upload checksum
id: upload-release-checksum id: upload-release-checksum
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./checksum.txt asset_path: ./checksum.txt
asset_name: checksum.txt asset_name: checksum.txt
asset_content_type: text/plain asset_content_type: text/plain

View file

@ -1,4 +1,4 @@
name: tests name: Run Test Suite
on: on:
push: push:
branch-ignore: branch-ignore:
@ -7,8 +7,8 @@ on:
pull_request: pull_request:
jobs: jobs:
integration_tests: integration_tests:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
services: services:
mysql: mysql:
image: mysql:5.7 image: mysql:5.7

View file

@ -3,6 +3,12 @@ This file is a running track of new features and fixes to each version of the pa
This project follows [Semantic Versioning](http://semver.org) guidelines. This project follows [Semantic Versioning](http://semver.org) guidelines.
## v1.1.2
### Fixed
* Fixes an exception thrown while trying to validate IP access for the client API.
* Fixes command history scrolling not putting the cursor at the end of the line.
* Fixes file manager rows triggering a 404 when middle-clicked to open in a new tab.
## v1.1.1 ## v1.1.1
### Fixed ### Fixed
* Fixes allocation permissions checking on the frontend checking the wrong permission therefore leading to the item never showing up. * Fixes allocation permissions checking on the frontend checking the wrong permission therefore leading to the item never showing up.

View file

@ -1,36 +1,39 @@
FROM php:7.4-fpm-alpine # Stage 0:
# Build the assets that are needed for the frontend. This build stage is then discarded
# since we won't need NodeJS anymore in the future. This Docker image ships a final production
# level distribution of Pterodactyl.
FROM mhart/alpine-node:14
WORKDIR /app WORKDIR /app
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot yarn; \
docker-php-ext-install bcmath; \
docker-php-ext-install gd; \
docker-php-ext-install mbstring; \
docker-php-ext-install pdo; \
docker-php-ext-install pdo_mysql; \
docker-php-ext-install tokenizer; \
docker-php-ext-install xml; \
docker-php-ext-configure zip --with-libzip=/usr/include; \
docker-php-ext-install zip; \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY . ./ COPY . ./
RUN yarn install --frozen-lockfile \
&& yarn run build:production
RUN cp .env.example .env \ # Stage 1:
&& composer install --no-dev --optimize-autoloader \ # Build the actual container with all of the needed PHP dependencies that will run the application.
&& rm .env \ FROM php:7.4-fpm-alpine
&& chown -R nginx:nginx . && chmod -R 777 storage/* bootstrap/cache WORKDIR /app
COPY . ./
COPY --from=0 /app/public/assets ./public/assets
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot \
&& docker-php-ext-configure zip \
&& docker-php-ext-install bcmath gd pdo_mysql zip \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& cp .env.example .env \
&& mkdir -p bootstrap/cache/ storage/logs storage/framework/sessions storage/framework/views storage/framework/cache \
&& chmod 777 -R bootstrap storage \
&& composer install --no-dev --optimize-autoloader \
&& rm -rf .env bootstrap/cache/*.php \
&& chown -R nginx:nginx .
RUN cp docker/default.conf /etc/nginx/conf.d/default.conf \ RUN rm /usr/local/etc/php-fpm.d/www.conf.default \
&& cat docker/www.conf > /usr/local/etc/php-fpm.d/www.conf \ && echo "* * * * * /usr/local/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& rm /usr/local/etc/php-fpm.d/www.conf.default \ && sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
&& cat docker/supervisord.conf > /etc/supervisord.conf \ && mkdir -p /var/run/php /var/run/nginx
&& echo "* * * * * /usr/local/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \ COPY .github/docker/default.conf /etc/nginx/conf.d/default.conf
&& mkdir -p /var/run/php /var/run/nginx COPY .github/docker/www.conf /usr/local/etc/php-fpm.d/www.conf
COPY .github/docker/supervisord.conf /etc/supervisord.conf
EXPOSE 80 443 EXPOSE 80 443
ENTRYPOINT ["/bin/ash", ".github/docker/entrypoint.sh"]
ENTRYPOINT ["/bin/ash", "docker/entrypoint.sh"]
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ] CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]

View file

@ -1,24 +1,53 @@
version: '2' version: '3.8'
x-common:
database:
&db-environment
# Do not remove the "&db-password" from the end of the line below, it is important
# for Panel functionality.
MYSQL_PASSWORD: &db-password "CHANGE_ME"
MYSQL_ROOT_PASSWORD: "CHANGE_ME_TOO"
panel:
&panel-environment
APP_URL: "https://example.com"
# A list of valid timezones can be found here: http://php.net/manual/en/timezones.php
APP_TIMEZONE: "UTC"
APP_SERVICE_AUTHOR: "noreply@example.com"
# Uncomment the line below and set to a non-empty value if you want to use Let's Encrypt
# to generate an SSL certificate for the Panel.
# LE_EMAIL: ""
mail:
&mail-environment
MAIL_FROM: "noreply@example.com"
MAIL_DRIVER: "smtp"
MAIL_HOST: "mail"
MAIL_PORT: "1025"
MAIL_USERNAME: ""
MAIL_PASSWORD: ""
MAIL_ENCRYPTION: "true"
#
# ------------------------------------------------------------------------------------------
# DANGER ZONE BELOW
#
# The remainder of this file likely does not need to be changed. Please only make modifications
# below if you understand what you are doing.
#
services: services:
database: database:
image: mariadb:10.4 image: library/mysql:8.0
restart: always restart: always
command: --default-authentication-plugin=mysql_native_password
volumes: volumes:
- "/srv/pterodactyl/database:/var/lib/mysql" - "/srv/pterodactyl/database:/var/lib/mysql"
environment: environment:
## Database settings <<: *db-environment
## change if you want it to be more secure. MYSQL_DATABASE: "panel"
- "MYSQL_ROOT_PASSWORD=apassword" MYSQL_USER: "pterodactyl"
- "MYSQL_DATABASE=pterodb"
- "MYSQL_USER=ptero"
- "MYSQL_PASSWORD=pterodbpass"
cache: cache:
image: redis:alpine image: redis:alpine
restart: always restart: always
panel: panel:
image: quay.io/pterodactyl/panel:latest image: ghcr.io/pterodactyl/panel:latest
restart: always restart: always
ports: ports:
- "80:80" - "80:80"
@ -32,47 +61,16 @@ services:
- "/srv/pterodactyl/certs/:/etc/letsencrypt/" - "/srv/pterodactyl/certs/:/etc/letsencrypt/"
- "/srv/pterodactyl/logs/:/var/log/" - "/srv/pterodactyl/logs/:/var/log/"
environment: environment:
## These are defaults and should be left alone <<: *panel-environment
- "APP_ENV=production" <<: *mail-environment
- "APP_DEBUG=false" DB_PASSWORD: *db-password
- "APP_THEME=pterodactyl" APP_ENV: "production"
- "APP_CLEAR_TASKLOG=720" APP_ENVIRONMENT_ONLY: "false"
- "APP_DELETE_MINUTES=10" CACHE_DRIVER: "redis"
- "APP_ENVIRONMENT_ONLY=false" SESSION_DRIVER: "redis"
- "QUEUE_HIGH=high" QUEUE_DRIVER: "redis"
- "QUEUE_STANDARD=standard" REDIS_HOST: "cache"
- "QUEUE_LOW=low" DB_HOST: "database"
## Cache settings
- "CACHE_DRIVER=redis"
- "SESSION_DRIVER=redis"
- "QUEUE_DRIVER=redis"
- "REDIS_HOST=cache"
- "REDIS_PASSWORD=null"
- "REDIS_PORT=6379"
## Domain settings
- "APP_URL=https://your.domain.here" ## if you are running this behind a reverse proxy with ssl app_url needs to be https still.
## Timezone settings
- "APP_TIMEZONE=UTC" ## http://php.net/manual/en/timezones.php
## Service egg settings
- "APP_SERVICE_AUTHOR=noreply@your.domain.here" ## this is the email that gets put on eggs you create
## Database settings
## These can be left alone. Only change if you know what you are doing.
- "DB_HOST=database"
- "DB_PORT=3306"
- "DB_DATABASE=pterodb"
- "DB_USERNAME=ptero"
- "DB_PASSWORD=pterodbpass"
## Email settings
- "MAIL_FROM=noreply@your.domain.here"
- "MAIL_DRIVER=smtp"
- "MAIL_HOST=mail"
- "MAIL_PORT=1025"
- "MAIL_USERNAME=''"
- "MAIL_PASSWORD=''"
- "MAIL_ENCRYPTION=true"
## certbot settings - Used to automatically generate ssl certs and
# - "LE_EMAIL=" ## uncomment if you are using ssl
networks: networks:
default: default:
ipam: ipam: