Skip to content

Commit d3a544a

Browse files
authored
Merge pull request pterodactyl#1 from pterodactyl/develop
Upstream Update
2 parents 4a27e56 + 800b475 commit d3a544a

Some content is hidden

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

52 files changed

+498
-239
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ What more are you waiting for? Make game servers a first class citizen on your p
1212

1313
![Image](https://cdn.pterodactyl.io/site-assets/mockup-macbook-grey.png)
1414

15+
## Sponsors
16+
I would like to extend my sincere thanks to the following sponsors for funding Pterodactyl's developement. [Interested
17+
in becoming a sponsor?](https://github.com/sponsors/DaneEveritt)
18+
19+
#### [BloomVPS](https://bloomvps.com)
20+
> BloomVPS offers dedicated core VPS and Minecraft hosting with Ryzen 9 processors. With owned-hardware, we offer truly
21+
> unbeatable prices on high-performance hosting.
22+
23+
#### [VersatileNode](https://versatilenode.com/)
24+
> Looking to host a minecraft server, vps, or a website? VersatileNode is one of the most affordable hosting providers
25+
> to provide quality yet cheap services with incredible support.
26+
27+
#### [MineStrator](https://minestrator.com/)
28+
> Looking for a French highend hosting company for you minecraft server? More than 14,000 members on our discord
29+
> trust us.
30+
31+
#### [DedicatedMC](https://dedicatedmc.io/)
32+
> DedicatedMC provides Raw Power hosting at affordable pricing, making sure to never compromise on your performance
33+
> and giving you the best performance money can buy.
34+
35+
1536
## Support & Documentation
1637
Support for using Pterodactyl can be found on our [Documentation Website](https://pterodactyl.io/project/introduction.html), [Guides Website](https://pterodactyl.io/community/about.html), or via our [Discord Chat](https://discord.gg/QRDZvVm).
1738

@@ -43,7 +64,7 @@ In addition to our standard nest of supported games, our community is constantly
4364
## Credits
4465
This software would not be possible without the work of other open-source authors who provide tools such as:
4566

46-
[Ace Editor](https://ace.c9.io), [AdminLTE](https://almsaeedstudio.com), [Animate.css](http://daneden.github.io/animate.css/), [AnsiUp](https://github.com/drudru/ansi_up), [Async.js](https://github.com/caolan/async),
67+
[Ace Editor](https://ace.c9.io), [AdminLTE](https://adminlte.io), [Animate.css](http://daneden.github.io/animate.css/), [AnsiUp](https://github.com/drudru/ansi_up), [Async.js](https://github.com/caolan/async),
4768
[Bootstrap](http://getbootstrap.com), [Bootstrap Notify](http://bootstrap-notify.remabledesigns.com), [Chart.js](http://www.chartjs.org), [FontAwesome](http://fontawesome.io),
4869
[FontAwesome Animations](https://github.com/l-lin/font-awesome-animation), [jQuery](http://jquery.com), [Laravel](https://laravel.com), [Lodash](https://lodash.com),
4970
[Select2](https://select2.github.io), [Socket.io](http://socket.io), [Socket.io File Upload](https://github.com/vote539/socketio-file-upload), [SweetAlert](http://t4t5.github.io/sweetalert),

app/Exceptions/Http/Connection/DaemonConnectionException.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Pterodactyl\Exceptions\Http\Connection;
44

5+
use Illuminate\Support\Arr;
56
use Illuminate\Http\Response;
67
use GuzzleHttp\Exception\GuzzleException;
78
use Pterodactyl\Exceptions\DisplayException;
@@ -28,12 +29,28 @@ public function __construct(GuzzleException $previous, bool $useStatusCode = tru
2829
$response = method_exists($previous, 'getResponse') ? $previous->getResponse() : null;
2930

3031
if ($useStatusCode) {
31-
$this->statusCode = is_null($response) ? 500 : $response->getStatusCode();
32+
$this->statusCode = is_null($response) ? $this->statusCode : $response->getStatusCode();
3233
}
3334

34-
parent::__construct(trans('admin/server.exceptions.daemon_exception', [
35+
$message = trans('admin/server.exceptions.daemon_exception', [
3536
'code' => is_null($response) ? 'E_CONN_REFUSED' : $response->getStatusCode(),
36-
]), $previous, DisplayException::LEVEL_WARNING);
37+
]);
38+
39+
// Attempt to pull the actual error message off the response and return that if it is not
40+
// a 500 level error.
41+
if ($this->statusCode < 500 && ! is_null($response)) {
42+
$body = $response->getBody();
43+
if (is_string($body) || (is_object($body) && method_exists($body, '__toString'))) {
44+
$body = json_decode(is_string($body) ? $body : $body->__toString(), true);
45+
$message = "[Wings Error]: " . Arr::get($body, 'error', $message);
46+
}
47+
}
48+
49+
$level = $this->statusCode >= 500 && $this->statusCode !== 504
50+
? DisplayException::LEVEL_ERROR
51+
: DisplayException::LEVEL_WARNING;
52+
53+
parent::__construct($message, $previous, $level);
3754
}
3855

3956
/**

app/Http/Requests/Admin/Settings/BaseSettingsFormRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function rules()
1919
'app:name' => 'required|string|max:255',
2020
'pterodactyl:auth:2fa_required' => 'required|integer|in:0,1,2',
2121
'app:locale' => ['required', 'string', Rule::in(array_keys($this->getAvailableLanguages()))],
22+
'app:analytics' => 'nullable|string',
2223
];
2324
}
2425

@@ -31,6 +32,7 @@ public function attributes()
3132
'app:name' => 'Company Name',
3233
'pterodactyl:auth:2fa_required' => 'Require 2-Factor Authentication',
3334
'app:locale' => 'Default Language',
35+
'app:analytics' => 'Google Analytics',
3436
];
3537
}
3638
}

app/Http/ViewComposers/AssetComposer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function compose(View $view)
3737
'enabled' => config('recaptcha.enabled', false),
3838
'siteKey' => config('recaptcha.website_key') ?? '',
3939
],
40+
'analytics' => config('app.analytics') ?? '',
4041
]);
4142
}
4243
}

app/Providers/SettingsServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class SettingsServiceProvider extends ServiceProvider
2121
protected $keys = [
2222
'app:name',
2323
'app:locale',
24+
'app:analytics',
2425
'recaptcha:enabled',
2526
'recaptcha:secret_key',
2627
'recaptcha:website_key',

app/Repositories/Wings/DaemonFileRepository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ public function compressFiles(?string $root, array $files): array
230230
'root' => $root ?? '/',
231231
'files' => $files,
232232
],
233+
// Wait for up to 15 minutes for the archive to be completed when calling this endpoint
234+
// since it will likely take quite awhile for large directories.
235+
'timeout' => 60 * 15,
233236
]
234237
);
235238
} catch (TransferException $exception) {

app/Services/Eggs/EggConfigurationService.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,29 @@ public function handle(Server $server): array
5151
);
5252

5353
return [
54-
'startup' => json_decode($server->egg->inherit_config_startup),
54+
'startup' => $this->convertStartupToNewFormat(json_decode($server->egg->inherit_config_startup, true)),
5555
'stop' => $this->convertStopToNewFormat($server->egg->inherit_config_stop),
5656
'configs' => $configs,
5757
];
5858
}
5959

60+
/**
61+
* Convert the "done" variable into an array if it is not currently one.
62+
*
63+
* @param array $startup
64+
* @return array
65+
*/
66+
protected function convertStartupToNewFormat(array $startup)
67+
{
68+
$done = Arr::get($startup, 'done');
69+
70+
return [
71+
'done' => is_string($done) ? [$done] : $done,
72+
'user_interaction' => Arr::get($startup, 'userInteraction') ?? Arr::get($startup, 'user_interaction') ?? [],
73+
'strip_ansi' => Arr::get($startup, 'strip_ansi') ?? false,
74+
];
75+
}
76+
6077
/**
6178
* Converts a legacy stop string into a new generation stop option for a server.
6279
*

app/Transformers/Api/Client/StatsTransformer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public function transform(array $data)
2727
'current_state' => Arr::get($data, 'state', 'stopped'),
2828
'is_suspended' => Arr::get($data, 'suspended', false),
2929
'resources' => [
30-
'memory_bytes' => Arr::get($data, 'resources.memory_bytes', 0),
31-
'cpu_absolute' => Arr::get($data, 'resources.cpu_absolute', 0),
32-
'disk_bytes' => Arr::get($data, 'resources.disk_bytes', 0),
33-
'network_rx_bytes' => Arr::get($data, 'resources.network.rx_bytes', 0),
34-
'network_tx_bytes' => Arr::get($data, 'resources.network.tx_bytes', 0),
30+
'memory_bytes' => Arr::get($data, 'memory_bytes', 0),
31+
'cpu_absolute' => Arr::get($data, 'cpu_absolute', 0),
32+
'disk_bytes' => Arr::get($data, 'disk_bytes', 0),
33+
'network_rx_bytes' => Arr::get($data, 'network.rx_bytes', 0),
34+
'network_tx_bytes' => Arr::get($data, 'network.tx_bytes', 0),
3535
],
3636
];
3737
}

config/pterodactyl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
| Configure the timeout to be used for Guzzle connections here.
8686
*/
8787
'guzzle' => [
88-
'timeout' => env('GUZZLE_TIMEOUT', 5),
89-
'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 3),
88+
'timeout' => env('GUZZLE_TIMEOUT', 30),
89+
'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 10),
9090
],
9191

9292
/*

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"@fortawesome/fontawesome-svg-core": "1.2.19",
55
"@fortawesome/free-solid-svg-icons": "^5.9.0",
66
"@fortawesome/react-fontawesome": "0.1.4",
7-
"@types/react-google-recaptcha": "^1.1.1",
87
"axios": "^0.19.2",
98
"ayu-ace": "^2.0.4",
109
"brace": "^0.11.1",
@@ -26,11 +25,14 @@
2625
"react-dom": "npm:@hot-loader/react-dom",
2726
"react-fast-compare": "^3.2.0",
2827
"react-google-recaptcha": "^2.0.1",
28+
"react-helmet": "^6.1.0",
29+
"react-ga": "^3.1.2",
2930
"react-hot-loader": "^4.12.21",
3031
"react-i18next": "^11.2.1",
3132
"react-redux": "^7.1.0",
3233
"react-router-dom": "^5.1.2",
3334
"react-transition-group": "^4.4.1",
35+
"reaptcha": "^1.7.2",
3436
"sockette": "^2.0.6",
3537
"styled-components": "^5.1.1",
3638
"styled-components-breakpoint": "^3.0.0-preview.20",
@@ -61,6 +63,7 @@
6163
"@types/query-string": "^6.3.0",
6264
"@types/react": "^16.9.41",
6365
"@types/react-dom": "^16.9.8",
66+
"@types/react-helmet": "^6.0.0",
6467
"@types/react-redux": "^7.1.1",
6568
"@types/react-router": "^5.1.3",
6669
"@types/react-router-dom": "^5.1.3",

0 commit comments

Comments
 (0)