1
0
mirror of https://github.com/coltoneshaw/CS-Repro-Mattermost.git synced 2025-12-23 18:11:34 +01:00

updated readme

This commit is contained in:
coltoneshaw
2024-03-29 11:59:00 -04:00
parent 2fcf7b0d63
commit fc1cfbe612
2 changed files with 131 additions and 86 deletions

View File

@@ -3,7 +3,14 @@
This is a basic reproduction that includes various components preconfigured like SAML, LDAP, advanced logging, prometheus, grafana, and elasticsearch.
- [LDAP](#ldap)
- [MMCTL](#mmctl)
- [Commands](#commands)
- [Accounts](#accounts)
- [Grafana](#use-grafana)
- [Guides](#guides)
- [How to upgrade](#how-to-upgrade)
- [How to Downgrade](#how-to-downgrade)
- [Migrating to Config in DB](#using-config-in-db)
- [MMCTL](#mmctl)
## Making Changes
@@ -102,19 +109,64 @@ Doing this will wipe anything you have in the database and any existing Mattermo
1. Modify the line in the `docker-compose.yml` file to be the version you want
You're just replacing the tag at the end, this one is `7.7` for example. It must be a version of Mattermost that exists on Docker.
You're just replacing the tag at the end, this one is `7.7` for example. It must be a version of Mattermost that exists on Docker.
```bash
mattermost/mattermost-enterprise-edition:release-7.7
```
```bash
mattermost/mattermost-enterprise-edition:release-7.7
```
2. Run `make downgrade`
This will:
This will:
- delete the database
- Restart the database container
- Restart the Mattermost container
- delete the database
- Restart the database container
- Restart the Mattermost container
### Using Config in DB
Config in DB has intentionally not been enabled by default to allow you to edit the `config.json` file directly for faster repros. However, if you want to migrate to config in DB just follow the below.
1. Start the container and init the default data. `make start`... `y`.
2. Edit the `docker-compose.yml`
```diff
mattermost:
environment:
- MM_SqlSettings_DriverName=postgres
- MM_SqlSettings_DataSource=postgres://mmuser:mmuser_password@cs-repro-postgres:5432/mattermost?sslmode=disable&connect_timeout=10&binary_parameters=yes
- MM_SAMLSETTINGS_IDPCERTIFICATEFILE=/mattermost/config/saml-cert.crt
# - MM_SqlSettings_DriverName=mysql
# - MM_SqlSettings_DataSource=mmuser:mmuser_password@tcp(mysql:3306)/mattermost?charset=utf8mb4,utf8&writeTimeout=30s
- MM_ServiceSettings_EnableLocalMode=true
- MM_ServiceSettings_LocalModeSocketLocation=/var/tmp/mattermost_local.socket
- MM_ServiceSettings_LicenseFileLocation=/mattermost/config/license.mattermost-enterprise
## Disable this to migrate your config to the database
-# - MM_CONFIG=postgres://mmuser:mmuser_password@cs-repro-postgres:5432/mattermost?sslmode=disable&connect_timeout=10&binary_parameters=yes
+ - MM_CONFIG=postgres://mmuser:mmuser_password@cs-repro-postgres:5432/mattermost?sslmode=disable&connect_timeout=10&binary_parameters=yes
```
3. Move the config to the DB
```bash
docker exec -it cs-repro-mattermost mmctl config migrate ./config/config.json "postgres://mmuser:mmuser_password@cs-repro-postgres:5432/mattermost?sslmode=disable&connect_timeout=10&binary_parameters=yes" --local
```
4. Restart Mattermost with a force stop / start to pickup the new env vars
```bash
make stop
make start
```
### MMCTL
To use `mmctl` it's already setup for local, just run the below docker command.
```bash
docker exec -it cs-repro-mattermost mmctl user list --local
```
## Use Grafana
@@ -208,11 +260,3 @@ docker exec -it cs-repro-openldap ldapmodify \
-w GoodNewsEveryone \
-f /ldap/addUniqueIdToUsers.ldif
```
## MMCTL
To use `mmctl` it's already setup for local, just run the below docker command.
```bash
docker exec -it cs-repro-mattermost mmctl user list --localhost
```

View File

@@ -1,29 +1,4 @@
services:
# mysql:
# container_name: cs-repro-mysql
# image: mysql:8
# restart: always
# environment:
# MYSQL_DATABASE: "mattermost"
# # So you don't have to use root, but you can if you like
# MYSQL_USER: "mmuser"
# # You can use whatever password you like
# MYSQL_PASSWORD: "mmuser_password"
# # Password for root access
# MYSQL_ROOT_PASSWORD: "mmuser_password"
# healthcheck:
# test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
# timeout: 20s
# retries: 10
# ports:
# # <Port exposed> : <MySQL Port running inside container>
# - "3306:3306"
# expose:
# # Opens port 3306 on the container
# - "3306"
# # Where our data will be persisted
# volumes:
# - ./volumes/db/mysql:/var/lib/mysql
postgres:
container_name: cs-repro-postgres
environment:
@@ -49,48 +24,6 @@ services:
interval: 10s
timeout: 3s
retries: 3
# postgres-replica:
# container_name: cs-repro-postgres-replica
# environment:
# - POSTGRES_USER=mmuser
# - POSTGRES_PASSWORD=mmuser_password
# # - POSTGRES_DB=mattermost
# - LISTEN_ADDRESS="*"
# image: postgres:13-alpine
# restart: unless-stopped
# ports:
# - "5433:5432"
# security_opt:
# - no-new-privileges:true
# pids_limit: 100
# read_only: false
# tmpfs:
# - /tmp
# - /var/run/postgresql
# volumes:
# # - ./volumes/db-replica/var/lib/postgresql/data:/var/lib/postgresql/data
# - ./volumes/db-replica/data2:/var/lib/postgresql/data
# postgres-replica2:
# container_name: cs-repro-postgres-replica2
# environment:
# - POSTGRES_USER=mmuser
# - POSTGRES_PASSWORD=mmuser_password
# # - POSTGRES_DB=mattermost
# - LISTEN_ADDRESS="*"
# image: postgres:13-alpine
# restart: unless-stopped
# ports:
# - "5434:5432"
# security_opt:
# - no-new-privileges:true
# pids_limit: 100
# read_only: false
# tmpfs:
# - /tmp
# - /var/run/postgresql
# volumes:
# # - ./volumes/db-replica2/var/lib/postgresql/data:/var/lib/postgresql/data
# - ./volumes/db-replica2/data2:/var/lib/postgresql/data
openldap:
platform: linux/amd64
container_name: cs-repro-openldap
@@ -98,7 +31,7 @@ services:
restart: unless-stopped
image: rroemhild/test-openldap:latest
volumes:
- ./ldap:/ldap:rw
- ./ldap:/mattermost/config:rw
ports:
- "10389:10389"
- "10636:10636"
@@ -203,3 +136,71 @@ services:
ports:
- 9200:9200
- 9300:9300
# mysql:
# container_name: cs-repro-mysql
# image: mysql:8
# restart: always
# environment:
# MYSQL_DATABASE: "mattermost"
# # So you don't have to use root, but you can if you like
# MYSQL_USER: "mmuser"
# # You can use whatever password you like
# MYSQL_PASSWORD: "mmuser_password"
# # Password for root access
# MYSQL_ROOT_PASSWORD: "mmuser_password"
# healthcheck:
# test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
# timeout: 20s
# retries: 10
# ports:
# # <Port exposed> : <MySQL Port running inside container>
# - "3306:3306"
# expose:
# # Opens port 3306 on the container
# - "3306"
# # Where our data will be persisted
# volumes:
# - ./volumes/db/mysql:/var/lib/mysql
# postgres-replica:
# container_name: cs-repro-postgres-replica
# environment:
# - POSTGRES_USER=mmuser
# - POSTGRES_PASSWORD=mmuser_password
# # - POSTGRES_DB=mattermost
# - LISTEN_ADDRESS="*"
# image: postgres:13-alpine
# restart: unless-stopped
# ports:
# - "5433:5432"
# security_opt:
# - no-new-privileges:true
# pids_limit: 100
# read_only: false
# tmpfs:
# - /tmp
# - /var/run/postgresql
# volumes:
# # - ./volumes/db-replica/var/lib/postgresql/data:/var/lib/postgresql/data
# - ./volumes/db-replica/data2:/var/lib/postgresql/data
# postgres-replica2:
# container_name: cs-repro-postgres-replica2
# environment:
# - POSTGRES_USER=mmuser
# - POSTGRES_PASSWORD=mmuser_password
# # - POSTGRES_DB=mattermost
# - LISTEN_ADDRESS="*"
# image: postgres:13-alpine
# restart: unless-stopped
# ports:
# - "5434:5432"
# security_opt:
# - no-new-privileges:true
# pids_limit: 100
# read_only: false
# tmpfs:
# - /tmp
# - /var/run/postgresql
# volumes:
# # - ./volumes/db-replica2/var/lib/postgresql/data:/var/lib/postgresql/data
# - ./volumes/db-replica2/data2:/var/lib/postgresql/data