Skip to content

Commit

Permalink
Upgrade to Laravel 9 (#4413)
Browse files Browse the repository at this point in the history
Co-authored-by: DaneEveritt <[email protected]>
  • Loading branch information
matthewpi and DaneEveritt authored Oct 14, 2022
1 parent 95e15d2 commit cbcf620
Show file tree
Hide file tree
Showing 573 changed files with 4,438 additions and 9,462 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true

[.*yml]
[*.yml]
indent_size = 2

[*.md]
Expand Down
5 changes: 3 additions & 2 deletions .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ APP_ENV=testing
APP_DEBUG=true
APP_KEY=SomeRandomString3232RandomString
APP_THEME=pterodactyl
APP_TIMEZONE=America/Los_Angeles
APP_TIMEZONE=UTC
APP_URL=http://localhost/
APP_ENVIRONMENT_ONLY=true

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=panel_test
DB_USERNAME=root
Expand All @@ -16,4 +18,3 @@ MAIL_DRIVER=array
QUEUE_DRIVER=sync

HASHIDS_SALT=test123
APP_ENVIRONMENT_ONLY=true
29 changes: 16 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,43 @@ APP_ENV=production
APP_DEBUG=false
APP_KEY=
APP_THEME=pterodactyl
APP_TIMEZONE=America/New_York
APP_CLEAR_TASKLOG=720
APP_DELETE_MINUTES=10
APP_TIMEZONE=UTC
APP_URL=http://panel.example.com
APP_LOCALE=en
APP_ENVIRONMENT_ONLY=true

LOG_CHANNEL=daily
APP_LOCALE=en
APP_URL=http://panel.example.com
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=panel
DB_USERNAME=pterodactyl
DB_PASSWORD=

SESSION_DRIVER=file
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file

HASHIDS_SALT=
HASHIDS_LENGTH=8

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM=[email protected]
MAILGUN_ENDPOINT=api.mailgun.net
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="Pterodactyl Panel"
# You should set this to your domain to prevent it defaulting to 'localhost', causing
# mail servers such as Gmail to reject your mail.
#
# @see: https://github.com/pterodactyl/panel/pull/3110
# SERVER_NAME=panel.example.com

QUEUE_HIGH=high
QUEUE_STANDARD=standard
QUEUE_LOW=low
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
public
node_modules
resources/views
babel.config.js
tailwind.config.js
webpack.config.js
32 changes: 20 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
name: Build Panel
name: Build

on:
push:
branches:
- 'develop'
- 'v2'
pull_request:

jobs:
build:
ui:
name: UI
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
node-version: [16.x]
node-version: [16]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install -g yarn
- run: yarn install
- run: yarn build:production
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build:production
42 changes: 24 additions & 18 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,51 @@
name: Publish Docker Image

on:
push:
branches:
- 'develop'
tags:
- 'v*'
- 'release/v*'

jobs:
push_to_registry:
push:
name: Push Image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
# 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
- name: Code Checkout
uses: actions/checkout@v3

- name: Docker Metadata
uses: docker/metadata-action@v4
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

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Bump Version
if: "!contains(github.ref, 'develop')"
env:
REF: ${{ github.ref }}
run: |
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
- name: Release Production Build

- name: Release production build
uses: docker/build-push-action@v2
if: "!contains(github.ref, 'develop')"
if: "contains(github.ref, 'release/v')"
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Release Development Build

- name: Release development build
uses: docker/build-push-action@v2
if: "contains(github.ref, 'develop')"
with:
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
name: Create Release
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: 16
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build:production

- name: Create release branch and bump version
env:
Expand All @@ -26,11 +39,6 @@ jobs:
git commit -m "bump version for release"
git push
- name: Build assets
run: |
yarn install
yarn run build:production
- name: Create release archive
run: |
rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.xml Vagrantfile
Expand Down Expand Up @@ -62,7 +70,7 @@ jobs:
draft: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}

- name: Upload binary
- name: Upload release archive
id: upload-release-archive
uses: actions/upload-release-asset@v1
env:
Expand All @@ -73,7 +81,7 @@ jobs:
asset_name: panel.tar.gz
asset_content_type: application/gzip

- name: Upload checksum
- name: Upload release checksum
id: upload-release-checksum
uses: actions/upload-release-asset@v1
env:
Expand Down
42 changes: 29 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Run Tests
name: Tests

on:
push:
branches:
- 'develop'
- 'v2'
pull_request:

jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
php: [ 7.4, 8.0, 8.1 ]
database: [ 'mariadb:10.2', 'mysql:8' ]
php: [8.0, 8.1]
database: ['mariadb:10.2', 'mysql:8']
services:
database:
image: ${{ matrix.database }}
Expand All @@ -23,35 +26,48 @@ jobs:
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: "php-${{ matrix.php }} (${{ matrix.database }})"
steps:
- uses: actions/checkout@v2
- name: get cache directory
- name: Code Checkout
uses: actions/checkout@v3

- name: Get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
- uses: shivammathur/setup-php@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
tools: composer:v2
coverage: none
- run: cp .env.ci .env
- run: composer install --prefer-dist --no-interaction --no-progress
- run: vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Setup .env
run: cp .env.ci .env

- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
continue-on-error: true
- name: execute unit tests

- name: Unit tests
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
if: ${{ always() }}
env:
DB_HOST: UNIT_NO_DB
- name: execute integration tests

- name: Integration tests
run: vendor/bin/phpunit tests/Integration
env:
DB_PORT: ${{ job.services.database.ports[3306] }}
Expand Down
1 change: 0 additions & 1 deletion .yarnclean

This file was deleted.

Loading

0 comments on commit cbcf620

Please sign in to comment.