From 8a54deba3d4d5421b3b53e91930064f036576b46 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 9 Jul 2019 15:45:30 -0400 Subject: [PATCH] Unify individual database configuration options All database configuration is now done using MAYAN_DATABASES to mirror Django way of doing database setup. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docs/chapters/deploying.rst | 10 ++++------ docs/releases/3.3.rst | 2 ++ mayan/apps/platform/classes.py | 25 +++---------------------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 84551e6da1..3ff767725a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,8 @@ CONFIGURATION_LAST_GOOD_FILEPATH (MAYAN_CONFIGURATION_LAST_GOOD_FILEPATH environment variable) settings. - Move bootstrapped settings code to their own module in the smart_settings apps. +- Remove individual database configuration options. All database configuration + is now done using MAYAN_DATABASES to mirror Django way of doing database setup. 3.2.5 (2019-07-05) ================== diff --git a/docs/chapters/deploying.rst b/docs/chapters/deploying.rst index 425f3274f9..d3016b98a3 100644 --- a/docs/chapters/deploying.rst +++ b/docs/chapters/deploying.rst @@ -127,9 +127,8 @@ For another setup that offers more performance and scalability refer to the :: - sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \ - MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \ - MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \ + sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \ + MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \ /opt/mayan-edms/bin/mayan-edms.py initialsetup @@ -148,9 +147,8 @@ For another setup that offers more performance and scalability refer to the ------------------------------------------------------------------------ :: - sudo MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \ - MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \ - MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \ + sudo mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \ + MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \ /opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf diff --git a/docs/releases/3.3.rst b/docs/releases/3.3.rst index 1c8fd00d20..74d0e402af 100644 --- a/docs/releases/3.3.rst +++ b/docs/releases/3.3.rst @@ -34,6 +34,8 @@ Changes CONFIGURATION_LAST_GOOD_FILEPATH (MAYAN_CONFIGURATION_LAST_GOOD_FILEPATH environment variable) settings. - Move bootstrapped settings code to their own module in the smart_settings apps. +- Remove individual database configuration options. All database configuration + is now done using MAYAN_DATABASES to mirror Django way of doing database setup. Removals -------- diff --git a/mayan/apps/platform/classes.py b/mayan/apps/platform/classes.py index 1d0152442f..9f897fbf7f 100644 --- a/mayan/apps/platform/classes.py +++ b/mayan/apps/platform/classes.py @@ -125,28 +125,9 @@ class PlatformTemplateSupervisord(PlatformTemplate): environment_name='MAYAN_GUNICORN_TIMEOUT' ), Variable( - name='DATABASE_CONN_MAX_AGE', default=0, - environment_name='MAYAN_DATABASE_CONN_MAX_AGE' - ), - Variable( - name='DATABASE_ENGINE', default='django.db.backends.postgresql', - environment_name='MAYAN_DATABASE_ENGINE' - ), - Variable( - name='DATABASE_HOST', default='127.0.0.1', - environment_name='MAYAN_DATABASE_HOST' - ), - Variable( - name='DATABASE_NAME', default='mayan', - environment_name='MAYAN_DATABASE_NAME' - ), - Variable( - name='DATABASE_PASSWORD', default='mayanuserpass', - environment_name='MAYAN_DATABASE_PASSWORD' - ), - Variable( - name='DATABASE_USER', default='mayan', - environment_name='MAYAN_DATABASE_USER' + name='DATABASES', + default="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}", + environment_name='MAYAN_DATABASES' ), Variable( name='INSTALLATION_PATH', default='/opt/mayan-edms',