Skip to content

Commit cbcf620

Browse files
Upgrade to Laravel 9 (pterodactyl#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
1 parent 95e15d2 commit cbcf620

File tree

573 files changed

+4438
-9462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

573 files changed

+4438
-9462
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ indent_size = 4
88
charset = utf-8
99
trim_trailing_whitespace = true
1010

11-
[.*yml]
11+
[*.yml]
1212
indent_size = 2
1313

1414
[*.md]

.env.ci

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ APP_ENV=testing
22
APP_DEBUG=true
33
APP_KEY=SomeRandomString3232RandomString
44
APP_THEME=pterodactyl
5-
APP_TIMEZONE=America/Los_Angeles
5+
APP_TIMEZONE=UTC
66
APP_URL=http://localhost/
7+
APP_ENVIRONMENT_ONLY=true
78

9+
DB_CONNECTION=mysql
810
DB_HOST=127.0.0.1
911
DB_DATABASE=panel_test
1012
DB_USERNAME=root
@@ -16,4 +18,3 @@ MAIL_DRIVER=array
1618
QUEUE_DRIVER=sync
1719

1820
HASHIDS_SALT=test123
19-
APP_ENVIRONMENT_ONLY=true

.env.example

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,43 @@ APP_ENV=production
22
APP_DEBUG=false
33
APP_KEY=
44
APP_THEME=pterodactyl
5-
APP_TIMEZONE=America/New_York
6-
APP_CLEAR_TASKLOG=720
7-
APP_DELETE_MINUTES=10
5+
APP_TIMEZONE=UTC
6+
APP_URL=http://panel.example.com
7+
APP_LOCALE=en
88
APP_ENVIRONMENT_ONLY=true
9+
910
LOG_CHANNEL=daily
10-
APP_LOCALE=en
11-
APP_URL=http://panel.example.com
11+
LOG_DEPRECATIONS_CHANNEL=null
12+
LOG_LEVEL=debug
1213

14+
DB_CONNECTION=mysql
1315
DB_HOST=127.0.0.1
1416
DB_PORT=3306
1517
DB_DATABASE=panel
1618
DB_USERNAME=pterodactyl
1719
DB_PASSWORD=
1820

19-
SESSION_DRIVER=file
21+
REDIS_HOST=127.0.0.1
22+
REDIS_PASSWORD=null
23+
REDIS_PORT=6379
24+
2025
CACHE_DRIVER=file
26+
QUEUE_CONNECTION=sync
27+
SESSION_DRIVER=file
2128

2229
HASHIDS_SALT=
2330
HASHIDS_LENGTH=8
2431

25-
MAIL_DRIVER=smtp
32+
MAIL_MAILER=smtp
2633
MAIL_HOST=smtp.example.com
2734
MAIL_PORT=25
2835
MAIL_USERNAME=
2936
MAIL_PASSWORD=
3037
MAIL_ENCRYPTION=tls
31-
MAIL_FROM=no-reply@example.com
32-
MAILGUN_ENDPOINT=api.mailgun.net
38+
MAIL_FROM_ADDRESS=no-reply@example.com
39+
MAIL_FROM_NAME="Pterodactyl Panel"
3340
# You should set this to your domain to prevent it defaulting to 'localhost', causing
3441
# mail servers such as Gmail to reject your mail.
3542
#
3643
# @see: https://github.com/pterodactyl/panel/pull/3110
3744
# SERVER_NAME=panel.example.com
38-
39-
QUEUE_HIGH=high
40-
QUEUE_STANDARD=standard
41-
QUEUE_LOW=low

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
public
22
node_modules
33
resources/views
4+
babel.config.js
5+
tailwind.config.js
46
webpack.config.js

.github/workflows/build.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
1-
name: Build Panel
1+
name: Build
2+
23
on:
34
push:
45
branches:
56
- 'develop'
67
- 'v2'
78
pull_request:
9+
810
jobs:
9-
build:
11+
ui:
12+
name: UI
1013
runs-on: ubuntu-20.04
1114
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
1215
strategy:
1316
matrix:
14-
node-version: [16.x]
17+
node-version: [16]
1518
steps:
16-
- uses: actions/checkout@v2
17-
- name: Use Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v2
19-
with:
20-
node-version: ${{ matrix.node-version }}
21-
cache: 'npm'
22-
- run: npm install -g yarn
23-
- run: yarn install
24-
- run: yarn build:production
19+
- name: Code Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Build
32+
run: yarn build:production

.github/workflows/docker.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
11
name: Publish Docker Image
2+
23
on:
34
push:
45
branches:
56
- 'develop'
6-
tags:
7-
- 'v*'
7+
- 'release/v*'
8+
89
jobs:
9-
push_to_registry:
10+
push:
1011
name: Push Image to GitHub Packages
11-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1213
# Always run against a tag, even if the commit into the tag has [docker skip]
1314
# within the commit message.
1415
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
1516
steps:
16-
- uses: actions/checkout@v2
17-
- uses: crazy-max/ghaction-docker-meta@v1
17+
- name: Code Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Docker Metadata
21+
uses: docker/metadata-action@v4
1822
id: docker_meta
1923
with:
2024
images: ghcr.io/pterodactyl/panel
21-
- uses: docker/setup-qemu-action@v1
22-
- uses: docker/setup-buildx-action@v1
23-
- uses: docker/login-action@v1
25+
26+
- name: Setup QEMU
27+
uses: docker/setup-qemu-action@v2
28+
29+
- name: Setup Docker Buildx
30+
uses: docker/setup-buildx-action@v2
31+
32+
- name: Docker Login
33+
uses: docker/login-action@v2
2434
with:
2535
registry: ghcr.io
2636
username: ${{ github.repository_owner }}
2737
password: ${{ secrets.REGISTRY_TOKEN }}
28-
- name: Bump Version
29-
if: "!contains(github.ref, 'develop')"
30-
env:
31-
REF: ${{ github.ref }}
32-
run: |
33-
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
34-
- name: Release Production Build
38+
39+
- name: Release production build
3540
uses: docker/build-push-action@v2
36-
if: "!contains(github.ref, 'develop')"
41+
if: "contains(github.ref, 'release/v')"
3742
with:
3843
push: true
3944
platforms: linux/amd64,linux/arm64
4045
tags: ${{ steps.docker_meta.outputs.tags }}
4146
labels: ${{ steps.docker_meta.outputs.labels }}
42-
- name: Release Development Build
47+
48+
- name: Release development build
4349
uses: docker/build-push-action@v2
4450
if: "contains(github.ref, 'develop')"
4551
with:

.github/workflows/release.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
name: Create Release
1+
name: Release
2+
23
on:
34
push:
45
tags:
56
- 'v*'
7+
68
jobs:
79
release:
10+
name: Release
811
runs-on: ubuntu-20.04
912
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v1
13+
- name: Code Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
1218
with:
13-
node-version: '16.x'
19+
node-version: 16
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
25+
- name: Build
26+
run: yarn build:production
1427

1528
- name: Create release branch and bump version
1629
env:
@@ -26,11 +39,6 @@ jobs:
2639
git commit -m "bump version for release"
2740
git push
2841
29-
- name: Build assets
30-
run: |
31-
yarn install
32-
yarn run build:production
33-
3442
- name: Create release archive
3543
run: |
3644
rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.xml Vagrantfile
@@ -62,7 +70,7 @@ jobs:
6270
draft: true
6371
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
6472

65-
- name: Upload binary
73+
- name: Upload release archive
6674
id: upload-release-archive
6775
uses: actions/upload-release-asset@v1
6876
env:
@@ -73,7 +81,7 @@ jobs:
7381
asset_name: panel.tar.gz
7482
asset_content_type: application/gzip
7583

76-
- name: Upload checksum
84+
- name: Upload release checksum
7785
id: upload-release-checksum
7886
uses: actions/upload-release-asset@v1
7987
env:

.github/workflows/tests.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
name: Run Tests
1+
name: Tests
2+
23
on:
34
push:
45
branches:
56
- 'develop'
67
- 'v2'
78
pull_request:
9+
810
jobs:
911
tests:
12+
name: Tests
1013
runs-on: ubuntu-20.04
1114
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
1215
strategy:
1316
fail-fast: false
1417
matrix:
15-
php: [ 7.4, 8.0, 8.1 ]
16-
database: [ 'mariadb:10.2', 'mysql:8' ]
18+
php: [8.0, 8.1]
19+
database: ['mariadb:10.2', 'mysql:8']
1720
services:
1821
database:
1922
image: ${{ matrix.database }}
@@ -23,35 +26,48 @@ jobs:
2326
ports:
2427
- 3306
2528
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
26-
name: "php-${{ matrix.php }} (${{ matrix.database }})"
2729
steps:
28-
- uses: actions/checkout@v2
29-
- name: get cache directory
30+
- name: Code Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: Get cache directory
3034
id: composer-cache
3135
run: |
3236
echo "::set-output name=dir::$(composer config cache-files-dir)"
33-
- uses: actions/cache@v2
37+
38+
- name: Cache
39+
uses: actions/cache@v3
3440
with:
3541
path: |
3642
~/.php_cs.cache
3743
${{ steps.composer-cache.outputs.dir }}
3844
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
39-
- uses: shivammathur/setup-php@v2
45+
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
4048
with:
4149
php-version: ${{ matrix.php }}
4250
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
4351
tools: composer:v2
4452
coverage: none
45-
- run: cp .env.ci .env
46-
- run: composer install --prefer-dist --no-interaction --no-progress
47-
- run: vendor/bin/php-cs-fixer fix --dry-run --diff
53+
54+
- name: Setup .env
55+
run: cp .env.ci .env
56+
57+
- name: Install dependencies
58+
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
59+
60+
- name: PHP CS Fixer
61+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
4862
continue-on-error: true
49-
- name: execute unit tests
63+
64+
- name: Unit tests
5065
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
5166
if: ${{ always() }}
5267
env:
5368
DB_HOST: UNIT_NO_DB
54-
- name: execute integration tests
69+
70+
- name: Integration tests
5571
run: vendor/bin/phpunit tests/Integration
5672
env:
5773
DB_PORT: ${{ job.services.database.ports[3306] }}

.yarnclean

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)