This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new bc412aa7 Allow Git to work across users
bc412aa7 is described below

commit bc412aa751f9cb9c50eca8c9409d04c1da906918
Author: Sebb <[email protected]>
AuthorDate: Wed Apr 20 00:17:48 2022 +0100

    Allow Git to work across users
---
 .dockerignore        | 1 +
 Dockerfile           | 3 +++
 config/gitconfig-www | 2 ++
 config/whimsy.conf   | 3 +++
 4 files changed, 9 insertions(+)

diff --git a/.dockerignore b/.dockerignore
index 512e8efe..3ed07bd5 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -4,3 +4,4 @@
 # Allow what we want
 !config/whimsy.conf
 !config/25-authz_ldap_group_membership.conf
+!config/gitconfig-www 
diff --git a/Dockerfile b/Dockerfile
index a77d47d4..0b34c4bc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -84,6 +84,9 @@ RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y 
ldap-utils
 COPY config/whimsy.conf /etc/apache2/sites-enabled/000-default.conf
 COPY config/25-authz_ldap_group_membership.conf 
/etc/apache2/conf-enabled/25-authz_ldap_group_membership.conf
 
+# Allow www-data user to use Git repo owned by root
+COPY config/gitconfig-www /var/www/.gitconfig
+
 # disable security check and telemetry
 RUN sed -i -e '$i  PassengerDisableSecurityUpdateCheck on' 
/etc/apache2/conf-enabled/passenger.conf
 RUN sed -i -e '$i  PassengerDisableAnonymousTelemetry on' 
/etc/apache2/conf-enabled/passenger.conf
diff --git a/config/gitconfig-www b/config/gitconfig-www
new file mode 100644
index 00000000..98041087
--- /dev/null
+++ b/config/gitconfig-www
@@ -0,0 +1,2 @@
+[safe]
+       directory = /srv/whimsy
diff --git a/config/whimsy.conf b/config/whimsy.conf
index c1f60b24..2dac4d68 100644
--- a/config/whimsy.conf
+++ b/config/whimsy.conf
@@ -36,6 +36,9 @@
 
 PassengerFriendlyErrorPages on
 
+# Needed for Git to be able to find .gitconfig
+SetEnv HOME /var/www
+
 AddCharset UTF-8 .json
 
 ExpiresActive On

Reply via email to