From fc727cdc0f317e52a7b16c680ce80ffc42d64139 Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:45:29 +0530 Subject: [PATCH 1/8] feat: remove extra background from code block. --- source/install/prepare-mattermost-database.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 5112e811426..6653f287406 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -16,9 +16,9 @@ To set up a PostgreSQL database for use by the Mattermost server: 2. Access PostgreSQL by running: - .. code-block:: sh +.. code-block:: sh - sudo -u postgres psql + sudo -u postgres psql 3. Create the Mattermost database by running: From 251119caaf3d2d394c87b005a074cf2edc81e915 Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:46:23 +0530 Subject: [PATCH 2/8] feat: remove extra background from code block of point 3. --- source/install/prepare-mattermost-database.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 6653f287406..de361fa2466 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -22,17 +22,17 @@ To set up a PostgreSQL database for use by the Mattermost server: 3. Create the Mattermost database by running: - .. tab:: Ubuntu +.. tab:: Ubuntu - .. code-block:: SQL + .. code-block:: SQL - CREATE DATABASE mattermost; + CREATE DATABASE mattermost; - .. tab:: Red Hat +.. tab:: Red Hat - .. code-block:: SQL + .. code-block:: SQL - CREATE DATABASE mattermost WITH ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0; + CREATE DATABASE mattermost WITH ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0; 4. Create the Mattermost user *mmuser* by running the following command. Ensure you use a password that's more secure than ``mmuser-password``. From 52202e067e9f27d9d6c60db3b102493f008f474d Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:46:52 +0530 Subject: [PATCH 3/8] feat: remove extra background from code block of point 4. --- source/install/prepare-mattermost-database.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index de361fa2466..0fee1ebc550 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -36,9 +36,9 @@ To set up a PostgreSQL database for use by the Mattermost server: 4. Create the Mattermost user *mmuser* by running the following command. Ensure you use a password that's more secure than ``mmuser-password``. - .. code-block:: SQL +.. code-block:: SQL - CREATE USER mmuser WITH PASSWORD 'mmuser-password'; + CREATE USER mmuser WITH PASSWORD 'mmuser-password'; 5. If you're configuring PostgreSQL v15.x or later: From 59023afdc0ac71fb149b01905e46d5e16bb0e43c Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:47:55 +0530 Subject: [PATCH 4/8] feat: remove extra background from code block of point 5. --- .../install/prepare-mattermost-database.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 0fee1ebc550..8210c4df3cd 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -42,24 +42,24 @@ To set up a PostgreSQL database for use by the Mattermost server: 5. If you're configuring PostgreSQL v15.x or later: - a. Grant the user access to the Mattermost database by running: +a. Grant the user access to the Mattermost database by running: - .. code-block:: SQL +.. code-block:: SQL - GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser; - + GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser; + - b. Grant the user to change the owner of a database to a user ``mmuser`` by running: +b. Grant the user to change the owner of a database to a user ``mmuser`` by running: - .. code-block:: SQL +.. code-block:: SQL - ALTER DATABASE mattermost OWNER TO mmuser; + ALTER DATABASE mattermost OWNER TO mmuser; - c. Grant access to objects contained in the specified schema by running: +c. Grant access to objects contained in the specified schema by running: - .. code-block:: SQL +.. code-block:: SQL - GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mmuser; + GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mmuser; 6. Exit the PostgreSQL interactive terminal by running: From 1371cd541ec2a818085f3fa1a147b9c599a7e0d5 Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:48:34 +0530 Subject: [PATCH 5/8] feat: remove extra background from code block of point 6. --- source/install/prepare-mattermost-database.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 8210c4df3cd..f96b54ed741 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -63,9 +63,9 @@ c. Grant access to objects contained in the specified schema by running: 6. Exit the PostgreSQL interactive terminal by running: - .. code-block:: text +.. code-block:: text - \q + \q 7. (Optional) If you use separate servers for your database and the Mattermost server, you may allow PostgreSQL to listen on all assigned IP addresses. We recommend ensuring that only the Mattermost server is able to connect to the PostgreSQL port using a firewall. From e596aead3d15576bef9e23aa1a1e44e1a734f6ea Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:50:00 +0530 Subject: [PATCH 6/8] feat: remove extra background from code block of point 8. --- .../install/prepare-mattermost-database.rst | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index f96b54ed741..6275897f808 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -69,99 +69,99 @@ c. Grant access to objects contained in the specified schema by running: 7. (Optional) If you use separate servers for your database and the Mattermost server, you may allow PostgreSQL to listen on all assigned IP addresses. We recommend ensuring that only the Mattermost server is able to connect to the PostgreSQL port using a firewall. - .. tab:: Ubuntu +.. tab:: Ubuntu - Open ``/etc/postgresql/{version}/main/postgresql.conf`` as *root* in a text editor. - - Replace ``{version}`` with the version of PostgreSQL that's currently running. + Open ``/etc/postgresql/{version}/main/postgresql.conf`` as *root* in a text editor. + + Replace ``{version}`` with the version of PostgreSQL that's currently running. - a. Find the following line: ``#listen_addresses = 'localhost'`` + a. Find the following line: ``#listen_addresses = 'localhost'`` - b. Uncomment the line and change ``localhost`` to ``*``: ``listen_addresses = '*'`` + b. Uncomment the line and change ``localhost`` to ``*``: ``listen_addresses = '*'`` - c. Restart PostgreSQL for the change to take effect by running: + c. Restart PostgreSQL for the change to take effect by running: - .. code-block:: sh + .. code-block:: sh - sudo systemctl restart postgresql-{version} + sudo systemctl restart postgresql-{version} - .. tab:: Red Hat +.. tab:: Red Hat - Open ``/var/lib/pgsql/{version}/data/postgresql.conf`` as *root* in a text editor. + Open ``/var/lib/pgsql/{version}/data/postgresql.conf`` as *root* in a text editor. - Replace ``{version}`` with the version of PostgreSQL that's currently running. + Replace ``{version}`` with the version of PostgreSQL that's currently running. - a. Find the following line: ``#listen_addresses = 'localhost'`` + a. Find the following line: ``#listen_addresses = 'localhost'`` - b. Uncomment the line and change ``localhost`` to ``*``: ``listen_addresses = '*'`` + b. Uncomment the line and change ``localhost`` to ``*``: ``listen_addresses = '*'`` - c. Restart PostgreSQL for the change to take effect by running: + c. Restart PostgreSQL for the change to take effect by running: - .. code-block:: sh + .. code-block:: sh - sudo systemctl restart postgresql-{version} + sudo systemctl restart postgresql-{version} 8. Modify the file ``pg_hba.conf`` to allow the Mattermost server to communicate with the database by ensuring host connection types are set to ``trust``. - .. tab:: Ubuntu +.. tab:: Ubuntu - These host connections are specific to Ubuntu 20.04, and will differ depending on the operating system version you're running. For example, in Ubuntu 22.04, the ``peer`` connection types are listed as ``sha-256`` instead. + These host connections are specific to Ubuntu 20.04, and will differ depending on the operating system version you're running. For example, in Ubuntu 22.04, the ``peer`` connection types are listed as ``sha-256`` instead. - **Local Database (same server)** + **Local Database (same server)** - If the Mattermost server and the database are on the same machine: + If the Mattermost server and the database are on the same machine: - a. Open ``/etc/postgresql/{version}/main/pg_hba.conf`` as *root* in a text editor. + a. Open ``/etc/postgresql/{version}/main/pg_hba.conf`` as *root* in a text editor. - b. Find the following lines: + b. Find the following lines: - ``local all all peer`` + ``local all all peer`` - ``host all all ::1/128 ident`` + ``host all all ::1/128 ident`` - c. Change ``peer`` and ``ident`` to ``trust``: + c. Change ``peer`` and ``ident`` to ``trust``: - ``local all all trust`` + ``local all all trust`` - ``host all all ::1/128 trust`` + ``host all all ::1/128 trust`` - **Remote Database (separate server)** + **Remote Database (separate server)** - If the Mattermost server and the database are on different machines: + If the Mattermost server and the database are on different machines: - a. Open ``/etc/postgresql/{version}/main/pg_hba.conf`` in a text editor as *root* user. + a. Open ``/etc/postgresql/{version}/main/pg_hba.conf`` in a text editor as *root* user. - b. Add the following line to the end of the file, where ``{mattermost-server-IP}`` is the IP address of the Mattermost server: ``host all all {mattermost-server-IP}/32 md5``. + b. Add the following line to the end of the file, where ``{mattermost-server-IP}`` is the IP address of the Mattermost server: ``host all all {mattermost-server-IP}/32 md5``. - .. tab:: Red Hat +.. tab:: Red Hat - These host connections are specific to Red Hat 8, and will differ depending on the operating system version you're running. + These host connections are specific to Red Hat 8, and will differ depending on the operating system version you're running. - **Local Database (same server)** + **Local Database (same server)** - If the Mattermost server and the database are on the same machine: + If the Mattermost server and the database are on the same machine: - a. Open ``/var/lib/pgsql/{version}/data/pg_hba.conf`` as *root* in a text editor. + a. Open ``/var/lib/pgsql/{version}/data/pg_hba.conf`` as *root* in a text editor. - b. Find the following lines: + b. Find the following lines: - ``local all all peer`` + ``local all all peer`` - ``host all all ::1/128 scram-sha-256`` + ``host all all ::1/128 scram-sha-256`` - c. Change ``peer`` and ``ident`` to ``trust``: + c. Change ``peer`` and ``ident`` to ``trust``: - ``local all all trust`` + ``local all all trust`` - ``host all all ::1/128 trust`` + ``host all all ::1/128 trust`` - **Remote Database (separate server)** + **Remote Database (separate server)** - If the Mattermost server and the database are on different machines: + If the Mattermost server and the database are on different machines: - a. Open ```/var/lib/pgsql/{version}/data/pg_hba.conf`` in a text editor as *root* user. + a. Open ```/var/lib/pgsql/{version}/data/pg_hba.conf`` in a text editor as *root* user. - b. Add the following line to the end of the file, where ``{mattermost-server-IP}`` is the IP address of the Mattermost server: ``host all all {mattermost-server-IP}/32 md5``. + b. Add the following line to the end of the file, where ``{mattermost-server-IP}`` is the IP address of the Mattermost server: ``host all all {mattermost-server-IP}/32 md5``. 9. Reload PostgreSQL by running: From 37d794d2822ee3f16d834b04d2975023c9b755f1 Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:51:07 +0530 Subject: [PATCH 7/8] feat: remove extra background from code block of point 9. --- source/install/prepare-mattermost-database.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 6275897f808..5f8ed1f925f 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -165,9 +165,9 @@ c. Grant access to objects contained in the specified schema by running: 9. Reload PostgreSQL by running: - .. code-block:: sh +.. code-block:: sh - sudo systemctl reload postgresql-{version} + sudo systemctl reload postgresql-{version} 10. Verify that you can connect with the user *mmuser*. From 42d0a4944064ba21f28e3ee6c069ec7de2563b9a Mon Sep 17 00:00:00 2001 From: Lavanya Mishra Date: Mon, 7 Oct 2024 11:51:58 +0530 Subject: [PATCH 8/8] feat: remove extra background from code block of point 10. --- source/install/prepare-mattermost-database.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/install/prepare-mattermost-database.rst b/source/install/prepare-mattermost-database.rst index 5f8ed1f925f..a03b05f77e3 100644 --- a/source/install/prepare-mattermost-database.rst +++ b/source/install/prepare-mattermost-database.rst @@ -175,17 +175,17 @@ c. Grant access to objects contained in the specified schema by running: If the Mattermost server and the database are on the same machine, use the following command: - .. code-block:: sh + .. code-block:: sh - psql --dbname=mattermost --username=mmuser --password + psql --dbname=mattermost --username=mmuser --password .. tab:: Remote Database (separate server) If the Mattermost server is on a different machine, log into that machine and use the following command: - .. code-block:: sh + .. code-block:: sh - psql --host={postgres-server-IP} --dbname=mattermost --username=mmuser --password + psql --host={postgres-server-IP} --dbname=mattermost --username=mmuser --password .. note::