Forge Home

gitweb

Installs Gitolite3 and gitweb onto a server so that you can have a local git server

13,829 downloads

7,944 latest version

1.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.6 (latest)
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Feb 20th 2017
This version is compatible with:
  • Puppet Enterprise 3.2.x
  • Puppet 3.x
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'jlcox-gitweb', '1.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jlcox-gitweb
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jlcox-gitweb --version 1.0.6

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

jlcox/gitweb — version 1.0.6 Feb 20th 2017

Gitweb

Module Description

Installs both gitolite and gitweb server that uses ssh to connect for read write and a website for browsing the repos. It assumes apache is separately installed and a vhost setup for CGI execution.

Setup

This class assumes that apache is separately installed, and includes its own vhost definition, for which this class needs to be installed.

Gitweb configuration

A simple setup needs to declare just an SSH key

class { 'gitweb':
  git_key => 'some key value'
}

This results in:

  • A gitolite respository installed in /home/git
  • A new user git:git created
  • An admin user in the gitolite repository named install that allows access through the provided SSH key
  • A umask of 0077 on the /home/git/repositories directory
  • A cgi script installed in /var/wwww/git/gitweb.cgi
  • The default /etc/gitweb.conf file configured to point to the gitolite repositories directory

If youre [apache] install is using defaults, it will have a user and group of apache:apache or httpd:httpd, depending on distro used. You will need to make sure that your apache user has a secondary group of git or that apache's group is set to git

class { 'apache':
   ...

   group => 'git'
}

in order to access the repositories directory

Apache configuration

On the apache side, you need to point it at the installed gitweb location, and enable the CGI handler. Various options are available, depending on whether you are using apache::mod::perl or apache::mod::fastcgi. The following setup illustrates basic CGI usage as a vhost

$git_cgi_dir = '/var/www/git'

include apache::mod::cgi

apache::vhost { "git":
  docroot => '/var/www/git/static',
  options => [ 'Indexes', 'FollowSymlinks', 'ExecCGI' ],
  custom_fragment =>  'AddHandler cgi-script .cgi',
  rewrite_rule => "^/$ $git_cgi_dir/gitweb.cgi",

  directories => [
    {
      'path' => '/var/www/git',
      'options' => 'ExecCGI',
      'allow' => 'from all',
    }
  ]
}

class { 'gitweb':
    git_key => hiera('git.admin.key'),
    admin_user => hiera('git.admin.name'),
    repo_umask => '0027',
    cgi_bin_dir => $git_cgi_dir,
  }

Classes

gitweb

Parameters

git_key

administrators public ssh key for setting up the system.

admin_user

Gitolite internal user name for the administrator key.

git_key_type

The type of key for the administrator (defaults to ssh-rsa)

git_home

root directory for the repository. Defaults to the git users home direcotry (/home/git)

auto_tag_serial

Adds an auto incrimental serial tag to each commit

Authors

Jason Cox j_cox@bigpond.com

Copyright

Copyright 2014-2017 Jason Cox, unless otherwise noted.