diff --git a/.github/docker/entrypoint.sh b/.github/docker/entrypoint.sh index b6aac4daae..9a801e2d94 100644 --- a/.github/docker/entrypoint.sh +++ b/.github/docker/entrypoint.sh @@ -21,6 +21,9 @@ else echo -e "APP_KEY exists in environment, using that." echo -e "APP_KEY=$APP_KEY" > /pelican-data/.env fi + + ## enable installer + echo -e "APP_INSTALLED=false" >> /pelican-data/.env fi mkdir /pelican-data/database diff --git a/app/Filament/Pages/Installer/Steps/DatabaseStep.php b/app/Filament/Pages/Installer/Steps/DatabaseStep.php index 29c47b3290..5a0d6b7368 100644 --- a/app/Filament/Pages/Installer/Steps/DatabaseStep.php +++ b/app/Filament/Pages/Installer/Steps/DatabaseStep.php @@ -30,25 +30,25 @@ public static function make(PanelInstaller $installer): Step ->label('Database Host') ->hintIcon('tabler-question-mark') ->hintIconTooltip('The host of your database. Make sure it is reachable.') - ->required() - ->default(env('DB_HOST', '127.0.0.1')) + ->required(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite') + ->default(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite' ? env('DB_HOST', '127.0.0.1') : null) ->hidden(fn (Get $get) => $get('env_general.DB_CONNECTION') === 'sqlite'), TextInput::make('env_database.DB_PORT') ->label('Database Port') ->hintIcon('tabler-question-mark') ->hintIconTooltip('The port of your database.') - ->required() + ->required(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite') ->numeric() ->minValue(1) ->maxValue(65535) - ->default(env('DB_PORT', 3306)) + ->default(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite' ? env('DB_PORT', 3306) : null) ->hidden(fn (Get $get) => $get('env_general.DB_CONNECTION') === 'sqlite'), TextInput::make('env_database.DB_USERNAME') ->label('Database Username') ->hintIcon('tabler-question-mark') ->hintIconTooltip('The name of your database user.') - ->required() - ->default(env('DB_USERNAME', 'pelican')) + ->required(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite') + ->default(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite' ? env('DB_USERNAME', 'pelican') : null) ->hidden(fn (Get $get) => $get('env_general.DB_CONNECTION') === 'sqlite'), TextInput::make('env_database.DB_PASSWORD') ->label('Database Password') @@ -56,7 +56,7 @@ public static function make(PanelInstaller $installer): Step ->hintIconTooltip('The password of your database user. Can be empty.') ->password() ->revealable() - ->default(env('DB_PASSWORD')) + ->default(fn (Get $get) => $get('env_general.DB_CONNECTION') !== 'sqlite' ? env('DB_PASSWORD') : null) ->hidden(fn (Get $get) => $get('env_general.DB_CONNECTION') === 'sqlite'), ]) ->afterValidation(function (Get $get) use ($installer) { diff --git a/compose.yml b/compose.yml index 23d2f2a397..6dab7145e3 100644 --- a/compose.yml +++ b/compose.yml @@ -5,9 +5,7 @@ x-common: ADMIN_EMAIL: "USEYOUROWNEMAILHERE@example.com" APP_DEBUG: "false" - APP_ENVIRONMENT_ONLY: "false" APP_ENV: "production" - SESSION_DRIVER: "file" mail: &mail-environment