⇤ ← Version 1 à la date du 2016-03-10 21:56:22
Taille: 5941
Commentaire:
|
Taille: 9287
Commentaire: Mise à jour
|
Texte supprimé. | Texte ajouté. |
Ligne 78: | Ligne 78: |
==> j'ai refait la réorganisation en remettant les titres aux bons endroits mais surtout supprimé les entrées dans la catégorie gitweb pour les dépôts à ne pas publier. Copie des clés ssh {{{ mnombre@u-nm:~/gitolite-admin$ cp -av ../gitosis-admin/keydir . }}} changement de ma clé (je mets ma nouvelle clé spécifique gitolite) {{{ mnombre@u-nm:~/gitolite-admin$ rm keydir/moussa.nombre.pub; cp ~mnombre/.ssh/nm_gitolite.pub keydir/moussa.nombre.pub }}} * côté serveur : adapter la config gitweb {{{ diff --git a/etc/gitweb.conf b/etc/gitweb.conf index 68e8e01..c99a789 100644 --- a/etc/gitweb.conf +++ b/etc/gitweb.conf @@ -1,6 +1,6 @@ # path to git projects (<project>.git) #$projectroot = "/var/cache/git"; -$projectroot = "/srv/gitosis/repositories"; +$projectroot = "/srv/gitolite/repositories"; # directory to use for temp files $git_temp = "/tmp"; @@ -16,23 +16,23 @@ $site_name = "Dépôts git de l'AuF"; # file with project list; by default, simply scan the projectroot dir. #$projects_list = $projectroot; -$projects_list = "/srv/gitosis/gitosis/projects.list"; +$projects_list = "/srv/gitolite/gitolite/projects.list"; $projects_list_description_width = 50; $export_ok = ""; $strict_export = "true"; @git_base_url_list = ('git://git.auf.org'); # stylesheet to use -$stylesheet = "gitweb.css"; +$stylesheet = "static/gitweb.css"; # javascript code for gitweb -$javascript = "gitweb.js"; +$javascript = "static/gitweb.js"; # logo to use -$logo = "git-logo.png"; +$logo = "static/git-logo.png"; # the 'favicon' -$favicon = "git-favicon.png"; +$favicon = "static/git-favicon.png"; # tout est Unicode par défaut $default_text_plain_charset = "utf-8"; }}} {{{ diff --git a/etc/gitweb-prive.conf b/etc/gitweb-prive.conf index 4be4717..415bbcc 100644 --- a/etc/gitweb-prive.conf +++ b/etc/gitweb-prive.conf @@ -1,6 +1,6 @@ # path to git projects (<project>.git) #$projectroot = "/var/cache/git"; -$projectroot = "/srv/gitosis/repositories"; +$projectroot = "/srv/gitolite/repositories"; # directory to use for temp files $git_temp = "/tmp"; @@ -19,23 +19,23 @@ $site_name = "Dépôts git de l'AuF"; # file with project list; by default, simply scan the projectroot dir. #$projects_list = $projectroot; -$projects_list = "/srv/gitosis/gitosis/projects-prive.list"; +$projects_list = "/srv/gitolite/gitolite/projects-prive.list"; $projects_list_description_width = 50; $export_ok = ""; $strict_export = "true"; @git_base_url_list = ('git://git.auf.org'); # stylesheet to use -$stylesheet = "gitweb.css"; +$stylesheet = "static/gitweb.css"; # javascript code for gitweb -$javascript = "gitweb.js"; +$javascript = "static/gitweb.js"; # logo to use -$logo = "git-logo.png"; +$logo = "static/git-logo.png"; # the 'favicon' -$favicon = "git-favicon.png"; +$favicon = "static/git-favicon.png"; # tout est Unicode par défaut $default_text_plain_charset = "utf-8"; }}} {{{ test-git:/srv# mv gitosis gitosis-FRIGO test-git:/srv# cp gitosis-FRIGO/gitosis/projects-prive.list gitolite/ test-git:/srv# chown gitolite: gitolite/projects-prive.list }}} ''' .... On n'a rien sur l'interface web :(...''' '''A SUIVRE''' www-data pas les droits d'accès ??? à vérifier |
Gitosis2Gitolite
- Doc :
- installation et config
J'ai dû me créer une nouvelle paire de clé ssh pour ma connexion gitolite
you probably supplied a key which already has shell access to the server. That won't work; you'll have to generate and use a different key pair for gitolite access
côté serveur
test-git:/srv# apt-get install gitolite test-git:/srv# dpkg-reconfigure gitolite ==> username : gitolite ==> homedir : /srv/gitolite ==> admin key : /srv/moussa.nombre.pub (clé pub de mnombre) test-git:/srv# cp -av /srv/gitosis/repositories /srv/gitolite/ test-git:/srv# chown -R gitolite: /srv/gitolite/repositories test-git:/srv# su - gitolite (auto-config de GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL) gitolite@test-git:~$ ls -al total 12 drwxr-xr-x 3 gitolite gitolite 4096 mar 10 11:53 . drwxr-xr-x 8 root root 4096 mar 10 11:52 .. drwxr-xr-x 150 gitolite gitolite 4096 mar 10 11:33 repositories #initialise the gitolite repository gitolite@test-git:~$ gl-setup creating gitolite-admin... Initialized empty Git repository in /srv/gitolite/repositories/gitolite-admin.git/ gitolite@test-git:~$ exit test-git:/srv# adduser gitolite ssh
- côté poste admin (poste client)
Clone
mnombre@u-nm:~$ git clone ssh://gitolite@199.84.140.58/gitolite-admin Clonage dans 'gitolite-admin'... warning: Vous semblez avoir cloné un dépôt vide. Vérification de la connectivité... fait. mnombre@u-nm:~$ cd gitolite-admin/ mnombre@u-nm:~/gitolite-admin$ ls -al total 12 drwxrwxr-x 3 mnombre mnombre 4096 mar 10 15:07 . drwx------ 51 mnombre mnombre 4096 mar 10 15:07 .. drwxrwxr-x 7 mnombre mnombre 4096 mar 10 15:07 .git mnombre@u-nm:~/gitolite-admin$ ls -al .git/ total 40 drwxrwxr-x 7 mnombre mnombre 4096 mar 10 15:07 . drwxrwxr-x 3 mnombre mnombre 4096 mar 10 15:07 .. drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 branches -rw-rw-r-- 1 mnombre mnombre 268 mar 10 15:07 config -rw-rw-r-- 1 mnombre mnombre 73 mar 10 15:07 description -rw-rw-r-- 1 mnombre mnombre 23 mar 10 15:07 HEAD drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 hooks drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 info drwxrwxr-x 4 mnombre mnombre 4096 mar 10 15:07 objects drwxrwxr-x 4 mnombre mnombre 409
Convert
mnombre@u-nm:~/gitolite-admin$ scp 199.84.140.58:/usr/share/gitolite/gl-conf-convert /home/mnombre/Bureau/ gl-conf-convert 100% 3396 3.3KB/s 00:00 mnombre@u-nm:~$ ~mnombre/Bureau/gl-conf-convert < gitosis-admin/gitosis.conf >> gitolite-admin/conf/gitolite.conf mnombre@u-nm:~$
en cours ... : Be sure to check the file to make sure it converted correctly http://gitolite.com/gitolite/gitolite.html#gsmigr ==> j'ai refait la réorganisation en remettant les titres aux bons endroits mais surtout supprimé les entrées dans la catégorie gitweb pour les dépôts à ne pas publier.
Copie des clés ssh
mnombre@u-nm:~/gitolite-admin$ cp -av ../gitosis-admin/keydir .
changement de ma clé (je mets ma nouvelle clé spécifique gitolite)
mnombre@u-nm:~/gitolite-admin$ rm keydir/moussa.nombre.pub; cp ~mnombre/.ssh/nm_gitolite.pub keydir/moussa.nombre.pub
côté serveur : adapter la config gitweb
diff --git a/etc/gitweb.conf b/etc/gitweb.conf index 68e8e01..c99a789 100644 --- a/etc/gitweb.conf +++ b/etc/gitweb.conf @@ -1,6 +1,6 @@ # path to git projects (<project>.git) #$projectroot = "/var/cache/git"; -$projectroot = "/srv/gitosis/repositories"; +$projectroot = "/srv/gitolite/repositories"; # directory to use for temp files $git_temp = "/tmp"; @@ -16,23 +16,23 @@ $site_name = "Dépôts git de l'AuF"; # file with project list; by default, simply scan the projectroot dir. #$projects_list = $projectroot; -$projects_list = "/srv/gitosis/gitosis/projects.list"; +$projects_list = "/srv/gitolite/gitolite/projects.list"; $projects_list_description_width = 50; $export_ok = ""; $strict_export = "true"; @git_base_url_list = ('git://git.auf.org'); # stylesheet to use -$stylesheet = "gitweb.css"; +$stylesheet = "static/gitweb.css"; # javascript code for gitweb -$javascript = "gitweb.js"; +$javascript = "static/gitweb.js"; # logo to use -$logo = "git-logo.png"; +$logo = "static/git-logo.png"; # the 'favicon' -$favicon = "git-favicon.png"; +$favicon = "static/git-favicon.png"; # tout est Unicode par défaut $default_text_plain_charset = "utf-8";
diff --git a/etc/gitweb-prive.conf b/etc/gitweb-prive.conf index 4be4717..415bbcc 100644 --- a/etc/gitweb-prive.conf +++ b/etc/gitweb-prive.conf @@ -1,6 +1,6 @@ # path to git projects (<project>.git) #$projectroot = "/var/cache/git"; -$projectroot = "/srv/gitosis/repositories"; +$projectroot = "/srv/gitolite/repositories"; # directory to use for temp files $git_temp = "/tmp"; @@ -19,23 +19,23 @@ $site_name = "Dépôts git de l'AuF"; # file with project list; by default, simply scan the projectroot dir. #$projects_list = $projectroot; -$projects_list = "/srv/gitosis/gitosis/projects-prive.list"; +$projects_list = "/srv/gitolite/gitolite/projects-prive.list"; $projects_list_description_width = 50; $export_ok = ""; $strict_export = "true"; @git_base_url_list = ('git://git.auf.org'); # stylesheet to use -$stylesheet = "gitweb.css"; +$stylesheet = "static/gitweb.css"; # javascript code for gitweb -$javascript = "gitweb.js"; +$javascript = "static/gitweb.js"; # logo to use -$logo = "git-logo.png"; +$logo = "static/git-logo.png"; # the 'favicon' -$favicon = "git-favicon.png"; +$favicon = "static/git-favicon.png"; # tout est Unicode par défaut $default_text_plain_charset = "utf-8";
test-git:/srv# mv gitosis gitosis-FRIGO test-git:/srv# cp gitosis-FRIGO/gitosis/projects-prive.list gitolite/ test-git:/srv# chown gitolite: gitolite/projects-prive.list
.... On n'a rien sur l'interface web :(... A SUIVRE www-data pas les droits d'accès ??? à vérifier
dpkg-reconfigure gitolite des erreurs (du fait que ce soit fait sous root ?): test-git:/srv/gitosis# dpkg-reconfigure gitolite creating gitolite-admin... fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>) could not symlink /srv/gitolite/.gitolite/hooks/common/gitolite-hooked to hooks fatal: Not a git repository: '/.git' error: could not lock config file /.git/config: Permission non accord?e error: could not lock config file /.git/config: Permission non accord?e fatal: Not a git repository: '/.git' could not symlink /srv/gitolite/.gitolite/hooks/common/gitolite-hooked to ./gitolite-admin.git/hooks fprint failed mais dossier créé : test-git:/srv/gitosis#ls -al /srv/gitolite/ total 28 drwxr-xr-x 5 gitolite gitolite 4096 mar 10 11:15 . drwxr-xr-x 7 root root 4096 mar 10 11:15 .. drwx------ 8 gitolite gitolite 4096 mar 10 11:15 .gitolite -rw-r--r-- 1 gitolite gitolite 4217 mar 10 11:15 .gitolite.rc drwx------ 3 gitolite gitolite 4096 mar 10 11:15 repositories drwx------ 2 gitolite gitolite 4096 mar 10 11:15 .ssh test-git:/srv/gitosis#
- problème ssh
WARNING: keydir/<yourname>.pub duplicates a non-gitolite key, sshd will ignore it You used a key that is already set to give you shell access. You cannot use the same key to get shell access as well as access gitolite repos. Solution: use a different keypair for gitolite. There's a wee bit more on this in the setup section of the install page. Also see why bypassing causes a problem and both the pages linked from ssh for background. 2.1.2.5 setup For the first-time setup, you need to have a public key file (usually from the admin's workstation) ready. If the main gitolite admin's username is "alice", this file should be named "alice.pub" and copied to the server. Once that is done, run: gitolite setup -pk alice.pub If that completes without any warnings, you are done. If it had a warning, you probably supplied a key which already has shell access to the server. That won't work; you'll have to generate and use a different key pair for gitolite access and use host aliases to distinguish between the two. While you're there, read both the ssh pages. Twice.
ajout de compte admin (s'inspirer de comment changer une clé)
If you lost your gitolite admin key or access, here's what you do. We'll assume your username is "alice" (i.e., alice has RW or RW+ permissions on the gitolite-admin repo). Make yourself a new keypair and copy the public key to the server as 'alice.pub'. Log on to the server, and run gitolite setup -pk alice.pub. That's it; the new alice.pub file replaces whatever existed in the repo before.