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,6 +3,13 @@
This is a basic reproduction that includes various components preconfigured like SAML, LDAP, advanced logging, prometheus, grafana, and elasticsearch. This is a basic reproduction that includes various components preconfigured like SAML, LDAP, advanced logging, prometheus, grafana, and elasticsearch.
- [LDAP](#ldap) - [LDAP](#ldap)
- [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) - [MMCTL](#mmctl)
## Making Changes ## Making Changes
@@ -116,6 +123,51 @@ Doing this will wipe anything you have in the database and any existing Mattermo
- Restart the database container - Restart the database container
- Restart the Mattermost 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 ## Use Grafana
All the Mattermost grafana charts are already installed and linked, you just have to access them. All the Mattermost grafana charts are already installed and linked, you just have to access them.
@@ -208,11 +260,3 @@ docker exec -it cs-repro-openldap ldapmodify \
-w GoodNewsEveryone \ -w GoodNewsEveryone \
-f /ldap/addUniqueIdToUsers.ldif -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: 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: postgres:
container_name: cs-repro-postgres container_name: cs-repro-postgres
environment: environment:
@@ -49,48 +24,6 @@ services:
interval: 10s interval: 10s
timeout: 3s timeout: 3s
retries: 3 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: openldap:
platform: linux/amd64 platform: linux/amd64
container_name: cs-repro-openldap container_name: cs-repro-openldap
@@ -98,7 +31,7 @@ services:
restart: unless-stopped restart: unless-stopped
image: rroemhild/test-openldap:latest image: rroemhild/test-openldap:latest
volumes: volumes:
- ./ldap:/ldap:rw - ./ldap:/mattermost/config:rw
ports: ports:
- "10389:10389" - "10389:10389"
- "10636:10636" - "10636:10636"
@@ -203,3 +136,71 @@ services:
ports: ports:
- 9200:9200 - 9200:9200
- 9300:9300 - 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