GitLab
GitLab est une interface Web pour les dépôts Git proposant de multiples fonctionnalités pratiques pour visualiser un dépôt, et donner des droits de commit/push à des utilisateurs n'existant pas sur le serveur.
Il est initialement basé sur gitolite, mais est devenu totalement indépendant récemment.
Lien
Le dépôt Gitlab du Crans se trouve à l'adresse https://gitlab.crans.org.
Installation
Pour installer Gitlab, on a suivi cette page : https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md .
Depuis, gitlab propose un paquet tout fait pour l'installer sur debian (7.5) : https://about.gitlab.com/downloads/ .
CAS
Pour permettre l'authentification via le CAS du crans : Ajouter gem 'omniauth-cas' dans /gitlab/gitlab/Gemfile lancer :
git@geet:~/gitlab$ bundle install --without development test mysql --no-deployment --path vendor/bundle
dans /gitlab/gitlab/
Pour le crans, remplacer vendor/bundle/ruby/1.9.1/gems/vendor/bundle/ruby/1.9.1/gems/omniauth-cas* par https://gitlab.crans.org/nounous/omniauth-cas qui a été tweaké pour le crans.
Éditez dans /gitlab/gitlab/config/gitlab.yml la section sur omniauth comme ceci :
## OmniAuth settings omniauth: # Allow login via Twitter, Google, etc. using OmniAuth providers enabled: true # CAUTION! # This allows users to login without having a user account first (default: false). # User accounts will be created automatically when authentication was successful. allow_single_sign_on: true # Locks down those users until they have been cleared by the admin (default: true). block_auto_created_users: false ## Auth providers # Uncomment the following lines and fill in the data of the auth provider you want to use # If your favorite auth provider is not listed you can use others: # see https://github.com/gitlabhq/gitlab-public-wiki/wiki/Working-custom-omniauth-provider-configur$ # The 'app_id' and 'app_secret' parameters are always passed as the first two # arguments, followed by optional 'args' which can be either a hash or an array. providers: # - { name: 'google_oauth2', app_id: 'YOUR APP ID', # app_secret: 'YOUR APP SECRET', # args: { access_type: 'offline', approval_prompt: '' } } # - { name: 'twitter', app_id: 'YOUR APP ID', # app_secret: 'YOUR APP SECRET'} # - { name: 'github', app_id: '', # app_secret: '', # args: { scope: 'user:email' } } - { name: 'cas', "args":{ 'host': 'cas.crans.org', 'port': 443, 'ssl': true, 'service_validate_url': '/cas/serviceValidate', 'login_url': '/cas/login', 'logout_url': '/cas/logout', 'disable_ssl_verification': false, 'email_key': 'login_mail' } }
Enfin, il y a un petit hack a faire dans le code de gitlab pour que l'auth CAS fonctionne de façon transparente avec l'auth ldap : il faut éditer le fichier /gitlab/gitlab/ib/gitlab/oauth/user.rb
--- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -42,7 +42,7 @@ module Gitlab private def find_by_uid_and_provider - model.where(provider: provider, extern_uid: uid).last + model.where(extern_uid: uid).last end def uid @@ -62,7 +62,7 @@ module Gitlab end def provider - auth.provider + "ldap" end def log
Sinon un user par mode d'authentification est créé.
Enfin, en redémarre gitlab :
samir@geet $ sudo service gitlab restart