From 889bb9a2807fb2e125b112383d6962ff393c5c5f Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 28 Apr 2021 11:09:53 +0200 Subject: [PATCH] Allow sysadmins to change data/ path --- CHANGELOG.md | 9 +++++++++ configuration/environment_development.php | 2 ++ configuration/environment_production.php | 2 ++ env.sample | 8 ++++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c42a44..d757a053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog of flusio +## 2021-xx-yy - v0.21 + +### Migration notes + +The `data/` directory can now contain big files (OPML importations). You can +move it to a different location by setting the `APP_DATA_PATH` variable in your +`.env` file. **Make sure to move the `data/migrations\_version.txt` file as +well!** + ## 2021-04-24 - v0.20 ### Improvements diff --git a/configuration/environment_development.php b/configuration/environment_development.php index 9692ca3b..54480eb2 100644 --- a/configuration/environment_development.php +++ b/configuration/environment_development.php @@ -39,6 +39,8 @@ 'cli_locale' => $dotenv->pop('CLI_LOCALE'), ], + 'data_path' => $dotenv->pop('APP_DATA_PATH', $app_path . '/data'), + 'database' => [ 'dsn' => "pgsql:host={$db_host};port={$db_port};dbname={$db_name}", 'username' => $dotenv->pop('DB_USERNAME'), diff --git a/configuration/environment_production.php b/configuration/environment_production.php index 600f8266..aaa828c4 100644 --- a/configuration/environment_production.php +++ b/configuration/environment_production.php @@ -23,6 +23,8 @@ 'port' => intval($dotenv->pop('APP_PORT', '443')), ], + 'data_path' => $dotenv->pop('APP_DATA_PATH', $app_path . '/data'), + 'application' => [ 'support_email' => $dotenv->pop('APP_SUPPORT_EMAIL'), 'brand' => $dotenv->pop('APP_BRAND', 'flusio'), diff --git a/env.sample b/env.sample index 61f76e20..7abc763a 100644 --- a/env.sample +++ b/env.sample @@ -23,14 +23,18 @@ APP_PORT=8000 # subpath. # APP_PATH=/ +# You can uncomment and change the path for the data. Default is the data +# directory presents in the current directory. +# APP_DATA_PATH=/path/to/data + # You can uncomment and change the path for the cache. Default is the cache # directory presents in the current directory. -# APP_CACHE_PATH=/tmp +# APP_CACHE_PATH=/path/to/cache # You can uncomment and change the path for the media files. Default is the # media directory presents in the public/ directory. If you change this value, # make sure the /media URL path is correctly served by your Web server. -# APP_MEDIA_PATH=/some/path/to/media +# APP_MEDIA_PATH=/path/to/media ################################## # Database environment variables #