diff --git a/.env.example b/.env.example index 95607b2e37..6a128b13df 100644 --- a/.env.example +++ b/.env.example @@ -26,11 +26,7 @@ MAIL_FROM_ADDRESS=no-reply@example.com MAIL_FROM_NAME="Pelican Admin" # Set this to your domain to prevent it defaulting to 'localhost', causing mail servers such as Gmail to reject your mail # MAIL_EHLO_DOMAIN=panel.example.com + SESSION_ENCRYPT=false SESSION_PATH=/ SESSION_DOMAIN=null - -# Set this to true, and set start & end ports to auto create allocations. -PANEL_CLIENT_ALLOCATIONS_ENABLED=false -PANEL_CLIENT_ALLOCATIONS_RANGE_START= -PANEL_CLIENT_ALLOCATIONS_RANGE_END= diff --git a/app/Filament/Pages/Settings.php b/app/Filament/Pages/Settings.php index 06513b47a1..5ec862795e 100644 --- a/app/Filament/Pages/Settings.php +++ b/app/Filament/Pages/Settings.php @@ -102,10 +102,10 @@ private function generalSettings(): array ->offColor('danger') ->formatStateUsing(fn ($state): bool => (bool) $state) ->afterStateUpdated(fn ($state, Set $set) => $set('APP_DEBUG', (bool) $state)) - ->default(env('RECAPTCHA_ENABLED', config('recaptcha.enabled'))), + ->default(env('APP_DEBUG', config('app.debug'))), ToggleButtons::make('FILAMENT_TOP_NAVIGATION') ->label('Navigation') - ->grouped() + ->inline() ->options([ false => 'Sidebar', true => 'Topbar', @@ -115,7 +115,7 @@ private function generalSettings(): array ->default(env('FILAMENT_TOP_NAVIGATION', config('panel.filament.top-navigation'))), ToggleButtons::make('PANEL_USE_BINARY_PREFIX') ->label('Unit prefix') - ->grouped() + ->inline() ->options([ false => 'Decimal Prefix (MB/ GB)', true => 'Binary Prefix (MiB/ GiB)', @@ -125,7 +125,7 @@ private function generalSettings(): array ->default(env('PANEL_USE_BINARY_PREFIX', config('panel.use_binary_prefix'))), ToggleButtons::make('APP_2FA_REQUIRED') ->label('2FA Requirement') - ->grouped() + ->inline() ->options([ 0 => 'Not required', 1 => 'Required for only Admins', @@ -209,7 +209,7 @@ private function mailSettings(): array ToggleButtons::make('MAIL_MAILER') ->label('Mail Driver') ->columnSpanFull() - ->grouped() + ->inline() ->options([ 'log' => 'Print mails to Log', 'smtp' => 'SMTP Server', @@ -284,7 +284,7 @@ private function mailSettings(): array ToggleButtons::make('MAIL_ENCRYPTION') ->label('SMTP encryption') ->required() - ->grouped() + ->inline() ->options(['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None']) ->default(env('MAIL_ENCRYPTION', config('mail.mailers.smtp.encryption', 'tls'))), ]), @@ -314,7 +314,7 @@ private function backupSettings(): array ToggleButtons::make('APP_BACKUP_DRIVER') ->label('Backup Driver') ->columnSpanFull() - ->grouped() + ->inline() ->options([ Backup::ADAPTER_DAEMON => 'Wings', Backup::ADAPTER_AWS_S3 => 'S3', @@ -532,6 +532,9 @@ public function save(): void try { $data = $this->form->getState(); + // Convert bools to a string, so they are correctly written to the .env file + $data = array_map(fn ($value) => is_bool($value) ? ($value ? 'true' : 'false') : $value, $data); + $this->writeToEnvironment($data); Artisan::call('config:clear');