Skip to content

Commit 46d7ba7

Browse files
committed
Merge branch 'develop' into feature/api-v1
2 parents 54b6fb5 + 6b2d7b6 commit 46d7ba7

File tree

32 files changed

+247
-201
lines changed

32 files changed

+247
-201
lines changed

.env.example

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
APP_ENV=production
22
APP_DEBUG=false
3-
APP_KEY=SomeRandomString3232RandomString
3+
APP_KEY=
44
APP_THEME=pterodactyl
55
APP_TIMEZONE=America/New_York
66
APP_CLEAR_TASKLOG=720
77
APP_DELETE_MINUTES=10
8-
APP_URL=
8+
APP_ENVIRONMENT_ONLY=true
99

1010
DB_HOST=127.0.0.1
1111
DB_PORT=3306
1212
DB_DATABASE=panel
1313
DB_USERNAME=pterodactyl
1414
DB_PASSWORD=
1515

16-
CACHE_DRIVER=
17-
SESSION_DRIVER=
18-
1916
HASHIDS_SALT=
2017
HASHIDS_LENGTH=8
2118

@@ -27,9 +24,6 @@ MAIL_PASSWORD=
2724
MAIL_ENCRYPTION=tls
2825
MAIL_FROM=no-reply@example.com
2926

30-
QUEUE_DRIVER=
3127
QUEUE_HIGH=high
3228
QUEUE_STANDARD=standard
3329
QUEUE_LOW=low
34-
35-
APP_SERVICE_AUTHOR=undefined@unknown-author.com

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## v0.7.0-beta.4 (Derelict Dermodactylus)
7+
### Fixed
8+
* `[beta.3]` — Fixes a bug with the default environment file that was causing an inability to perform a fresh install when running package discovery.
9+
* `[beta.3]` — Fixes an edge case caused by the Laravel 5.5 upgrade that would try to perform an in_array check aganist a null value.
10+
* `[beta.3]` — Fixes a bug that would cause an error when attempting to create a new user on the Panel.
11+
* `[beta.3]` — Fixes error handling of the settings service provider when no migrations have been run.
12+
613
## v0.7.0-beta.3 (Derelict Dermodactylus)
714
### Fixed
815
* `[beta.2]` — Fixes a bug that would cause an endless exception message stream in the console when attemping to setup environment settings in certain instances.
@@ -12,15 +19,17 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1219
* `[beta.2]` — Fixes bug that caused incorrect rendering of CPU usage on server graphs due to missing variable.
1320
* `[beta.2]` — Fixes bug causing schedules to be un-deletable.
1421
* `[beta.2]` — Fixes bug that prevented the deletion of nodes due to an allocation deletion cascade issue with the SQL schema.
22+
* `[beta.2]` — Fixes a bug causing eggs not extending other eggs to fail validation.
1523

1624
### Changed
1725
* Revoking the administrative status for an admin will revoke all authentication tokens currently assigned to their account.
1826
* Updated core framework to Laravel 5.5. This includes many dependency updates.
1927
* Certain AWS specific environment keys were changed, this should have minimal impact on users unless you specifically enabled AWS specific features. The renames are: `AWS_KEY -> AWS_ACCESS_KEY_ID`, `AWS_SECRET -> AWS_SECRET_ACCESS_KEY`, `AWS_REGION -> AWS_DEFAULT_REGION`
28+
* API keys have been changed to only use a single public key passed in a bearer token. All existing keys can continue being used, however only the first 32 characters should be sent.
2029

2130
### Added
2231
* Added star indicators to user listing in Admin CP to indicate users who are set as a root admin.
23-
* Settings are now editable via the Admin CP and override config values where possible.
32+
* Creating a new node will now requires a SSL connection if the Panel is configured to use SSL as well.
2433

2534
## v0.7.0-beta.2 (Derelict Dermodactylus)
2635
### Fixed

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class AppSettingsCommand extends Command
6666
{--queue= : The queue driver backend to use.}
6767
{--redis-host= : Redis host to use for connections.}
6868
{--redis-pass= : Password used to connect to redis.}
69-
{--redis-port= : Port to connect to redis over.}';
69+
{--redis-port= : Port to connect to redis over.}
70+
{--disable-settings-ui}';
7071

7172
/**
7273
* @var array
@@ -136,6 +137,12 @@ public function handle()
136137
array_key_exists($selected, self::ALLOWED_QUEUE_DRIVERS) ? $selected : null
137138
);
138139

140+
if ($this->option('disable-settings-ui')) {
141+
$this->variables['APP_ENVIRONMENT_ONLY'] = 'true';
142+
} else {
143+
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm(trans('command/messages.environment.app.settings'), true) ? 'false' : 'true';
144+
}
145+
139146
$this->checkForRedis();
140147
$this->writeToEnvironment($this->variables);
141148

app/Exceptions/DisplayException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function render($request)
6565
if ($request->expectsJson()) {
6666
return response()->json(Handler::convertToArray($this, [
6767
'detail' => $this->getMessage(),
68-
]), 500);
68+
]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : 500);
6969
}
7070

7171
app()->make(AlertsMessageBag::class)->danger($this->getMessage())->flash();

app/Exceptions/Http/Connection/DaemonConnectionException.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,38 @@
77

88
class DaemonConnectionException extends DisplayException
99
{
10+
/**
11+
* @var int
12+
*/
13+
private $statusCode = 500;
14+
1015
/**
1116
* Throw a displayable exception caused by a daemon connection error.
1217
*
1318
* @param \GuzzleHttp\Exception\GuzzleException $previous
19+
* @param bool $useStatusCode
1420
*/
15-
public function __construct(GuzzleException $previous)
21+
public function __construct(GuzzleException $previous, bool $useStatusCode = false)
1622
{
1723
/** @var \GuzzleHttp\Psr7\Response|null $response */
1824
$response = method_exists($previous, 'getResponse') ? $previous->getResponse() : null;
1925

26+
if ($useStatusCode) {
27+
$this->statusCode = is_null($response) ? 500 : $response->getStatusCode();
28+
}
29+
2030
parent::__construct(trans('admin/server.exceptions.daemon_exception', [
2131
'code' => is_null($response) ? 'E_CONN_REFUSED' : $response->getStatusCode(),
2232
]), $previous, DisplayException::LEVEL_WARNING);
2333
}
34+
35+
/**
36+
* Return the HTTP status code for this exception.
37+
*
38+
* @return int
39+
*/
40+
public function getStatusCode()
41+
{
42+
return $this->statusCode;
43+
}
2444
}

app/Http/Controllers/Admin/UserController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
use Pterodactyl\Http\Controllers\Controller;
1010
use Illuminate\Contracts\Translation\Translator;
1111
use Pterodactyl\Services\Users\UserUpdateService;
12+
use Pterodactyl\Traits\Helpers\AvailableLanguages;
1213
use Pterodactyl\Services\Users\UserCreationService;
1314
use Pterodactyl\Services\Users\UserDeletionService;
1415
use Pterodactyl\Http\Requests\Admin\UserFormRequest;
1516
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
1617

1718
class UserController extends Controller
1819
{
20+
use AvailableLanguages;
21+
1922
/**
2023
* @var \Prologue\Alerts\AlertsMessageBag
2124
*/
@@ -92,7 +95,9 @@ public function index(Request $request)
9295
*/
9396
public function create()
9497
{
95-
return view('admin.users.new');
98+
return view('admin.users.new', [
99+
'languages' => $this->getAvailableLanguages(true),
100+
]);
96101
}
97102

98103
/**
@@ -103,7 +108,10 @@ public function create()
103108
*/
104109
public function view(User $user)
105110
{
106-
return view('admin.users.view', ['user' => $user]);
111+
return view('admin.users.view', [
112+
'user' => $user,
113+
'languages' => $this->getAvailableLanguages(true),
114+
]);
107115
}
108116

109117
/**

app/Http/Requests/Admin/AdminFormRequest.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Http\Requests\Admin;
114

@@ -39,11 +32,11 @@ public function authorize()
3932
* Return only the fields that we are interested in from the request.
4033
* This will include empty fields as a null value.
4134
*
42-
* @param array $only
35+
* @param array|null $only
4336
* @return array
4437
*/
45-
public function normalize($only = [])
38+
public function normalize(array $only = null)
4639
{
47-
return $this->all(empty($only) ? array_keys($this->rules()) : $only);
40+
return $this->only($only ?? array_keys($this->rules()));
4841
}
4942
}

app/Http/Requests/Admin/UserFormRequest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ public function rules()
2222
return User::getCreateRules();
2323
}
2424

25-
public function normalize($only = [])
25+
/**
26+
* @param array|null $only
27+
* @return array
28+
*/
29+
public function normalize(array $only = null)
2630
{
2731
if ($this->method === 'PATCH') {
2832
return array_merge(
2933
$this->all(['password']),
30-
$this->only(['email', 'username', 'name_first', 'name_last', 'root_admin', 'ignore_connection_error'])
34+
$this->only(['email', 'username', 'name_first', 'name_last', 'root_admin', 'language', 'ignore_connection_error'])
3135
);
3236
}
3337

app/Models/User.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Models;
114

@@ -127,6 +120,8 @@ class User extends Model implements
127120
'name_first' => 'required',
128121
'name_last' => 'required',
129122
'password' => 'sometimes',
123+
'language' => 'sometimes',
124+
'use_totp' => 'sometimes',
130125
];
131126

132127
/**

app/Observers/UserObserver.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Observers;
114

125
use Pterodactyl\Events;
136
use Pterodactyl\Models\User;
14-
use Pterodactyl\Services\Components\UuidService;
157

168
class UserObserver
179
{
1810
protected $uuid;
1911

20-
public function __construct(UuidService $uuid)
21-
{
22-
$this->uuid = $uuid;
23-
}
24-
2512
/**
2613
* Listen to the User creating event.
2714
*
2815
* @param \Pterodactyl\Models\User $user
2916
*/
3017
public function creating(User $user)
3118
{
32-
$user->uuid = $this->uuid->generate('users', 'uuid');
33-
3419
event(new Events\User\Creating($user));
3520
}
3621

0 commit comments

Comments
 (0)