Tools/Gitlab/sysconfig

De MonPtitSite
Sauter à la navigation Sauter à la recherche
Accueil SysAdmin Hobbies                  


Gitlab - éléments de configuration


Sites Références


Fichier de configuration pricipal

/etc/gitlab/gitlab.rb


IMPORTANT
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

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

<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>