GitLab - Configurations¶
Prepare GitLab password¶
- Show the initial
rootpassword, from the GitLab server machine :
Task sources: server:password
- Initial GitLab access :
- Open :
https://DOMAIN_GITLAB:PORT_GITLAB - Username :
root - Password : Paste the initial password seen above
Table of contents
Prepare GitLab settings¶
Admin Area / Settings / General¶
- Visibility and access controls :
-
Restricted visibility levels :
- Internal : Enable
- Public : Enable
- Action : Save changes
-
Import and export settings :
- Repository by URL : Enable
- GitLab export : Enable
-
Action : Save changes
-
Sign-up restrictions :
- Sign-up enabled : Disable
- Require admin approval for new sign-ups : Enable
- Email confirmation settings : Off
-
Action : Save changes
-
Sign-in restrictions :
- Admin Mode / Enable Admin Mode : Enable
- Action : Save changes
Admin Area / Overview / Users¶
- New user :
- Name :
GitLab CI - Username :
gitlab-ci - Email :
CONTACT_EMAIL@DOMAIN - Access level : Regular
- Avatar :
GITLAB_AVATAR.png - Action : Create user
- Groups : Add 'gitlab-ci' as 'Reporter' to all projects using GitLab CI/CD or GitLab Container Registry
Admin Area / Settings / CI/CD¶
- Admin Area / Overview / Users / gitlab-ci / Impersonation Tokens :
-
Action : Add new token
- Token name :
runner-HOSTNAME-registry - Expiration date :
...-12-31(current year's last day or less) - Select scopes : read_registry
- Action : Create impersonation token
- Action : Copy impersonation token
- Token name :
-
Generate the Docker authentication configuration from the Runner machine (impersonation token as password) :
Task sources: configurations:docker-auth
#!/usr/bin/env bash
# Mise
#MISE description="Generate the 'DOCKER_AUTH_CONFIG' CI/CD variable value for the 'gitlab-ci' user"
#MISE arg "[user]" default="gitlab-ci" help="GitLab user owning the 'read_registry' impersonation token"
# Configurations
set -e -o pipefail
# Sources
# shellcheck source=lib/common.sh
source "${MISE_PROJECT_ROOT:?}/lib/common.sh"
# Prepare settings
settings_require
temporary=$(mktemp -d)
trap 'rm -rf "${temporary:?}"' EXIT
# Generate credentials (impersonation token as password)
step "Login to ${DOMAIN_REGISTRY:?}:${PORT_REGISTRY:?}"
docker --config "${temporary}" login -u "${usage_user:-gitlab-ci}" "${DOMAIN_REGISTRY:?}:${PORT_REGISTRY:?}"
# Show configuration
step "'DOCKER_AUTH_CONFIG' value"
cat "${temporary}/config.json"
echo ''
- Admin Area / Settings / CI/CD / Variables :
-
Action : Add variable
- Type : Variable (default)
- Protect variable : Disable
- Mask variable : Disable
- Expand variable reference : Disable
- Description : Empty
- Key :
DOCKER_AUTH_CONFIG -
Value : Paste previously generated Docker authentication configuration, similar to:
-
Action : Add variable
-
Admin Area / Settings / CI/CD / Continuous Integration and Deployment :
- Maximum artifacts size (MB) :
5000 - Default artifacts expiration :
60 minutes -
Action : Save changes
-
Admin Area / Settings / CI/CD / Container Registry :
- Enable cleanup policies for projects created earlier than GitLab 12.7 : Enable
- Action : Save changes
Admin Area / Settings / Metrics and profiling¶
- Metrics - Prometheus :
- Enable GitLab Prometheus metrics endpoint : Disable
-
Action : Save changes
-
Usage statistics :
- Enable version check : Disable
- Enable Service Ping : Disable
- Action : Save changes
Admin Area / Settings / Preferences¶
- Pages :
- Maximum size of pages (MiB) :
500 -
Action : Save changes
-
Localization :
- Default first day of the week : Monday
- Action : Save changes
Account / Edit profile¶
- Upload new avatar :
- Sources path :
GITLAB_AVATAR.png - Action : Fully unzoom, Set new profile picture
- Action : Update profile settings
Admin Area / Overview / Users (repeat)¶
- New user :
- Name :
Firstname LASTNAME - Username :
flastname - Email :
USER_EMAIL@DOMAIN - Access level : Regular or Administrator
- Avatar : Optional
- Action : Create user
- Edit :
- Password :
A1z2e3r4t5y6 - Password confirmation :
A1z2e3r4t5y6 - Action : Save changes
Account / Sign out¶
Authentication (repeat)¶
- Username :
flastname - Password :
A1z2e3r4t5y6 - Set up new password :
- Current password :
A1z2e3r4t5y6 - New password :
NEW_PASSWORD - Password confirmation :
NEW_PASSWORD - Action : Set new password
- Information : Password successfully changed
Welcome to GitLab¶
- Create a group :
... - Create a project :
...