Add cgit for dgit (RT#5866)
authorPeter Palfrader <peter@palfrader.org>
Sun, 12 Jul 2015 15:35:59 +0000 (17:35 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 12 Jul 2015 15:35:59 +0000 (17:35 +0200)
hieradata/common.yaml
modules/roles/files/dgit/browse.dgit.debian.org [new file with mode: 0644]
modules/roles/files/dgit/cgitrc [new file with mode: 0644]
modules/roles/manifests/dgit_browse.pp [new file with mode: 0644]
modules/roles/manifests/init.pp

index af8c675..dfb82e1 100644 (file)
@@ -38,6 +38,8 @@ roles:
     - coccia.debian.org
   api.ftp-master:
     - coccia.debian.org
+  dgit_browse:
+    - cgi-grnet-01.debian.org
   git_master:
     - adayevskaya.debian.org
   keyring:
diff --git a/modules/roles/files/dgit/browse.dgit.debian.org b/modules/roles/files/dgit/browse.dgit.debian.org
new file mode 100644 (file)
index 0000000..51c9dfd
--- /dev/null
@@ -0,0 +1,30 @@
+#Use common-dsa-vhost-https-redirect browse.dgit.debian.org
+
+<VirtualHost *:80>
+       ServerName browse.dgit.debian.org
+       ServerAdmin dgit-owner@debian.org
+
+       ErrorLog /var/log/apache2/browse.dgit.debian.org-ssl-error.log
+       CustomLog /var/log/apache2/browse.dgit.debian.org-ssl-access.log privacy
+
+       #Use common-debian-service-ssl lintian.debian.org
+       #Use common-ssl-HSTS
+
+       <IfModule mod_userdir.c>
+               UserDir disabled
+       </IfModule>
+
+       Alias /cgit-css "/usr/share/cgit/"
+       Alias /static "/srv/dgit.debian.org/static"
+       ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
+       <Directory "/usr/lib/cgit/">
+               AllowOverride None
+               Options ExecCGI FollowSymlinks
+       </Directory>
+
+       AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css 
+       AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/x-javascript application/javascript
+       AddOutputFilterByType DEFLATE application/json
+</VirtualHost>
+
+# vim:set syntax=apache:
diff --git a/modules/roles/files/dgit/cgitrc b/modules/roles/files/dgit/cgitrc
new file mode 100644 (file)
index 0000000..a73a785
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# cgit config
+# see cgitrc(5) for details
+
+css=/cgit-css/cgit.css
+logo=/cgit-css/cgit.png
+
+root-title=gitweb.debian.org
+root-desc=debian dgit's repository browser
+logo=/static/logo.jpg
+
+enable-commit-graph=1
+enable-http-clone=0
+
+source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
+mimetype.gif=image/gif
+mimetype.html=text/html
+mimetype.jpg=image/jpeg
+mimetype.jpeg=image/jpeg
+mimetype.pdf=application/pdf
+mimetype.png=image/png
+mimetype.svg=image/svg+xml
+
+max-repo-count=999999
+include=/srv/dgit.debian.org/etc/projects.cgit
diff --git a/modules/roles/manifests/dgit_browse.pp b/modules/roles/manifests/dgit_browse.pp
new file mode 100644 (file)
index 0000000..686c7f7
--- /dev/null
@@ -0,0 +1,20 @@
+class roles::dgit_browse {
+       #ssl::service { 'wiki.debian.org':
+       #       notify => Service['apache2'],
+       #}
+       #rsync::site { 'wiki':
+       #       source => 'puppet:///modules/roles/wiki/rsyncd.conf',
+       #}
+
+       package { 'cgi': ensure => installed, }
+
+       file { '/etc/cgitrc':
+               source => 'puppet:///modules/roles/dgit/cgitrc',
+       }
+
+       apache2::site { '010-browse.dgit.debian.org':
+               site    => 'browse.dgit.debian.org',
+               source => 'puppet:///modules/roles/dgit/browse.dgit.debian.org',
+       }
+
+}
index a4ef596..09de1f9 100644 (file)
@@ -247,4 +247,8 @@ class roles {
        if has_role('search_frontend') {
                include search_frontend
        }
+
+       if has_role('dgit_browse') {
+               include dgit_browse
+       }
 }