mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-23 01:22:30 +01:00
Merge pull request #1147 from pterodactyl/feature/upgrade-laravel-to-5.6
Upgrade Laravel to 5.6
This commit is contained in:
commit
3bb9c521c0
@ -6,6 +6,7 @@ APP_TIMEZONE=America/New_York
|
||||
APP_CLEAR_TASKLOG=720
|
||||
APP_DELETE_MINUTES=10
|
||||
APP_ENVIRONMENT_ONLY=true
|
||||
LOG_CHANNEL=daily
|
||||
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
|
@ -6,11 +6,16 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||
## v0.7.7 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* Fixes an issue with the sidebar logo not working correctly in some browsers due to the CSS being assigned.
|
||||
* Fixes a bunch of typos through the code base.
|
||||
|
||||
### Added
|
||||
* Added a new client API endpoint for gathering the utilization stats for servers including disk, cpu, and memory. `GET /api/client/servers/<id>/utilization`
|
||||
* Added validation to variable validation rules to validate that the validation rules are valid because we heard you like validating your validation.
|
||||
|
||||
### Changed
|
||||
* Updated core framework from Laravel 5.5 to Laravel 5.6.
|
||||
* Improved support for Windows based environments.
|
||||
|
||||
## v0.7.6 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* Fixes a UI error when attempting to change the default Nest and Egg for an existing server.
|
||||
|
@ -15,15 +15,9 @@ class TrustProxies extends Middleware
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The current proxy header mappings.
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var array
|
||||
* @var int
|
||||
*/
|
||||
protected $headers = [
|
||||
Request::HEADER_FORWARDED => 'FORWARDED',
|
||||
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
|
||||
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
|
||||
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
||||
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
||||
];
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Pterodactyl\Providers;
|
||||
|
||||
use Illuminate\Contracts\Logging\Log;
|
||||
use Psr\Log\LoggerInterface as Log;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
@ -62,7 +62,7 @@ class SettingsServiceProvider extends ServiceProvider
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
|
||||
* @param \Illuminate\Contracts\Logging\Log $log
|
||||
* @param \Psr\Log\LoggerInterface $log
|
||||
* @param \Pterodactyl\Contracts\Repository\SettingsRepositoryInterface $settings
|
||||
*/
|
||||
public function boot(ConfigRepository $config, Encrypter $encrypter, Log $log, SettingsRepositoryInterface $settings)
|
||||
|
@ -24,9 +24,9 @@
|
||||
|
||||
namespace Pterodactyl\Services\DaemonKeys;
|
||||
|
||||
use Illuminate\Log\Writer;
|
||||
use Webmozart\Assert\Assert;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
@ -57,7 +57,7 @@ class DaemonKeyDeletionService
|
||||
protected $serverRepository;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
@ -68,7 +68,7 @@ class DaemonKeyDeletionService
|
||||
* @param \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface $repository
|
||||
* @param \Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface $daemonRepository
|
||||
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $serverRepository
|
||||
* @param \Illuminate\Log\Writer $writer
|
||||
* @param \Psr\Log\LoggerInterface $writer
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace Pterodactyl\Services\Servers;
|
||||
|
||||
use Illuminate\Log\Writer;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Services\Databases\DatabaseManagementService;
|
||||
@ -51,7 +51,7 @@ class ServerDeletionService
|
||||
protected $repository;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
@ -63,7 +63,7 @@ class ServerDeletionService
|
||||
* @param \Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface $databaseRepository
|
||||
* @param \Pterodactyl\Services\Databases\DatabaseManagementService $databaseManagementService
|
||||
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $repository
|
||||
* @param \Illuminate\Log\Writer $writer
|
||||
* @param \Psr\Log\LoggerInterface $writer
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
namespace Pterodactyl\Services\Servers;
|
||||
|
||||
use Illuminate\Log\Writer;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
@ -38,7 +38,7 @@ class SuspensionService
|
||||
protected $repository;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
@ -48,7 +48,7 @@ class SuspensionService
|
||||
* @param \Illuminate\Database\ConnectionInterface $database
|
||||
* @param \Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface $daemonServerRepository
|
||||
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $repository
|
||||
* @param \Illuminate\Log\Writer $writer
|
||||
* @param \Psr\Log\LoggerInterface $writer
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $database,
|
||||
|
@ -19,24 +19,23 @@
|
||||
"aws/aws-sdk-php": "^3.48",
|
||||
"cakephp/chronos": "^1.1",
|
||||
"doctrine/dbal": "^2.5",
|
||||
"fideloper/proxy": "^3.3",
|
||||
"fideloper/proxy": "^4.0",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"hashids/hashids": "^2.0",
|
||||
"igaster/laravel-theme": "^2.0.6",
|
||||
"laracasts/utilities": "^3.0",
|
||||
"laravel/framework": "5.5.*",
|
||||
"laravel/framework": "5.6.*",
|
||||
"laravel/tinker": "^1.0",
|
||||
"lord/laroute": "^2.4",
|
||||
"matriphe/iso-639": "^1.2",
|
||||
"mtdowling/cron-expression": "^1.2",
|
||||
"nesbot/carbon": "^1.22",
|
||||
"pragmarx/google2fa": "^2.0",
|
||||
"predis/predis": "^1.1",
|
||||
"prologue/alerts": "^0.4",
|
||||
"ramsey/uuid": "^3.7",
|
||||
"s1lentium/iptools": "^1.1",
|
||||
"sofa/eloquence-base": "v5.5",
|
||||
"sofa/eloquence-validable": "v5.5",
|
||||
"sofa/eloquence-base": "v5.6",
|
||||
"sofa/eloquence-validable": "v5.6",
|
||||
"spatie/laravel-fractal": "^5.3",
|
||||
"webmozart/assert": "^1.2",
|
||||
"znck/belongs-to-through": "^2.3"
|
||||
@ -44,13 +43,14 @@
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.1",
|
||||
"barryvdh/laravel-ide-helper": "^2.4",
|
||||
"codedungeon/phpunit-result-printer": "^0.6.0",
|
||||
"codedungeon/phpunit-result-printer": "^0.17.1",
|
||||
"filp/whoops": "^2.1",
|
||||
"friendsofphp/php-cs-fixer": "^2.8.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.11.1",
|
||||
"fzaninotto/faker": "^1.6",
|
||||
"mockery/mockery": "^1.0",
|
||||
"php-mock/php-mock-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "~6.4.0"
|
||||
"nunomaduro/collision": "^2.0",
|
||||
"php-mock/php-mock-phpunit": "^2.1",
|
||||
"phpunit/phpunit": "~7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
1165
composer.lock
generated
1165
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -116,23 +116,6 @@ return [
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Logging Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log settings for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Settings: "single", "daily", "syslog", "errorlog"
|
||||
|
|
||||
*/
|
||||
|
||||
'log' => env('APP_LOG', 'daily'),
|
||||
|
||||
'log_level' => env('APP_LOG_LEVEL', 'info'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Exception Reporter Configuration
|
||||
|
50
config/hashing.php
Normal file
50
config/hashing.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default hash driver that will be used to hash
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 10),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 1024,
|
||||
'threads' => 2,
|
||||
'time' => 2,
|
||||
],
|
||||
];
|
81
config/logging.php
Normal file
81
config/logging.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
use Monolog\Handler\StreamHandler;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that gets used when writing
|
||||
| messages to the logs. The name specified in this option should match
|
||||
| one of the channels defined in the "channels" configuration array.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'daily'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog",
|
||||
| "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['single'],
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => 'debug',
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => 'debug',
|
||||
'days' => 7,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => 'Laravel Log',
|
||||
'emoji' => ':boom:',
|
||||
'level' => 'critical',
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => StreamHandler::class,
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => 'debug',
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => 'debug',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
@ -50,10 +50,5 @@ return [
|
||||
* The following are Symfony defaults, found in
|
||||
* \Symfony\Component\HttpFoundation\Request::$trustedHeaders
|
||||
*/
|
||||
'headers' => [
|
||||
\Illuminate\Http\Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR',
|
||||
\Illuminate\Http\Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST',
|
||||
\Illuminate\Http\Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO',
|
||||
\Illuminate\Http\Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT',
|
||||
],
|
||||
'headers' => \Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
|
||||
];
|
||||
|
@ -24,6 +24,7 @@
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="DB_CONNECTION" value="testing"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace Tests;
|
||||
|
||||
use Cake\Chronos\Chronos;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
|
||||
abstract class TestCase extends BaseTestCase
|
||||
@ -17,7 +16,6 @@ abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
Hash::setRounds(4);
|
||||
$this->setKnownUuidFactory();
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@ namespace Tests\Unit\Services\DaemonKeys;
|
||||
|
||||
use Mockery as m;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Log\Writer;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Models\DaemonKey;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
@ -57,7 +57,7 @@ class DaemonKeyDeletionServiceTest extends TestCase
|
||||
protected $service;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer|\Mockery\Mock
|
||||
* @var \Psr\Log\LoggerInterface|\Mockery\Mock
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
|
@ -4,9 +4,9 @@ namespace Tests\Unit\Services\Servers;
|
||||
|
||||
use Mockery as m;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Log\Writer;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use Tests\Traits\MocksRequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Services\Servers\ServerDeletionService;
|
||||
@ -45,7 +45,7 @@ class ServerDeletionServiceTest extends TestCase
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer|\Mockery\Mock
|
||||
* @var \Psr\Log\LoggerInterface|\Mockery\Mock
|
||||
*/
|
||||
private $writer;
|
||||
|
||||
|
@ -12,9 +12,9 @@ namespace Tests\Unit\Services\Servers;
|
||||
use Exception;
|
||||
use Mockery as m;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Log\Writer;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
@ -55,7 +55,7 @@ class SuspensionServiceTest extends TestCase
|
||||
protected $service;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Log\Writer
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user