diff --git a/.env.docker b/.env.docker index 05f2035445..28b1973148 100644 --- a/.env.docker +++ b/.env.docker @@ -22,7 +22,7 @@ LOG_CHANNEL=${LOG_CHANNEL} # Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III # If you use SQLite, set connection to `sqlite` and remove the database, username and password settings. -DB_CONNECTION=mysql +DB_CONNECTION=${FF_DB_CONNECTION} DB_HOST=${FF_DB_HOST} DB_PORT=${FF_DB_PORT} DB_DATABASE=${FF_DB_NAME} diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index f7c935ac75..2df70e8f2b 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -55,6 +55,9 @@ class Range // set more view variables: $this->configureList(); + + // flash a big fat warning when users use SQLite in Docker + $this->loseItAll($request); } return $next($request); @@ -99,6 +102,18 @@ class Range View::share('defaultCurrency', $defaultCurrency); } + /** + * @param Request $request + */ + private function loseItAll(Request $request) + { + if (getenv('DB_CONNECTION') === 'sqlite' && getenv('IS_DOCKER') === true) { + $request->session()->flash( + 'error', 'You seem to be using SQLite in a Docker container. Don\'t do this. If the container restarts all your data will be gone.' + ); + } + } + /** * */