diff options
author | Michael Scherer <misc@mageia.org> | 2011-07-19 20:12:32 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-07-19 20:12:32 +0000 |
commit | 835fa6f17fe9dc0b74d478c5131a5266b8294993 (patch) | |
tree | 59dd08ba4d8118316bfb99f3e65d66990b01de1d | |
parent | 69c3ec7b91c0cb80f32d712ee29df01661fbb844 (diff) | |
download | puppet-835fa6f17fe9dc0b74d478c5131a5266b8294993.tar puppet-835fa6f17fe9dc0b74d478c5131a5266b8294993.tar.gz puppet-835fa6f17fe9dc0b74d478c5131a5266b8294993.tar.bz2 puppet-835fa6f17fe9dc0b74d478c5131a5266b8294993.tar.xz puppet-835fa6f17fe9dc0b74d478c5131a5266b8294993.zip |
add a prototype of a working gitweb module
-rw-r--r-- | modules/gitweb/manifests/init.pp | 36 | ||||
-rw-r--r-- | modules/gitweb/templates/gitweb.conf | 125 | ||||
-rw-r--r-- | modules/gitweb/templates/vhost.conf | 2 | ||||
-rw-r--r-- | modules/gitweb/templates/webapp.conf | 9 | ||||
-rw-r--r-- | modules/gitweb/templates/wrapper.sh | 5 |
5 files changed, 177 insertions, 0 deletions
diff --git a/modules/gitweb/manifests/init.pp b/modules/gitweb/manifests/init.pp new file mode 100644 index 00000000..d0b3b255 --- /dev/null +++ b/modules/gitweb/manifests/init.pp @@ -0,0 +1,36 @@ +class gitweb { + package { 'gitweb': + ensure => installed, + } + # TODO some rpm may be needed ( like perl-FCGI ) + # git >= 17.2 is needed for fastcgi support + + # TODO fix git rpm to show the css, the js, and others missing file + + file { 'gitweb.conf': + ensure => present, + path => '/etc/gitweb.conf', + content => template('gitweb/gitweb.conf'), + notify => Service['apache'], + require => Package['gitweb'] + } + + file { 'webapps.d/gitweb.conf': + ensure => present, + path => '/etc/httpd/conf/webapps.d/gitweb.conf', + content => template('gitweb/webapp.conf'), + notify => Service['apache'], + } + + file { 'gitweb.wrapper.sh': + ensure => present, + mode => 755, + path => '/usr/local/bin/gitweb.wrapper.sh', + content => template('gitweb/wrapper.sh'), + notify => Service['apache'], + } + + apache::vhost_base { "gitweb.$domain": + content => template("gitweb/vhost.conf") + } +} diff --git a/modules/gitweb/templates/gitweb.conf b/modules/gitweb/templates/gitweb.conf new file mode 100644 index 00000000..5216077c --- /dev/null +++ b/modules/gitweb/templates/gitweb.conf @@ -0,0 +1,125 @@ +# default config file (in perl syntax) + +# absolute fs-path which will be prepended to the project path +our $projectroot = "/git"; + +# target of the home link on top of all pages +our $home_link = "/"; + +# string of the home link on top of all pages +#our $home_link_str = "projects"; + +# name of your site or organization to appear in page titles +# replace this with something more descriptive for clearer bookmarks +our $site_name = "Mageia Git"; + +# filename of html text to include at top of each page +#our $site_header = ""; +# html text to include at home page +#our $home_text = "indextext.html"; +# filename of html text to include at bottom of each page +#our $site_footer = ""; + +# URI of stylesheets +#our @stylesheets = ("gitweb.css"); +# URI of a single stylesheet +#our $stylesheet = undef; +# URI of GIT logo (72x27 size) +#our $logo = "git-logo.png"; +# URI of GIT favicon, assumed to be image/png type +#our $favicon = "git-favicon.png"; + +# URI and label (title) of GIT logo link +#our $logo_url = "http://git.or.cz/"; +#our $logo_label = "git homepage"; + +# source of projects list +#our $projects_list = ""; + +# default order of projects list +# valid values are none, project, descr, owner, and age +#our $default_projects_order = "project"; + +# show repository only if this file exists +# (only effective if this variable evaluates to true) +#our $export_ok = ""; + +# only allow viewing of repositories also shown on the overview page +#our $strict_export = ""; + +# list of git base URLs used for URL to where fetch project from, +# i.e. full URL is "$git_base_url/$project" +#our @git_base_url_list = grep { $_ ne '' } (""); + +# Enable the 'blame' blob view, showing the last commit that modified +# each line in the file. This can be very CPU-intensive. + +# To enable system wide have in /etc/gitweb.conf +# $feature{'blame'}{'default'} = [1]; +# To have project specific config enable override in /etc/gitweb.conf +# $feature{'blame'}{'override'} = 1; +# and in project config gitweb.blame = 0|1; + +# Enable the 'snapshot' link, providing a compressed tarball of any +# tree. This can potentially generate high traffic if you have large +# project. + +# To disable system wide have in /etc/gitweb.conf +# $feature{'snapshot'}{'default'} = [undef]; +# To have project specific config enable override in /etc/gitweb.conf +# $feature{'snapshot'}{'override'} = 1; +# and in project config gitweb.snapshot = none|gzip|bzip2; + +# Enable text search, which will list the commits which match author, +# committer or commit text to a given string. Enabled by default. +# Project specific override is not supported. + +# Enable grep search, which will list the files in currently selected +# tree containing the given string. Enabled by default. This can be +# potentially CPU-intensive, of course. + +# To enable system wide have in /etc/gitweb.conf +# $feature{'grep'}{'default'} = [1]; +# To have project specific config enable override in /etc/gitweb.conf +# $feature{'grep'}{'override'} = 1; +# and in project config gitweb.grep = 0|1; + +# Enable the pickaxe search, which will list the commits that modified +# a given string in a file. This can be practical and quite faster +# alternative to 'blame', but still potentially CPU-intensive. + +# To enable system wide have in /etc/gitweb.conf +# $feature{'pickaxe'}{'default'} = [1]; +# To have project specific config enable override in /etc/gitweb.conf +# $feature{'pickaxe'}{'override'} = 1; +# and in project config gitweb.pickaxe = 0|1; + +# Make gitweb use an alternative format of the URLs which can be +# more readable and natural-looking: project name is embedded +# directly in the path and the query string contains other +# auxiliary information. All gitweb installations recognize +# URL in either format; this configures in which formats gitweb +# generates links. + +# To enable system wide have in /etc/gitweb.conf +# $feature{'pathinfo'}{'default'} = [1]; +# Project specific override is not supported. + +# Note that you will need to change the default location of CSS, +# favicon, logo and possibly other files to an absolute URL. Also, +# if gitweb.cgi serves as your indexfile, you will need to force +# $my_uri to contain the script name in your /etc/gitweb.conf. + +# Make gitweb consider projects in project root subdirectories +# to be forks of existing projects. Given project $projname.git, +# projects matching $projname/*.git will not be shown in the main +# projects list, instead a '+' mark will be added to $projname +# there and a 'forks' view will be enabled for the project, listing +# all the forks. If project list is taken from a file, forks have +# to be listed after the main project. + +# To enable system wide have in /etc/gitweb.conf +# $feature{'forks'}{'default'} = [1]; +# Project specific override is not supported. + + diff --git a/modules/gitweb/templates/vhost.conf b/modules/gitweb/templates/vhost.conf new file mode 100644 index 00000000..c21b86a8 --- /dev/null +++ b/modules/gitweb/templates/vhost.conf @@ -0,0 +1,2 @@ +Alias / /usr/local/bin/gitweb.wrapper.sh +FastCgiServer /usr/local/bin/gitweb.wrapper.sh -processes 1 -idle-timeout 30 -socket /tmp/gitweb.socket diff --git a/modules/gitweb/templates/webapp.conf b/modules/gitweb/templates/webapp.conf new file mode 100644 index 00000000..54c85a29 --- /dev/null +++ b/modules/gitweb/templates/webapp.conf @@ -0,0 +1,9 @@ +# gitweb configuration +# disabled +#Alias /gitweb /usr/share/gitweb + +<Directory /usr/share/gitweb> + Order allow,deny + Allow from all +</Directory> + diff --git a/modules/gitweb/templates/wrapper.sh b/modules/gitweb/templates/wrapper.sh new file mode 100644 index 00000000..c8fdcb6d --- /dev/null +++ b/modules/gitweb/templates/wrapper.sh @@ -0,0 +1,5 @@ +#!/bin/bash +export FCGI_SOCKET_PATH=/tmp/gitweb.socket + +/usr/share/gitweb/gitweb.cgi --fastcgi + |