diff options
author | Adrien Thebo <adrien.thebo@gmail.com> | 2011-05-31 14:09:31 -0700 |
---|---|---|
committer | Adrien Thebo <adrien.thebo@gmail.com> | 2011-05-31 14:09:31 -0700 |
commit | 18310aa26c9fd5644115ef38722aaf75302ded53 (patch) | |
tree | de916fa0320eb30fdddf7447cf55c34920bbc98d | |
parent | 26dc2c63d1f07b04cd4e639f40cc651aacb2ce54 (diff) |
Updated apache template, added args, removed ssl.
- SSL was breaking testing, removed it for the time being.
- Converted gitweb.conf to template.
- Added more options to gitweb::settings.
-rw-r--r-- | manifests/init.pp | 8 | ||||
-rw-r--r-- | manifests/settings.pp | 6 | ||||
-rw-r--r-- | templates/apache-gitweb.conf.erb | 16 | ||||
-rw-r--r-- | templates/gitweb.conf.erb (renamed from files/gitweb.conf) | 2 |
4 files changed, 26 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index fbe5610..4f62e1d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,14 +21,16 @@ class gitweb { owner => "root", group => "root", mode => "0644", - source => "puppet:///modules/gitweb/gitweb.conf", + content => template("gitweb/gitweb.conf.erb"), require => Package["gitweb"], } + A2mod <| title == "rewrite" |> + apache::vhost { "$gitweb::settings::site_alias": priority => "10", - port => "443", - ssl => true, + port => "80", + ssl => false, docroot => "/var/www/git", template => "gitweb/apache-gitweb.conf.erb", } diff --git a/manifests/settings.pp b/manifests/settings.pp index 49317db..c108b3b 100644 --- a/manifests/settings.pp +++ b/manifests/settings.pp @@ -1,7 +1,8 @@ # Class: gitweb::settings # # Parameters: -# +# - site_alias: The site alias to make gitweb available +# - projectroot: The location where the git repositories are stored # Actions: # # Requires: @@ -9,6 +10,7 @@ # Sample Usage: # class gitweb::settings ( - $site_alias = "gitweb" + $site_alias = "gitweb", + $projectroot = "/var/cache/git" ) { } diff --git a/templates/apache-gitweb.conf.erb b/templates/apache-gitweb.conf.erb index d0736ae..dca3f5f 100644 --- a/templates/apache-gitweb.conf.erb +++ b/templates/apache-gitweb.conf.erb @@ -1,6 +1,11 @@ +NameVirtualHost *:<%= port %> <VirtualHost *:<%= port %>> ServerName <%= name %> DocumentRoot <%= docroot %> + + RewriteEngine On + RewriteRule ^/$ /gitweb [R] + <Directory <%= docroot %>> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All @@ -8,6 +13,17 @@ Allow from all AddHandler cgi-script cgi DirectoryIndex gitweb.cgi + <%# if auth == true -%> + AuthType Basic + AuthName "Protected" + AuthUserFile /usr/local/apache/passwd/passwords + Require valid-user + <%# end -%> </Directory> + + ErrorLog /var/log/apache2/<%= name %>_error.log + LogLevel warn + CustomLog /var/log/apache2/<%= name %>_access.log combined + ServerSignature Off </VirtualHost> diff --git a/files/gitweb.conf b/templates/gitweb.conf.erb index 8e2fb51..0731b69 100644 --- a/files/gitweb.conf +++ b/templates/gitweb.conf.erb @@ -1,5 +1,5 @@ # path to git projects (<project>.git) -$projectroot = "/var/cache/git"; +$projectroot = "<%= scope.lookupvar('gitweb::settings::projectroot') %>"; # directory to use for temp files $git_temp = "/tmp"; |