From 2e3ecf5818e4b7f99e1a0b491e9617c571f36416 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 2 Mar 2017 15:46:56 +0100 Subject: [PATCH] Updated documentation. --- doc/upgrade.rst | 80 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/doc/upgrade.rst b/doc/upgrade.rst index 8c927c1b7..1aea7dfa0 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -34,7 +34,7 @@ Then, run the following commands: Once done, check if the version you are installing requires :ref:`specific_upgrade_instructions`. - + Finally, restart your web server. Sometimes, you might need to upgrade postfix map files too. To do so, @@ -87,9 +87,63 @@ Specific instructions 1.7.0 ===== -Modoboa used to provide a custom authentication backend -(``modoboa.lib.authbackends.SimpleBackend``) but it has been -removed. Please modify you :file:`settings.py` file as follows: +This version requires Django >= 1.10 so you need to make some +modifications. It also brings internal API changes which are not +backward compatible so installed extensions must be upgraded too. + +First of all, deactivate all installed extensions (edit the +:file:`settings.py` file and comment the corresponding lines in +``MODOBOA_APPS``). + +Edit the :file:`urls.py` file of your local instance and replace its +content by the following one: + +.. sourcecode:: python + + from django.conf.urls import include, url + + urlpatterns = [ + url(r'', include('modoboa.urls')), + ] + +Edit the :file:`settings.py` and apply the following changes: + +* Add ``'modoboa.parameters'`` to ``MODOBOA_APPS``: + +.. sourcecode:: python + + MODOBOA_APPS = ( + 'modoboa', + 'modoboa.core', + 'modoboa.lib', + 'modoboa.admin', + 'modoboa.relaydomains', + 'modoboa.limits', + 'modoboa.parameters', + # Modoboa extensions here. + ) + +* Add ``'modoboa.core.middleware.LocalConfigMiddleware'`` to ``MIDDLEWARE_CLASSES``: + +.. sourcecode:: python + + MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'modoboa.core.middleware.LocalConfigMiddleware', + 'modoboa.lib.middleware.AjaxLoginRedirect', + 'modoboa.lib.middleware.CommonExceptionCatcher', + 'modoboa.lib.middleware.RequestCatcherMiddleware', + ) + +* Modoboa used to provide a custom authentication backend + (``modoboa.lib.authbackends.SimpleBackend``) but it has been + removed. Replace it as follows: .. sourcecode:: python @@ -98,6 +152,18 @@ removed. Please modify you :file:`settings.py` file as follows: 'django.contrib.auth.backends.ModelBackend', ) +Run the following commands (load virtualenv if you use one): + +.. sourcecode:: bash + + > sudo -u -i + > source /bin/activate + > cd + > python manage.py migrate + > python manage.py collectstatic + +Finally, upgrade your extensions and reactivate them. + 1.6.1 ===== @@ -154,7 +220,7 @@ Command line shortcut: You have to upgrade extensions due to `core.User` model attribute change (`user.group` to `user.role`). Otherwise, you will have an internal error after upgrade. - In particular: `modoboa-amavisd https://github.com/modoboa/modoboa-amavis/commit/35df4e48b124e56df930cda8c013af0c1fcaabf3`_, `modoboa-stats https://github.com/modoboa/modoboa-stats/commit/aa4a39ce65eb306ad6dec30a54eb58945b120274`_, `modoboa-postfix-autoreply `_ are concerned. + In particular: `modoboa-amavisd `_, `modoboa-stats `_, `modoboa-postfix-autoreply `_ are concerned. An interesting feature brougth by this version is the capability to make different checks about MX records. For example, Modoboa can @@ -407,8 +473,8 @@ Here are the required steps: #. The cleanup job has been renamed in Django, so you have to modify your crontab entry:: - - 0 0 * * * /manage.py cleanup - + 0 0 * * * /manage.py clearsessions + - 0 0 * * * /manage.py cleanup + + 0 0 * * * /manage.py clearsessions 1.2.0 =====