From 5b7df9f70aafb6883f8127b3f4862c99116c2b8c Mon Sep 17 00:00:00 2001 From: Elizabeth Krumbach Joseph Date: Wed, 14 Aug 2013 17:33:00 -0700 Subject: [PATCH] Add static web directory for cgit & initial files Create and define a static directory for cgit to use. Add initial favicon and logo files and include in cgitrc. Also include custom CSS and background image. Change-Id: If1e20d8e62557cc90aafbf92f4291b964400e029 --- manifests/init.pp | 18 ++++++++++++++++++ templates/git.vhost.erb | 1 + 2 files changed, 19 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index e014a1c..b3c5202 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,6 +17,8 @@ class cgit( $vhost_name = $::fqdn, $serveradmin = "webmaster@${::fqdn}", + $cgitdir = '/var/www/cgit', + $staticfiles = '/var/www/cgit/static', $ssl_cert_file = '', $ssl_key_file = '', $ssl_chain_file = '', @@ -81,6 +83,7 @@ class cgit( priority => '50', template => 'cgit/git.vhost.erb', ssl => true, + require => [ File[$staticfiles], Package['cgit'] ], } file { '/etc/httpd/conf.d/ssl.conf': @@ -92,6 +95,21 @@ class cgit( require => Package['mod_ssl'], } + file { $cgitdir: + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + } + + file { $staticfiles: + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + require => File[$cgitdir], + } + file { '/etc/xinetd.d/git': ensure => present, owner => 'root', diff --git a/templates/git.vhost.erb b/templates/git.vhost.erb index d17f16a..e4c0a40 100644 --- a/templates/git.vhost.erb +++ b/templates/git.vhost.erb @@ -18,6 +18,7 @@ Alias /cgit-data /usr/share/cgit ScriptAlias /cgit /var/www/cgi-bin/cgit + Alias /static <%= scope.lookupvar("cgit::staticfiles") %> RewriteEngine On RewriteRule ^/$ /cgit [R]