diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp index e014a1cff6..b3c52025b3 100644 --- a/modules/cgit/manifests/init.pp +++ b/modules/cgit/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/modules/cgit/templates/git.vhost.erb b/modules/cgit/templates/git.vhost.erb index d17f16a3b0..e4c0a4001e 100644 --- a/modules/cgit/templates/git.vhost.erb +++ b/modules/cgit/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] diff --git a/modules/openstack_project/files/git/cgitrc b/modules/openstack_project/files/git/cgitrc index 4dffbcc3ce..fd36a70453 100644 --- a/modules/openstack_project/files/git/cgitrc +++ b/modules/openstack_project/files/git/cgitrc @@ -9,7 +9,7 @@ cache-size=0 clone-prefix=git://git.openstack.org https://git.openstack.org # Specify the css url -css=/cgit-data/cgit.css +css=/static/openstack.css # Hide owner for each repository on the index page enable-index-owner=0 @@ -18,10 +18,10 @@ enable-index-owner=0 enable-index-links=1 # Add a cgit favicon -#favicon=/favicon.ico +favicon=/static/favicon.ico # Use a custom logo -logo=/cgit-data/cgit.png +logo=/static/openstack.png # Enable statistics per week, month and quarter max-stats=quarter diff --git a/modules/openstack_project/files/git/openstack.css b/modules/openstack_project/files/git/openstack.css new file mode 100644 index 0000000000..cd75dbf9aa --- /dev/null +++ b/modules/openstack_project/files/git/openstack.css @@ -0,0 +1,68 @@ +@import url('/cgit-data/cgit.css'); + +body { + background: url("/static/openstack-page-bkg.jpg") no-repeat scroll 0 0 white !important; +} + +div#cgit { + background: transparent; +} + +div#cgit table#header td.main { + font-size: 200%; + letter-spacing: -1px; + color: #CF2F19; +} + +div#cgit table.list { + border-collapse: separate; + border-spacing: 0; +} + +div#cgit table.list th { + border: 1px solid #ffffff; + padding: 2px 6px 1px; + background-color: #eef3f5; + font-style: italic; + white-space: nowrap; + font-weight: normal; +} + +div#cgit table.list th a { + color: #264d69; +} + +div#cgit table.list td.reposection { + color: #264d69; +} + +div#cgit table.list tr:nth-child(odd) { + background: white; +} + +div#cgit table.list tr:nth-child(even) { + background: #f5f5ff; +} + +div#cgit table.list td { + padding-left: 5px; + padding-right: 5px; + border-right: 1px solid #eef3f5; + border-bottom: 1px solid #eef3f5; +} + +div#cgit table.list td a { + color: #264d69; +} + +div#cgit table.list td a:hover { + color: black; +} + +div#cgit table.list tr.nohover { + background: #eef3f5; +} + +div#cgit table.list tr.nohover:hover { + background: #eef3f5; +} diff --git a/modules/openstack_project/manifests/git.pp b/modules/openstack_project/manifests/git.pp index f8a168c973..25fe919bba 100644 --- a/modules/openstack_project/manifests/git.pp +++ b/modules/openstack_project/manifests/git.pp @@ -88,4 +88,29 @@ class openstack_project::git ( class { 'selinux': mode => 'enforcing' } + + file { '/var/www/cgit/static/openstack.png': + ensure => present, + source => 'puppet:///modules/openstack_project/openstack.png', + require => File['/var/www/cgit/static'], + } + + file { '/var/www/cgit/static/favicon.ico': + ensure => present, + source => 'puppet:///modules/openstack_project/status/favicon.ico', + require => File['/var/www/cgit/static'], + } + + file { '/var/www/cgit/static/openstack-page-bkg.jpg': + ensure => present, + source => 'puppet:///modules/openstack_project/openstack-page-bkg.jpg', + require => File['/var/www/cgit/static'], + } + + file { '/var/www/cgit/static/openstack.css': + ensure => present, + source => 'puppet:///modules/openstack_project/git/openstack.css', + require => File['/var/www/cgit/static'], + } + }