From e63885bcc0d46bfe58a32fcfc1d02daae8735929 Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guilhem@fripost.org>
Date: Sun, 31 May 2015 18:02:27 +0200
Subject: Git (gitolite + git-http-backend + gitweb) configuration

By default repos are be readable by gitweb and the web server ('gitweb' and
'www-data' are both in the 'gitolite' group).  Private repo owners will have
'chmod -R og-rwx' manually.

To automatically add new repos to gitweb's 'project.list' file, make it
readable to the special 'gitweb' user.

See /usr/share/doc/gitolite3/README.txt.gz for details.
---
 roles/git/files/lib/systemd/system/gitweb.service | 13 +++++++++++++
 roles/git/files/lib/systemd/system/gitweb.socket  | 11 +++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 roles/git/files/lib/systemd/system/gitweb.service
 create mode 100644 roles/git/files/lib/systemd/system/gitweb.socket

(limited to 'roles/git/files/lib/systemd/system')

diff --git a/roles/git/files/lib/systemd/system/gitweb.service b/roles/git/files/lib/systemd/system/gitweb.service
new file mode 100644
index 0000000..a0f7a96
--- /dev/null
+++ b/roles/git/files/lib/systemd/system/gitweb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Gitweb Service
+After=network.target
+Requires=gitweb.socket
+
+[Service]
+StandardInput=socket
+User=gitweb
+Group=gitweb
+ExecStart=/usr/lib/cgi-bin/gitweb.fcgi
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/git/files/lib/systemd/system/gitweb.socket b/roles/git/files/lib/systemd/system/gitweb.socket
new file mode 100644
index 0000000..355b490
--- /dev/null
+++ b/roles/git/files/lib/systemd/system/gitweb.socket
@@ -0,0 +1,11 @@
+[Unit]
+Description=Gitweb Listen Socket
+
+[Socket]
+SocketUser=www-data
+SocketGroup=www-data
+SocketMode=0600
+ListenStream=/run/gitweb.socket
+
+[Install]
+WantedBy=sockets.target
-- 
cgit v1.2.3