From 5c016f0993fb557052cce7e11cd6ad818bd7c3a3 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Fri, 25 Aug 2017 12:13:03 +0100 Subject: [PATCH] Update docs to more accurately reflect the SERVER_MODE config requirements. --- docs/en_US/desktop_deployment.rst | 39 ++++++++----------------------- docs/en_US/server_deployment.rst | 18 +++++++------- 2 files changed, 18 insertions(+), 39 deletions(-) diff --git a/docs/en_US/desktop_deployment.rst b/docs/en_US/desktop_deployment.rst index 9f2515a18..036450f81 100644 --- a/docs/en_US/desktop_deployment.rst +++ b/docs/en_US/desktop_deployment.rst @@ -16,12 +16,13 @@ packages and users interested in understanding how pgAdmin works.** Configuration ************* -In order to configure pgAdmin to run in desktop mode, it is first necessary to -configure the Python code to run in single-user mode, and then to configure the -runtime to find and execute the code. +From pgAdmin 4 v2 onwards, the default configuration mode is server, however, +this is overridden by the desktop runtime at startup. In most environments, no +Python configuration is required unless you wish to override other default +settings. -Note that there are multiple configuration files that are read at startup by -pgAdmin. These are as follows: +There are multiple configuration files that are read at startup by pgAdmin. These +are as follows: * ``config.py``: This is the main configuration file, and should not be modified. It can be used as a reference for configuration settings, that may be overridden @@ -35,31 +36,11 @@ pgAdmin. These are as follows: for end users to change any default or packaging specific settings that they may wish to adjust to meet local preferences or standards. -Python ------- +NOTE: If the SERVER_MODE setting is changed in ``config_distro.py`` or ``config_local.py``, +you will most likely need to re-set the LOG_FILE, SQLITE_PATH, SESSION_DB_PATH +and STORAGE_DIR values as well as they will have been set based on the default +configuration or overridden by the runtime. -In order to configure the Python code, follow these steps: - -1. Ensure that any existing configuration database (``pgadmin4.db``) is moved - out of the way in the ``web/`` directory containing the pgAdmin Python code. - -2. Create a ``config_local.py`` file alongside the existing ``config.py`` file. - -3. Edit ``config_local.py`` and add the following setting: - - .. code-block:: python - - SERVER_MODE = False - -4. Run the following command to create the configuration database: - - .. code-block:: bash - - $ python setup.py - -Alternatively, you can simply run ``pgAdmin4.py`` at this point or at a later time, -and ``pgadmin4.db`` will be created automatically at first run. - Runtime ------- diff --git a/docs/en_US/server_deployment.rst b/docs/en_US/server_deployment.rst index bf45fb790..39d4e7ddd 100644 --- a/docs/en_US/server_deployment.rst +++ b/docs/en_US/server_deployment.rst @@ -46,7 +46,7 @@ little practical gain. Configuration ************* -In order to configure pgAdmin to run in server mode, it is first necessary to +In order to configure pgAdmin to run in server mode, it may be necessary to configure the Python code to run in multi-user mode, and then to configure the web server to find and execute the code. @@ -68,19 +68,17 @@ pgAdmin. These are as follows: Python ------ +From pgAdmin 4 v2 onwards, server mode is the default configuration. If running under +the desktop runtime, this is overridden automatically. There should typically be no +need to modify the configuration simply to enable server mode to work, however it may +be desirable to adjust some of the paths used. + In order to configure the Python code, follow these steps: 1. Create a ``config_local.py`` file alongside the existing ``config.py`` file. -2. Edit ``config_local.py`` and add the following setting: - - .. code-block:: python - - SERVER_MODE = True - -3. In most cases, the default file locations are setup for running in desktop mode. - Add settings similar to the following to ``config_local.py`` to use paths suitable - for server mode. +2. Edit ``config_local.py`` and add the following settings. In most cases, the default + file locations should be appropriate: *NOTE: You must ensure the directories specified are writeable by the user that the web server processes will be running as, e.g. apache or www-data.*