summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-01-19 19:33:13 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-01-19 19:33:13 +0100
commit85b66431a04d2080509b2623b56d66bf29b92f8f (patch)
tree4ffa2a59754d79051a9047adeedbf4b0ddc1fb2b
parent59d3128711c0222092135e93ca788d388aacd573 (diff)
downloadmemory-leaks-85b66431a04d2080509b2623b56d66bf29b92f8f.tar.xz
Touch up recipe for cgit setup
-rw-r--r--guides/cloud/git.org18
1 files changed, 12 insertions, 6 deletions
diff --git a/guides/cloud/git.org b/guides/cloud/git.org
index 109f306..11ec021 100644
--- a/guides/cloud/git.org
+++ b/guides/cloud/git.org
@@ -32,10 +32,16 @@ scan-path=/srv/git
#+end_src
* git
#+begin_src sh
-$ echo $(which git-shell) >> /etc/shells
-$ chsh git -s $(which git-shell)
-$ mkdir /srv/git
-$ chown git:www-data /srv/git
-# Each time a repository is added:
-$ git -C /srv/git/$repo config core.sharedRepository 0640
+$ sudo echo $(which git-shell) >> /etc/shells
+$ sudo adduser git --disabled-password --shell $(which git-shell)
+# Add SSH keys to ~git/.ssh/authorized_keys, prefixed with:
+# "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty "
+$ sudo addgroup git-data
+$ sudo adduser git git-data
+$ sudo adduser www-data git-data
+$ sudo mkdir /srv/git
+$ sudo chown git:git-data /srv/git
+$ sudo chmod g+s /srv/git
+# For each repo:
+$ sudo -u git git init --bare /srv/git/$repo
#+end_src