aboutsummaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2025-10-11 13:10:50 +0200
committeralex <alex@pdp7.net>2025-10-11 17:56:49 +0200
commit53d4504bfa39e06b9e43db07a6c8d2f15a8223a1 (patch)
tree70125f4bc1f3c6bb183be37b35de58f7d73888b8 /infrastructure
parent340e1da68775afb99e049854624ae36ea2d46bd0 (diff)
Add gitweb and git https publishing instructions
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/roles/git/README.md20
-rw-r--r--infrastructure/roles/git/tasks/main.yaml9
2 files changed, 25 insertions, 4 deletions
diff --git a/infrastructure/roles/git/README.md b/infrastructure/roles/git/README.md
index ca32c99..f21bfef 100644
--- a/infrastructure/roles/git/README.md
+++ b/infrastructure/roles/git/README.md
@@ -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.
diff --git a/infrastructure/roles/git/tasks/main.yaml b/infrastructure/roles/git/tasks/main.yaml
index 79fad63..ba39e05 100644
--- a/infrastructure/roles/git/tasks/main.yaml
+++ b/infrastructure/roles/git/tasks/main.yaml
@@ -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