From 38d5bca1672b2f0084932d9f3e332b3b014d939e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCster?= Date: Fri, 9 May 2025 21:39:10 +0200 Subject: [PATCH] add claude file and update readme --- CLAUDE.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 11 ++++--- 2 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..dfa0839 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,92 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +This repository contains a CS Repro Mattermost environment - a reproduction of a standard Mattermost customer production environment with preconfigured SAML, LDAP, Advanced Logging, Prometheus, Grafana, Elasticsearch, and read replicas. It is designed for testing and reproducing customer environments. + +## Environment Setup + +### Prerequisites + +You need to have Docker and Docker Compose installed on your machine to run this environment. + +### Initial Setup + +1. Add an enterprise license file named `license.mattermost` to the root directory +2. Run `make run` to start the core services + +## Common Commands + +### Environment Management + +- `make run` - Initialize environment and create containers +- `make run-all` - Spin up all environment containers (with DB replicas and Mattermost HA) +- `make run-db-replicas` - Add database replicas to the environment +- `make run-mm-replicas` - Add Mattermost HA nodes to the environment +- `make run-rtcd` - Launch RTCD service for Mattermost Calls +- `make start` - Start existing containers +- `make stop` - Stop all running containers +- `make restart` - Restart all containers +- `make restart-mattermost` - Restart only Mattermost containers (preferred for testing changes) +- `make backup-keycloak` - Generate a backup of the current Keycloak setup +- `make restore-keycloak` - Restore Keycloak data from an existing backup +- `make reset` - Clean volumes directory and reinitialize the environment +- `make delete-data` - Clear all data within volumes +- `make nuke` - Erase all configurations and data +- `make nuke-rmi` - Complete cleanup including removing Docker images + +### Upgrading and Downgrading + +To upgrade Mattermost: +1. Modify the image tag in `docker-compose.yml` +2. Run `make restart-mattermost` + +To downgrade Mattermost: +1. Modify the image tag in `docker-compose.yml` +2. Run `make downgrade` + +## Component Access + +### Mattermost + +- URL: http://localhost:8065 +- Default credentials available in the accounts section below + +### LDAP + +- Admin access: `cn=admin,dc=planetexpress,dc=com` / `GoodNewsEveryone` +- Commands for LDAP operations are in the README.md + +### Grafana + +- URL: http://localhost:3000 +- Credentials: admin / admin + +### Elasticsearch + +- URL: http://localhost:9200 + +### mitmproxy + +- URL: http://localhost:8181 + +## Account Information + +| Username | Password | Role in Mattermost | Can use LDAP? | Can use SAML? | +|-----------|-----------|-------------------|---------------|---------------| +| admin | admin | n/a | n/a | n/a | +| professor | professor | Sys Admin | Yes | Yes | +| bender | bender | Member | Yes | Yes | +| hermes | hermes | Sys Admin | Yes | Yes | +| fry | fry | Member | Yes | Yes | +| leela | leela | Member | Yes | Yes | +| zoidberg | zoidberg | Member | Yes | Yes | +| amy | amy | Member | Yes | Yes | + +## Database Information + +- Primary PostgreSQL: `postgresql://mmuser:mmuser_password@localhost:5432/mattermost` +- Replica 1: `postgresql://mmuser:mmuser_password@localhost:5433/mattermost` +- Replica 2: `postgresql://mmuser:mmuser_password@localhost:5434/mattermost` \ No newline at end of file diff --git a/README.md b/README.md index 44cfca4..6f4090b 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Additionally, the keycloak container can take up to 5 minutes to spin up. If it' - **`make run`**: Initializes the environment and creates the containers - **`make run-all`**: Spins up all environment containers with the database replicas and Mattermost HA. - You must run `make run` before running the below: - - **`make run-db-replica`**: Launches the environment with replicas. Ideal for adding replicas to an existing setup or initializing with replicas from the get-go. + - **`make run-db-replicas`**: Launches the environment with replicas. Ideal for adding replicas to an existing setup or initializing with replicas from the get-go. - **`make run-mm-replica`**: Launches an additional Mattermost node and enables HA. - **`make run-rtcd`**: Launches the RTCD service for Mattermost Calls and updates the config to use it correctly. - **`make backup-keycloak`**: Generates a backup of the current Keycloak setup in the files directory. Useful for infrequent backups. @@ -79,6 +79,7 @@ Additionally, the keycloak container can take up to 5 minutes to spin up. If it' - **`make stop`**: Halts all running containers. - **`make restart`**: Restarts all Docker containers in the environment. - **`make restart-mattermost`**: Specifically restarts only the Mattermost containers for quick testing. +- **`make restart-grafana`**: Specifically restarts only the Grafana container. - **`make reset`**: Cleans the volumes directory and reinitializes the environment to default settings. - **`make delete-data`**: Clears all data within volumes, effectively stopping Mattermost. - **`make nuke`**: Erases all configurations and data, sparing your personal data. @@ -90,10 +91,10 @@ Additionally, the keycloak container can take up to 5 minutes to spin up. If it' 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 `10.7` for example. It must be a version of Mattermost that exists on Docker. ```bash - mattermost/mattermost-enterprise-edition:release-7.7 + mattermost/mattermost-enterprise-edition:10.7 ``` 2. Run `make restart-mattermost` @@ -106,10 +107,10 @@ 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 `10.7` for example. It must be a version of Mattermost that exists on Docker. ```bash - mattermost/mattermost-enterprise-edition:release-7.7 + mattermost/mattermost-enterprise-edition:10.7 ``` 2. Run `make downgrade`