Code Monkey home page Code Monkey logo

gitweb's Introduction

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 [email protected]

Copyright

Copyright 2014-2017 Jason Cox, unless otherwise noted.

gitweb's People

Contributors

jlcox1970 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.