]> xn--ix-yja.es Git - infrastructure.git/commitdiff
Add gitweb and git https publishing instructions
authoralex <alex@pdp7.net>
Sat, 11 Oct 2025 11:10:50 +0000 (13:10 +0200)
committeralex <alex@pdp7.net>
Sat, 11 Oct 2025 15:56:49 +0000 (17:56 +0200)
infrastructure/roles/git/README.md
infrastructure/roles/git/tasks/main.yaml

index ca32c99c57771107a0a470cb4314d537b93bfbb1..f21bfefa587747c77a150ec699c270c9dd1f05e9 100644 (file)
@@ -5,15 +5,29 @@
 On the server:
 
 ```
-mkdir -p ~/git
-cd ~/git
 git init --bare $REPO
 ```
 
 ## Push an existing repository
 
 ```
-git remote add $REMOTE_NAME $SERVER:git/$REPO
+git remote add $REMOTE_NAME $SERVER:$REPO
 git push $REMOTE_NAME main
 ```
 
+## Exposing via gitweb
+
+```
+sudo ln -s $ABSOLUTE_PATH_TO_REPO /var/lib/git/$NAME.git
+```
+
+You can use `~/foo` as the `ABSOLUTE_PATH_TO_REPO` to expose a repository in your home directory.
+
+## Exposing via https
+
+```
+mv $ABSOLUTE_PATH_TO_REPO/hooks/post-update.sample $ABSOLUTE_PATH_TO_REPO/hooks/post-update
+ln -s $ABSOLUTE_PATH_TO_REPO ~/public_html/$REPO.git
+```
+
+Ensure that you push once to the repo, or run `git update-server-info` in the repository.
index 79fad63d9d0fb6b050be38b4e5fcdf35502b785e..ba39e0557656910a56f3e100ecc52aed4cbaefb1 100644 (file)
@@ -1,3 +1,10 @@
 - name: install git
   ansible.builtin.package:
-    name: git
+    name:
+      - git
+      - gitweb
+- name: enable cgid
+  ansible.builtin.command:
+    cmd: a2enmod cgid
+    creates: /etc/apache2/mods-enabled/cgid.load
+  notify: restart web