Tools/Gitlab/sysconfig : Différence entre versions
Sauter à la navigation
Sauter à la recherche
(Page créée avec « {{MediaWiki}} <br> {{FOND_BLEU|Gitlab - éléments de '''configuration'''}} = Sites Références = * [https://docs.gitlab.com/ee Documentation Gitlab officielle] = Fi… ») |
|||
(2 révisions intermédiaires par le même utilisateur non affichées) | |||
Ligne 10 : | Ligne 10 : | ||
= Fichier de configuration pricipal = | = Fichier de configuration pricipal = | ||
<code>/etc/gitlab/gitlab.rb</code> | <code>/etc/gitlab/gitlab.rb</code> | ||
+ | |||
+ | {{IMPORTANT | ||
+ | |contenu=Certaines parties de ce fichier suivent le format YAML. Bien faire attention à l'indentation. En cas d'erreur de syntaxe YAML, le processus de reconfiguration échouera sans vraiment donner le moyen de trouver la cause du problème | ||
+ | }} | ||
== configurer authentification AD == | == configurer authentification AD == | ||
Ligne 28 : | Ligne 32 : | ||
main: # 'main' is the GitLab 'provider ID' of this LDAP server | main: # 'main' is the GitLab 'provider ID' of this LDAP server | ||
label: 'Active Directory' | label: 'Active Directory' | ||
− | #host: 'DC.example.com' | + | #host: 'DC.git.example.com' |
#host: '10.11.12.13' #DC | #host: '10.11.12.13' #DC | ||
port: 389 # 636 | port: 389 # 636 | ||
uid: 'sAMAccountName' | uid: 'sAMAccountName' | ||
− | bind_dn: 'CN=bind_user,OU=xxxx,DC= | + | bind_dn: 'CN=bind_user,OU=xxxx,DC=git,DC=example,DC=com' |
password: 'MyGreatPassword' | password: 'MyGreatPassword' | ||
#encryption: 'plain' # "start_tls" or "simple_tls" or "plain" | #encryption: 'plain' # "start_tls" or "simple_tls" or "plain" | ||
Ligne 41 : | Ligne 45 : | ||
lowercase_usernames: false | lowercase_usernames: false | ||
block_auto_created_users: false | block_auto_created_users: false | ||
− | base: 'DC= | + | base: 'DC=git,DC=example,DC=com' |
− | user_filter: '(memberOf:1.2.840.113556.1.4.1941:=CN=my_ad_group,OU=xx,OU=yyy,DC= | + | user_filter: '(memberOf:1.2.840.113556.1.4.1941:=CN=my_ad_group,OU=xx,OU=yyy,DC=git,DC=example,DC=com)' |
user_filter: '' | user_filter: '' | ||
# ## EE only | # ## EE only | ||
Ligne 71 : | Ligne 75 : | ||
EOS | EOS | ||
+ | |||
+ | </syntaxhighlight> | ||
+ | |||
+ | == reconfiguration de gitlab == | ||
+ | |||
+ | <code>gitlab-ctl reconfigure</code> | ||
+ | |||
+ | == Outil de diagnostic == | ||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | gitlab-rake gitlab:ldap:check --trace | ||
+ | ** Invoke gitlab:ldap:check (first_time) | ||
+ | ** Invoke gitlab_environment (first_time) | ||
+ | ** Invoke environment (first_time) | ||
+ | ** Execute environment | ||
+ | ** Execute gitlab_environment | ||
+ | ** Execute gitlab:ldap:check | ||
+ | Checking LDAP ... | ||
+ | |||
+ | LDAP: ... Server: ldapmain | ||
+ | not verifying SSL hostname of LDAPS server '10.28.139.2:389' | ||
+ | LDAP authentication... Success | ||
+ | LDAP users with access to your GitLab server (only showing the first 100 results) | ||
+ | |||
+ | DN: cn=Franck Martin,ou=users,dc=git,dc=example,dc=com sAMAccountName: fmartin | ||
+ | ..... | ||
+ | |||
+ | Checking LDAP ... Finished | ||
</syntaxhighlight> | </syntaxhighlight> |
Version actuelle datée du 8 juillet 2021 à 21:26
Sommaire
Sites Références
Fichier de configuration pricipal
/etc/gitlab/gitlab.rb
|
configurer authentification AD
exemple de configuration :
### LDAP Settings
###! Docs: https://docs.gitlab.com/omnibus/settings/ldap.html
###! **Be careful not to break the indentation in the ldap_servers block. It is
###! in yaml format and the spaces must be retained. Using tabs will not work.**
gitlab_rails['ldap_enabled'] = true
##! **remember to close this block with 'EOS' below**
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'Active Directory'
#host: 'DC.git.example.com'
#host: '10.11.12.13' #DC
port: 389 # 636
uid: 'sAMAccountName'
bind_dn: 'CN=bind_user,OU=xxxx,DC=git,DC=example,DC=com'
password: 'MyGreatPassword'
#encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
encryption: 'start_tls' # "start_tls" or "simple_tls" or "plain"
verify_certificates: true # false
active_directory: true
allow_username_or_email_login: false
lowercase_usernames: false
block_auto_created_users: false
base: 'DC=git,DC=example,DC=com'
user_filter: '(memberOf:1.2.840.113556.1.4.1941:=CN=my_ad_group,OU=xx,OU=yyy,DC=git,DC=example,DC=com)'
user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
#
# secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
# label: 'LDAP'
# host: '_your_ldap_server'
# port: 389
# uid: 'sAMAccountName'
# bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
# password: '_the_password_of_the_bind_user'
# encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
# verify_certificates: true
# active_directory: true
# allow_username_or_email_login: false
# lowercase_usernames: false
# block_auto_created_users: false
# base: ''
# user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
EOS
reconfiguration de gitlab
gitlab-ctl reconfigure
Outil de diagnostic
gitlab-rake gitlab:ldap:check --trace
** Invoke gitlab:ldap:check (first_time)
** Invoke gitlab_environment (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab_environment
** Execute gitlab:ldap:check
Checking LDAP ...
LDAP: ... Server: ldapmain
not verifying SSL hostname of LDAPS server '10.28.139.2:389'
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
DN: cn=Franck Martin,ou=users,dc=git,dc=example,dc=com sAMAccountName: fmartin
.....
Checking LDAP ... Finished