Änderungen

Zur Navigation springen Zur Suche springen
3.888 Bytes hinzugefügt ,  17:21, 16. Jan. 2015
Zeile 43: Zeile 43:  
Should your repository storage:
 
Should your repository storage:
   −
  be avaiable by other means than ssh?
+
  be available by other means than ssh?
    
Depending on the setup of your repository storage, you can access your git repositories by different means: ssh, git, http(s) . You can also configure the access to your repositories for these different protocols using the gitolite config file on a repository basis. But still you need to tell us by which protocols your repositories should (potentially be available).
 
Depending on the setup of your repository storage, you can access your git repositories by different means: ssh, git, http(s) . You can also configure the access to your repositories for these different protocols using the gitolite config file on a repository basis. But still you need to tell us by which protocols your repositories should (potentially be available).
Zeile 60: Zeile 60:     
You have to choose a login name for your repository storage. This will be the login name that you can use access your repositories by ssh. Also if you choose to make it possible to browse your repositories by http(s), you will also be able to access them by ''http(s)://git-LOGINNAME.immerda.ch'' using a correct certificate for the domain name.
 
You have to choose a login name for your repository storage. This will be the login name that you can use access your repositories by ssh. Also if you choose to make it possible to browse your repositories by http(s), you will also be able to access them by ''http(s)://git-LOGINNAME.immerda.ch'' using a correct certificate for the domain name.
 +
 +
As a bonus point we can set you a dedicated cgit-logo if you provide as one.
    
== Configuration ==
 
== Configuration ==
Zeile 89: Zeile 91:  
=== http(s)-protocol ===
 
=== http(s)-protocol ===
   −
If you want to make a repository appear in the webinterface cgit (and accessible via anonymous http(s)), you need to - similar to the git-protocol - give read access to the daemon user for this repository. Additionally you might want to set gitweb options for the git config that will be read by cgit and for example label your repository in the webinterface.
+
If you want to make a repository appear in the webinterface cgit (and accessible via anonymous http(s)), you need to - similar to the git-protocol - give read access to the daemon user for this repository. Additionally you '''have''' to set gitweb options for the git config that will be read by cgit and for example label your repository in the webinterface. Otherwise your repositories won't show up in cgit.
    
<pre>
 
<pre>
Zeile 125: Zeile 127:     
This prefix is only required for repositories that are not published in cgit. A good example is for example the '''gitolite-admin.git''' repository, which you might not want to publish in cgit, but still push changed to it over https.
 
This prefix is only required for repositories that are not published in cgit. A good example is for example the '''gitolite-admin.git''' repository, which you might not want to publish in cgit, but still push changed to it over https.
 +
 +
=== wildcard repositories with create rights ===
 +
 +
* http://gitolite.com/gitolite/wild.html#create
 +
 +
    repo somedir/..*
 +
      C = u1
 +
      RW+ = u1 u2
 +
 +
This means, that u1 can create any repositories under somedir/ by using a simple `git clone git@git.yourdomain.com:somedir/foo.git . u2 can push to any existing repository.
 +
 +
== commands ==
 +
 +
Gitolite provides a set of basic commands to run commands on the repository storage for a certain user. One example is the htpasswd command mentioned above or the hooks command in the next section.
 +
 +
You can get a list of possible commands by calling:
 +
 +
$ ssh LOGINNAME@git.yourdomain.com help
 +
 +
Additional help for a command can be printed by calling this command with -h. Example:
 +
 +
<pre>
 +
$ ssh LOGINNAME@git.yourdomain.com desc -h
 +
Usage:    ssh git@host desc <repo>
 +
          ssh git@host desc <repo> <description string>
 +
 +
Show or set description for user-created ("wild") repo.
 +
</pre>
 +
 +
Calling the repository storage without any command provides you a list for repository you have access to and the specific access rights.
 +
 +
== Hooks ==
 +
 +
Hooks can be very comfortable to run additional commands for example before or after you pushed updates to your repository. To ease administration of hooks on your repository we provide you as a repository storage owner (gitolite user than can write to gitolite-admin) with gitolite command to manage hooks on repositories:
 +
 +
<pre>
 +
$ ssh LOGINNAME@git.yourdomain.com hooks -h
 +
Usage:  ssh git@host hooks show <repo> <hook>        # Shows current active hooks for repo.
 +
        ssh git@host hooks list [<hook>]            # List available hooks for a certain type. If <hook> is omitted all hooks are shown.
 +
        ssh git@host hooks add  <repo> <hook/script> # Add a certain script to a hook - this must be named like hook/script.
 +
        ssh git@host hooks rm  <repo> <hook/script> # Removes a certain hook script from a repository.
 +
 +
Only users with write access to the giolite-admin repository can show, add or rm hooks from a certain repository.
 +
</pre>
 +
 +
To minimize possible attack vectors on our system you are only able to add hooks we previously reviewed and activated for global usage. You can get a list of possible hooks by running the list action on the specific command:
 +
 +
<pre>
 +
$ ssh LOGINNAME@git.yourdomain.com hooks list
 +
post-receive:
 +
  email-notification
 +
</pre>
 +
 +
Example to activate the hook:
 +
 +
<pre>
 +
ssh LOGINNAME@git.yourdomain.com hooks gitolite-admin post-receive/email-notification
 +
</pre>
 +
 +
=== post-receive/email-notification ===
 +
 +
Sends an email to a certain address (config hooks.mailinglist option on your repository) about the recently pushed changes. You will need to set at least the option hooks.mailinglist for your repository:
 +
 +
<pre>
 +
repo gitolite-admin
 +
RW = @gitolite-admin
 +
  config hooks.mailinglist    = 'gitusers@example.com'
 +
  config hooks.envelopesender = 'git@example.com'
 +
</pre>
 +
 +
You can also easily activate this config setting for all repositories:
 +
 +
<pre>
 +
repo @all
 +
  config hooks.mailinglist    = 'mh@scrit.ch'
 +
  config hooks.envelopesender = 'git@scrit.ch'
 +
 +
repo gitolite-admin
 +
RW = @gitolite-admin
 +
</pre>
 +
 +
The behavior of this hook can be configured by different options:
 +
 +
* hooks.mailinglist - '''required''' - Receivers of emails
 +
* hooks.announcelist - Additional receivers of pushed tags
 +
* hooks.envelopesender - sender of the email
 +
* hooks.emailprefix - Prefix of the emails subject. Default: [SCM]
 +
* hooks.generatepatch - Should we include a diff of all the pushed changes? Default: true
 +
 +
You can get more Information at:http://git.puppet.immerda.ch/?p=module-gitolite.git;a=blob;f=files/hooks/post-receive/email-notification
 +
 +
=== More ===
 +
 +
Expect more hooks to come. Get in contact with us if you miss one.
 +
 +
[[Category:immerda]]
1.368

Bearbeitungen

Navigationsmenü