From 24267c75a335c166e76039feb4d410e0bc0a6847 Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Tue, 31 May 2011 15:43:18 -0700 Subject: Added documentation, fixed ssl. --- manifests/init.pp | 18 ++++++++++++------ manifests/settings.pp | 1 + templates/apache-gitweb.conf.erb | 8 ++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4f62e1d..801e3e5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,13 +1,14 @@ # Class: gitweb -# +# Installs gitweb and configures apache to server it. # Parameters: # # Actions: # # Requires: -# - puppetlabs-apache +# - apache +# - gitweb::settings # Sample Usage: -# +# include gitweb class gitweb { include gitweb::settings @@ -27,10 +28,15 @@ class gitweb { A2mod <| title == "rewrite" |> - apache::vhost { "$gitweb::settings::site_alias": + apache::vhost::redirect { "${gitweb::settings::site_alias}": + port => "80", + dest => "https://${gitweb::settings::site_alias}", + } + + apache::vhost { "${gitweb::settings::site_alias}_ssl": priority => "10", - port => "80", - ssl => false, + port => "443", + ssl => true, docroot => "/var/www/git", template => "gitweb/apache-gitweb.conf.erb", } diff --git a/manifests/settings.pp b/manifests/settings.pp index c108b3b..85c58dc 100644 --- a/manifests/settings.pp +++ b/manifests/settings.pp @@ -1,4 +1,5 @@ # Class: gitweb::settings +# Provides default values for gitweb and allows for overriding. # # Parameters: # - site_alias: The site alias to make gitweb available diff --git a/templates/apache-gitweb.conf.erb b/templates/apache-gitweb.conf.erb index dca3f5f..3b481a8 100644 --- a/templates/apache-gitweb.conf.erb +++ b/templates/apache-gitweb.conf.erb @@ -6,6 +6,12 @@ NameVirtualHost *:<%= port %> RewriteEngine On RewriteRule ^/$ /gitweb [R] +<% if ssl == true -%> + SSLEngine on + SSLCertificateFile /etc/ssl/certs/gitweb.cert + SSLCertificateKeyFile /etc/ssl/private/gitweb.key +<% end -%> + > Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All @@ -13,12 +19,10 @@ NameVirtualHost *:<%= port %> 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 -%> ErrorLog /var/log/apache2/<%= name %>_error.log -- cgit v1.2.3