Compare commits

...

185 Commits
1.x ... 3.x

Author SHA1 Message Date
iamkubi
03574ce4b3 Delete migrated CLA signatures 2024-04-17 22:57:14 -07:00
iamkubi
56dbac6f81 Fix CLA workflow missing access token 2024-04-17 22:49:15 -07:00
iamkubi
8801d1db59 Update cla.yaml 2024-04-17 20:19:47 -07:00
iamkubi
dd913008c1 Update CLA workflow
Store signatures in a separate repo
2024-04-17 20:15:07 -07:00
github-actions[bot]
f6d068be2c @Poseidon281 has signed the CLA in pelican-dev/panel#94 2024-04-17 14:11:17 +00:00
github-actions[bot]
5c450900fd @MikkelHebel has signed the CLA in pelican-dev/panel#86 2024-04-15 13:42:46 +00:00
Lance Pioch
2743698e2c Fix these again 2024-04-14 21:23:41 -04:00
Lance Pioch
0195e36ccf Update Crowdin configuration file 2024-04-14 13:54:15 -04:00
Lance Pioch
867777f2e4 Update Crowdin configuration file 2024-04-14 13:18:59 -04:00
github-actions[bot]
e96dd13170 @notAreYouScared has signed the CLA in pelican-dev/panel#66 2024-04-14 01:59:18 +00:00
iamkubi
7860710cca Merge pull request #65 from pelican-dev/iamkubi-license-update
Update license
2024-04-13 16:33:25 -07:00
iamkubi
67fa753e7b Update license 2024-04-13 16:30:02 -07:00
github-actions[bot]
3b0c5540a7 @iamkubi has signed the CLA in pelican-dev/panel#64 2024-04-13 21:40:08 +00:00
github-actions[bot]
3e940e8c48 Creating file for storing CLA Signatures 2024-04-13 21:39:29 +00:00
iamkubi
b39e1c6f78 Add CLA and workflow for CLA bot 2024-04-13 14:31:16 -07:00
Lance Pioch
7c575205d3 logo and favicon changes
# Conflicts:
#	resources/scripts/components/auth/LoginFormContainer.tsx
#	resources/scripts/components/elements/PageContentBlock.tsx
#	resources/views/layouts/admin.blade.php
2024-04-11 21:01:03 -04:00
Lance Pioch
01f63f7122 Don’t bother running this locally, it’s not meant to 2024-04-11 20:34:57 -04:00
Lance Pioch
0a6c43ba4f Merge branch '3.x' of github.com:pelican-dev/panel into 3.x 2024-04-11 20:19:08 -04:00
Lance Pioch
ef1bd0098b Remove hard requirement on posix 2024-04-11 20:18:57 -04:00
Lance Pioch
cbca669e10 Merge pull request #7 from Huguitis/3.x
Add Spanish Translations
2024-04-10 20:31:05 -04:00
Huguitis
2d93c90060 messages.php correction. 2024-04-10 23:27:36 +02:00
Huguitis
3e90484125 passwords.php correction. 2024-04-10 23:26:23 +02:00
Lance Pioch
f3085afcbc Styling 2024-04-10 17:10:51 -04:00
Lance Pioch
f6eede37aa Populate tags for nodes 2024-04-09 20:08:55 -04:00
Lance Pioch
8ce84239e1 Populate new tags 2024-04-09 19:24:04 -04:00
Lance Pioch
2e3d17b94a Redis is no longer the default 2024-04-06 10:17:17 -04:00
Huguitis
2849f8a36a Create user.php (Spanish) 2024-04-03 22:38:00 +02:00
Huguitis
1dcb08ccc0 Create server.php (Spanish) 2024-04-03 22:37:30 +02:00
Huguitis
c07f015ccd Create node.php (Spanish) 2024-04-03 22:36:49 +02:00
Huguitis
0213e7dfec Create eggs.php (Spanish) 2024-04-03 22:36:07 +02:00
Huguitis
5d4713e0de Create messages.php (Spanish) 2024-04-03 22:34:27 +02:00
Huguitis
c328f5cd9b Create account.php (Spanish) 2024-04-03 22:33:19 +02:00
Huguitis
43a250ac31 Create index.php (Spanish) 2024-04-03 22:32:32 +02:00
Huguitis
4c4ec54981 Create users.php (Spanish) 2024-04-03 22:31:29 +02:00
Huguitis
20875d8d3f Create activity.php (Spanish) 2024-04-03 22:30:21 +02:00
Huguitis
9120e81514 Create auth.php (Spanish) 2024-04-03 22:28:25 +02:00
Huguitis
2225d50b9a Create exceptions.php (Spanish) 2024-04-03 22:27:34 +02:00
Huguitis
f805219ddc Create pagination.php (Spanish) 2024-04-03 22:25:37 +02:00
Huguitis
79e8842228 Create passwords.php (Spanish) 2024-04-03 22:24:58 +02:00
Huguitis
9b29ba8e30 Create strings.php (Spanish) 2024-04-03 22:24:15 +02:00
Huguitis
a61c07a04c Create validation.php (Spanish) 2024-04-03 22:21:25 +02:00
Lance Pioch
06f66027dd Whoops, add this in real quick before anybody notices! 2024-03-24 14:43:25 -04:00
Lance Pioch
039c669fc7 Customize the domain 2024-03-24 01:48:21 -04:00
Lance Pioch
0bfcf000f1 Rewrite this 2024-03-23 17:47:18 -04:00
Lance Pioch
d5783811c8 Switch to link to discussions 2024-03-23 17:28:22 -04:00
Lance Pioch
e1eb79e4e5 Simplify using helper 2024-03-23 17:25:10 -04:00
Lance Pioch
b39f843d0f Update funding for now 2024-03-23 17:17:15 -04:00
Lance Pioch
1b4566d123 Latest squash 2024-03-23 16:51:13 -04:00
Lance Pioch
e8bf5dbfcc Squash the migrations 2024-03-23 16:49:20 -04:00
Lance Pioch
bbe3361607 Bump php version 2024-03-23 16:37:33 -04:00
Lance Pioch
96c30b6a34 This option is deprecated 2024-03-23 16:34:10 -04:00
Lance Pioch
7e0e0908de Bump php versions 2024-03-23 16:34:02 -04:00
Lance Pioch
21465a0d93 Clean up 2024-03-23 16:26:56 -04:00
Lance Pioch
9560e18798 Easier to read 2024-03-23 16:26:43 -04:00
Lance Pioch
358ac96ac1 Swap http client out 2024-03-23 16:10:47 -04:00
Lance Pioch
1ffc65897b Daemon grammar 2024-03-23 12:43:41 -04:00
Lance Pioch
b8b4750f46 Simplify locales 2024-03-23 12:43:01 -04:00
Lance Pioch
08d98581aa Migrate config 2024-03-23 12:32:10 -04:00
Lance Pioch
675c289780 Set content type 2024-03-23 12:31:31 -04:00
Lance Pioch
f795b38db5 Better way 2024-03-23 11:27:26 -04:00
Lance Pioch
e3947e4b50 Only check first token 2024-03-23 11:20:15 -04:00
Lance Pioch
146965fcba We don’t need this anymore 2024-03-23 11:07:00 -04:00
Lance Pioch
cea1a3eccc Discord link 2024-03-23 11:03:59 -04:00
Lance Pioch
a507434422 Don’t need these anymore 2024-03-23 10:58:21 -04:00
Lance Pioch
41f35d6956 Official discord link 2024-03-23 10:40:09 -04:00
Lance Pioch
227ce5ec89 These are no longer needed 2024-03-23 10:39:41 -04:00
Lance Pioch
18ad46fe16 Use php locale instead 2024-03-23 10:39:19 -04:00
Lance Pioch
62d56099d7 Add default name 2024-03-23 08:21:57 -04:00
Lance Pioch
119ef075da Small static analysis adjustments 2024-03-23 08:14:06 -04:00
Lance Pioch
f7bc9f005f Styling fixes 2024-03-23 08:10:28 -04:00
Lance Pioch
49de8fae3e Shouldn’t be testing controllers in this case… 2024-03-23 08:07:54 -04:00
Lance Pioch
ae0882740a Better this 2024-03-23 08:07:35 -04:00
Lance Pioch
7e5d21a889 Do all exceptions here 2024-03-23 08:07:21 -04:00
Lance Pioch
796a236ef4 Use new context to log the request id 2024-03-23 08:07:00 -04:00
Lance Pioch
03b1fc4636 Update this 2024-03-22 21:34:19 -04:00
Lance Pioch
654aad06bb This test is useless 2024-03-22 21:32:19 -04:00
Lance Pioch
0d2e63f590 Better route model binding 2024-03-22 21:32:12 -04:00
Lance Pioch
0c5b449c4e Fix password resets 2024-03-22 18:02:07 -04:00
Lance Pioch
3d740907db This is no longer needed 2024-03-20 03:02:35 -04:00
Lance Pioch
cd9044753f Re-register these providers 2024-03-20 03:02:24 -04:00
Lance Pioch
add838d42f This has to match up with the parent 2024-03-20 02:19:20 -04:00
Lance Pioch
7df31a1eeb This is amazing, this bug was apparently fixed 2024-03-20 02:19:07 -04:00
Lance Pioch
0eef1c9bbc Use new lang path 2024-03-20 02:11:15 -04:00
Lance Pioch
798ac6d4c1 Style fixes 2024-03-19 21:13:55 -04:00
Lance Pioch
582f9e03d8 No longer need to manually specify this 2024-03-19 21:12:59 -04:00
Lance Pioch
29b3debee2 Use Laravel’s same return types 2024-03-19 21:12:27 -04:00
Lance Pioch
f5269e7e5c Fix tests visibility 2024-03-19 21:09:16 -04:00
Lance Pioch
6d3da18bf6 Use new method, property is deprecated 2024-03-19 21:08:49 -04:00
Lance Pioch
899b8836fb Use anonymous migrations instead 2024-03-19 21:03:50 -04:00
Lance Pioch
375c32f767 Update the whole lot 2024-03-19 21:03:22 -04:00
Lance Pioch
afe6068f4f Fallback to old key 2024-03-19 21:02:30 -04:00
Lance Pioch
e7316ba973 Simplification 2024-03-19 21:02:19 -04:00
Lance Pioch
ab4c3eedc3 Re-register service providers 2024-03-19 20:44:21 -04:00
Lance Pioch
ec38f7567e Consolidate service providers 2024-03-19 20:42:40 -04:00
Lance Pioch
dcdfd2cea9 Re-register middleware 2024-03-19 20:38:01 -04:00
Lance Pioch
0ce1739b9f New bootstrap 2024-03-19 17:03:30 -04:00
Lance Pioch
7c39c00400 Update env vars 2024-03-19 17:03:01 -04:00
Lance Pioch
1f9c98ba61 Simplify configs 2024-03-19 16:59:53 -04:00
Lance Pioch
e1869ed9e6 Update these 2024-03-19 16:49:42 -04:00
Lance Pioch
9347f776e6 Don’t need these anymore 2024-03-19 16:49:09 -04:00
Lance Pioch
301976e984 Move to lang dir 2024-03-19 16:48:46 -04:00
Lance Pioch
b4532d9d10 Use more fluent methods 2024-03-19 16:47:52 -04:00
Lance Pioch
d4d3ffc96c Use faker methods instead of properties 2024-03-19 16:47:02 -04:00
Lance Pioch
c124d403ff Use nullsafe operator 2024-03-19 16:46:25 -04:00
Lance Pioch
44b9eb2358 Remove event dispatcher explicit usage 2024-03-19 16:14:24 -04:00
Lance Pioch
1d96ed8869 Replace service 2024-03-19 15:48:11 -04:00
Lance Pioch
627442e40f Add logo 2024-03-19 15:42:19 -04:00
Lance Pioch
d58496a355 Replace with helper 2024-03-19 05:11:41 -04:00
Lance Pioch
d9cfb62a12 Use config helper instead 2024-03-19 04:59:19 -04:00
Lance Pioch
b11810588a Branding 2024-03-19 04:54:39 -04:00
Lance Pioch
c4c4834acc Fix this 2024-03-19 04:52:43 -04:00
Lance Pioch
3a95105931 Style fixes 2024-03-19 04:48:57 -04:00
Lance Pioch
25001c54a8 Update funding 2024-03-19 04:37:08 -04:00
Lance Pioch
c01330dc06 Remove service 2024-03-19 04:30:26 -04:00
Lance Pioch
139c70e52b Merge branch '3.x' of panel into 3.x 2024-03-19 04:23:12 -04:00
Lance Pioch
d012b895e1 Merge pull request #1 from lancepioch/dependabot/npm_and_yarn/npm_and_yarn-security-group-b2e1eb7815
build(deps): bump the npm_and_yarn group across 1 directory with 1 update
2024-03-18 21:36:50 -04:00
Lance Pioch
c4a471f91a Handle deletion better 2024-03-18 21:23:13 -04:00
Lance Pioch
2aa9be62a1 Use route model binding 2024-03-17 20:57:06 -04:00
Lance Pioch
c8c3b55be8 Remove baseline that’s unused 2024-03-17 20:37:19 -04:00
Lance Pioch
a3f33eea3f No need for function 2024-03-17 14:27:24 -04:00
Lance Pioch
0dacfc31ac Use built in casts 2024-03-17 14:15:06 -04:00
Lance Pioch
4cc123aed5 Styling fix 2024-03-17 14:04:12 -04:00
Lance Pioch
37094ffc1f Best of both worlds because of mockery 2024-03-17 13:59:21 -04:00
Lance Pioch
a97e3ee3e8 Better baseline 2024-03-17 13:52:02 -04:00
Lance Pioch
b8d0cb0745 Styling 2024-03-17 13:49:19 -04:00
Lance Pioch
6030a0e890 Specify typehint 2024-03-17 13:49:14 -04:00
Lance Pioch
7c0a46deaa Yet more static analysis 2024-03-17 13:46:01 -04:00
Lance Pioch
e9ea5b1cae Even more static analysis! 2024-03-17 13:16:39 -04:00
Lance Pioch
c7bf124a15 This one was me! laravel/framework#44807 2024-03-17 13:13:22 -04:00
Lance Pioch
861aeb0c5c More static analysis 2024-03-17 13:03:04 -04:00
Lance Pioch
3cea8ca979 Better static analysis 2024-03-17 12:52:22 -04:00
Lance Pioch
53c1626805 Put these back too 2024-03-17 02:15:36 -04:00
Lance Pioch
b4610ce2c9 Should be using http fakes… but this works for now 2024-03-17 02:13:49 -04:00
Lance Pioch
088a7cd5a7 Move this over to integration testing 2024-03-17 01:47:36 -04:00
Lance Pioch
c7fba40ba3 Adjust this back 2024-03-17 01:47:29 -04:00
Lance Pioch
c3529acb22 Adjustments 2024-03-17 01:08:48 -04:00
Lance Pioch
daca4d1d5b Small ci updates 2024-03-17 00:51:35 -04:00
Lance Pioch
f7c2c1a84c Formatting 2024-03-17 00:40:18 -04:00
Lance Pioch
1172fec6e5 Remove record not found exception 2024-03-16 23:34:45 -04:00
Lance Pioch
dece74c185 Remove config repository 2024-03-16 23:29:54 -04:00
Lance Pioch
80c5a97038 Use logger helper 2024-03-16 23:27:24 -04:00
Lance Pioch
80d3827e4e Remove config repository usage 2024-03-16 23:24:10 -04:00
Lance Pioch
38d68d8221 Use view helper instead 2024-03-16 23:23:07 -04:00
Lance Pioch
8808a94154 Small clean up 2024-03-16 23:20:58 -04:00
Lance Pioch
67c2bb53e0 Remove unused repository interface 2024-03-16 23:09:32 -04:00
Lance Pioch
49749ebfcc Remove these repository references 2024-03-16 23:02:17 -04:00
Lance Pioch
aa93cd65c1 Remove backup and mount repositories 2024-03-16 23:01:45 -04:00
Lance Pioch
9d3a6ae494 Remove DatabaseHost Repository 2024-03-16 22:41:36 -04:00
Lance Pioch
449f875d20 Remove egg variable repository 2024-03-16 22:13:13 -04:00
Lance Pioch
50fa260a38 Remove node repository 2024-03-16 21:34:09 -04:00
dependabot[bot]
fc343aca46 build(deps): bump the npm_and_yarn group across 1 directory with 1 update
Bumps the npm_and_yarn group with 1 update in the / directory: [follow-redirects](https://github.com/follow-redirects/follow-redirects).


Updates `follow-redirects` from 1.15.5 to 1.15.6
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
  dependency-group: npm_and_yarn-security-group
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-17 01:18:10 +00:00
Lance Pioch
f988cc8cfa Remove database repository 2024-03-16 20:56:37 -04:00
Lance Pioch
ba95045583 Remove settings repository 2024-03-16 20:30:31 -04:00
Lance Pioch
df37de4d2d Remove egg repository 2024-03-16 20:14:50 -04:00
Lance Pioch
89477421e1 Remove api key repository 2024-03-16 20:00:31 -04:00
Lance Pioch
ea417cf45e Remove allocation repository 2024-03-16 19:52:32 -04:00
Lance Pioch
ca543a3b91 Add license 2024-03-16 19:36:14 -04:00
Lance Pioch
384612360e Remove server variable repository 2024-03-16 19:32:24 -04:00
Lance Pioch
a0cc4b3d5f Put this back down for now 2024-03-16 19:29:16 -04:00
Lance Pioch
666634ae88 Small fixes 2024-03-16 19:28:31 -04:00
Lance Pioch
191e0adc58 Remove recovery token repository 2024-03-16 19:28:25 -04:00
Lance Pioch
a496be67b8 Remove api permission repository 2024-03-16 19:22:52 -04:00
Lance Pioch
60c32cdb81 Remove schedule and task repositories 2024-03-16 19:20:55 -04:00
Lance Pioch
1813e6f549 Remove user repository 2024-03-16 19:10:31 -04:00
Lance Pioch
f27f673615 Array mail in tests 2024-03-16 18:55:07 -04:00
Lance Pioch
2aa06fc009 Small replacement fixes 2024-03-16 18:54:57 -04:00
Lance Pioch
521aa203b8 Better handling of our permissions 2024-03-16 18:53:53 -04:00
Lance Pioch
9b2dfb4212 Simplify this 2024-03-16 18:53:20 -04:00
Lance Pioch
4969aed383 Remove daemon command repo 2024-03-16 15:11:10 -04:00
Lance Pioch
4e42cd784a Remove server repository and interface 2024-03-16 15:01:41 -04:00
Lance Pioch
4ea5341e97 Remove daemon transfer repository 2024-03-16 14:35:13 -04:00
Lance Pioch
41c3f1336a More static analysis 2024-03-16 14:26:08 -04:00
Lance Pioch
095bc89aee Basic fixes from phpstan 2024-03-16 14:19:40 -04:00
Lance Pioch
6b5e990a1c Add phpstan to help with static analysis 2024-03-16 14:19:32 -04:00
Lance Pioch
afc22a2787 Don’t force the platform 2024-03-16 14:12:25 -04:00
Lance Pioch
a9774718d2 Fix the repo links 2024-03-16 14:05:38 -04:00
Lance Pioch
e4cee4d69d Remove locations 2024-03-14 02:23:30 -04:00
Lance Pioch
9fb0c451f5 Run the tests 2024-03-14 01:30:34 -04:00
Lance Pioch
a296084d6e Remove nests 2024-03-14 01:27:50 -04:00
Lance Pioch
05681641d3 Update default mail driver 2024-03-14 01:22:26 -04:00
Lance Pioch
aa85727156 Force add these 2024-03-14 01:15:18 -04:00
Lance Pioch
cd51705b58 Add readme 2024-03-14 01:10:56 -04:00
Lance Pioch
2f3d4e2819 Remove telemetry 2024-03-12 22:47:49 -04:00
Lance Pioch
883314b74a Small updates 2024-03-12 22:47:32 -04:00
Lance Pioch
c83dd86a41 Switch namespace back to App 2024-03-12 22:39:16 -04:00
1110 changed files with 11019 additions and 19510 deletions

20
.env.ci
View File

@@ -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

View File

@@ -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
View File

@@ -1 +1 @@
github: [matthewpi]
custom: [https://buy.stripe.com/14kdU99SI4UT7ni9AB, https://buy.stripe.com/14kaHXc0Q9b9372eUU]

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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$ {

View File

@@ -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;
}
}
}

View File

@@ -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"

View File

@@ -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
View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.

File diff suppressed because it is too large Load Diff

View File

@@ -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/

View File

@@ -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).

View File

@@ -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 . ./

View File

@@ -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.
```

View File

@@ -1,70 +0,0 @@
[![Logo Image](https://cdn.pterodactyl.io/logos/new/pterodactyl_logo.png)](https://pterodactyl.io)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/pterodactyl/panel/ci.yaml?label=Tests&style=for-the-badge&branch=1.0-develop)
![Discord](https://img.shields.io/discord/122900397965705216?label=Discord&logo=Discord&logoColor=white&style=for-the-badge)
![GitHub Releases](https://img.shields.io/github/downloads/pterodactyl/panel/latest/total?style=for-the-badge)
![GitHub contributors](https://img.shields.io/github/contributors/pterodactyl/panel?style=for-the-badge)
# 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.
![Image](https://cdn.pterodactyl.io/site-assets/pterodactyl_v1_demo.gif)
## 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).

View File

@@ -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.

View File

@@ -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';

View File

@@ -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();
}
}

View File

@@ -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')
);
}
}

View File

@@ -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');
}

View File

@@ -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'));
}
}

View File

@@ -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,
]));
}
}

View File

@@ -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');

View File

@@ -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());

View File

@@ -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 . '.');
}
}

View File

@@ -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.');

View File

@@ -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();

View File

@@ -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.');

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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());
}

View File

@@ -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);
}

View File

@@ -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());
}
}

View File

@@ -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)

View File

@@ -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'));
}

View File

@@ -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]));
}
}

View File

@@ -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;
}
}

View File

@@ -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");
}
}

View File

@@ -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.
');

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Contracts\Extensions;
namespace App\Contracts\Extensions;
use Hashids\HashidsInterface as VendorHashidsInterface;

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Contracts\Http;
namespace App\Contracts\Http;
interface ClientPermissionsRequest
{

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,7 +0,0 @@
<?php
namespace Pterodactyl\Contracts\Repository;
interface ApiPermissionRepositoryInterface extends RepositoryInterface
{
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,7 +0,0 @@
<?php
namespace Pterodactyl\Contracts\Repository;
interface PermissionRepositoryInterface extends RepositoryInterface
{
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,7 +0,0 @@
<?php
namespace Pterodactyl\Contracts\Repository;
interface ServerVariableRepositoryInterface extends RepositoryInterface
{
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,7 +0,0 @@
<?php
namespace Pterodactyl\Contracts\Repository;
interface UserRepositoryInterface extends RepositoryInterface
{
}

View File

@@ -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

View File

@@ -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
{

View File

@@ -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

View File

@@ -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

View File

@@ -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
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Events;
namespace App\Events;
abstract class Event
{

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
class AccountNotFoundException extends \Exception
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
class AutoDeploymentException extends \Exception
{

View File

@@ -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';

View File

@@ -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);
}
/**

View File

@@ -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
{

View File

@@ -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;
}
}

View File

@@ -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