diff --git a/app/Console/Commands/Environment/AppSettingsCommand.php b/app/Console/Commands/Environment/AppSettingsCommand.php index 8b9aad48e..e3ffbcfbc 100644 --- a/app/Console/Commands/Environment/AppSettingsCommand.php +++ b/app/Console/Commands/Environment/AppSettingsCommand.php @@ -44,7 +44,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 = []; @@ -119,6 +120,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'; diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a00b17b6d..f79e6c905 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -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. diff --git a/app/Services/Telemetry/TelemetryCollectionService.php b/app/Services/Telemetry/TelemetryCollectionService.php index ca157694e..6c1b527ef 100644 --- a/app/Services/Telemetry/TelemetryCollectionService.php +++ b/app/Services/Telemetry/TelemetryCollectionService.php @@ -52,10 +52,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) {