bsmeding.gitlab_docker
GitLab CE
根密码
如果没有通过 ENV GITLAB_ROOT_PASSWORD 或 gitlab_rails['initial_root_password'] 设置在 gitlab.rb 中进行设置:
第一次运行后,可以从容器中获取根密码,位置在 /etc/gitlab/initial_root_password
此文件仅在创建后的前 24 小时内可用!
获取方法:
- 登录到主机
- 登录到容器:
docker exec -it gitlab /bin/bash - 执行命令:
cat /etc/gitlab/initial_root_password
待办事项:
测试不自动生成用户(创建用户为操作系统用户,然后将 /etc/passwd 文件映射到容器)
禁用注册
手动关闭注册功能 查看 https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/2837
LDAP 支持
启用/设置变量 gitlab__ldap_server_host_ip 和 gitlab__ldap_server_host_port 时,LDAP 支持将被启用。
gitlab__ldap_search_users: 设置用户基础搜索路径gitlab__ldap_search_groups: 尚未实现gitlab__ldap_auth_bind_dn: 绑定到 LDAP 服务器的用户(最低权限,仅用于身份验证和执行搜索查询)gitlab__ldap_auth_bind_pass: 用户的密码gitlab__ldap_user_filter: 用户必须属于哪个组才能获得访问权限
微软 Active Directory
如果您有 MS AD,则将变量 gitlab__ldap_is_ad 设置为 true,并在使用时设置 user_search 的前缀为:(memberOf:1.2.840.113556.1.4.194:=CN=....,而不是(memberOf=CN=.....)
Gitlab.rb
请注意,默认情况下创建 gitlab.rb 文件时,它不会被覆盖。因此,在进行手动更改时,后续的剧本运行不会重置它。 只有在更改模板中存在的变量时,如 LDAP 等,请注意更新/更改不会反映。
SSL
要复制 GitLab 和/或 Docker 注册服务的 SSL 证书,请将证书文件放在 ./files/certs/* 中(如果目录不存在,请创建目录),并将证书文件名添加到剧本中:
gitlab__ssl_cert_file: 'git.example.com.pub'
gitlab__ssl_cert_key_file: 'git.example.com.key'
# 可选:
gitlab__registery_ssl_cert_file: 'registery.example.com'
gitlab__registery_ssl_cert_key_file: 'registery.example.key'
SSL 可信根证书
要添加受信任的证书,请将证书文件放在 ./files/certs/trusted-certs/ 中,以便将它们复制到主机。
Manage and run the gitlab ce docker container with Postgres container as backend.
ansible-galaxy install bsmeding.gitlab_docker