From ab8615d05df97e6f8fd9c0b1bdbcf7439d8b8b0e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 11 Aug 2010 14:52:25 +0200 Subject: introduce logmode for webrepos --- manifests/web/repo.pp | 7 +++++++ manifests/web/repo/lighttpd.pp | 4 ++++ templates/web/lighttpd | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/manifests/web/repo.pp b/manifests/web/repo.pp index 2cb387a..da6f74f 100644 --- a/manifests/web/repo.pp +++ b/manifests/web/repo.pp @@ -1,10 +1,15 @@ # domain: the domain under which this repo will be avaiable # projectroot: where the git repos are listened # projects_list: which repos to export +# +# logmode: +# - default: Do normal logging including ips +# - anonym: Don't log ips define git::web::repo( $ensure = 'present', $projectroot = 'absent', $projects_list = 'absent', + $logmode = 'default', $sitename = 'absent' ){ if ($ensure == 'present') and (($projects_list == 'absent') or ($projectroot == 'absent')){ @@ -31,12 +36,14 @@ define git::web::repo( 'lighttpd': { git::web::repo::lighttpd{$name: ensure => $ensure, + logmode => $logmode, gitweb_url => $gitweb_url, gitweb_config => $gitweb_config, } } 'apache': { apache::vhost::gitweb{$gitweb_url: + logmode => $logmode, ensure => $ensure, } } diff --git a/manifests/web/repo/lighttpd.pp b/manifests/web/repo/lighttpd.pp index 111cc5e..621df00 100644 --- a/manifests/web/repo/lighttpd.pp +++ b/manifests/web/repo/lighttpd.pp @@ -1,6 +1,10 @@ +# logmode: +# - default: Do normal logging including ips +# - anonym: Don't log ips define git::web::repo::lighttpd( $ensure = 'present', $gitweb_url, + $logmode = 'default' $gitweb_config ){ if $ensure == 'present' { include git::web::lighttpd } diff --git a/templates/web/lighttpd b/templates/web/lighttpd index 1153154..57acb2e 100644 --- a/templates/web/lighttpd +++ b/templates/web/lighttpd @@ -3,6 +3,10 @@ $HTTP["host"] == "<%= gitweb_url %>" { "^$" => "/", ) + <%- if logmode.to_s == 'anonym' -%> + accesslog.format = "127.0.0.1 %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" + <%- end -%> + alias.url += ( "/gitweb.css" => "/var/www/git/gitweb.css", "/git-logo.png" => "/var/www/git/git-logo.png", -- cgit v1.2.3