fix: first

This commit is contained in:
Guwan 2025-08-28 23:30:16 +08:00
parent 3c688a0757
commit 7fa6648d6c
2 changed files with 129 additions and 1 deletions

View File

@ -0,0 +1,88 @@
version: "3.8"
services:
# Mattermost Team Edition
mattermost:
image: mattermost/mattermost-team-edition:latest
container_name: mattermost
hostname: mattermost
ports:
- "8065:8065"
environment:
# 数据库配置
MM_SQLSETTINGS_DRIVERNAME: "postgres"
MM_SQLSETTINGS_DATASOURCE: "postgres://mattermost:mattermost_password@postgres:5432/mattermost?sslmode=disable&connect_timeout=10"
# 服务配置
MM_SERVICESETTINGS_SITEURL: "http://localhost:8065"
MM_SERVICESETTINGS_LISTENADDRESS: ":8065"
MM_SERVICESETTINGS_ENABLEDEVELOPER: "true"
# 文件存储配置
MM_FILESETTINGS_DRIVERNAME: "local"
MM_FILESETTINGS_DIRECTORY: "/mattermost/data/"
# 日志配置
MM_LOGSETTINGS_ENABLECONSOLE: "true"
MM_LOGSETTINGS_CONSOLELEVEL: "INFO"
# 用户配置
MM_TEAMSETTINGS_ENABLEUSERCREATION: "true"
MM_TEAMSETTINGS_ENABLEOPENSERVER: "true"
MM_SERVICESETTINGS_ENABLEEMAILINVITATIONS: "false"
# 安全配置
MM_SERVICESETTINGS_ENABLEINSECUREOUTGOINGCONNECTIONS: "true"
# 插件配置
MM_PLUGINSETTINGS_ENABLE: "true"
MM_PLUGINSETTINGS_ENABLEUPLOADS: "true"
depends_on:
postgres:
condition: service_healthy
networks:
- mattermost_network
volumes:
- mattermost_data:/mattermost/data
- mattermost_config:/mattermost/config
- mattermost_logs:/mattermost/logs
- mattermost_plugins:/mattermost/plugins
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8065/api/v4/system/ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
# PostgreSQL数据库
postgres:
image: postgres:13-alpine
container_name: mattermost_postgres
environment:
POSTGRES_DB: mattermost
POSTGRES_USER: mattermost
POSTGRES_PASSWORD: mattermost_password
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- mattermost_network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mattermost -d mattermost"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
mattermost_network:
driver: bridge
volumes:
mattermost_data:
mattermost_config:
mattermost_logs:
mattermost_plugins:
postgres_data:

40
step.md
View File

@ -7,3 +7,43 @@ docker exec openldap ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -f /tmp
ldap ldap
用户DN: cn=admin,dc=example,dc=com 用户DN: cn=admin,dc=example,dc=com
密码: admin 密码: admin
RDN 是 Relative Distinguished Name相对可分辨名称的缩写是LDAP中的一个重要概念。
RDN 解释
1. 什么是RDN
RDN 是LDAP条目在其父容器中的唯一标识符
它是DNDistinguished Name的最左边部分
类似于文件系统中的文件名
2. 举例说明
完整DN: uid=Guwan,ou=people,dc=example,dc=com
RDN: uid=Guwan (最左边的部分)
父DN: ou=people,dc=example,dc=com
3. 常见的RDN格式
RDN格式 含义 用途
uid=john User ID 用户账户
cn=John Doe Common Name 人员或组
ou=people Organizational Unit 组织单位
dc=example Domain Component 域名组件
4. 在您的情况下
当您创建用户时系统会问您要使用什么作为RDN
选择 uid: 创建 uid=Guwan,ou=people,dc=example,dc=com
选择 cn: 创建 cn=Guwan,ou=people,dc=example,dc=com
5. 为什么重要
唯一性: 同一容器中不能有相同的RDN
引用: 其他系统如GitLab通过RDN来识别用户
搜索: LDAP搜索时RDN是重要的查找依据
6. 在创建用户界面中
当您看到RDN选择时
选择 uid 如果您想要 uid=Guwan 格式
选择 cn 如果您想要 cn=Guwan 格式
对于GitLab LDAP集成通常推荐使用 uid 作为RDN因为
更符合用户账户的标准
GitLab配置中使用 uid 字段进行认证
与其他现有用户uid=bob.wilson 等)保持一致