diff --git a/doc/manual_installation/webserver.rst b/doc/manual_installation/webserver.rst index 7badb4f2c..47bcd4a6d 100644 --- a/doc/manual_installation/webserver.rst +++ b/doc/manual_installation/webserver.rst @@ -43,18 +43,18 @@ following content inside:: Require all granted - Alias /new-admin /frontend - /frontend> - Options FollowSymLinks - Require all granted - - - WSGIScriptAlias / /instance/wsgi.py + WSGIScriptAliasMatch ^/(api|accounts) /instance/wsgi.py WSGIApplicationGroup %{GLOBAL} # Pass Authorization header to enable API usage: WSGIPassAuthorization On + Alias / /frontend + /frontend> + Options FollowSymLinks + Require all granted + + LogLevel info @@ -157,7 +157,13 @@ Here is a sample nginx configuration:: try_files $uri $uri/ =404; } - location ^~ /new-admin { + location ~ ^/(api|accounts) { + include uwsgi_params; + uwsgi_param UWSGI_SCRIPT instance.wsgi:application; + uwsgi_pass modoboa; + } + + location / { alias /frontend/; index index.html; @@ -167,13 +173,6 @@ Here is a sample nginx configuration:: try_files $uri $uri/ /index.html = 404; } - - location / { - include uwsgi_params; - uwsgi_param UWSGI_SCRIPT instance.wsgi:application; - uwsgi_pass modoboa; - } - %{extra_config} } ````, ````, ```` and ```` must be replaced by the value you used. diff --git a/doc/upgrade.rst b/doc/upgrade.rst index b14f2b8aa..9adc118f7 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -151,7 +151,13 @@ Specific instructions Version 2.4.0 ============= -Legacy web interface has been removed and all extensions have been +.. warning:: + + The ``modoboa-amavis`` extension has not been migrated into the + core Modoboa package yet. If you are using it, **you cannot install + version 2.4.0 yet**. + +Legacy web interface has been removed and almost all extensions have been integrated to the core Modoboa package. Pre update @@ -175,18 +181,22 @@ Pre update > echo "UPDATE django_content_type SET app_label='autoreply' WHERE app_label='postfix_autoreply'" | mysql -u root -p modoboa > echo "UPDATE django_migrations SET app='autoreply' WHERE app='postfix_autoreply'" | mysql -u root -p modoboa + > echo "UPDATE django_content_type SET app_label='contacts' WHERE app_label='modoboa_contacts'" | mysql -u root -p modoboa + > echo "UPDATE django_migrations SET app='contacts' WHERE app='modoboa_contacts'" | mysql -u root -p modoboa + > echo "UPDATE django_content_type SET app_label='calendars' WHERE app_label='modoboa_radicale'" | mysql -u root -p modoboa + > echo "UPDATE django_migrations SET app='calendars' WHERE app='modoboa_radicale'" | mysql -u root -p modoboa Required changes to :file:`settings.py` --------------------------------------- -- Rename the following extensions: +- Rename the following extensions in the ``MODOBOA_APPS`` variable: - - modoboa.postfix_autoreply -> modoboa.autoreply - - modoboa_contacts -> modoboa.contacts - - modoboa_radicale -> modoboa.calendars - - modoboa_webmail -> modoboa.webmail + - ``modoboa.postfix_autoreply`` -> ``modoboa.autoreply`` + - ``modoboa_contacts`` -> ``modoboa.contacts`` + - ``modoboa_radicale`` -> ``modoboa.calendars`` + - ``modoboa_webmail`` -> ``modoboa.webmail`` -- Remove configuration blocks related to modoboa_contacts and modoboa_radicale plugins +- Remove configuration blocks related to ``modoboa_contacts`` and ``modoboa_radicale`` plugins - Remove ``AjaxLoginRedirect`` from ``MIDDLEWARE`` variable: @@ -218,10 +228,16 @@ Required changes to :file:`settings.py` Post update ----------- -Run the following command:: +- Run the following command:: $ python manage.py load_initial_data +- Update your :ref:`webserver ` configuration + +- Remove ``autoreply`` service definition from postfix`s :file:`master.cf` file if you were using it + +- Then proceed with regular upgrade instructions + Version 2.3.3 ============= diff --git a/modoboa/webmail/lib/imapemail.py b/modoboa/webmail/lib/imapemail.py index 2ca4fffe0..04af9817a 100644 --- a/modoboa/webmail/lib/imapemail.py +++ b/modoboa/webmail/lib/imapemail.py @@ -208,7 +208,7 @@ class ImapEmail(Email): if re.search(r"\.\.", cid): continue fname = f"{self.mailid}_{cid}" - path = get_storage_path(fname) + path = os.path.relpath(get_storage_path(fname), settings.MEDIA_ROOT) params["fname"] = os.path.join( settings.MEDIA_URL, os.path.basename(get_storage_path("")), fname )