[ 'app:name' => 'Pterodactyl', 'pterodactyl:auth:2fa_required' => 0, 'app:locale' => 'en', ], 'mail' => [ 'mail:default' => 'smtp', 'mail:mailers:smtp:host' => 'mail.example.com', 'mail:mailers:smtp:port' => 587, 'mail:mailers:smtp:encryption' => 'tls', 'mail:mailers:smtp:username' => 'panel@example.com', 'mail:mailers:smtp:password' => '', 'mail:from:address' => 'panel@example.com', 'mail:from:name' => 'Pterodactyl', ], 'advanced' => [ 'recaptcha:enabled' => false, 'recaptcha:secret_key' => '', 'recaptcha:website_key' => 'website', 'pterodactyl:guzzle:timeout' => 15, 'pterodactyl:guzzle:connect_timeout' => 5, 'pterodactyl:client_features:allocations:enabled' => false, 'pterodactyl:client_features:allocations:range_start' => null, 'pterodactyl:client_features:allocations:range_end' => null, ], 'meta' => [ 'load_environment_only' => false, 'show_recaptcha_warning' => false, ], ]; /** * Return current panel settings. */ #[Endpoint('Get settings', 'Returns current general, mail, advanced, and metadata settings.')] #[ScribeResponse(self::SETTINGS_EXAMPLE, description: 'Settings returned.')] public function index(GetSettingsRequest $request): JsonResponse { return new JsonResponse([ 'general' => [ 'app:name' => config('app.name'), 'pterodactyl:auth:2fa_required' => JsonValueGuard::integer(config('pterodactyl.auth.2fa_required')), 'app:locale' => config('app.locale'), ], 'mail' => [ 'mail:default' => config('mail.default'), 'mail:mailers:smtp:host' => config('mail.mailers.smtp.host'), 'mail:mailers:smtp:port' => JsonValueGuard::integer(config('mail.mailers.smtp.port')), 'mail:mailers:smtp:encryption' => config('mail.mailers.smtp.encryption'), 'mail:mailers:smtp:username' => config('mail.mailers.smtp.username'), // Never return the SMTP password to the client. 'mail:mailers:smtp:password' => '', 'mail:from:address' => config('mail.from.address'), 'mail:from:name' => config('mail.from.name'), ], 'advanced' => [ 'recaptcha:enabled' => JsonValueGuard::boolean(config('recaptcha.enabled')), 'recaptcha:secret_key' => '', 'recaptcha:website_key' => config('recaptcha.website_key'), 'pterodactyl:guzzle:timeout' => JsonValueGuard::integer(config('pterodactyl.guzzle.timeout')), 'pterodactyl:guzzle:connect_timeout' => JsonValueGuard::integer(config('pterodactyl.guzzle.connect_timeout')), 'pterodactyl:client_features:allocations:enabled' => JsonValueGuard::boolean(config('pterodactyl.client_features.allocations.enabled')), 'pterodactyl:client_features:allocations:range_start' => config('pterodactyl.client_features.allocations.range_start'), 'pterodactyl:client_features:allocations:range_end' => config('pterodactyl.client_features.allocations.range_end'), ], 'meta' => [ 'load_environment_only' => JsonValueGuard::boolean(config('pterodactyl.load_environment_only', false)), 'show_recaptcha_warning' => config('recaptcha._shipped_secret_key') === config('recaptcha.secret_key') || config('recaptcha._shipped_website_key') === config('recaptcha.website_key'), ], ]); } }