Skip to content

Commit 01e4d9c

Browse files
committed
feat(lab-05): Mattermost Advanced Integration -- OpenLDAP, Keycloak OIDC, MinIO S3, LDAP sync env
1 parent d13231e commit 01e4d9c

3 files changed

Lines changed: 332 additions & 82 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,33 @@ jobs:
195195
run: docker compose -f docker/docker-compose.sso.yml logs
196196
- name: Cleanup
197197
if: always()
198-
run: docker compose -f docker/docker-compose.sso.yml down -v
198+
run: docker compose -f docker/docker-compose.sso.yml down -v
199+
lab-05-smoke:
200+
name: Lab 05 -- Mattermost Advanced Integration (LDAP + OIDC + MinIO)
201+
runs-on: ubuntu-latest
202+
needs: validate
203+
continue-on-error: true
204+
steps:
205+
- uses: actions/checkout@v4
206+
- name: Install tools
207+
run: sudo apt-get install -y curl ldap-utils
208+
- name: Validate integration compose
209+
run: docker compose -f docker/docker-compose.integration.yml config -q && echo "Integration compose valid"
210+
- name: Start integration stack
211+
run: docker compose -f docker/docker-compose.integration.yml up -d
212+
- name: Wait for Keycloak
213+
run: timeout 180 bash -c 'until curl -sf http://localhost:8106/health/ready | grep -q UP; do sleep 5; done'
214+
- name: Wait for OpenLDAP
215+
run: timeout 120 bash -c 'until docker exec mm-int-ldap ldapsearch -x -H ldap://localhost -b dc=lab,dc=local -D cn=admin,dc=lab,dc=local -w LdapAdmin05! > /dev/null 2>&1; do sleep 5; done'
216+
- name: Wait for MinIO
217+
run: timeout 120 bash -c 'until curl -sf http://localhost:9100/minio/health/live; do sleep 5; done'
218+
- name: Wait for Mattermost
219+
run: timeout 300 bash -c 'until curl -sf http://localhost:8105/api/v4/system/ping | grep -q "\"status\":\"OK\""; do sleep 10; done'
220+
- name: Run Lab 07-05 test script
221+
run: bash tests/labs/test-lab-07-05.sh --no-cleanup
222+
- name: Collect logs on failure
223+
if: failure()
224+
run: docker compose -f docker/docker-compose.integration.yml logs
225+
- name: Cleanup
226+
if: always()
227+
run: docker compose -f docker/docker-compose.integration.yml down -v
Lines changed: 171 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,177 @@
1-
# Lab 05 — Advanced Integration: mattermost with full IT-Stack ecosystem
2-
---
1+
# docker-compose.integration.yml -- Lab 05: Advanced Integration
2+
# Mattermost + OpenLDAP (FreeIPA sim) + PostgreSQL + Redis + Keycloak + MinIO
3+
# Lab 05 tests: LDAP user sync, OIDC SSO, S3 file storage, API verification
4+
#
5+
# Ports:
6+
# 8105 -- Mattermost
7+
# 8106 -- Keycloak admin console
8+
# 3891 -- OpenLDAP
9+
# 9100 -- MinIO API
10+
# 9101 -- MinIO console
11+
#
12+
# Credentials:
13+
# LDAP admin: cn=admin,dc=lab,dc=local / LdapAdmin05!
14+
# LDAP readonly: cn=readonly,dc=lab,dc=local / ReadOnly05!
15+
# DB: mattermost / Lab05Password!
16+
# Redis: Lab05Redis!
17+
# Keycloak: admin / Lab05Admin!
18+
# MinIO: minio-access-05 / MinioSecret05!
19+
# OIDC secret: mattermost-secret-05
20+
21+
x-mm-int-env: &mm-int-env
22+
MM_SQLSETTINGS_DRIVERNAME: postgres
23+
MM_SQLSETTINGS_DATASOURCE: "postgres://mattermost:Lab05Password!@mm-int-db:5432/mattermost?sslmode=disable"
24+
MM_SERVICESETTINGS_SITEURL: http://localhost:8105
25+
MM_OPENIDSETTINGS_ENABLE: "true"
26+
MM_OPENIDSETTINGS_DISCOVERYENDPOINT: http://mm-int-keycloak:8080/realms/it-stack/.well-known/openid-configuration
27+
MM_OPENIDSETTINGS_ID: mattermost-client
28+
MM_OPENIDSETTINGS_SECRET: mattermost-secret-05
29+
MM_LDAPSETTINGS_ENABLE: "true"
30+
MM_LDAPSETTINGS_LDAPSERVER: mm-int-ldap
31+
MM_LDAPSETTINGS_LDAPPORT: "389"
32+
MM_LDAPSETTINGS_BINDUSERNAME: "cn=readonly,dc=lab,dc=local"
33+
MM_LDAPSETTINGS_BINDPASSWORD: ReadOnly05!
34+
MM_LDAPSETTINGS_BASEDN: "dc=lab,dc=local"
35+
MM_LDAPSETTINGS_USERIDATTRIBUTE: uid
36+
MM_LDAPSETTINGS_EMAILATTRIBUTE: mail
37+
MM_LDAPSETTINGS_USERNAMEATRIBUTE: uid
38+
MM_LDAPSETTINGS_FIRSTNAMEATTRIBUTE: givenName
39+
MM_LDAPSETTINGS_LASTNAMEATTRIBUTE: sn
40+
MM_FILESETTINGS_DRIVERNAME: amazons3
41+
MM_FILESETTINGS_AMAZONS3ACCESSKEYID: minio-access-05
42+
MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY: MinioSecret05!
43+
MM_FILESETTINGS_AMAZONS3BUCKET: mattermost
44+
MM_FILESETTINGS_AMAZONS3ENDPOINT: mm-int-minio:9000
45+
MM_FILESETTINGS_AMAZONS3SSL: "false"
46+
MM_FILESETTINGS_AMAZONS3PATHSTYLE: "true"
47+
348
services:
4-
mattermost:
5-
image: mattermost/mattermost-team-edition:9
6-
container_name: it-stack-mattermost
7-
restart: unless-stopped
49+
mm-int-ldap:
50+
image: osixia/openldap:1.5.0
51+
container_name: mm-int-ldap
52+
environment:
53+
LDAP_ORGANISATION: "IT-Stack Lab"
54+
LDAP_DOMAIN: lab.local
55+
LDAP_ADMIN_PASSWORD: LdapAdmin05!
56+
LDAP_READONLY_USER: "true"
57+
LDAP_READONLY_USER_USERNAME: readonly
58+
LDAP_READONLY_USER_PASSWORD: ReadOnly05!
59+
ports:
60+
- "3891:389"
61+
networks:
62+
- mm-int-net
63+
healthcheck:
64+
test: ["CMD-SHELL", "ldapsearch -x -H ldap://localhost -b dc=lab,dc=local -D cn=admin,dc=lab,dc=local -w LdapAdmin05! > /dev/null 2>&1"]
65+
interval: 15s
66+
timeout: 10s
67+
retries: 5
68+
start_period: 20s
69+
70+
mm-int-db:
71+
image: postgres:16-alpine
72+
container_name: mm-int-db
73+
environment:
74+
POSTGRES_DB: mattermost
75+
POSTGRES_USER: mattermost
76+
POSTGRES_PASSWORD: Lab05Password!
77+
volumes:
78+
- mm-int-db-data:/var/lib/postgresql/data
79+
networks:
80+
- mm-int-data-net
81+
healthcheck:
82+
test: ["CMD-SHELL", "pg_isready -U mattermost"]
83+
interval: 10s
84+
timeout: 5s
85+
retries: 5
86+
87+
mm-int-redis:
88+
image: redis:7-alpine
89+
container_name: mm-int-redis
90+
command: redis-server --requirepass Lab05Redis!
91+
networks:
92+
- mm-int-net
93+
healthcheck:
94+
test: ["CMD", "redis-cli", "-a", "Lab05Redis!", "ping"]
95+
interval: 10s
96+
timeout: 5s
97+
retries: 5
98+
99+
mm-int-minio:
100+
image: minio/minio:latest
101+
container_name: mm-int-minio
102+
command: server /data --console-address ":9001"
103+
environment:
104+
MINIO_ROOT_USER: minio-access-05
105+
MINIO_ROOT_PASSWORD: MinioSecret05!
106+
ports:
107+
- "9100:9000"
108+
- "9101:9001"
109+
volumes:
110+
- mm-int-minio-data:/data
111+
networks:
112+
- mm-int-net
113+
healthcheck:
114+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
115+
interval: 15s
116+
timeout: 10s
117+
retries: 5
118+
119+
mm-int-keycloak:
120+
image: quay.io/keycloak/keycloak:24.0
121+
container_name: mm-int-keycloak
122+
command: start-dev
123+
environment:
124+
KC_HEALTH_ENABLED: "true"
125+
KEYCLOAK_ADMIN: admin
126+
KEYCLOAK_ADMIN_PASSWORD: Lab05Admin!
8127
ports:
9-
- "8065:$firstPort"
128+
- "8106:8080"
129+
networks:
130+
- mm-int-net
131+
healthcheck:
132+
test: ["CMD-SHELL", "curl -sf http://localhost:8080/health/ready | grep -q UP || exit 1"]
133+
interval: 20s
134+
timeout: 10s
135+
retries: 10
136+
start_period: 60s
137+
138+
mm-int-app:
139+
image: mattermost/mattermost-team-edition:latest
140+
container_name: mm-int-app
141+
depends_on:
142+
mm-int-db:
143+
condition: service_healthy
144+
mm-int-redis:
145+
condition: service_healthy
146+
mm-int-minio:
147+
condition: service_healthy
148+
mm-int-keycloak:
149+
condition: service_healthy
150+
mm-int-ldap:
151+
condition: service_healthy
10152
environment:
11-
- IT_STACK_ENV=lab-05-integration
12-
- KEYCLOAK_URL=
13-
- DB_HOST=
14-
- REDIS_HOST=
15-
- SMTP_HOST=
16-
- GRAYLOG_HOST=
17-
extra_hosts:
18-
- "lab-id1:10.0.50.11"
19-
- "lab-db1:10.0.50.12"
20-
- "lab-proxy1:10.0.50.15"
153+
<<: *mm-int-env
154+
ports:
155+
- "8105:8065"
156+
volumes:
157+
- mm-int-data:/mattermost/data
158+
- mm-int-logs:/mattermost/logs
21159
networks:
22-
- it-stack-net
160+
- mm-int-net
161+
- mm-int-data-net
162+
healthcheck:
163+
test: ["CMD", "curl", "-f", "http://localhost:8065/api/v4/system/ping"]
164+
interval: 20s
165+
timeout: 10s
166+
retries: 10
167+
start_period: 60s
168+
169+
volumes:
170+
mm-int-db-data:
171+
mm-int-minio-data:
172+
mm-int-data:
173+
mm-int-logs:
23174

24175
networks:
25-
it-stack-net:
26-
driver: bridge
176+
mm-int-net:
177+
mm-int-data-net:

0 commit comments

Comments
 (0)