From 95398b631cc0b970b79805ded33d88803b736012 Mon Sep 17 00:00:00 2001 From: Elizabeth Krumbach Date: Tue, 13 Aug 2013 13:04:55 -0700 Subject: [PATCH] Add chown of git repo directories When creating git repositories, we want to recursively chown them to the cgit user so the cgit user for replication can write to them. Change-Id: Ib349b4af32090d0fbda933d51ef514cae7033499 --- jeepyb/cmd/create_cgitrepos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jeepyb/cmd/create_cgitrepos.py b/jeepyb/cmd/create_cgitrepos.py index 8acbfd6..3fc4f19 100644 --- a/jeepyb/cmd/create_cgitrepos.py +++ b/jeepyb/cmd/create_cgitrepos.py @@ -31,6 +31,8 @@ CGIT_REPOS = os.environ.get('CGIT_REPOS', '/etc/cgitrepos') REPO_PATH = os.environ.get('REPO_PATH', '/var/lib/git') +CGIT_USER = os.environ.get('CGIT_USER', 'cgit') +CGIT_GROUP = os.environ.get('CGIT_GROUP', 'cgit') def main(): @@ -62,6 +64,8 @@ def main(): cgit_file.write('repo.desc=%s\n' % (description)) if not os.path.exists(project_repo): subprocess.call(['git', 'init', '--bare', project_repo]) + subprocess.call(['chown', '-R', '%s:%s' + % (CGIT_USER, CGIT_GROUP), project_repo]) if __name__ == "__main__":