Merge branch 'matthewpi/yarn-upgrade' into feature/react-admin

This commit is contained in:
Matthew Penner 2021-07-13 15:25:43 -06:00
commit ef5380e59d
24 changed files with 13271 additions and 8566 deletions

View File

@ -1,11 +0,0 @@
module.exports = {
twin: {
preset: 'styled-components',
autoCssProp: true,
},
styledComponents: {
pure: true,
displayName: false,
fileName: false,
},
};

View File

@ -8,7 +8,7 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
[.*yml]
[*.yml]
indent_size = 2
[*.md]

View File

@ -1,4 +1,5 @@
public
node_modules
resources/views
babel.config.js
webpack.config.js

4
.github/FUNDING.yml vendored
View File

@ -1,2 +1,2 @@
github: [DaneEveritt]
custom: ["https://paypal.me/PterodactylSoftware"]
github: [ DaneEveritt ]
custom: [ "https://paypal.me/PterodactylSoftware" ]

View File

@ -8,7 +8,7 @@ on:
jobs:
push_to_registry:
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'))"

View File

@ -7,11 +7,13 @@ jobs:
release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
cache: 'yarn'
- name: Create release branch and bump version
env:
REF: ${{ github.ref }}
@ -25,17 +27,14 @@ jobs:
git add config/app.php
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.dusk.xml phpunit.xml Vagrantfile
tar -czf panel.tar.gz * .env.example .babel-plugin-macrosrc.js
rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.dusk.xml phpunit.xml
tar -czf panel.tar.gz * .env.example .eslintignore .eslintrc.yml .yarnclean
- name: Extract changelog
id: extract_changelog
env:
@ -43,13 +42,11 @@ jobs:
run: |
sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
echo ::set-output name=version_name::`sed -nr "s/^## (${REF:10} .*)$/\1/p" CHANGELOG.md`
- name: Create checksum and add to changelog
run: |
SUM=`sha256sum panel.tar.gz`
echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG
echo $SUM > checksum.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
@ -61,7 +58,6 @@ jobs:
body_path: ./RELEASE_CHANGELOG
draft: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
- name: Upload binary
id: upload-release-archive
uses: actions/upload-release-asset@v1
@ -72,7 +68,6 @@ jobs:
asset_path: panel.tar.gz
asset_name: panel.tar.gz
asset_content_type: application/gzip
- name: Upload checksum
id: upload-release-checksum
uses: actions/upload-release-asset@v1

View File

@ -1,45 +1,36 @@
name: run tests
name: Run Tests
on:
push:
branches-ignore:
- master
- "release/**"
branches:
- 'develop'
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
services:
mariadb:
image: mariadb:10.2
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: panel_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: panel_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php: [ 7.4, 8.0 ]
database: [ mysql, mariadb ]
name: "php-${{ matrix.php }} (engine: ${{ matrix.database }})"
database: [ 'mariadb:10.2', 'mariadb:10.5', 'mysql:8' ]
services:
database:
image: ${{ matrix.database }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: panel_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: "php-${{ matrix.php }} (${{ matrix.database }})"
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v2
- name: get cache directory
- name: Get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: cache dependencies
- name: Cache
uses: actions/cache@v2
with:
path: |
@ -48,35 +39,28 @@ jobs:
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-cache-${{ matrix.php }}-
- name: setup
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: cli, openssl, gd, mysql, pdo, mbstring, tokenizer, bcmath, xml, curl, zip
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
tools: composer:v2
coverage: none
- name: configure
- name: Configure .env
run: cp .env.ci .env
- name: install dependencies
- name: composer install
run: composer install --prefer-dist --no-interaction --no-progress
- name: run cs-fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --config .php_cs.dist
- name: Run cs-fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --config .php-cs-fixer.dist.php
continue-on-error: true
- name: execute unit tests
- name: Execute Unit Tests
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
if: ${{ always() }}
env:
DB_CONNECTION: testing
TESTING_DB_HOST: UNIT_NO_DB
- name: execute integration tests (mysql)
- name: Execute Integration Tests
run: vendor/bin/phpunit tests/Integration
if: "${{ matrix.database }} == 'mysql'"
env:
TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }}
TESTING_DB_USERNAME: root
- name: execute integration tests (mariadb)
run: vendor/bin/phpunit tests/Integration
if: "${{ matrix.database }} == 'mariadb'"
env:
TESTING_DB_PORT: ${{ job.services.mariadb.ports[3306] }}
TESTING_DB_PORT: ${{ job.services.database.ports[3306] }}
TESTING_DB_USERNAME: root

104
.gitignore vendored
View File

@ -1,38 +1,78 @@
#------------------#
# IDEs and Editors #
#------------------#
# Jetbrains
/.idea
*.iml
*.ipr
*.iws
# Visual Studio Code
/.vscode
# Sublime Text
*.sublime-*
#-------------------#
# Tools #
#-------------------#
# Vagrant
/.vagrant
#-------------------#
# Languages #
#-------------------#
# Node.js
/.npm
/node_modules
npm-debug.log
.cache
.eslintcache
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
.yarn-integrity
yarn-debug.log
yarn-error.log
# PHP
/vendor
*.DS_Store*
.php_cs.cache
#-------------------#
# Operating Systems #
#-------------------#
# External Drives
.Spotlight-V100
.Trashes
# Linux
*~
# Mac OS
/.DS_Store
*.DS_Store
# VIM
.*.sw[a-p]
#-------------------#
# Project Files #
#-------------------#
# Environment Files
!.env.ci
!.env.dusk
!.env.example
.env*
.vagrant/*
.vscode/*
storage/framework/*
/.idea
/nbproject
node_modules
*.log
_ide_helper.php
.phpstorm.meta.php
.php_cs.cache
public/assets/manifest.json
# For local development with docker
# Remove if we ever put the Dockerfile in the repo
.dockerignore
#Dockerfile
docker-compose.yml
# for image related files
misc
.phpstorm.meta.php
.php_cs.cache
coverage.xml
# Vagrant
*.log
resources/lang/locales.js
resources/assets/pterodactyl/scripts/helpers/ziggy.js
resources/assets/scripts/helpers/ziggy.js
.phpunit.result.cache

55
.yarn/releases/yarn-berry.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
@types/react-native

4
.yarnrc.yml Normal file
View File

@ -0,0 +1,4 @@
nodeLinker: 'node-modules'
pnpIgnorePatterns:
- './public/**/*'
yarnPath: '.yarn/releases/yarn-berry.cjs'

View File

@ -21,7 +21,7 @@ class AllocationFactory extends Factory
{
return [
'ip' => $this->faker->unique()->ipv4,
'port' => $this->faker->unique()->randomNumber(5),
'port' => $this->faker->unique()->numberBetween(1024, 65535),
];
}
}

View File

@ -1,6 +1,16 @@
{
"name": "pterodactyl-panel",
"private": true,
"scripts": {
"clean": "cd public/assets && find . \\( -name \"*.js\" -o -name \"*.map\" \\) -type f -delete",
"lint": "$npm_execpath eslint ./resources/scripts/**/*.{ts,tsx} --ext .ts,.tsx",
"watch": "$npm_execpath cross-env NODE_ENV=development $npm_execpath webpack --watch --progress",
"build": "$npm_execpath cross-env NODE_ENV=development $npm_execpath webpack --progress",
"build:production": "$npm_execpath run clean && $npm_execpath cross-env NODE_ENV=production $npm_execpath webpack --mode production",
"serve": "$npm_execpath run clean && $npm_execpath cross-env PUBLIC_PATH=https://pterodactyl.test:8080 NODE_ENV=development $npm_execpath webpack-dev-server --host 0.0.0.0 --hot --https --key /etc/ssl/private/pterodactyl.test-key.pem --cert /etc/ssl/private/pterodactyl.test.pem"
},
"dependencies": {
"@": "link:./resources/scripts",
"@codemirror/autocomplete": "^0.18.5",
"@codemirror/closebrackets": "^0.18.0",
"@codemirror/commands": "^0.18.2",
@ -20,44 +30,46 @@
"@codemirror/stream-parser": "^0.18.2",
"@codemirror/theme-one-dark": "^0.18.1",
"@codemirror/view": "^0.18.12",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@tailwindcss/forms": "^0.2.1",
"@hot-loader/react-dom": "^16.14.0",
"axios": "^0.21.1",
"chart.js": "^2.8.0",
"codemirror": "^5.57.0",
"date-fns": "^2.16.1",
"debounce": "^1.2.0",
"chart.js": "^2.9.3",
"codemirror": "^5.62.0",
"date-fns": "^2.22.1",
"debounce": "^1.2.1",
"deepmerge": "^4.2.2",
"easy-peasy": "^4.0.1",
"events": "^3.0.0",
"formik": "^2.2.6",
"i18next": "^19.0.0",
"i18next-chained-backend": "^2.0.0",
"i18next-localstorage-backend": "^3.0.0",
"easy-peasy": "^5.0.3",
"events": "^3.3.0",
"feature": "link:./resources/scripts/components/server/features",
"formik": "^2.2.9",
"history": "^4.10.1",
"i18next": "^20.3.2",
"i18next-chained-backend": "^3.0.2",
"i18next-localstorage-backend": "^3.1.3",
"i18next-xhr-backend": "^3.2.2",
"qrcode.react": "^1.0.1",
"query-string": "^6.7.0",
"react": "^16.13.1",
"query-string": "^7.0.1",
"react": "^16.14.0",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "npm:@hot-loader/react-dom",
"react-dom": "^16.14.0",
"react-fast-compare": "^3.2.0",
"react-ga": "^3.3.0",
"react-google-recaptcha": "^2.1.0",
"react-hot-loader": "^4.13.0",
"react-i18next": "^11.8.5",
"react-i18next": "^11.11.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-select": "^4.3.1",
"react-transition-group": "^4.4.1",
"react-transition-group": "^4.4.2",
"reaptcha": "^1.7.2",
"sockette": "^2.0.6",
"styled-components": "^5.2.1",
"styled-components-breakpoint": "^3.0.0-preview.20",
"swr": "^0.5.6",
"tailwindcss": "^2.0.2",
"uuid": "^3.3.2",
"xterm": "^4.12.0",
"xterm": "^4.13.0",
"xterm-addon-attach": "^0.6.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-search": "^0.8.0",
@ -66,80 +78,90 @@
"yup": "^0.32.9"
},
"devDependencies": {
"@babel/core": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/core": "^7.14.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.14.5",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-react-jsx": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.12.1",
"@types/chart.js": "^2.8.5",
"@types/codemirror": "^0.0.98",
"@babel/plugin-transform-react-jsx": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@babel/runtime": "^7.14.5",
"@tailwindcss/forms": "^0.3.3",
"@types/chart.js": "^2.9.34",
"@types/codemirror": "^5.60.2",
"@types/debounce": "^1.2.0",
"@types/events": "^3.0.0",
"@types/node": "^14.11.10",
"@types/qrcode.react": "^1.0.1",
"@types/history": "^4.7.9",
"@types/node": "^16.3.0",
"@types/qrcode.react": "^1.0.2",
"@types/query-string": "^6.3.0",
"@types/react": "^16.9.41",
"@types/react-copy-to-clipboard": "^4.3.0",
"@types/react-dom": "^16.9.8",
"@types/react-helmet": "^6.0.0",
"@types/react-redux": "^7.1.1",
"@types/react-router": "^5.1.3",
"@types/react-router-dom": "^5.1.3",
"@types/react-select": "^4.0.15",
"@types/react-transition-group": "^4.4.0",
"@types/react": "^16.14.11",
"@types/react-copy-to-clipboard": "^5.0.1",
"@types/react-dom": "^16.9.14",
"@types/react-helmet": "^6.1.2",
"@types/react-redux": "^7.1.18",
"@types/react-router": "^5.1.16",
"@types/react-router-dom": "^5.1.8",
"@types/react-select": "^4.0.17",
"@types/react-transition-group": "^4.4.2",
"@types/styled-components": "^5.1.7",
"@types/uuid": "^3.4.5",
"@types/webpack-env": "^1.15.2",
"@types/yup": "^0.29.3",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"autoprefixer": "^10.1.0",
"babel-loader": "^8.0.6",
"babel-plugin-styled-components": "^1.12.0",
"cross-env": "^7.0.2",
"css-loader": "^3.2.1",
"eslint": "^7.27.0",
"@types/webpack-env": "^1.16.2",
"@types/yup": "^0.29.13",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"autoprefixer": "^10.2.6",
"babel-loader": "^8.2.2",
"babel-plugin-styled-components": "^1.13.2",
"browserslist": "^4.16.6",
"cross-env": "^7.0.3",
"css-loader": "^5.2.6",
"eslint": "^7.30.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^6.2.10",
"postcss": "^8.2.4",
"redux-devtools-extension": "^2.13.8",
"source-map-loader": "^1.0.1",
"style-loader": "^1.2.1",
"svg-url-loader": "^6.0.0",
"terser-webpack-plugin": "^3.0.6",
"twin.macro": "^2.0.7",
"typescript": "^4.2.4",
"webpack": "^4.43.0",
"webpack-assets-manifest": "^3.1.1",
"webpack-bundle-analyzer": "^3.8.0",
"fork-ts-checker-webpack-plugin": "^6.2.12",
"postcss": "^8.3.5",
"redux-devtools-extension": "^2.13.9",
"source-map-loader": "^1.1.3",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"tailwindcss": "^2.2.4",
"terser-webpack-plugin": "^4.2.3",
"twin.macro": "^2.6.2",
"typescript": "^4.3.5",
"webpack": "^4.46.0",
"webpack-assets-manifest": "^4.0.6",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"yarn-deduplicate": "^1.1.1"
"webpack-dev-server": "^3.11.2"
},
"scripts": {
"clean": "cd public/assets && find . \\( -name \"*.js\" -o -name \"*.map\" \\) -type f -delete",
"lint": "eslint ./resources/scripts/**/*.{ts,tsx} --ext .ts,.tsx",
"watch": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
"build": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --progress",
"build:production": "yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production",
"serve": "yarn run clean && cross-env PUBLIC_PATH=https://pterodactyl.test:8080 NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot --https --key /etc/ssl/private/pterodactyl.test-key.pem --cert /etc/ssl/private/pterodactyl.test.pem"
"engines": {
"node": ">=12",
"yarn": "^1.22.x"
},
"browserslist": [
"> 0.5%",
"last 2 versions",
"firefox esr",
"not dead"
]
],
"babelMacros": {
"twin": {
"preset": "styled-components",
"autoCssProp": true
},
"styledComponents": {
"pure": true,
"displayName": false,
"fileName": false
}
}
}

View File

@ -7,7 +7,7 @@ import tw from 'twin.macro';
const StyledSwitchTransition = styled(SwitchTransition)`
${tw`relative`};
& section {
${tw`absolute w-full top-0 left-0`};
}

View File

@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { StaticContext } from 'react-router';
import { Link, RouteComponentProps } from 'react-router-dom';
import loginCheckpoint from '@/api/auth/loginCheckpoint';
import LoginFormContainer from '@/components/auth/LoginFormContainer';
import { ActionCreator } from 'easy-peasy';
import { StaticContext } from 'react-router';
import { useFormikContext, withFormik } from 'formik';
import useFlash from '@/plugins/useFlash';
import { FlashStore } from '@/state/flashes';

View File

@ -158,9 +158,10 @@ export default ({ style, initialContent, filename, mode, fetchContent, onContent
indentWithTabs: false,
lineWrapping: true,
lineNumbers: true,
// @ts-ignore
foldGutter: true,
fixedGutter: true,
scrollbarStyle: 'overlay',
scrollbarStyle: 'native',
coverGutterNextToScrollbar: false,
readOnly: false,
showCursorWhenSelecting: false,
@ -169,8 +170,6 @@ export default ({ style, initialContent, filename, mode, fetchContent, onContent
autocorrect: false,
autocapitalize: false,
lint: false,
// This property is actually used, the d.ts file for CodeMirror is incorrect.
// @ts-ignore
autoCloseBrackets: true,
matchBrackets: true,
gutters: [ 'CodeMirror-linenumbers', 'CodeMirror-foldgutter' ],

View File

@ -7,7 +7,7 @@ import ServerContentBlock from '@/components/elements/ServerContentBlock';
import ServerDetailsBlock from '@/components/server/ServerDetailsBlock';
import isEqual from 'react-fast-compare';
import PowerControls from '@/components/server/PowerControls';
import { EulaModalFeature } from '@feature/index';
import { EulaModalFeature } from 'feature/index';
import ErrorBoundary from '@/components/elements/ErrorBoundary';
import Spinner from '@/components/elements/Spinner';

View File

@ -6,6 +6,6 @@ import { lazy } from 'react';
* whenever they are actually loaded for the client (which may be never, depending
* on the feature and the egg).
*/
const EulaModalFeature = lazy(() => import(/* webpackChunkName: "feature.eula" */'@feature/eula/EulaModalFeature'));
const EulaModalFeature = lazy(() => import(/* webpackChunkName: "feature.eula" */'feature/eula/EulaModalFeature'));
export { EulaModalFeature };

View File

@ -1,2 +1,2 @@
*
!.gitignore
!.gitignore

View File

@ -1,3 +1,3 @@
*
!data/
!.gitignore
!.gitignore

View File

@ -1,2 +1,2 @@
*
!.gitignore
!.gitignore

View File

@ -60,7 +60,8 @@ module.exports = {
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
'@': path.join(__dirname, '/resources/scripts'),
'@feature': path.join(__dirname, '/resources/scripts/components/server/features'),
'feature': path.join(__dirname, '/resources/scripts/components/server/features'),
'react-dom': '@hot-loader/react-dom',
},
symlinks: false,
},

21360
yarn.lock

File diff suppressed because it is too large Load Diff