Merge branch '1.0-develop' into develop
This commit is contained in:
commit
ae27a8a65c
10 changed files with 79 additions and 19 deletions
|
@ -43,7 +43,8 @@ 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.}';
|
||||
{--settings-ui= : Enable or disable the settings UI.}
|
||||
{--telemetry= : Enable or disable anonymous telemetry.}';
|
||||
|
||||
protected array $variables = [];
|
||||
|
||||
|
@ -118,6 +119,12 @@ 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';
|
||||
|
|
|
@ -56,10 +56,10 @@ class Kernel extends ConsoleKernel
|
|||
{
|
||||
$settingsRepository = app()->make(SettingsRepository::class);
|
||||
|
||||
$uuid = $settingsRepository->get('app:uuid');
|
||||
$uuid = $settingsRepository->get('app:telemetry:uuid');
|
||||
if (is_null($uuid)) {
|
||||
$uuid = Uuid::uuid4()->toString();
|
||||
$settingsRepository->set('app:uuid', $uuid);
|
||||
$settingsRepository->set('app:telemetry:uuid', $uuid);
|
||||
}
|
||||
|
||||
// Calculate a fixed time to run the data push at, this will be the same time every day.
|
||||
|
|
|
@ -11,6 +11,7 @@ use Illuminate\Database\ConnectionInterface;
|
|||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
||||
use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
||||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
||||
|
||||
class ServerTransferController extends Controller
|
||||
|
@ -33,8 +34,12 @@ class ServerTransferController extends Controller
|
|||
public function failure(string $uuid): JsonResponse
|
||||
{
|
||||
$server = $this->repository->getByUuid($uuid);
|
||||
$transfer = $server->transfer;
|
||||
if (is_null($transfer)) {
|
||||
throw new ConflictHttpException('Server is not being transferred.');
|
||||
}
|
||||
|
||||
return $this->processFailedTransfer($server->transfer);
|
||||
return $this->processFailedTransfer($transfer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,6 +51,9 @@ class ServerTransferController extends Controller
|
|||
{
|
||||
$server = $this->repository->getByUuid($uuid);
|
||||
$transfer = $server->transfer;
|
||||
if (is_null($transfer)) {
|
||||
throw new ConflictHttpException('Server is not being transferred.');
|
||||
}
|
||||
|
||||
/** @var \Pterodactyl\Models\Server $server */
|
||||
$server = $this->connection->transaction(function () use ($server, $transfer) {
|
||||
|
|
|
@ -51,10 +51,10 @@ class TelemetryCollectionService
|
|||
*/
|
||||
public function collect(): array
|
||||
{
|
||||
$uuid = $this->settingsRepository->get('app:uuid');
|
||||
$uuid = $this->settingsRepository->get('app:telemetry:uuid');
|
||||
if (is_null($uuid)) {
|
||||
$uuid = Uuid::uuid4()->toString();
|
||||
$this->settingsRepository->set('app:uuid', $uuid);
|
||||
$this->settingsRepository->set('app:telemetry:uuid', $uuid);
|
||||
}
|
||||
|
||||
$nodes = Node::all()->map(function ($node) {
|
||||
|
@ -115,9 +115,11 @@ class TelemetryCollectionService
|
|||
'backup' => [
|
||||
'type' => config('backups.default'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'type' => config('cache.default'),
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'type' => config('database.default'),
|
||||
'version' => DB::getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION),
|
||||
|
@ -138,7 +140,10 @@ class TelemetryCollectionService
|
|||
|
||||
'eggs' => [
|
||||
'count' => Egg::count(),
|
||||
'ids' => Egg::pluck('uuid')->toArray(),
|
||||
'server_usage' => Egg::all()
|
||||
->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()])
|
||||
->filter(fn (int $count) => $count > 0)
|
||||
->toArray(),
|
||||
],
|
||||
|
||||
'locations' => [
|
||||
|
@ -151,6 +156,10 @@ class TelemetryCollectionService
|
|||
|
||||
'nests' => [
|
||||
'count' => Nest::count(),
|
||||
'server_usage' => Nest::all()
|
||||
->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())])
|
||||
->filter(fn (int $count) => $count > 0)
|
||||
->toArray(),
|
||||
],
|
||||
|
||||
'nodes' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue