src.nth.io/

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-04-18 21:45:06 -0500
committerLuke Hoersten <[email protected]>2026-04-18 21:45:06 -0500
commit9e4694c554b75b115d54f610c4e22c8027e94e0b (patch)
tree1dd21749abc025e75f3bf76b9c72d7357169c60e
parent2592380207121753a2f64abd9c4fd4b3e99b3c0f (diff)
Remove nginx config tasks from git/web role, make owner discovery recursiveHEADmain
-rw-r--r--git/web/tasks/main.yaml18
-rw-r--r--git/web/templates/cgit.nginx.conf.j25
2 files changed, 3 insertions, 20 deletions
diff --git a/git/web/tasks/main.yaml b/git/web/tasks/main.yaml
index 6a33521..1d07e2f 100644
--- a/git/web/tasks/main.yaml
+++ b/git/web/tasks/main.yaml
@@ -41,25 +41,13 @@
- name: set cgit repo owners
become: yes
shell: |
- for repo in {{cgit_scan_path}}*/; do
- git config --file "${repo}config" gitweb.owner "{{cgit_owner}}"
+ find {{cgit_scan_path}} -maxdepth 2 -name HEAD -type f | while read headfile; do
+ repodir=$(dirname "$headfile")
+ git config --file "${repodir}/config" gitweb.owner "{{cgit_owner}}"
done
when: cgit_owner is defined
changed_when: true
-- name: install cgit nginx site
- become: yes
- template: src="cgit.nginx.conf.j2" dest="/etc/nginx/sites-available/cgit.conf"
- notify: restart nginx
-
-- name: enable cgit nginx site
- become: yes
- file:
- src: "/etc/nginx/sites-available/cgit.conf"
- dest: "/etc/nginx/sites-enabled/cgit.conf"
- state: "link"
- notify: restart nginx
-
- name: ensure fcgiwrap service is started
become: yes
systemd: name="fcgiwrap.service" enabled="yes" state="started"
diff --git a/git/web/templates/cgit.nginx.conf.j2 b/git/web/templates/cgit.nginx.conf.j2
index 324dd0c..0ddbe38 100644
--- a/git/web/templates/cgit.nginx.conf.j2
+++ b/git/web/templates/cgit.nginx.conf.j2
@@ -25,11 +25,6 @@ server {
root /usr/share/cgit;
- # Redirect old Mercurial-style paths to cgit equivalents
- rewrite ^/([^/]+)/file/tip/(.*)$ /$1/tree/$2 permanent;
- rewrite ^/([^/]+)/file/tip$ /$1/tree permanent;
- rewrite ^/([^/]+)/file$ /$1/tree permanent;
-
try_files $uri @cgit;
location @cgit {