mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-09 19:07:58 +03:00
Compare commits
185 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03574ce4b3 | ||
|
|
56dbac6f81 | ||
|
|
8801d1db59 | ||
|
|
dd913008c1 | ||
|
|
f6d068be2c | ||
|
|
5c450900fd | ||
|
|
2743698e2c | ||
|
|
0195e36ccf | ||
|
|
867777f2e4 | ||
|
|
e96dd13170 | ||
|
|
7860710cca | ||
|
|
67fa753e7b | ||
|
|
3b0c5540a7 | ||
|
|
3e940e8c48 | ||
|
|
b39e1c6f78 | ||
|
|
7c575205d3 | ||
|
|
01f63f7122 | ||
|
|
0a6c43ba4f | ||
|
|
ef1bd0098b | ||
|
|
cbca669e10 | ||
|
|
2d93c90060 | ||
|
|
3e90484125 | ||
|
|
f3085afcbc | ||
|
|
f6eede37aa | ||
|
|
8ce84239e1 | ||
|
|
2e3d17b94a | ||
|
|
2849f8a36a | ||
|
|
1dcb08ccc0 | ||
|
|
c07f015ccd | ||
|
|
0213e7dfec | ||
|
|
5d4713e0de | ||
|
|
c328f5cd9b | ||
|
|
43a250ac31 | ||
|
|
4c4ec54981 | ||
|
|
20875d8d3f | ||
|
|
9120e81514 | ||
|
|
2225d50b9a | ||
|
|
f805219ddc | ||
|
|
79e8842228 | ||
|
|
9b29ba8e30 | ||
|
|
a61c07a04c | ||
|
|
06f66027dd | ||
|
|
039c669fc7 | ||
|
|
0bfcf000f1 | ||
|
|
d5783811c8 | ||
|
|
e1eb79e4e5 | ||
|
|
b39f843d0f | ||
|
|
1b4566d123 | ||
|
|
e8bf5dbfcc | ||
|
|
bbe3361607 | ||
|
|
96c30b6a34 | ||
|
|
7e0e0908de | ||
|
|
21465a0d93 | ||
|
|
9560e18798 | ||
|
|
358ac96ac1 | ||
|
|
1ffc65897b | ||
|
|
b8b4750f46 | ||
|
|
08d98581aa | ||
|
|
675c289780 | ||
|
|
f795b38db5 | ||
|
|
e3947e4b50 | ||
|
|
146965fcba | ||
|
|
cea1a3eccc | ||
|
|
a507434422 | ||
|
|
41f35d6956 | ||
|
|
227ce5ec89 | ||
|
|
18ad46fe16 | ||
|
|
62d56099d7 | ||
|
|
119ef075da | ||
|
|
f7bc9f005f | ||
|
|
49de8fae3e | ||
|
|
ae0882740a | ||
|
|
7e5d21a889 | ||
|
|
796a236ef4 | ||
|
|
03b1fc4636 | ||
|
|
654aad06bb | ||
|
|
0d2e63f590 | ||
|
|
0c5b449c4e | ||
|
|
3d740907db | ||
|
|
cd9044753f | ||
|
|
add838d42f | ||
|
|
7df31a1eeb | ||
|
|
0eef1c9bbc | ||
|
|
798ac6d4c1 | ||
|
|
582f9e03d8 | ||
|
|
29b3debee2 | ||
|
|
f5269e7e5c | ||
|
|
6d3da18bf6 | ||
|
|
899b8836fb | ||
|
|
375c32f767 | ||
|
|
afe6068f4f | ||
|
|
e7316ba973 | ||
|
|
ab4c3eedc3 | ||
|
|
ec38f7567e | ||
|
|
dcdfd2cea9 | ||
|
|
0ce1739b9f | ||
|
|
7c39c00400 | ||
|
|
1f9c98ba61 | ||
|
|
e1869ed9e6 | ||
|
|
9347f776e6 | ||
|
|
301976e984 | ||
|
|
b4532d9d10 | ||
|
|
d4d3ffc96c | ||
|
|
c124d403ff | ||
|
|
44b9eb2358 | ||
|
|
1d96ed8869 | ||
|
|
627442e40f | ||
|
|
d58496a355 | ||
|
|
d9cfb62a12 | ||
|
|
b11810588a | ||
|
|
c4c4834acc | ||
|
|
3a95105931 | ||
|
|
25001c54a8 | ||
|
|
c01330dc06 | ||
|
|
139c70e52b | ||
|
|
d012b895e1 | ||
|
|
c4a471f91a | ||
|
|
2aa9be62a1 | ||
|
|
c8c3b55be8 | ||
|
|
a3f33eea3f | ||
|
|
0dacfc31ac | ||
|
|
4cc123aed5 | ||
|
|
37094ffc1f | ||
|
|
a97e3ee3e8 | ||
|
|
b8d0cb0745 | ||
|
|
6030a0e890 | ||
|
|
7c0a46deaa | ||
|
|
e9ea5b1cae | ||
|
|
c7bf124a15 | ||
|
|
861aeb0c5c | ||
|
|
3cea8ca979 | ||
|
|
53c1626805 | ||
|
|
b4610ce2c9 | ||
|
|
088a7cd5a7 | ||
|
|
c7fba40ba3 | ||
|
|
c3529acb22 | ||
|
|
daca4d1d5b | ||
|
|
f7c2c1a84c | ||
|
|
1172fec6e5 | ||
|
|
dece74c185 | ||
|
|
80c5a97038 | ||
|
|
80d3827e4e | ||
|
|
38d68d8221 | ||
|
|
8808a94154 | ||
|
|
67c2bb53e0 | ||
|
|
49749ebfcc | ||
|
|
aa93cd65c1 | ||
|
|
9d3a6ae494 | ||
|
|
449f875d20 | ||
|
|
50fa260a38 | ||
|
|
fc343aca46 | ||
|
|
f988cc8cfa | ||
|
|
ba95045583 | ||
|
|
df37de4d2d | ||
|
|
89477421e1 | ||
|
|
ea417cf45e | ||
|
|
ca543a3b91 | ||
|
|
384612360e | ||
|
|
a0cc4b3d5f | ||
|
|
666634ae88 | ||
|
|
191e0adc58 | ||
|
|
a496be67b8 | ||
|
|
60c32cdb81 | ||
|
|
1813e6f549 | ||
|
|
f27f673615 | ||
|
|
2aa06fc009 | ||
|
|
521aa203b8 | ||
|
|
9b2dfb4212 | ||
|
|
4969aed383 | ||
|
|
4e42cd784a | ||
|
|
4ea5341e97 | ||
|
|
41c3f1336a | ||
|
|
095bc89aee | ||
|
|
6b5e990a1c | ||
|
|
afc22a2787 | ||
|
|
a9774718d2 | ||
|
|
e4cee4d69d | ||
|
|
9fb0c451f5 | ||
|
|
a296084d6e | ||
|
|
05681641d3 | ||
|
|
aa85727156 | ||
|
|
cd51705b58 | ||
|
|
2f3d4e2819 | ||
|
|
883314b74a | ||
|
|
c83dd86a41 |
20
.env.ci
20
.env.ci
@@ -1,20 +0,0 @@
|
||||
APP_ENV=testing
|
||||
APP_DEBUG=true
|
||||
APP_KEY=SomeRandomString3232RandomString
|
||||
APP_THEME=pterodactyl
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://localhost/
|
||||
APP_ENVIRONMENT_ONLY=true
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_DATABASE=testing
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
CACHE_DRIVER=array
|
||||
SESSION_DRIVER=array
|
||||
MAIL_DRIVER=array
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
HASHIDS_SALT=test123
|
||||
22
.env.example
22
.env.example
@@ -1,13 +1,13 @@
|
||||
APP_ENV=production
|
||||
APP_DEBUG=false
|
||||
APP_KEY=
|
||||
APP_THEME=pterodactyl
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://panel.example.com
|
||||
APP_URL=http://panel.test
|
||||
APP_LOCALE=en
|
||||
APP_ENVIRONMENT_ONLY=true
|
||||
|
||||
LOG_CHANNEL=daily
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
@@ -15,30 +15,30 @@ DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=panel
|
||||
DB_USERNAME=pterodactyl
|
||||
DB_USERNAME=panel
|
||||
DB_PASSWORD=
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=redis
|
||||
CACHE_STORE=file
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
|
||||
HASHIDS_SALT=
|
||||
HASHIDS_LENGTH=8
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_MAILER=log
|
||||
MAIL_HOST=smtp.example.com
|
||||
MAIL_PORT=25
|
||||
MAIL_USERNAME=
|
||||
MAIL_PASSWORD=
|
||||
MAIL_ENCRYPTION=tls
|
||||
MAIL_FROM_ADDRESS=no-reply@example.com
|
||||
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
|
||||
MAIL_FROM_NAME="Pelican Admin"
|
||||
# Set this to your domain to prevent it defaulting to 'localhost', causing mail servers such as Gmail to reject your mail
|
||||
# MAIL_EHLO_DOMAIN=panel.example.com
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1 +1 @@
|
||||
github: [matthewpi]
|
||||
custom: [https://buy.stripe.com/14kdU99SI4UT7ni9AB, https://buy.stripe.com/14kaHXc0Q9b9372eUU]
|
||||
|
||||
24
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
24
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -5,23 +5,23 @@ body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Bug reports should only be used for reporting issues with how the software works. For assistance installing this software, as well as debugging issues with dependencies, please use our [Discord server](https://discord.gg/pterodactyl).
|
||||
Bug reports should only be used for reporting issues with how the software works. For assistance installing this software, as well as debugging issues with dependencies, please use our Discord Server.
|
||||
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
description: Please provide a clear & concise description of the issue.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: Please describe what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: Please be as detailed as possible when providing steps to reproduce, failure to provide steps will result in this issue being closed.
|
||||
@@ -45,20 +45,20 @@ body:
|
||||
placeholder: 1.4.2
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: input
|
||||
id: egg-details
|
||||
attributes:
|
||||
label: Games and/or Eggs Affected
|
||||
description: Please include the specific game(s) or egg(s) you are running into this bug with.
|
||||
placeholder: Minecraft (Paper), Minecraft (Forge)
|
||||
|
||||
|
||||
- type: input
|
||||
id: docker-image
|
||||
attributes:
|
||||
label: Docker Image
|
||||
description: The specific Docker image you are using for the game(s) above.
|
||||
placeholder: ghcr.io/pterodactyl/yolks:java_17
|
||||
placeholder: ghcr.io/pelican-dev/yolks:java_17
|
||||
|
||||
- type: textarea
|
||||
id: panel-logs
|
||||
@@ -66,18 +66,18 @@ body:
|
||||
label: Error Logs
|
||||
description: |
|
||||
Run the following command to collect logs on your system.
|
||||
|
||||
|
||||
Wings: `sudo wings diagnostics`
|
||||
Panel: `tail -n 150 /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log | nc pteropaste.com 99`
|
||||
placeholder: "https://pteropaste.com/a1h6z"
|
||||
Panel: `tail -n 150 /var/www/pelican/storage/logs/laravel-$(date +%F).log | nc pelipaste.com 99`
|
||||
placeholder: "https://pelipaste.com/a1h6z"
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please [search here](https://github.com/pterodactyl/panel/issues) to see if an issue already exists for your problem.
|
||||
description: Please [search here](https://github.com/pelican-dev/panel/issues) to see if an issue already exists for your problem.
|
||||
options:
|
||||
- label: I have searched the existing issues before opening this issue.
|
||||
required: true
|
||||
|
||||
9
.github/ISSUE_TEMPLATE/config.yml
vendored
9
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,11 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Feature Request
|
||||
url: https://github.com/pelican-dev/panel/discussions
|
||||
about: Suggest a new feature or improvement for the software.
|
||||
- name: Installation Help
|
||||
url: https://discord.gg/pterodactyl
|
||||
url: https://pelican.dev/discord
|
||||
about: Please visit our Discord for help with your installation.
|
||||
- name: General Question
|
||||
url: https://discord.gg/pterodactyl
|
||||
about: Please visit our Discord for general questions about Pterodactyl.
|
||||
url: https://pelican.dev/discord
|
||||
about: Please visit our Discord for general questions about Pelican.
|
||||
|
||||
32
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
32
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
@@ -1,32 +0,0 @@
|
||||
name: Feature Request
|
||||
description: Suggest a new feature or improvement for the software.
|
||||
labels: [feature request]
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing feature request for this?
|
||||
description: Please [search here](https://github.com/pterodactyl/panel/issues?q=is%3Aissue) to see if someone else has already suggested this.
|
||||
options:
|
||||
- label: I have searched the existing issues before opening this feature request.
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the feature you would like to see.
|
||||
description: "A clear & concise description of the feature you'd like to have added, and what issues it would solve."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like.
|
||||
description: "You must explain how you'd like to see this feature implemented. Technical implementation details are not necessary, rather an idea of how you'd like to see this feature used."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context to this request.
|
||||
description: "Add any other context or screenshots about the feature request."
|
||||
validations:
|
||||
required: false
|
||||
50
.github/docker/README.md
vendored
50
.github/docker/README.md
vendored
@@ -1,8 +1,8 @@
|
||||
# Pterodactyl Panel - Docker Image
|
||||
# Pelican Panel - Docker Image
|
||||
This is a ready to use docker image for the panel.
|
||||
|
||||
## Requirements
|
||||
This docker image requires some additional software to function. The software can either be provided in other containers (see the [docker-compose.yml](https://github.com/pterodactyl/panel/blob/develop/docker-compose.example.yml) as an example) or as existing instances.
|
||||
This docker image requires some additional software to function. The software can either be provided in other containers (see the [docker-compose.yml](https://github.com/pelican-dev/panel/blob/develop/docker-compose.example.yml) as an example) or as existing instances.
|
||||
|
||||
A mysql database is required. We recommend the stock [MariaDB Image](https://hub.docker.com/_/mariadb/) image if you prefer to run it in a docker container. As a non-containerized option we recommend mariadb.
|
||||
|
||||
@@ -12,7 +12,7 @@ You can provide additional settings using a custom `.env` file or by setting the
|
||||
|
||||
## Setup
|
||||
|
||||
Start the docker container and the required dependencies (either provide existing ones or start containers as well, see the [docker-compose.yml](https://github.com/pterodactyl/panel/blob/develop/docker-compose.example.yml) file as an example.
|
||||
Start the docker container and the required dependencies (either provide existing ones or start containers as well, see the [docker-compose.yml](https://github.com/pelican-dev/panel/blob/develop/docker-compose.example.yml) file as an example.
|
||||
|
||||
After the startup is complete you'll need to create a user.
|
||||
If you are running the docker container without docker-compose, use:
|
||||
@@ -29,28 +29,28 @@ There are multiple environment variables to configure the panel when not providi
|
||||
|
||||
Note: If your `APP_URL` starts with `https://` you need to provide an `LE_EMAIL` as well so Certificates can be generated.
|
||||
|
||||
| Variable | Description | Required |
|
||||
| ------------------- | ------------------------------------------------------------------------------ | -------- |
|
||||
| `APP_URL` | The URL the panel will be reachable with (including protocol) | yes |
|
||||
| `APP_TIMEZONE` | The timezone to use for the panel | yes |
|
||||
| `LE_EMAIL` | The email used for letsencrypt certificate generation | yes |
|
||||
| `DB_HOST` | The host of the mysql instance | yes |
|
||||
| `DB_PORT` | The port of the mysql instance | yes |
|
||||
| `DB_DATABASE` | The name of the mysql database | yes |
|
||||
| `DB_USERNAME` | The mysql user | yes |
|
||||
| `DB_PASSWORD` | The mysql password for the specified user | yes |
|
||||
| `CACHE_DRIVER` | The cache driver (see [Cache drivers](#cache-drivers) for detais) | yes |
|
||||
| `SESSION_DRIVER` | | yes |
|
||||
| `QUEUE_DRIVER` | | yes |
|
||||
| `REDIS_HOST` | The hostname or IP address of the redis database | yes |
|
||||
| `REDIS_PASSWORD` | The password used to secure the redis database | maybe |
|
||||
| `REDIS_PORT` | The port the redis database is using on the host | maybe |
|
||||
| `MAIL_DRIVER` | The email driver (see [Mail drivers](#mail-drivers) for details) | yes |
|
||||
| `MAIL_FROM` | The email that should be used as the sender email | yes |
|
||||
| `MAIL_HOST` | The host of your mail driver instance | maybe |
|
||||
| `MAIL_PORT` | The port of your mail driver instance | maybe |
|
||||
| `MAIL_USERNAME` | The username for your mail driver | maybe |
|
||||
| `MAIL_PASSWORD` | The password for your mail driver | maybe |
|
||||
| Variable | Description | Required |
|
||||
|-------------------| ------------------------------------------------------------------------------ | -------- |
|
||||
| `APP_URL` | The URL the panel will be reachable with (including protocol) | yes |
|
||||
| `APP_TIMEZONE` | The timezone to use for the panel | yes |
|
||||
| `LE_EMAIL` | The email used for letsencrypt certificate generation | yes |
|
||||
| `DB_HOST` | The host of the mysql instance | yes |
|
||||
| `DB_PORT` | The port of the mysql instance | yes |
|
||||
| `DB_DATABASE` | The name of the mysql database | yes |
|
||||
| `DB_USERNAME` | The mysql user | yes |
|
||||
| `DB_PASSWORD` | The mysql password for the specified user | yes |
|
||||
| `CACHE_STORE` | The cache driver (see [Cache drivers](#cache-drivers) for detais) | yes |
|
||||
| `SESSION_DRIVER` | | yes |
|
||||
| `QUEUE_DRIVER` | | yes |
|
||||
| `REDIS_HOST` | The hostname or IP address of the redis database | yes |
|
||||
| `REDIS_PASSWORD` | The password used to secure the redis database | maybe |
|
||||
| `REDIS_PORT` | The port the redis database is using on the host | maybe |
|
||||
| `MAIL_DRIVER` | The email driver (see [Mail drivers](#mail-drivers) for details) | yes |
|
||||
| `MAIL_FROM` | The email that should be used as the sender email | yes |
|
||||
| `MAIL_HOST` | The host of your mail driver instance | maybe |
|
||||
| `MAIL_PORT` | The port of your mail driver instance | maybe |
|
||||
| `MAIL_USERNAME` | The username for your mail driver | maybe |
|
||||
| `MAIL_PASSWORD` | The password for your mail driver | maybe |
|
||||
|
||||
|
||||
### Cache drivers
|
||||
|
||||
6
.github/docker/default.conf
vendored
6
.github/docker/default.conf
vendored
@@ -7,7 +7,7 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
|
||||
root /app/public;
|
||||
index index.html index.htm index.php;
|
||||
charset utf-8;
|
||||
@@ -20,12 +20,12 @@ server {
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
access_log off;
|
||||
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||||
error_log /var/log/nginx/panel.app-error.log error;
|
||||
|
||||
# allow larger file uploads and longer script runtimes
|
||||
client_max_body_size 100m;
|
||||
client_body_timeout 120s;
|
||||
|
||||
|
||||
sendfile off;
|
||||
|
||||
location ~ \.php$ {
|
||||
|
||||
12
.github/docker/default_ssl.conf
vendored
12
.github/docker/default_ssl.conf
vendored
@@ -1,4 +1,4 @@
|
||||
# If using Ubuntu this file should be placed in:
|
||||
# If using Ubuntu this file should be placed in:
|
||||
# /etc/nginx/sites-available/
|
||||
#
|
||||
server {
|
||||
@@ -14,13 +14,13 @@ server {
|
||||
root /app/public;
|
||||
index index.php;
|
||||
|
||||
access_log /var/log/nginx/pterodactyl.app-access.log;
|
||||
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||||
access_log /var/log/nginx/panel.app-access.log;
|
||||
error_log /var/log/nginx/panel.app-error.log error;
|
||||
|
||||
# allow larger file uploads and longer script runtimes
|
||||
client_max_body_size 100m;
|
||||
client_body_timeout 120s;
|
||||
|
||||
|
||||
sendfile off;
|
||||
|
||||
# strengthen ssl security
|
||||
@@ -30,7 +30,7 @@ server {
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
|
||||
|
||||
|
||||
# See the link below for more SSL information:
|
||||
# https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
|
||||
#
|
||||
@@ -67,4 +67,4 @@ server {
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
.github/workflows/build.yaml
vendored
15
.github/workflows/build.yaml
vendored
@@ -1,29 +1,24 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
pull_request:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
ui:
|
||||
name: UI
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [16]
|
||||
node-version: [18]
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "yarn"
|
||||
|
||||
25
.github/workflows/ci.yaml
vendored
25
.github/workflows/ci.yaml
vendored
@@ -1,23 +1,18 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
pull_request:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: [8.1, 8.2]
|
||||
php: [8.2, 8.3]
|
||||
database: ["mariadb:10.2", "mysql:8"]
|
||||
services:
|
||||
database:
|
||||
@@ -30,7 +25,7 @@ jobs:
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get cache directory
|
||||
id: composer-cache
|
||||
@@ -38,7 +33,7 @@ jobs:
|
||||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
|
||||
@@ -54,16 +49,20 @@ jobs:
|
||||
coverage: none
|
||||
|
||||
- name: Setup .env
|
||||
run: cp .env.ci .env
|
||||
run: cp .env.example .env
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
|
||||
run: composer install --no-interaction --no-suggest --prefer-dist
|
||||
|
||||
- name: Generate App Key
|
||||
run: php artisan key:generate
|
||||
|
||||
- name: Unit tests
|
||||
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
|
||||
run: vendor/bin/phpunit tests/Unit
|
||||
if: ${{ always() }}
|
||||
env:
|
||||
DB_HOST: UNIT_NO_DB
|
||||
SKIP_MIGRATIONS: true
|
||||
|
||||
- name: Integration tests
|
||||
run: vendor/bin/phpunit tests/Integration
|
||||
|
||||
30
.github/workflows/cla.yaml
vendored
Normal file
30
.github/workflows/cla.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: "CLA Assistant"
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_target:
|
||||
types: [opened,closed,synchronize]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
|
||||
jobs:
|
||||
CLAAssistant:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "CLA Assistant"
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
with:
|
||||
path-to-signatures: 'version1/cla.json'
|
||||
path-to-document: 'https://github.com/pelican-dev/panel/blob/3.x/contributor_license_agreement.md'
|
||||
branch: 'main'
|
||||
allowlist: dependabot[bot]
|
||||
remote-organization-name: pelican-dev
|
||||
remote-repository-name: cla-signatures
|
||||
68
.github/workflows/docker.yaml
vendored
68
.github/workflows/docker.yaml
vendored
@@ -1,68 +0,0 @@
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- 1.0-develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- 1.0-develop
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
push:
|
||||
name: Push
|
||||
runs-on: ubuntu-20.04
|
||||
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
|
||||
steps:
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Docker metadata
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ghcr.io/pterodactyl/panel
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false }}
|
||||
type=ref,event=tag
|
||||
type=ref,event=branch
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
if: "github.event_name != 'pull_request'"
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Update version
|
||||
if: "github.event_name == 'release' && github.event.action == 'published'"
|
||||
env:
|
||||
REF: ${{ github.event.release.tag_name }}
|
||||
run: |
|
||||
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:1}',/" config/app.php
|
||||
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
21
.github/workflows/lint.yaml
vendored
21
.github/workflows/lint.yaml
vendored
@@ -1,36 +1,31 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
pull_request:
|
||||
branches:
|
||||
- "develop"
|
||||
- "1.0-develop"
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: "8.1"
|
||||
php-version: "8.2"
|
||||
extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
|
||||
tools: composer:v2
|
||||
coverage: none
|
||||
|
||||
- name: Setup .env
|
||||
run: cp .env.ci .env
|
||||
run: cp .env.example .env
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
|
||||
run: composer install --no-interaction --no-progress --prefer-dist
|
||||
|
||||
- name: PHP CS Fixer
|
||||
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
||||
- name: Pint
|
||||
run: vendor/bin/pint --test
|
||||
|
||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -30,8 +30,8 @@ jobs:
|
||||
REF: ${{ github.ref }}
|
||||
run: |
|
||||
BRANCH=release/${REF:10}
|
||||
git config --local user.email "ci@pterodactyl.io"
|
||||
git config --local user.name "Pterodactyl CI"
|
||||
git config --local user.email "ci@pelican.dev"
|
||||
git config --local user.name "Pelican CI"
|
||||
git checkout -b $BRANCH
|
||||
git push -u origin $BRANCH
|
||||
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
|
||||
- name: Create release archive
|
||||
run: |
|
||||
rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix
|
||||
rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix
|
||||
tar -czf panel.tar.gz * .editorconfig .env.example .eslintignore .eslintrc.js .gitignore .prettierrc.json
|
||||
|
||||
- name: Extract changelog
|
||||
|
||||
63
BUILDING.md
63
BUILDING.md
@@ -1,63 +0,0 @@
|
||||
# Local Development
|
||||
Pterodactyl is now powered by React, Typescript, and Tailwindcss using webpack at its core to generate compiled assets.
|
||||
Release versions of Pterodactyl will include pre-compiled, minified, and hashed assets ready-to-go.
|
||||
|
||||
However, if you are interested in running custom themes or making modifications to the React files you'll need a build
|
||||
system in place to generate these compiled assets. To get your environment setup you'll need at minimum:
|
||||
|
||||
* [Node.js](https://nodejs.org/en/) v14.x.x
|
||||
* [Yarn](https://classic.yarnpkg.com/lang/en/) v1.x.x
|
||||
* [Go](https://golang.org/) 1.17.x
|
||||
|
||||
### Install Dependencies
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
The command above will download all of the dependencies necessary to get Pterodactyl assets building. After that, its as
|
||||
simple as running the command below to generate assets while you're developing. Until you've run this command at least
|
||||
once you'll likely see a 500 error on your Panel about a missing `manifest.json` file. This is generated by the commands
|
||||
below.
|
||||
|
||||
```bash
|
||||
# Build the compiled set of assets for development.
|
||||
yarn run build
|
||||
|
||||
# Build the assets automatically as they are changed. This allows you to refresh
|
||||
# the page and see the changes immediately.
|
||||
yarn run watch
|
||||
```
|
||||
|
||||
### Hot Module Reloading
|
||||
For more advanced users, we also support 'Hot Module Reloading', allowing you to quickly see changes you're making
|
||||
to the Vue template files without having to reload the page you're on. To Get started with this, you just need
|
||||
to run the command below.
|
||||
|
||||
```bash
|
||||
PUBLIC_PATH=http://192.168.1.1:8080 yarn run serve --host 192.168.1.1
|
||||
```
|
||||
|
||||
There are two _very important_ parts of this command to take note of and change for your specific environment. The first
|
||||
is the `--host` flag, which is required and should point to the machine where the `webpack-serve` server will be running.
|
||||
The second is the `PUBLIC_PATH` environment variable which is the URL pointing to the HMR server and is appended to all of
|
||||
the asset URLs used in Pterodactyl.
|
||||
|
||||
#### Development Environment
|
||||
If you're using the [`pterodactyl/development`](https://github.com/pterodactyl/development) environments, which are
|
||||
highly recommended, you can just run `yarn run serve` to run the HMR server, no additional configuration is necessary.
|
||||
|
||||
### Building for Production
|
||||
Once you have your files squared away and ready for the live server, you'll be needing to generate compiled, minified,
|
||||
and hashed assets to push live. To do so, run the command below:
|
||||
|
||||
```bash
|
||||
yarn run build:production
|
||||
```
|
||||
|
||||
This will generate a production JS bundle and associated assets, all located in `public/assets/` which will need to
|
||||
be uploaded to your server or CDN for clients to use.
|
||||
|
||||
### Running Wings
|
||||
To run `wings` in development all you need to do is set up the configuration file as normal when adding a new node, and
|
||||
then you can build and run a local version of Wings by executing `make debug` in the Wings code directory. This must
|
||||
be run on a Linux VM of some sort, you cannot run this locally on macOS or Windows.
|
||||
1769
CHANGELOG.md
1769
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at support@pterodactyl.io. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -1,31 +0,0 @@
|
||||
# Contributing
|
||||
|
||||
Pterodactyl does not accept Pull Requests (PRs) _for new functionality_ from users that are not currently part of the
|
||||
core project team. It has become overwhelming to try and give the proper time and attention that such complicated PRs
|
||||
tend to require — and deserve. As a result, it is in the project's best interest to limit the scope of work on
|
||||
new functionality to work done within the core project team.
|
||||
|
||||
PRs that address existing _bugs_ with a corresponding issue opened in our issue tracker will continue to be accepted
|
||||
and reviewed. Their scope is often significantly more targeted, and simply improving upon existing and well defined
|
||||
logic.
|
||||
|
||||
### Responsible Disclosure
|
||||
|
||||
This is a fairly in-depth project and makes use of a lot of parts. We strive to keep everything as secure as possible
|
||||
and welcome you to take a look at the code provided in this project yourself. We do ask that you be considerate of
|
||||
others who are using the software and not publicly disclose security issues without contacting us first by email.
|
||||
|
||||
We'll make a deal with you: if you contact us by email, and we fail to respond to you within a week you are welcome to
|
||||
publicly disclose whatever issue you have found. We understand how frustrating it is when you find something big and
|
||||
no one will respond to you. This holds us to a standard of providing prompt attention to any issues that arise and
|
||||
keeping this community safe.
|
||||
|
||||
If you've found what you believe is a security issue please email `matthew@pterodactyl.io`. Please check
|
||||
[SECURITY.md](/SECURITY.md) for additional details.
|
||||
|
||||
### Contact Us
|
||||
|
||||
You can find us in a couple places online. First and foremost, we're active right here on GitHub. If you encounter a
|
||||
bug or other problems, open an issue on here for us to take a look at it. We also accept feature requests here as well.
|
||||
|
||||
You can also find us on [Discord](https://discord.gg/pterodactyl).
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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.
|
||||
# level distribution
|
||||
FROM --platform=$TARGETOS/$TARGETARCH mhart/alpine-node:14
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
|
||||
24
LICENSE.md
24
LICENSE.md
@@ -1,24 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
```
|
||||
Pterodactyl®
|
||||
Copyright © Dane Everitt <dane@daneeveritt.com> and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
70
README.md
70
README.md
@@ -1,70 +0,0 @@
|
||||
[](https://pterodactyl.io)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# Pterodactyl Panel
|
||||
|
||||
Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security
|
||||
in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive
|
||||
UI to end users.
|
||||
|
||||
Stop settling for less. Make game servers a first class citizen on your platform.
|
||||
|
||||

|
||||
|
||||
## Documentation
|
||||
|
||||
* [Panel Documentation](https://pterodactyl.io/panel/1.0/getting_started.html)
|
||||
* [Wings Documentation](https://pterodactyl.io/wings/1.0/installing.html)
|
||||
* [Community Guides](https://pterodactyl.io/community/about.html)
|
||||
* Or, get additional help [via Discord](https://discord.gg/pterodactyl)
|
||||
|
||||
## Sponsors
|
||||
|
||||
I would like to extend my sincere thanks to the following sponsors for helping fund Pterodactyl's development.
|
||||
[Interested in becoming a sponsor?](https://github.com/sponsors/matthewpi)
|
||||
|
||||
| Company | About |
|
||||
|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [**Aussie Server Hosts**](https://aussieserverhosts.com/) | No frills Australian Owned and operated High Performance Server hosting for some of the most demanding games serving Australia and New Zealand. |
|
||||
| [**BisectHosting**](https://www.bisecthosting.com/) | BisectHosting provides Minecraft, Valheim and other server hosting services with the highest reliability and lightning fast support since 2012. |
|
||||
| [**MineStrator**](https://minestrator.com/) | Looking for the most highend French hosting company for your minecraft server? More than 24,000 members on our discord trust us. Give us a try! |
|
||||
| [**VibeGAMES**](https://vibegames.net/) | VibeGAMES is a game server provider that specializes in DDOS protection for the games we offer. We have multiple locations in the US, Brazil, France, Germany, Singapore, Australia and South Africa. |
|
||||
|
||||
### Supported Games
|
||||
|
||||
Pterodactyl supports a wide variety of games by utilizing Docker containers to isolate each instance. This gives
|
||||
you the power to run game servers without bloating machines with a host of additional dependencies.
|
||||
|
||||
Some of our core supported games include:
|
||||
|
||||
* Minecraft — including Paper, Sponge, Bungeecord, Waterfall, and more
|
||||
* Rust
|
||||
* Terraria
|
||||
* Teamspeak
|
||||
* Mumble
|
||||
* Team Fortress 2
|
||||
* Counter Strike: Global Offensive
|
||||
* Garry's Mod
|
||||
* ARK: Survival Evolved
|
||||
|
||||
In addition to our standard nest of supported games, our community is constantly pushing the limits of this software
|
||||
and there are plenty more games available provided by the community. Some of these games include:
|
||||
|
||||
* Factorio
|
||||
* San Andreas: MP
|
||||
* Pocketmine MP
|
||||
* Squad
|
||||
* Xonotic
|
||||
* Starmade
|
||||
* Discord ATLBot, and most other Node.js/Python discord bots
|
||||
* [and many more...](https://github.com/parkervcp/eggs)
|
||||
|
||||
## License
|
||||
|
||||
Pterodactyl® Copyright © 2015 - 2022 Dane Everitt and contributors.
|
||||
|
||||
Code released under the [MIT License](./LICENSE.md).
|
||||
20
SECURITY.md
20
SECURITY.md
@@ -1,20 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
The following versions of Pterodactyl are receiving active support and maintenance. Any security vulnerabilities discovered must be reproducible in supported versions.
|
||||
|
||||
| Panel | Daemon | Supported |
|
||||
|--------|--------------|--------------------|
|
||||
| 1.10.x | wings@1.7.x | :white_check_mark: |
|
||||
| 1.11.x | wings@1.11.x | :white_check_mark: |
|
||||
| 0.7.x | daemon@0.6.x | :x: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please reach out directly to any project team member on Discord when reporting a security vulnerability, or you can email `matthew@pterodactyl.io`.
|
||||
|
||||
We make every effort to respond as soon as possible, although it may take a day or two for us to sync internally and determine the severity of the report and its impact. Please, _do not_ use a public facing channel or GitHub issues to report sensitive security issues.
|
||||
|
||||
As part of our process, we will create a security advisory for the affected versions and disclose it publicly, usually two to four weeks after a releasing a version that addresses it.
|
||||
@@ -1,33 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Environment;
|
||||
namespace App\Console\Commands\Environment;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Pterodactyl\Traits\Commands\EnvironmentWriterTrait;
|
||||
use App\Traits\Commands\EnvironmentWriterTrait;
|
||||
|
||||
class AppSettingsCommand extends Command
|
||||
{
|
||||
use EnvironmentWriterTrait;
|
||||
|
||||
public const CACHE_DRIVERS = [
|
||||
'redis' => 'Redis (recommended)',
|
||||
'redis' => 'Redis',
|
||||
'memcached' => 'Memcached',
|
||||
'file' => 'Filesystem',
|
||||
'file' => 'Filesystem (recommended)',
|
||||
];
|
||||
|
||||
public const SESSION_DRIVERS = [
|
||||
'redis' => 'Redis (recommended)',
|
||||
'redis' => 'Redis',
|
||||
'memcached' => 'Memcached',
|
||||
'database' => 'MySQL Database',
|
||||
'file' => 'Filesystem',
|
||||
'file' => 'Filesystem (recommended)',
|
||||
'cookie' => 'Cookie',
|
||||
];
|
||||
|
||||
public const QUEUE_DRIVERS = [
|
||||
'redis' => 'Redis (recommended)',
|
||||
'redis' => 'Redis',
|
||||
'database' => 'MySQL Database',
|
||||
'sync' => 'Sync',
|
||||
'sync' => 'Sync (recommended)',
|
||||
];
|
||||
|
||||
protected $description = 'Configure basic environment settings for the Panel.';
|
||||
@@ -43,8 +43,7 @@ class AppSettingsCommand extends Command
|
||||
{--redis-host= : Redis host to use for connections.}
|
||||
{--redis-pass= : Password used to connect to redis.}
|
||||
{--redis-port= : Port to connect to redis over.}
|
||||
{--settings-ui= : Enable or disable the settings UI.}
|
||||
{--telemetry= : Enable or disable anonymous telemetry.}';
|
||||
{--settings-ui= : Enable or disable the settings UI.}';
|
||||
|
||||
protected array $variables = [];
|
||||
|
||||
@@ -59,7 +58,7 @@ class AppSettingsCommand extends Command
|
||||
/**
|
||||
* Handle command execution.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\PterodactylException
|
||||
* @throws \App\Exceptions\PanelException
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@@ -70,7 +69,7 @@ class AppSettingsCommand extends Command
|
||||
$this->output->comment('Provide the email address that eggs exported by this Panel should be from. This should be a valid email address.');
|
||||
$this->variables['APP_SERVICE_AUTHOR'] = $this->option('author') ?? $this->ask(
|
||||
'Egg Author Email',
|
||||
config('pterodactyl.service.author', 'unknown@unknown.com')
|
||||
config('panel.service.author', 'unknown@unknown.com')
|
||||
);
|
||||
|
||||
if (!filter_var($this->variables['APP_SERVICE_AUTHOR'], FILTER_VALIDATE_EMAIL)) {
|
||||
@@ -92,21 +91,21 @@ class AppSettingsCommand extends Command
|
||||
config('app.timezone')
|
||||
);
|
||||
|
||||
$selected = config('cache.default', 'redis');
|
||||
$this->variables['CACHE_DRIVER'] = $this->option('cache') ?? $this->choice(
|
||||
$selected = config('cache.default', 'file');
|
||||
$this->variables['CACHE_STORE'] = $this->option('cache') ?? $this->choice(
|
||||
'Cache Driver',
|
||||
self::CACHE_DRIVERS,
|
||||
array_key_exists($selected, self::CACHE_DRIVERS) ? $selected : null
|
||||
);
|
||||
|
||||
$selected = config('session.driver', 'redis');
|
||||
$selected = config('session.driver', 'file');
|
||||
$this->variables['SESSION_DRIVER'] = $this->option('session') ?? $this->choice(
|
||||
'Session Driver',
|
||||
self::SESSION_DRIVERS,
|
||||
array_key_exists($selected, self::SESSION_DRIVERS) ? $selected : null
|
||||
);
|
||||
|
||||
$selected = config('queue.default', 'redis');
|
||||
$selected = config('queue.default', 'sync');
|
||||
$this->variables['QUEUE_CONNECTION'] = $this->option('queue') ?? $this->choice(
|
||||
'Queue Driver',
|
||||
self::QUEUE_DRIVERS,
|
||||
@@ -119,12 +118,6 @@ class AppSettingsCommand extends Command
|
||||
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm('Enable UI based settings editor?', true) ? 'false' : 'true';
|
||||
}
|
||||
|
||||
$this->output->comment('Please reference https://pterodactyl.io/panel/1.0/additional_configuration.html#telemetry for more detailed information regarding telemetry data and collection.');
|
||||
$this->variables['PTERODACTYL_TELEMETRY_ENABLED'] = $this->option('telemetry') ?? $this->confirm(
|
||||
'Enable sending anonymous telemetry data?',
|
||||
config('pterodactyl.telemetry.enabled', true)
|
||||
) ? 'true' : 'false';
|
||||
|
||||
// Make sure session cookies are set as "secure" when using HTTPS
|
||||
if (str_starts_with($this->variables['APP_URL'], 'https://')) {
|
||||
$this->variables['SESSION_SECURE_COOKIE'] = 'true';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Environment;
|
||||
namespace App\Console\Commands\Environment;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Illuminate\Database\DatabaseManager;
|
||||
use Pterodactyl\Traits\Commands\EnvironmentWriterTrait;
|
||||
use App\Traits\Commands\EnvironmentWriterTrait;
|
||||
|
||||
class DatabaseSettingsCommand extends Command
|
||||
{
|
||||
@@ -32,8 +32,6 @@ class DatabaseSettingsCommand extends Command
|
||||
|
||||
/**
|
||||
* Handle command execution.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\PterodactylException
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@@ -56,7 +54,7 @@ class DatabaseSettingsCommand extends Command
|
||||
$this->output->note('Using the "root" account for MySQL connections is not only highly frowned upon, it is also not allowed by this application. You\'ll need to have created a MySQL user for this software.');
|
||||
$this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask(
|
||||
'Database Username',
|
||||
config('database.connections.mysql.username', 'pterodactyl')
|
||||
config('database.connections.mysql.username', 'panel')
|
||||
);
|
||||
|
||||
$askForMySQLPassword = true;
|
||||
@@ -76,7 +74,7 @@ class DatabaseSettingsCommand extends Command
|
||||
$this->output->error('Your connection credentials have NOT been saved. You will need to provide valid connection information before proceeding.');
|
||||
|
||||
if ($this->confirm('Go back and try again?')) {
|
||||
$this->database->disconnect('_pterodactyl_command_test');
|
||||
$this->database->disconnect('_panel_command_test');
|
||||
|
||||
return $this->handle();
|
||||
}
|
||||
@@ -96,7 +94,7 @@ class DatabaseSettingsCommand extends Command
|
||||
*/
|
||||
private function testMySQLConnection()
|
||||
{
|
||||
config()->set('database.connections._pterodactyl_command_test', [
|
||||
config()->set('database.connections._panel_command_test', [
|
||||
'driver' => 'mysql',
|
||||
'host' => $this->variables['DB_HOST'],
|
||||
'port' => $this->variables['DB_PORT'],
|
||||
@@ -108,6 +106,6 @@ class DatabaseSettingsCommand extends Command
|
||||
'strict' => true,
|
||||
]);
|
||||
|
||||
$this->database->connection('_pterodactyl_command_test')->getPdo();
|
||||
$this->database->connection('_panel_command_test')->getPdo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Environment;
|
||||
namespace App\Console\Commands\Environment;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Traits\Commands\EnvironmentWriterTrait;
|
||||
use Illuminate\Contracts\Config\Repository as ConfigRepository;
|
||||
use App\Traits\Commands\EnvironmentWriterTrait;
|
||||
|
||||
class EmailSettingsCommand extends Command
|
||||
{
|
||||
@@ -25,20 +24,12 @@ class EmailSettingsCommand extends Command
|
||||
|
||||
protected array $variables = [];
|
||||
|
||||
/**
|
||||
* EmailSettingsCommand constructor.
|
||||
*/
|
||||
public function __construct(private ConfigRepository $config)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle command execution.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\PterodactylException
|
||||
* @throws \App\Exceptions\PanelException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice(
|
||||
trans('command/messages.environment.mail.ask_driver'),
|
||||
@@ -49,7 +40,7 @@ class EmailSettingsCommand extends Command
|
||||
'mandrill' => 'Mandrill Transactional Email',
|
||||
'postmark' => 'Postmark Transactional Email',
|
||||
],
|
||||
$this->config->get('mail.default', 'smtp')
|
||||
config('mail.default', 'smtp')
|
||||
);
|
||||
|
||||
$method = 'setup' . studly_case($this->variables['MAIL_DRIVER']) . 'DriverVariables';
|
||||
@@ -59,12 +50,12 @@ class EmailSettingsCommand extends Command
|
||||
|
||||
$this->variables['MAIL_FROM_ADDRESS'] = $this->option('email') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mail_from'),
|
||||
$this->config->get('mail.from.address')
|
||||
config('mail.from.address')
|
||||
);
|
||||
|
||||
$this->variables['MAIL_FROM_NAME'] = $this->option('from') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mail_name'),
|
||||
$this->config->get('mail.from.name')
|
||||
config('mail.from.name')
|
||||
);
|
||||
|
||||
$this->writeToEnvironment($this->variables);
|
||||
@@ -80,17 +71,17 @@ class EmailSettingsCommand extends Command
|
||||
{
|
||||
$this->variables['MAIL_HOST'] = $this->option('host') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_smtp_host'),
|
||||
$this->config->get('mail.mailers.smtp.host')
|
||||
config('mail.mailers.smtp.host')
|
||||
);
|
||||
|
||||
$this->variables['MAIL_PORT'] = $this->option('port') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_smtp_port'),
|
||||
$this->config->get('mail.mailers.smtp.port')
|
||||
config('mail.mailers.smtp.port')
|
||||
);
|
||||
|
||||
$this->variables['MAIL_USERNAME'] = $this->option('username') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_smtp_username'),
|
||||
$this->config->get('mail.mailers.smtp.username')
|
||||
config('mail.mailers.smtp.username')
|
||||
);
|
||||
|
||||
$this->variables['MAIL_PASSWORD'] = $this->option('password') ?? $this->secret(
|
||||
@@ -100,7 +91,7 @@ class EmailSettingsCommand extends Command
|
||||
$this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice(
|
||||
trans('command/messages.environment.mail.ask_encryption'),
|
||||
['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'],
|
||||
$this->config->get('mail.mailers.smtp.encryption', 'tls')
|
||||
config('mail.mailers.smtp.encryption', 'tls')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,17 +102,17 @@ class EmailSettingsCommand extends Command
|
||||
{
|
||||
$this->variables['MAILGUN_DOMAIN'] = $this->option('host') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mailgun_domain'),
|
||||
$this->config->get('services.mailgun.domain')
|
||||
config('services.mailgun.domain')
|
||||
);
|
||||
|
||||
$this->variables['MAILGUN_SECRET'] = $this->option('password') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mailgun_secret'),
|
||||
$this->config->get('services.mailgun.secret')
|
||||
config('services.mailgun.secret')
|
||||
);
|
||||
|
||||
$this->variables['MAILGUN_ENDPOINT'] = $this->option('endpoint') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mailgun_endpoint'),
|
||||
$this->config->get('services.mailgun.endpoint')
|
||||
config('services.mailgun.endpoint')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,7 +123,7 @@ class EmailSettingsCommand extends Command
|
||||
{
|
||||
$this->variables['MANDRILL_SECRET'] = $this->option('password') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_mandrill_secret'),
|
||||
$this->config->get('services.mandrill.secret')
|
||||
config('services.mandrill.secret')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,7 +137,7 @@ class EmailSettingsCommand extends Command
|
||||
$this->variables['MAIL_PORT'] = 587;
|
||||
$this->variables['MAIL_USERNAME'] = $this->variables['MAIL_PASSWORD'] = $this->option('username') ?? $this->ask(
|
||||
trans('command/messages.environment.mail.ask_postmark_username'),
|
||||
$this->config->get('mail.username')
|
||||
config('mail.username')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Services\Helpers\SoftwareVersionService;
|
||||
use Illuminate\Contracts\Config\Repository as ConfigRepository;
|
||||
use App\Services\Helpers\SoftwareVersionService;
|
||||
|
||||
class InfoCommand extends Command
|
||||
{
|
||||
@@ -15,7 +14,7 @@ class InfoCommand extends Command
|
||||
/**
|
||||
* VersionCommand constructor.
|
||||
*/
|
||||
public function __construct(private ConfigRepository $config, private SoftwareVersionService $versionService)
|
||||
public function __construct(private SoftwareVersionService $versionService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -23,51 +22,51 @@ class InfoCommand extends Command
|
||||
/**
|
||||
* Handle execution of command.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$this->output->title('Version Information');
|
||||
$this->table([], [
|
||||
['Panel Version', $this->config->get('app.version')],
|
||||
['Panel Version', config('app.version')],
|
||||
['Latest Version', $this->versionService->getPanel()],
|
||||
['Up-to-Date', $this->versionService->isLatestPanel() ? 'Yes' : $this->formatText('No', 'bg=red')],
|
||||
['Unique Identifier', $this->config->get('pterodactyl.service.author')],
|
||||
['Unique Identifier', config('panel.service.author')],
|
||||
], 'compact');
|
||||
|
||||
$this->output->title('Application Configuration');
|
||||
$this->table([], [
|
||||
['Environment', $this->formatText($this->config->get('app.env'), $this->config->get('app.env') === 'production' ?: 'bg=red')],
|
||||
['Debug Mode', $this->formatText($this->config->get('app.debug') ? 'Yes' : 'No', !$this->config->get('app.debug') ?: 'bg=red')],
|
||||
['Installation URL', $this->config->get('app.url')],
|
||||
['Environment', $this->formatText(config('app.env'), config('app.env') === 'production' ?: 'bg=red')],
|
||||
['Debug Mode', $this->formatText(config('app.debug') ? 'Yes' : 'No', !config('app.debug') ?: 'bg=red')],
|
||||
['Installation URL', config('app.url')],
|
||||
['Installation Directory', base_path()],
|
||||
['Timezone', $this->config->get('app.timezone')],
|
||||
['Cache Driver', $this->config->get('cache.default')],
|
||||
['Queue Driver', $this->config->get('queue.default')],
|
||||
['Session Driver', $this->config->get('session.driver')],
|
||||
['Filesystem Driver', $this->config->get('filesystems.default')],
|
||||
['Default Theme', $this->config->get('themes.active')],
|
||||
['Proxies', $this->config->get('trustedproxies.proxies')],
|
||||
['Timezone', config('app.timezone')],
|
||||
['Cache Driver', config('cache.default')],
|
||||
['Queue Driver', config('queue.default')],
|
||||
['Session Driver', config('session.driver')],
|
||||
['Filesystem Driver', config('filesystems.default')],
|
||||
['Default Theme', config('themes.active')],
|
||||
['Proxies', config('trustedproxies.proxies')],
|
||||
], 'compact');
|
||||
|
||||
$this->output->title('Database Configuration');
|
||||
$driver = $this->config->get('database.default');
|
||||
$driver = config('database.default');
|
||||
$this->table([], [
|
||||
['Driver', $driver],
|
||||
['Host', $this->config->get("database.connections.$driver.host")],
|
||||
['Port', $this->config->get("database.connections.$driver.port")],
|
||||
['Database', $this->config->get("database.connections.$driver.database")],
|
||||
['Username', $this->config->get("database.connections.$driver.username")],
|
||||
['Host', config("database.connections.$driver.host")],
|
||||
['Port', config("database.connections.$driver.port")],
|
||||
['Database', config("database.connections.$driver.database")],
|
||||
['Username', config("database.connections.$driver.username")],
|
||||
], 'compact');
|
||||
|
||||
// TODO: Update this to handle other mail drivers
|
||||
$this->output->title('Email Configuration');
|
||||
$this->table([], [
|
||||
['Driver', $this->config->get('mail.default')],
|
||||
['Host', $this->config->get('mail.mailers.smtp.host')],
|
||||
['Port', $this->config->get('mail.mailers.smtp.port')],
|
||||
['Username', $this->config->get('mail.mailers.smtp.username')],
|
||||
['From Address', $this->config->get('mail.from.address')],
|
||||
['From Name', $this->config->get('mail.from.name')],
|
||||
['Encryption', $this->config->get('mail.mailers.smtp.encryption')],
|
||||
['Driver', config('mail.default')],
|
||||
['Host', config('mail.mailers.smtp.host')],
|
||||
['Port', config('mail.mailers.smtp.port')],
|
||||
['Username', config('mail.mailers.smtp.username')],
|
||||
['From Address', config('mail.from.address')],
|
||||
['From Name', config('mail.from.name')],
|
||||
['Encryption', config('mail.mailers.smtp.encryption')],
|
||||
], 'compact');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Location;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
use Pterodactyl\Services\Locations\LocationDeletionService;
|
||||
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
|
||||
|
||||
class DeleteLocationCommand extends Command
|
||||
{
|
||||
protected $description = 'Deletes a location from the Panel.';
|
||||
|
||||
protected $signature = 'p:location:delete {--short= : The short code of the location to delete.}';
|
||||
|
||||
protected Collection $locations;
|
||||
|
||||
/**
|
||||
* DeleteLocationCommand constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
private LocationDeletionService $deletionService,
|
||||
private LocationRepositoryInterface $repository
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Respond to the command request.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Pterodactyl\Exceptions\Service\Location\HasActiveNodesException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->locations = $this->locations ?? $this->repository->all();
|
||||
$short = $this->option('short') ?? $this->anticipate(
|
||||
trans('command/messages.location.ask_short'),
|
||||
$this->locations->pluck('short')->toArray()
|
||||
);
|
||||
|
||||
$location = $this->locations->where('short', $short)->first();
|
||||
if (is_null($location)) {
|
||||
$this->error(trans('command/messages.location.no_location_found'));
|
||||
if ($this->input->isInteractive()) {
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->deletionService->handle($location->id);
|
||||
$this->line(trans('command/messages.location.deleted'));
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Location;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Services\Locations\LocationCreationService;
|
||||
|
||||
class MakeLocationCommand extends Command
|
||||
{
|
||||
protected $signature = 'p:location:make
|
||||
{--short= : The shortcode name of this location (ex. us1).}
|
||||
{--long= : A longer description of this location.}';
|
||||
|
||||
protected $description = 'Creates a new location on the system via the CLI.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct(private LocationCreationService $creationService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the command execution process.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$short = $this->option('short') ?? $this->ask(trans('command/messages.location.ask_short'));
|
||||
$long = $this->option('long') ?? $this->ask(trans('command/messages.location.ask_long'));
|
||||
|
||||
$location = $this->creationService->handle(compact('short', 'long'));
|
||||
$this->line(trans('command/messages.location.created', [
|
||||
'name' => $location->short,
|
||||
'id' => $location->id,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Maintenance;
|
||||
namespace App\Console\Commands\Maintenance;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -30,7 +30,7 @@ class CleanServiceBackupFilesCommand extends Command
|
||||
/**
|
||||
* Handle command execution.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$files = $this->disk->files('services/.bak');
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Maintenance;
|
||||
namespace App\Console\Commands\Maintenance;
|
||||
|
||||
use App\Models\Backup;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Repositories\Eloquent\BackupRepository;
|
||||
|
||||
class PruneOrphanedBackupsCommand extends Command
|
||||
{
|
||||
@@ -12,22 +12,14 @@ class PruneOrphanedBackupsCommand extends Command
|
||||
|
||||
protected $description = 'Marks all backups older than "n" minutes that have not yet completed as being failed.';
|
||||
|
||||
/**
|
||||
* PruneOrphanedBackupsCommand constructor.
|
||||
*/
|
||||
public function __construct(private BackupRepository $backupRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$since = $this->option('prune-age') ?? config('backups.prune_age', 360);
|
||||
if (!$since || !is_digit($since)) {
|
||||
throw new \InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
|
||||
}
|
||||
|
||||
$query = $this->backupRepository->getBuilder()
|
||||
$query = Backup::query()
|
||||
->whereNull('completed_at')
|
||||
->where('created_at', '<=', CarbonImmutable::now()->subMinutes($since)->toDateTimeString());
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Node;
|
||||
namespace App\Console\Commands\Node;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Services\Nodes\NodeCreationService;
|
||||
use App\Services\Nodes\NodeCreationService;
|
||||
|
||||
class MakeNodeCommand extends Command
|
||||
{
|
||||
@@ -21,8 +21,8 @@ class MakeNodeCommand extends Command
|
||||
{--maxDisk= : Set the max disk amount.}
|
||||
{--overallocateDisk= : Enter the amount of disk to overallocate (% or -1 to overallocate the maximum).}
|
||||
{--uploadSize= : Enter the maximum upload filesize.}
|
||||
{--daemonListeningPort= : Enter the wings listening port.}
|
||||
{--daemonSFTPPort= : Enter the wings SFTP listening port.}
|
||||
{--daemonListeningPort= : Enter the daemon listening port.}
|
||||
{--daemonSFTPPort= : Enter the daemon SFTP listening port.}
|
||||
{--daemonBase= : Enter the base folder.}';
|
||||
|
||||
protected $description = 'Creates a new node on the system via the CLI.';
|
||||
@@ -38,13 +38,12 @@ class MakeNodeCommand extends Command
|
||||
/**
|
||||
* Handle the command execution process.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$data['name'] = $this->option('name') ?? $this->ask('Enter a short identifier used to distinguish this node from others');
|
||||
$data['description'] = $this->option('description') ?? $this->ask('Enter a description to identify the node');
|
||||
$data['location_id'] = $this->option('locationId') ?? $this->ask('Enter a valid location id');
|
||||
$data['scheme'] = $this->option('scheme') ?? $this->anticipate(
|
||||
'Please either enter https for SSL or http for a non-ssl connection',
|
||||
['https', 'http'],
|
||||
@@ -59,11 +58,11 @@ class MakeNodeCommand extends Command
|
||||
$data['disk'] = $this->option('maxDisk') ?? $this->ask('Enter the maximum amount of disk space');
|
||||
$data['disk_overallocate'] = $this->option('overallocateDisk') ?? $this->ask('Enter the amount of memory to over allocate by, -1 will disable checking and 0 will prevent creating new server');
|
||||
$data['upload_size'] = $this->option('uploadSize') ?? $this->ask('Enter the maximum filesize upload', '100');
|
||||
$data['daemonListen'] = $this->option('daemonListeningPort') ?? $this->ask('Enter the wings listening port', '8080');
|
||||
$data['daemonSFTP'] = $this->option('daemonSFTPPort') ?? $this->ask('Enter the wings SFTP listening port', '2022');
|
||||
$data['daemonBase'] = $this->option('daemonBase') ?? $this->ask('Enter the base folder', '/var/lib/pterodactyl/volumes');
|
||||
$data['daemonListen'] = $this->option('daemonListeningPort') ?? $this->ask('Enter the daemon listening port', '8080');
|
||||
$data['daemonSFTP'] = $this->option('daemonSFTPPort') ?? $this->ask('Enter the daemon SFTP listening port', '2022');
|
||||
$data['daemonBase'] = $this->option('daemonBase') ?? $this->ask('Enter the base folder', '/var/lib/panel/volumes');
|
||||
|
||||
$node = $this->creationService->handle($data);
|
||||
$this->line('Successfully created a new node on the location ' . $data['location_id'] . ' with the name ' . $data['name'] . ' and has an id of ' . $node->id . '.');
|
||||
$this->line('Successfully created a new node with the name ' . $data['name'] . ' and has an id of ' . $node->id . '.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Node;
|
||||
namespace App\Console\Commands\Node;
|
||||
|
||||
use Pterodactyl\Models\Node;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class NodeConfigurationCommand extends Command
|
||||
@@ -17,7 +17,7 @@ class NodeConfigurationCommand extends Command
|
||||
{
|
||||
$column = ctype_digit((string) $this->argument('node')) ? 'id' : 'uuid';
|
||||
|
||||
/** @var \Pterodactyl\Models\Node $node */
|
||||
/** @var \App\Models\Node $node */
|
||||
$node = Node::query()->where($column, $this->argument('node'))->firstOr(function () {
|
||||
$this->error('The selected node does not exist.');
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Node;
|
||||
namespace App\Console\Commands\Node;
|
||||
|
||||
use Pterodactyl\Models\Node;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class NodeListCommand extends Command
|
||||
@@ -11,12 +11,11 @@ class NodeListCommand extends Command
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$nodes = Node::query()->with('location')->get()->map(function (Node $node) {
|
||||
$nodes = Node::query()->get()->map(function (Node $node) {
|
||||
return [
|
||||
'id' => $node->id,
|
||||
'uuid' => $node->uuid,
|
||||
'name' => $node->name,
|
||||
'location' => $node->location->short,
|
||||
'host' => $node->getConnectionAddress(),
|
||||
];
|
||||
});
|
||||
@@ -24,7 +23,7 @@ class NodeListCommand extends Command
|
||||
if ($this->option('format') === 'json') {
|
||||
$this->output->write($nodes->toJson(JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
} else {
|
||||
$this->table(['ID', 'UUID', 'Name', 'Location', 'Host'], $nodes->toArray());
|
||||
$this->table(['ID', 'UUID', 'Name', 'Host'], $nodes->toArray());
|
||||
}
|
||||
|
||||
$this->output->newLine();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Overrides;
|
||||
namespace App\Console\Commands\Overrides;
|
||||
|
||||
use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;
|
||||
|
||||
@@ -10,7 +10,7 @@ class KeyGenerateCommand extends BaseKeyGenerateCommand
|
||||
* Override the default Laravel key generation command to throw a warning to the user
|
||||
* if it appears that they have already generated an application encryption key.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
if (!empty(config('app.key')) && $this->input->isInteractive()) {
|
||||
$this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Overrides;
|
||||
namespace App\Console\Commands\Overrides;
|
||||
|
||||
use Pterodactyl\Console\RequiresDatabaseMigrations;
|
||||
use App\Console\RequiresDatabaseMigrations;
|
||||
use Illuminate\Database\Console\Seeds\SeedCommand as BaseSeedCommand;
|
||||
|
||||
class SeedCommand extends BaseSeedCommand
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Overrides;
|
||||
namespace App\Console\Commands\Overrides;
|
||||
|
||||
use Pterodactyl\Console\RequiresDatabaseMigrations;
|
||||
use App\Console\RequiresDatabaseMigrations;
|
||||
use Illuminate\Foundation\Console\UpCommand as BaseUpCommand;
|
||||
|
||||
class UpCommand extends BaseUpCommand
|
||||
@@ -21,6 +21,6 @@ class UpCommand extends BaseUpCommand
|
||||
return 1;
|
||||
}
|
||||
|
||||
return parent::handle() ?? 0;
|
||||
return parent::handle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Schedule;
|
||||
namespace App\Console\Commands\Schedule;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Models\Schedule;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Models\Schedule;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Pterodactyl\Services\Schedules\ProcessScheduleService;
|
||||
use App\Services\Schedules\ProcessScheduleService;
|
||||
|
||||
class ProcessRunnableCommand extends Command
|
||||
{
|
||||
@@ -51,8 +49,6 @@ class ProcessRunnableCommand extends Command
|
||||
* Processes a given schedule and logs and errors encountered the console output. This should
|
||||
* never throw an exception out, otherwise you'll end up killing the entire run group causing
|
||||
* any other schedules to not process correctly.
|
||||
*
|
||||
* @see https://github.com/pterodactyl/panel/issues/2609
|
||||
*/
|
||||
protected function processSchedule(Schedule $schedule)
|
||||
{
|
||||
@@ -68,7 +64,7 @@ class ProcessRunnableCommand extends Command
|
||||
'hash' => $schedule->hashid,
|
||||
]));
|
||||
} catch (\Throwable|\Exception $exception) {
|
||||
Log::error($exception, ['schedule_id' => $schedule->id]);
|
||||
logger()->error($exception, ['schedule_id' => $schedule->id]);
|
||||
|
||||
$this->error("An error was encountered while processing Schedule #$schedule->id: " . $exception->getMessage());
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Server;
|
||||
namespace App\Console\Commands\Server;
|
||||
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Validation\Factory as ValidatorFactory;
|
||||
use Pterodactyl\Repositories\Wings\DaemonPowerRepository;
|
||||
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
||||
use App\Repositories\Daemon\DaemonPowerRepository;
|
||||
use App\Exceptions\Http\Connection\DaemonConnectionException;
|
||||
|
||||
class BulkPowerActionCommand extends Command
|
||||
{
|
||||
@@ -32,7 +32,7 @@ class BulkPowerActionCommand extends Command
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$action = $this->argument('action');
|
||||
$nodes = empty($this->option('nodes')) ? [] : explode(',', $this->option('nodes'));
|
||||
@@ -97,7 +97,7 @@ class BulkPowerActionCommand extends Command
|
||||
$instance->whereIn('id', $servers)->orWhereIn('node_id', $nodes);
|
||||
} elseif (empty($nodes) && !empty($servers)) {
|
||||
$instance->whereIn('id', $servers);
|
||||
} elseif (!empty($nodes) && empty($servers)) {
|
||||
} elseif (!empty($nodes)) {
|
||||
$instance->whereIn('node_id', $nodes);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
use Pterodactyl\Services\Telemetry\TelemetryCollectionService;
|
||||
|
||||
class TelemetryCommand extends Command
|
||||
{
|
||||
protected $description = 'Displays all the data that would be sent to the Pterodactyl Telemetry Service if telemetry collection is enabled.';
|
||||
|
||||
protected $signature = 'p:telemetry';
|
||||
|
||||
/**
|
||||
* TelemetryCommand constructor.
|
||||
*/
|
||||
public function __construct(private TelemetryCollectionService $telemetryCollectionService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle execution of command.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->output->info('Collecting telemetry data, this may take a while...');
|
||||
|
||||
VarDumper::dump($this->telemetryCollectionService->collect());
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands;
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Console\Kernel;
|
||||
use App\Console\Kernel;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\Console\Helper\ProgressBar;
|
||||
|
||||
class UpgradeCommand extends Command
|
||||
{
|
||||
protected const DEFAULT_URL = 'https://github.com/pterodactyl/panel/releases/%s/panel.tar.gz';
|
||||
protected const DEFAULT_URL = 'https://github.com/pelican-dev/panel/releases/%s/panel.tar.gz';
|
||||
|
||||
protected $signature = 'p:upgrade
|
||||
{--user= : The user that PHP runs under. All files will be owned by this user.}
|
||||
{--group= : The group that PHP runs under. All files will be owned by this group.}
|
||||
{--url= : The specific archive to download.}
|
||||
{--release= : A specific Pterodactyl version to download from GitHub. Leave blank to use latest.}
|
||||
{--release= : A specific version to download from GitHub. Leave blank to use latest.}
|
||||
{--skip-download : If set no archive will be downloaded.}';
|
||||
|
||||
protected $description = 'Downloads a new archive for Pterodactyl from GitHub and then executes the normal upgrade commands.';
|
||||
protected $description = 'Downloads a new archive from GitHub and then executes the normal upgrade commands.';
|
||||
|
||||
/**
|
||||
* Executes an upgrade command which will run through all of our standard
|
||||
* commands for Pterodactyl and enable users to basically just download
|
||||
* Panel commands and enable users to basically just download
|
||||
* the archive and execute this and be done.
|
||||
*
|
||||
* This places the application in maintenance mode as well while the commands
|
||||
@@ -30,7 +30,7 @@ class UpgradeCommand extends Command
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$skipDownload = $this->option('skip-download');
|
||||
if (!$skipDownload) {
|
||||
@@ -51,7 +51,7 @@ class UpgradeCommand extends Command
|
||||
}
|
||||
|
||||
if (is_null($this->option('user'))) {
|
||||
$userDetails = posix_getpwuid(fileowner('public'));
|
||||
$userDetails = function_exists('posix_getpwuid') ? posix_getpwuid(fileowner('public')) : [];
|
||||
$user = $userDetails['name'] ?? 'www-data';
|
||||
|
||||
if (!$this->confirm("Your webserver user has been detected as <fg=blue>[{$user}]:</> is this correct?", true)) {
|
||||
@@ -67,7 +67,7 @@ class UpgradeCommand extends Command
|
||||
}
|
||||
|
||||
if (is_null($this->option('group'))) {
|
||||
$groupDetails = posix_getgrgid(filegroup('public'));
|
||||
$groupDetails = function_exists('posix_getgrgid') ? posix_getgrgid(filegroup('public')) : [];
|
||||
$group = $groupDetails['name'] ?? 'www-data';
|
||||
|
||||
if (!$this->confirm("Your webserver group has been detected as <fg=blue>[{$group}]:</> is this correct?", true)) {
|
||||
@@ -133,7 +133,7 @@ class UpgradeCommand extends Command
|
||||
|
||||
/** @var \Illuminate\Foundation\Application $app */
|
||||
$app = require __DIR__ . '/../../../bootstrap/app.php';
|
||||
/** @var \Pterodactyl\Console\Kernel $kernel */
|
||||
/** @var \App\Console\Kernel $kernel */
|
||||
$kernel = $app->make(Kernel::class);
|
||||
$kernel->bootstrap();
|
||||
$this->setLaravel($app);
|
||||
@@ -173,7 +173,7 @@ class UpgradeCommand extends Command
|
||||
});
|
||||
|
||||
$this->newLine(2);
|
||||
$this->info('Panel has been successfully upgraded. Please ensure you also update any Wings instances: https://pterodactyl.io/wings/1.0/upgrading.html');
|
||||
$this->info('Panel has been successfully upgraded. Please ensure you also update any Daemon instances');
|
||||
}
|
||||
|
||||
protected function withProgress(ProgressBar $bar, \Closure $callback)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\User;
|
||||
namespace App\Console\Commands\User;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use App\Models\User;
|
||||
use Webmozart\Assert\Assert;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Services\Users\UserDeletionService;
|
||||
|
||||
class DeleteUserCommand extends Command
|
||||
{
|
||||
@@ -13,14 +12,6 @@ class DeleteUserCommand extends Command
|
||||
|
||||
protected $signature = 'p:user:delete {--user=}';
|
||||
|
||||
/**
|
||||
* DeleteUserCommand constructor.
|
||||
*/
|
||||
public function __construct(private UserDeletionService $deletionService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$search = $this->option('user') ?? $this->ask(trans('command/messages.user.search_users'));
|
||||
@@ -62,7 +53,9 @@ class DeleteUserCommand extends Command
|
||||
}
|
||||
|
||||
if ($this->confirm(trans('command/messages.user.confirm_delete')) || !$this->input->isInteractive()) {
|
||||
$this->deletionService->handle($deleteUser);
|
||||
$user = User::query()->findOrFail($deleteUser);
|
||||
$user->delete();
|
||||
|
||||
$this->info(trans('command/messages.user.deleted'));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\User;
|
||||
namespace App\Console\Commands\User;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
|
||||
|
||||
class DisableTwoFactorCommand extends Command
|
||||
{
|
||||
@@ -11,33 +11,24 @@ class DisableTwoFactorCommand extends Command
|
||||
|
||||
protected $signature = 'p:user:disable2fa {--email= : The email of the user to disable 2-Factor for.}';
|
||||
|
||||
/**
|
||||
* DisableTwoFactorCommand constructor.
|
||||
*/
|
||||
public function __construct(private UserRepositoryInterface $repository)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle command execution process.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
if ($this->input->isInteractive()) {
|
||||
$this->output->warning(trans('command/messages.user.2fa_help_text'));
|
||||
}
|
||||
|
||||
$email = $this->option('email') ?? $this->ask(trans('command/messages.user.ask_email'));
|
||||
$user = $this->repository->setColumns(['id', 'email'])->findFirstWhere([['email', '=', $email]]);
|
||||
|
||||
$this->repository->withoutFreshModel()->update($user->id, [
|
||||
'use_totp' => false,
|
||||
'totp_secret' => null,
|
||||
]);
|
||||
$user = User::query()->where('email', $email)->firstOrFail();
|
||||
$user->use_totp = false;
|
||||
$user->totp_secret = null;
|
||||
$user->save();
|
||||
|
||||
$this->info(trans('command/messages.user.2fa_disabled', ['email' => $user->email]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\User;
|
||||
namespace App\Console\Commands\User;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Services\Users\UserCreationService;
|
||||
use App\Services\Users\UserCreationService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MakeUserCommand extends Command
|
||||
{
|
||||
@@ -22,11 +24,19 @@ class MakeUserCommand extends Command
|
||||
/**
|
||||
* Handle command request to create a new user.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws Exception
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
try {
|
||||
DB::select('select 1 where 1');
|
||||
} catch (Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$root_admin = $this->option('admin') ?? $this->confirm(trans('command/messages.user.ask_admin'));
|
||||
$email = $this->option('email') ?? $this->ask(trans('command/messages.user.ask_email'));
|
||||
$username = $this->option('username') ?? $this->ask(trans('command/messages.user.ask_username'));
|
||||
@@ -47,5 +57,7 @@ class MakeUserCommand extends Command
|
||||
['Name', $user->name],
|
||||
['Admin', $user->root_admin ? 'Yes' : 'No'],
|
||||
]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console;
|
||||
namespace App\Console;
|
||||
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Pterodactyl\Models\ActivityLog;
|
||||
use App\Models\ActivityLog;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Database\Console\PruneCommand;
|
||||
use Pterodactyl\Repositories\Eloquent\SettingsRepository;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use Pterodactyl\Services\Telemetry\TelemetryCollectionService;
|
||||
use Pterodactyl\Console\Commands\Schedule\ProcessRunnableCommand;
|
||||
use Pterodactyl\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
|
||||
use Pterodactyl\Console\Commands\Maintenance\CleanServiceBackupFilesCommand;
|
||||
use App\Console\Commands\Schedule\ProcessRunnableCommand;
|
||||
use App\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
|
||||
use App\Console\Commands\Maintenance\CleanServiceBackupFilesCommand;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
@@ -43,34 +40,5 @@ class Kernel extends ConsoleKernel
|
||||
if (config('activity.prune_days')) {
|
||||
$schedule->command(PruneCommand::class, ['--model' => [ActivityLog::class]])->daily();
|
||||
}
|
||||
|
||||
if (config('pterodactyl.telemetry.enabled')) {
|
||||
$this->registerTelemetry($schedule);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* I wonder what this does.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
||||
*/
|
||||
private function registerTelemetry(Schedule $schedule): void
|
||||
{
|
||||
$settingsRepository = app()->make(SettingsRepository::class);
|
||||
|
||||
$uuid = $settingsRepository->get('app:telemetry:uuid');
|
||||
if (is_null($uuid)) {
|
||||
$uuid = Uuid::uuid4()->toString();
|
||||
$settingsRepository->set('app:telemetry:uuid', $uuid);
|
||||
}
|
||||
|
||||
// Calculate a fixed time to run the data push at, this will be the same time every day.
|
||||
$time = hexdec(str_replace('-', '', substr($uuid, 27))) % 1440;
|
||||
$hour = floor($time / 60);
|
||||
$minute = $time % 60;
|
||||
|
||||
// Run the telemetry collector.
|
||||
$schedule->call(app()->make(TelemetryCollectionService::class))->description('Collect Telemetry')->dailyAt("$hour:$minute");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Console;
|
||||
namespace App\Console;
|
||||
|
||||
/**
|
||||
* @mixin \Illuminate\Console\Command
|
||||
@@ -46,7 +46,7 @@ You must run the following command to finish migrating your database:
|
||||
|
||||
<fg=green;options=bold>php artisan migrate --step --force</>
|
||||
|
||||
You will not be able to use Pterodactyl Panel as expected without fixing your
|
||||
You will not be able to use the Panel as expected without fixing your
|
||||
database state by running the command above.
|
||||
');
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Core;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
|
||||
interface ReceivesEvents
|
||||
{
|
||||
/**
|
||||
* Handles receiving an event from the application.
|
||||
*/
|
||||
public function handle(Event $notification): void;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Criteria;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Pterodactyl\Repositories\Repository;
|
||||
|
||||
interface CriteriaInterface
|
||||
{
|
||||
/**
|
||||
* Apply selected criteria to a repository call.
|
||||
*/
|
||||
public function apply(Model $model, Repository $repository): mixed;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Extensions;
|
||||
namespace App\Contracts\Extensions;
|
||||
|
||||
use Hashids\HashidsInterface as VendorHashidsInterface;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Http;
|
||||
namespace App\Contracts\Http;
|
||||
|
||||
interface ClientPermissionsRequest
|
||||
{
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Allocation;
|
||||
|
||||
interface AllocationRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return all the allocations that exist for a node that are not currently
|
||||
* allocated.
|
||||
*/
|
||||
public function getUnassignedAllocationIds(int $node): array;
|
||||
|
||||
/**
|
||||
* Return a single allocation from those meeting the requirements.
|
||||
*/
|
||||
public function getRandomAllocation(array $nodes, array $ports, bool $dedicated = false): ?Allocation;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface ApiKeyRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Get all the account API keys that exist for a specific user.
|
||||
*/
|
||||
public function getAccountKeys(User $user): Collection;
|
||||
|
||||
/**
|
||||
* Get all the application API keys that exist for a specific user.
|
||||
*/
|
||||
public function getApplicationKeys(User $user): Collection;
|
||||
|
||||
/**
|
||||
* Delete an account API key from the panel for a specific user.
|
||||
*/
|
||||
public function deleteAccountKey(User $user, string $identifier): int;
|
||||
|
||||
/**
|
||||
* Delete an application API key from the panel for a specific user.
|
||||
*/
|
||||
public function deleteApplicationKey(User $user, string $identifier): int;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
interface ApiPermissionRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface DatabaseHostRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return database hosts with a count of databases and the node
|
||||
* information for which it is attached.
|
||||
*/
|
||||
public function getWithViewDetails(): Collection;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface DatabaseRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
public const DEFAULT_CONNECTION_NAME = 'dynamic';
|
||||
|
||||
/**
|
||||
* Set the connection name to execute statements against.
|
||||
*/
|
||||
public function setConnection(string $connection): self;
|
||||
|
||||
/**
|
||||
* Return the connection to execute statements against.
|
||||
*/
|
||||
public function getConnection(): string;
|
||||
|
||||
/**
|
||||
* Return all the databases belonging to a server.
|
||||
*/
|
||||
public function getDatabasesForServer(int $server): Collection;
|
||||
|
||||
/**
|
||||
* Return all the databases for a given host with the server relationship loaded.
|
||||
*/
|
||||
public function getDatabasesForHost(int $host, int $count = 25): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* Create a new database on a given connection.
|
||||
*/
|
||||
public function createDatabase(string $database): bool;
|
||||
|
||||
/**
|
||||
* Create a new database user on a given connection.
|
||||
*/
|
||||
public function createUser(string $username, string $remote, string $password, ?int $max_connections): bool;
|
||||
|
||||
/**
|
||||
* Give a specific user access to a given database.
|
||||
*/
|
||||
public function assignUserToDatabase(string $database, string $username, string $remote): bool;
|
||||
|
||||
/**
|
||||
* Flush the privileges for a given connection.
|
||||
*/
|
||||
public function flush(): bool;
|
||||
|
||||
/**
|
||||
* Drop a given database on a specific connection.
|
||||
*/
|
||||
public function dropDatabase(string $database): bool;
|
||||
|
||||
/**
|
||||
* Drop a given user on a specific connection.
|
||||
*/
|
||||
public function dropUser(string $username, string $remote): bool;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Egg;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
interface EggRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return an egg with the variables relation attached.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithVariables(int $id): Egg;
|
||||
|
||||
/**
|
||||
* Return all eggs and their relations to be used in the daemon API.
|
||||
*/
|
||||
public function getAllWithCopyAttributes(): Collection;
|
||||
|
||||
/**
|
||||
* Return an egg with the scriptFrom and configFrom relations loaded onto the model.
|
||||
*/
|
||||
public function getWithCopyAttributes(int|string $value, string $column = 'id'): Egg;
|
||||
|
||||
/**
|
||||
* Return all the data needed to export a service.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithExportAttributes(int $id): Egg;
|
||||
|
||||
/**
|
||||
* Confirm a copy script belongs to the same nest as the item trying to use it.
|
||||
*/
|
||||
public function isCopyableScript(int $copyFromId, int $service): bool;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface EggVariableRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return editable variables for a given egg. Editable variables must be set to
|
||||
* user viewable in order to be picked up by this function.
|
||||
*/
|
||||
public function getEditableVariables(int $egg): Collection;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Location;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface LocationRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return locations with a count of nodes and servers attached to it.
|
||||
*/
|
||||
public function getAllWithDetails(): Collection;
|
||||
|
||||
/**
|
||||
* Return all the available locations with the nodes as a relationship.
|
||||
*/
|
||||
public function getAllWithNodes(): Collection;
|
||||
|
||||
/**
|
||||
* Return all the nodes and their respective count of servers for a location.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithNodes(int $id): Location;
|
||||
|
||||
/**
|
||||
* Return a location and the count of nodes in that location.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithNodeCount(int $id): Location;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Nest;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
interface NestRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return a nest or all nests with their associated eggs and variables.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithEggs(int $id = null): Collection|Nest;
|
||||
|
||||
/**
|
||||
* Return a nest or all nests and the count of eggs and servers for that nest.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithCounts(int $id = null): Collection|Nest;
|
||||
|
||||
/**
|
||||
* Return a nest along with its associated eggs and the servers relation on those eggs.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithEggServers(int $id): Nest;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Node;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface NodeRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
public const THRESHOLD_PERCENTAGE_LOW = 75;
|
||||
public const THRESHOLD_PERCENTAGE_MEDIUM = 90;
|
||||
|
||||
/**
|
||||
* Return the usage stats for a single node.
|
||||
*/
|
||||
public function getUsageStats(Node $node): array;
|
||||
|
||||
/**
|
||||
* Return the usage stats for a single node.
|
||||
*/
|
||||
public function getUsageStatsRaw(Node $node): array;
|
||||
|
||||
/**
|
||||
* Return a single node with location and server information.
|
||||
*/
|
||||
public function loadLocationAndServerCount(Node $node, bool $refresh = false): Node;
|
||||
|
||||
/**
|
||||
* Attach a paginated set of allocations to a node mode including
|
||||
* any servers that are also attached to those allocations.
|
||||
*/
|
||||
public function loadNodeAllocations(Node $node, bool $refresh = false): Node;
|
||||
|
||||
/**
|
||||
* Return a collection of nodes for all locations to use in server creation UI.
|
||||
*/
|
||||
public function getNodesForServerCreation(): Collection;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
interface PermissionRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return an identifier or Model object to be used by the repository.
|
||||
*/
|
||||
public function model(): string;
|
||||
|
||||
/**
|
||||
* Return the model being used for this repository instance.
|
||||
*/
|
||||
public function getModel(): Model;
|
||||
|
||||
/**
|
||||
* Returns an instance of a query builder.
|
||||
*/
|
||||
public function getBuilder(): Builder;
|
||||
|
||||
/**
|
||||
* Returns the columns to be selected or returned by the query.
|
||||
*/
|
||||
public function getColumns(): array;
|
||||
|
||||
/**
|
||||
* An array of columns to filter the response by.
|
||||
*/
|
||||
public function setColumns(array|string $columns = ['*']): self;
|
||||
|
||||
/**
|
||||
* Stop repository update functions from returning a fresh
|
||||
* model when changes are committed.
|
||||
*/
|
||||
public function withoutFreshModel(): self;
|
||||
|
||||
/**
|
||||
* Return a fresh model with a repository updates a model.
|
||||
*/
|
||||
public function withFreshModel(): self;
|
||||
|
||||
/**
|
||||
* Set whether the repository should return a fresh model
|
||||
* when changes are committed.
|
||||
*/
|
||||
public function setFreshModel(bool $fresh = true): self;
|
||||
|
||||
/**
|
||||
* Create a new model instance and persist it to the database.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function create(array $fields, bool $validate = true, bool $force = false): mixed;
|
||||
|
||||
/**
|
||||
* Find a model that has the specific ID passed.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function find(int $id): mixed;
|
||||
|
||||
/**
|
||||
* Find a model matching an array of where clauses.
|
||||
*/
|
||||
public function findWhere(array $fields): Collection;
|
||||
|
||||
/**
|
||||
* Find and return the first matching instance for the given fields.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function findFirstWhere(array $fields): mixed;
|
||||
|
||||
/**
|
||||
* Return a count of records matching the passed arguments.
|
||||
*/
|
||||
public function findCountWhere(array $fields): int;
|
||||
|
||||
/**
|
||||
* Delete a given record from the database.
|
||||
*/
|
||||
public function delete(int $id): int;
|
||||
|
||||
/**
|
||||
* Delete records matching the given attributes.
|
||||
*/
|
||||
public function deleteWhere(array $attributes): int;
|
||||
|
||||
/**
|
||||
* Update a given ID with the passed array of fields.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(int $id, array $fields, bool $validate = true, bool $force = false): mixed;
|
||||
|
||||
/**
|
||||
* Perform a mass update where matching records are updated using whereIn.
|
||||
* This does not perform any model data validation.
|
||||
*/
|
||||
public function updateWhereIn(string $column, array $values, array $fields): int;
|
||||
|
||||
/**
|
||||
* Update a record if it exists in the database, otherwise create it.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function updateOrCreate(array $where, array $fields, bool $validate = true, bool $force = false): mixed;
|
||||
|
||||
/**
|
||||
* Return all records associated with the given model.
|
||||
*/
|
||||
public function all(): Collection;
|
||||
|
||||
/**
|
||||
* Return a paginated result set using a search term if set on the repository.
|
||||
*/
|
||||
public function paginated(int $perPage): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* Insert a single or multiple records into the database at once skipping
|
||||
* validation and mass assignment checking.
|
||||
*/
|
||||
public function insert(array $data): bool;
|
||||
|
||||
/**
|
||||
* Insert multiple records into the database and ignore duplicates.
|
||||
*/
|
||||
public function insertIgnore(array $values): bool;
|
||||
|
||||
/**
|
||||
* Get the amount of entries in the database.
|
||||
*/
|
||||
public function count(): int;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Schedule;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface ScheduleRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return all the schedules for a given server.
|
||||
*/
|
||||
public function findServerSchedules(int $server): Collection;
|
||||
|
||||
/**
|
||||
* Return a schedule model with all the associated tasks as a relationship.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getScheduleWithTasks(int $schedule): Schedule;
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Server;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface ServerRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Load the egg relations onto the server model.
|
||||
*/
|
||||
public function loadEggRelations(Server $server, bool $refresh = false): Server;
|
||||
|
||||
/**
|
||||
* Return a collection of servers with their associated data for rebuild operations.
|
||||
*/
|
||||
public function getDataForRebuild(int $server = null, int $node = null): Collection;
|
||||
|
||||
/**
|
||||
* Return a collection of servers with their associated data for reinstall operations.
|
||||
*/
|
||||
public function getDataForReinstall(int $server = null, int $node = null): Collection;
|
||||
|
||||
/**
|
||||
* Return a server model and all variables associated with the server.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function findWithVariables(int $id): Server;
|
||||
|
||||
/**
|
||||
* Get the primary allocation for a given server. If a model is passed into
|
||||
* the function, load the allocation relationship onto it. Otherwise, find and
|
||||
* return the server from the database.
|
||||
*/
|
||||
public function getPrimaryAllocation(Server $server, bool $refresh = false): Server;
|
||||
|
||||
/**
|
||||
* Return enough data to be used for the creation of a server via the daemon.
|
||||
*/
|
||||
public function getDataForCreation(Server $server, bool $refresh = false): Server;
|
||||
|
||||
/**
|
||||
* Load associated databases onto the server model.
|
||||
*/
|
||||
public function loadDatabaseRelations(Server $server, bool $refresh = false): Server;
|
||||
|
||||
/**
|
||||
* Get data for use when updating a server on the Daemon. Returns an array of
|
||||
* the egg which is used for build and rebuild. Only loads relations
|
||||
* if they are missing, or refresh is set to true.
|
||||
*/
|
||||
public function getDaemonServiceData(Server $server, bool $refresh = false): array;
|
||||
|
||||
/**
|
||||
* Return a server by UUID.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getByUuid(string $uuid): Server;
|
||||
|
||||
/**
|
||||
* Check if a given UUID and UUID-Short string are unique to a server.
|
||||
*/
|
||||
public function isUniqueUuidCombo(string $uuid, string $short): bool;
|
||||
|
||||
/**
|
||||
* Returns all the servers that exist for a given node in a paginated response.
|
||||
*/
|
||||
public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
interface ServerVariableRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface SessionRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return all the active sessions for a user.
|
||||
*/
|
||||
public function getUserSessions(int $user): Collection;
|
||||
|
||||
/**
|
||||
* Delete a session for a given user.
|
||||
*/
|
||||
public function deleteUserSession(int $user, string $session): ?int;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
interface SettingsRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Store a new persistent setting in the database.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function set(string $key, string $value = null);
|
||||
|
||||
/**
|
||||
* Retrieve a persistent setting from the database.
|
||||
*/
|
||||
public function get(string $key, mixed $default): mixed;
|
||||
|
||||
/**
|
||||
* Remove a key from the database cache.
|
||||
*/
|
||||
public function forget(string $key);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Subuser;
|
||||
|
||||
interface SubuserRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return a subuser with the associated server relationship.
|
||||
*/
|
||||
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser;
|
||||
|
||||
/**
|
||||
* Return a subuser with the associated permissions relationship.
|
||||
*/
|
||||
public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser;
|
||||
|
||||
/**
|
||||
* Return a subuser and associated permissions given a user_id and server_id.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithPermissionsUsingUserAndServer(int $user, int $server): Subuser;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\Task;
|
||||
|
||||
interface TaskRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Get a task and the server relationship for that task.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getTaskForJobProcess(int $id): Task;
|
||||
|
||||
/**
|
||||
* Returns the next task in a schedule.
|
||||
*/
|
||||
public function getNextTask(int $schedule, int $index): ?Task;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
interface UserRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events;
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Pterodactyl\Models\ActivityLog;
|
||||
use App\Models\ActivityLog;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ActivityLogged extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Auth;
|
||||
namespace App\Events\Auth;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
|
||||
class DirectLogin extends Event
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Auth;
|
||||
namespace App\Events\Auth;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class FailedCaptcha extends Event
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Auth;
|
||||
namespace App\Events\Auth;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class FailedPasswordReset extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Auth;
|
||||
namespace App\Events\Auth;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
|
||||
class ProvidedAuthenticationToken extends Event
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events;
|
||||
namespace App\Events;
|
||||
|
||||
abstract class Event
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Created extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Creating extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleted extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleting extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Installed extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Saved extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Saving extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Updated extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Server;
|
||||
namespace App\Events\Server;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Server;
|
||||
use App\Events\Event;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Updating extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Subuser;
|
||||
namespace App\Events\Subuser;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use App\Events\Event;
|
||||
use App\Models\Subuser;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Created extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Subuser;
|
||||
namespace App\Events\Subuser;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use App\Events\Event;
|
||||
use App\Models\Subuser;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Creating extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Subuser;
|
||||
namespace App\Events\Subuser;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use App\Events\Event;
|
||||
use App\Models\Subuser;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleted extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\Subuser;
|
||||
namespace App\Events\Subuser;
|
||||
|
||||
use Pterodactyl\Events\Event;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use App\Events\Event;
|
||||
use App\Models\Subuser;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleting extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\User;
|
||||
namespace App\Events\User;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Created extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\User;
|
||||
namespace App\Events\User;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Creating extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\User;
|
||||
namespace App\Events\User;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleted extends Event
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Events\User;
|
||||
namespace App\Events\User;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Events\Event;
|
||||
use App\Models\User;
|
||||
use App\Events\Event;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Deleting extends Event
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
class AccountNotFoundException extends \Exception
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
class AutoDeploymentException extends \Exception
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Http\RedirectResponse;
|
||||
use Prologue\Alerts\AlertsMessageBag;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
class DisplayException extends PterodactylException implements HttpExceptionInterface
|
||||
class DisplayException extends PanelException implements HttpExceptionInterface
|
||||
{
|
||||
public const LEVEL_DEBUG = 'debug';
|
||||
public const LEVEL_INFO = 'info';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -19,7 +18,6 @@ use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
@@ -30,7 +28,7 @@ class Handler extends ExceptionHandler
|
||||
* resulting in some weird rule names. This string will be parsed out and
|
||||
* replaced with 'p_' in the response code.
|
||||
*/
|
||||
private const PTERODACTYL_RULE_STRING = 'pterodactyl\_rules\_';
|
||||
private const PANEL_RULE_STRING = 'App\_rules\_';
|
||||
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
@@ -40,7 +38,6 @@ class Handler extends ExceptionHandler
|
||||
AuthorizationException::class,
|
||||
HttpException::class,
|
||||
ModelNotFoundException::class,
|
||||
RecordNotFoundException::class,
|
||||
TokenMismatchException::class,
|
||||
ValidationException::class,
|
||||
];
|
||||
@@ -132,8 +129,6 @@ class Handler extends ExceptionHandler
|
||||
// This is kind of a hack, and ideally things like this should be handled as
|
||||
// much as possible at the code level, but there are a lot of spots that do a
|
||||
// ton of actions and were written before this bug discovery was made.
|
||||
//
|
||||
// @see https://github.com/pterodactyl/panel/pull/1468
|
||||
if ($connections->transactionLevel()) {
|
||||
$connections->rollBack(0);
|
||||
}
|
||||
@@ -163,7 +158,7 @@ class Handler extends ExceptionHandler
|
||||
foreach ($errors as $key => $error) {
|
||||
$meta = [
|
||||
'source_field' => $field,
|
||||
'rule' => str_replace(self::PTERODACTYL_RULE_STRING, 'p_', Arr::get(
|
||||
'rule' => str_replace(self::PANEL_RULE_STRING, 'p_', Arr::get(
|
||||
$codes,
|
||||
str_replace('.', '_', $field) . '.' . $key
|
||||
)),
|
||||
@@ -235,7 +230,7 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public static function isReportable(\Exception $exception): bool
|
||||
{
|
||||
return (new static(Container::getInstance()))->shouldReport($exception);
|
||||
return (new self(Container::getInstance()))->shouldReport($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions\Http\Base;
|
||||
namespace App\Exceptions\Http\Base;
|
||||
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class InvalidPasswordProvidedException extends DisplayException
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions\Http\Connection;
|
||||
namespace App\Exceptions\Http\Connection;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
use Illuminate\Support\Facades\Context;
|
||||
|
||||
/**
|
||||
* @method \GuzzleHttp\Exception\GuzzleException getPrevious()
|
||||
@@ -15,7 +15,7 @@ class DaemonConnectionException extends DisplayException
|
||||
private int $statusCode = Response::HTTP_GATEWAY_TIMEOUT;
|
||||
|
||||
/**
|
||||
* Every request to the Wings instance will return a unique X-Request-Id header
|
||||
* Every request to the daemon instance will return a unique X-Request-Id header
|
||||
* which allows for all errors to be efficiently tied to a specific request that
|
||||
* triggered them, and gives users a more direct method of informing hosts when
|
||||
* something goes wrong.
|
||||
@@ -31,9 +31,11 @@ class DaemonConnectionException extends DisplayException
|
||||
$response = method_exists($previous, 'getResponse') ? $previous->getResponse() : null;
|
||||
$this->requestId = $response?->getHeaderLine('X-Request-Id');
|
||||
|
||||
Context::add('request_id', $this->requestId);
|
||||
|
||||
if ($useStatusCode) {
|
||||
$this->statusCode = is_null($response) ? $this->statusCode : $response->getStatusCode();
|
||||
// There are rare conditions where wings encounters a panic condition and crashes the
|
||||
// There are rare conditions where daemon encounters a panic condition and crashes the
|
||||
// request being made after content has already been sent over the wire. In these cases
|
||||
// you can end up with a "successful" response code that is actual an error.
|
||||
//
|
||||
@@ -64,17 +66,6 @@ class DaemonConnectionException extends DisplayException
|
||||
parent::__construct($message, $previous, $level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the default reporting method for DisplayException by just logging immediately
|
||||
* here and including the specific X-Request-Id header that was returned by the call.
|
||||
*/
|
||||
public function report()
|
||||
{
|
||||
Log::{$this->getErrorLevel()}($this->getPrevious(), [
|
||||
'request_id' => $this->requestId,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTTP status code for this exception.
|
||||
*/
|
||||
@@ -82,9 +73,4 @@ class DaemonConnectionException extends DisplayException
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
public function getRequestId(): ?string
|
||||
{
|
||||
return $this->requestId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions\Http;
|
||||
namespace App\Exceptions\Http;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user