diff --git a/doc/rest_api.rst b/doc/rest_api.rst index 13cb23ef7..74159185f 100644 --- a/doc/rest_api.rst +++ b/doc/rest_api.rst @@ -11,13 +11,14 @@ documentation. **You will find them using the following url patterns:** * New API+Docs: *https:///api/schema-v2/swagger/* -* Old API: *http:///api/v1/ +* Old API: *http:///api/v1/* * (Old) Documentation: *http:///docs/api/* **Examples:** * `new example `_ * `old example `_ + documentation is available on the official demo. Using this API requires an authentication and for now, only a token diff --git a/doc/upgrade.rst b/doc/upgrade.rst index 5097873b8..8245b937f 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -50,6 +50,23 @@ Make sure to use root privileges and run the following command: Then, reload postfix. +New-admin interface +=================== + +.. note:: + You don't need to perform these actions if you use the installer to upgrade your instance. + +New admin interface won't update by itself. Run the following commands to update it: + +.. sourcecode:: bash + + > sudo -u -i bash + > cd + > cp frontend/config.json ./ + > rm -rf frontend + > cp -R /lib/pythonX.X/site-packages/modoboa/frontend_dist/ frontend/ + > cp ./config.json frontend/config.json + Extensions ********** @@ -124,13 +141,13 @@ The following modifications must be applied to the :file:`settings.py` file: ] -* Add the following variable:: +* Add the following variable: .. sourcecode:: python PID_FILE_STORAGE_PATH = '/var/run' -* Update ``LOGGING`` variable to define an address for ``syslog-auth`` handler:: +* Update ``LOGGING`` variable to define an address for ``syslog-auth`` handler: .. sourcecode:: python @@ -142,9 +159,8 @@ The following modifications must be applied to the :file:`settings.py` file: }, -* You now have the possibility to customize the url of the new-admin -interface. To do so please head up to :ref:`the custom configuration -chapter ` (advanced user). +* You now have the possibility to customize the url of the new-admin interface. + To do so please head up to :ref:`the custom configuration chapter ` (advanced user). * Add ``DEFAULT_THROTTLE_RATES`` to ``REST_FRAMEWORK``: diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index 22bf058ee..3c46fb253 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -213,7 +213,7 @@ REST_FRAMEWORK = { } # Uncomment if you need a custom sub url for new_admin interface -# NEW_ADMIN_URL = 'new_admin' +# NEW_ADMIN_URL = 'new-admin' SPECTACULAR_SETTINGS = { 'SCHEMA_PATH_PREFIX': r'/api/v[0-9]', diff --git a/modoboa/core/context_processors.py b/modoboa/core/context_processors.py index 2f9126ec4..6b967b758 100644 --- a/modoboa/core/context_processors.py +++ b/modoboa/core/context_processors.py @@ -25,5 +25,5 @@ def top_notifications(request): def new_admin_url(*args): """A context processor to include new admin url.""" return { - "new_admin": getattr(settings, "NEW_ADMIN_URL", "new_admin") + "new_admin": getattr(settings, "NEW_ADMIN_URL", "new-admin") } diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index f0d1b63de..19ce64b57 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -205,7 +205,7 @@ REST_FRAMEWORK = { } # Uncomment if you need a custom sub url for new_admin interface -# NEW_ADMIN_URL = 'new_admin' +# NEW_ADMIN_URL = 'new-admin' SPECTACULAR_SETTINGS = { 'SCHEMA_PATH_PREFIX': r'/api/v[0-9]',