From 028c5722d6281964754d6e95ba761a31841b5707 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Sun, 24 Mar 2024 23:54:17 +0100 Subject: [PATCH 1/7] Update developer-setup.md to provide no-docker setup --- site/content/contribute/developer-setup.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index 7ebd598a0a..db045b0c08 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -36,7 +36,16 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL sudo apt install build-essential ``` -1. Install [Docker](https://www.docker.com/). +1. Install [Docker](https://www.docker.com/). If you dont want to use Docker, you can follow the steps in the sub-bullets for manual database setup + 1. Zet `MM_NO_DOCKER` to `true` in `server/config.mk` file + 2. Install [PostgreSQL](https://www.postgresql.org/download/) + 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` + 4. Modify the role to give rights to create ` database by running `ALTER ROLE mmuser CREATEDB;` + 5. Check the role by running `\du` + 6. Before creating the database, exit by running `\q` + 7. Login again via mmuser by running `psql postgres -U mmuser` + 8. Create the database

 by running `CREATE DATABASE mattermost_test;` and exit again with `\q` + 9. Login again with `psql postgres` and run `GRANT ALL PRIVILEGES ON DATABASE mattermost_test TO mmuser;` to give all rights to `mmuser` 1. Install [Go](https://go.dev/). From 4eca3843abfd8e746aef0604d31e4789cf3acdf2 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:52:02 +0100 Subject: [PATCH 2/7] Update site/content/contribute/developer-setup.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> --- site/content/contribute/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index db045b0c08..7ac4fb7eee 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -36,7 +36,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL sudo apt install build-essential ``` -1. Install [Docker](https://www.docker.com/). If you dont want to use Docker, you can follow the steps in the sub-bullets for manual database setup +1. Install [Docker](https://www.docker.com/). If you don't want to use Docker, you can follow the steps in the sub-bullets below for manual database setup. 1. Zet `MM_NO_DOCKER` to `true` in `server/config.mk` file 2. Install [PostgreSQL](https://www.postgresql.org/download/) 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` From df1233c81231bbf4f1cec3a0f4f9cbe354495a5b Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:52:13 +0100 Subject: [PATCH 3/7] Update site/content/contribute/developer-setup.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> --- site/content/contribute/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index 7ac4fb7eee..c263f5d7a8 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -37,7 +37,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL ``` 1. Install [Docker](https://www.docker.com/). If you don't want to use Docker, you can follow the steps in the sub-bullets below for manual database setup. - 1. Zet `MM_NO_DOCKER` to `true` in `server/config.mk` file + 1. Set `MM_NO_DOCKER` to `true` in the `server/config.mk` file. 2. Install [PostgreSQL](https://www.postgresql.org/download/) 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` 4. Modify the role to give rights to create ` database by running `ALTER ROLE mmuser CREATEDB;` From 83c0900c1fe86a383c4254550d2f4ab5223561d2 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:52:27 +0100 Subject: [PATCH 4/7] Update site/content/contribute/developer-setup.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> --- site/content/contribute/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index c263f5d7a8..da017df611 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -40,7 +40,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL 1. Set `MM_NO_DOCKER` to `true` in the `server/config.mk` file. 2. Install [PostgreSQL](https://www.postgresql.org/download/) 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` - 4. Modify the role to give rights to create ` database by running `ALTER ROLE mmuser CREATEDB;` + 4. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` 5. Check the role by running `\du` 6. Before creating the database, exit by running `\q` 7. Login again via mmuser by running `psql postgres -U mmuser` From 7aedd0ff79bb4a366544c9755f15fdb37dab868e Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:52:39 +0100 Subject: [PATCH 5/7] Update site/content/contribute/developer-setup.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> --- site/content/contribute/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index da017df611..e3b2f5145f 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -41,7 +41,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL 2. Install [PostgreSQL](https://www.postgresql.org/download/) 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` 4. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` - 5. Check the role by running `\du` + 5. Confirm the role rights by running `\du` 6. Before creating the database, exit by running `\q` 7. Login again via mmuser by running `psql postgres -U mmuser` 8. Create the database

 by running `CREATE DATABASE mattermost_test;` and exit again with `\q` From 23e6773ca36e86ed48ce713194df989dfcb1e762 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:52:50 +0100 Subject: [PATCH 6/7] Update site/content/contribute/developer-setup.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> --- site/content/contribute/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index e3b2f5145f..8cc86a8f5b 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -43,7 +43,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL 4. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` 5. Confirm the role rights by running `\du` 6. Before creating the database, exit by running `\q` - 7. Login again via mmuser by running `psql postgres -U mmuser` + 7. Login again via `mmuser` by running `psql postgres -U mmuser` 8. Create the database

 by running `CREATE DATABASE mattermost_test;` and exit again with `\q` 9. Login again with `psql postgres` and run `GRANT ALL PRIVILEGES ON DATABASE mattermost_test TO mmuser;` to give all rights to `mmuser` From 0fe22c72df1ff5bc93858e83c6604cdc3e6ae813 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:05:23 +0100 Subject: [PATCH 7/7] create a new section for without docker --- site/content/contribute/developer-setup.md | 83 +++++++++++++++++++--- 1 file changed, 73 insertions(+), 10 deletions(-) diff --git a/site/content/contribute/developer-setup.md b/site/content/contribute/developer-setup.md index 8cc86a8f5b..7f07e5d036 100644 --- a/site/content/contribute/developer-setup.md +++ b/site/content/contribute/developer-setup.md @@ -36,16 +36,7 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL sudo apt install build-essential ``` -1. Install [Docker](https://www.docker.com/). If you don't want to use Docker, you can follow the steps in the sub-bullets below for manual database setup. - 1. Set `MM_NO_DOCKER` to `true` in the `server/config.mk` file. - 2. Install [PostgreSQL](https://www.postgresql.org/download/) - 3. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` - 4. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` - 5. Confirm the role rights by running `\du` - 6. Before creating the database, exit by running `\q` - 7. Login again via `mmuser` by running `psql postgres -U mmuser` - 8. Create the database

 by running `CREATE DATABASE mattermost_test;` and exit again with `\q` - 9. Login again with `psql postgres` and run `GRANT ALL PRIVILEGES ON DATABASE mattermost_test TO mmuser;` to give all rights to `mmuser` +1. Install [Docker](https://www.docker.com/). If you don't want to use Docker, you can follow [this guide](#develop-mattermost-without-docker). 1. Install [Go](https://go.dev/). @@ -120,3 +111,75 @@ If you're using Windows, we recommend using the Windows Subsystem for Linux (WSL 1. Set your options: Some behaviors can be customized such as running the server in the foreground as described in the `config.mk` file in the server directory. See that file for details. + +# Develop Mattermost without Docker +1. Install `make`. + - On Ubuntu, you can install `build essential` tools which will also take care of installing the `make`: + ```sh + sudo apt install build-essential + ``` +1. Set `MM_NO_DOCKER` to `true` in the `server/config.mk` file. +1. Install [PostgreSQL](https://www.postgresql.org/download/) +1. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` +1. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` +1. Confirm the role rights by running `\du` +1. Before creating the database, exit by running `\q` +1. Login again via `mmuser` by running `psql postgres -U mmuser` +1. Create the database

 by running `CREATE DATABASE mattermost_test;` and exit again with `\q` +1. Login again with `psql postgres` and run `GRANT ALL PRIVILEGES ON DATABASE mattermost_test TO mmuser;` to give all rights to `mmuser` +1. Install [Go](https://go.dev/). +1. Increase the number of available file descriptors. Update your shell's initialization script (e.g. `.bashrc` or `.zshrc`), and add the following: + ```sh + ulimit -n 8096 + ``` + +1. If you don't have it already, install libpng with your preferred package manager. + - If you are on ARM based Mac, you'll need to install [Rosetta](https://support.apple.com/en-in/HT211861) to make `libpng` work. Rosetta can be installed by the following command- + ```sh + softwareupdate --install-rosetta + ``` + +1. Fork https://github.com/mattermost/mattermost. +1. Clone the Mattermost source code from your fork: + ```sh + git clone https://github.com/YOUR_GITHUB_USERNAME/mattermost.git + ``` + +1. Install NVM and use it to install the required version of Node.js: + - First, install {{< newtabref href="https://github.com/nvm-sh/nvm" title="NVM" >}} by following {{< newtabref href="https://github.com/nvm-sh/nvm#installing-and-updating" title="these instructions" >}}. + - Then, use NVM to install the correct version of Node.js for the Mattermost web app (this should be run within the `webapp` directory): + ```sh + nvm install + ``` + +1. Start the server: + ```sh + cd server + make run-server + ``` + +1. Test your environment: + ```sh + curl http://localhost:8065/api/v4/system/ping + ``` + If successful, the `curl` step will return a JSON object: + ```json + {"AndroidLatestVersion":"","AndroidMinVersion":"","DesktopLatestVersion":"","DesktopMinVersion":"","IosLatestVersion":"","IosMinVersion":"","status":"OK"} + ``` + +1. Run the webapp and watch: + ```sh + make run + ``` + +1. Stop the server: + ```sh + make stop-server + ``` + The `stop-server` make target does not stop all the docker containers started by `run-server`. To stop the running docker containers: + ```sh + make stop-docker + ``` + +1. Set your options: + Some behaviors can be customized such as running the server in the foreground as described in the `config.mk` file in the server directory. See that file for details.