Skip to content

Commit

Permalink
Follow up installer fixes (#621)
Browse files Browse the repository at this point in the history
* enable installer on docker first run

* add SESSION_COOKIE to compose file

* `APP_ENVIRONMENT_ONLY` is long gone

* session env vars no longer needed after #624

* set defaults to null if sqlite is selected
  • Loading branch information
Boy132 authored Oct 15, 2024
1 parent c5c0515 commit f2063d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions app/Filament/Pages/Installer/Steps/DatabaseStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@ 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')
->hintIcon('tabler-question-mark')
->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) {
Expand Down
2 changes: 0 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ x-common:
ADMIN_EMAIL: "[email protected]"

APP_DEBUG: "false"
APP_ENVIRONMENT_ONLY: "false"
APP_ENV: "production"
SESSION_DRIVER: "file"

mail:
&mail-environment
Expand Down

0 comments on commit f2063d7

Please sign in to comment.