Shorten //gitweb.cgi/path URLs to //git/path.
authorMatt Birkholz <matt@birchwood-abbey.net>
Mon, 11 Mar 2024 22:30:52 +0000 (17:30 -0500)
committerMatt Birkholz <matt@birchwood-abbey.net>
Mon, 11 Mar 2024 22:30:52 +0000 (17:30 -0500)
README.org
roles_t/abbey-core/tasks/main.yml
roles_t/abbey-front/tasks/main.yml

index e7c50d751ca7f2b92e0236ba0ea2348a934858bf..97034ec9cde01ba33bbb5b887e10b5c9f1f668da 100644 (file)
@@ -270,12 +270,11 @@ Apache configurations.
 Like the suggested per-user rewrite rule in the ~gitweb(1)~ manual
 page, the second ~RewriteRule~ specifies the root directory of the
 user's public Git repositories via the ~GITWEB_PROJECTROOT~
-environment variable.  It makes ~http://www/~dick/gitweb.cgi~ run
+environment variable.  It makes ~http://www/~dick/git~ run
 Gitweb with the project root =~dick/Public/Git/=, the same directory
 the ~git-daemon~ makes available.  The first ~RewriteRule~ directs
-URLs with no user name to the default.  Thus ~http://www/gitweb.cgi~
-lists the repositories found in =/var/www/git/=.  The match patterns
-of both rules recognize =/gitweb= as well as =/gitweb.cgi=.
+URLs with no user name to the default.  Thus ~http://www/git~
+lists the repositories found in =/var/www/git/=.
 
 #+NAME: apache-gitweb
 #+CAPTION: ~apache-gitweb~
@@ -286,10 +285,10 @@ Alias /gitweb-static/ /usr/share/gitweb/static/
     Options MultiViews
 </Directory>
 RewriteEngine on
-RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
-            /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
-            /cgi-bin/gitweb.cgi$3 \
+RewriteRule ^/git(/.*)?$ \
+            /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+            /cgi-bin/gitweb.cgi$2 \
             [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
 #+END_SRC
 
index 7e646356d39939307e94150f1de3c8357307584a..a624ee44ae2482dca2f60abd82ec56d521f6528e 100644 (file)
             Options MultiViews
         </Directory>
         RewriteEngine on
-        RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-        RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$3 \
+        RewriteRule ^/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+        RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$2 \
                     [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
     dest: /etc/apache2/sites-available/live-vhost.conf
     mode: u=rw,g=r,o=r
             Options MultiViews
         </Directory>
         RewriteEngine on
-        RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-        RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$3 \
+        RewriteRule ^/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+        RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$2 \
                     [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
     dest: /etc/apache2/sites-available/test-vhost.conf
     mode: u=rw,g=r,o=r
           Options MultiViews
       </Directory>
       RewriteEngine on
-      RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
-                  /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-      RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
-                  /cgi-bin/gitweb.cgi$3 \
+      RewriteRule ^/git(/.*)?$ \
+                  /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+      RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+                  /cgi-bin/gitweb.cgi$2 \
                   [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
     dest: /etc/apache2/sites-available/www-vhost.conf
     mode: u=rw,g=r,o=r
index d71f050d6f3715a5c2accfc97e7be548781be386..878e3e4103e9dd4da0e35d66a95848bc25c830a6 100644 (file)
             Options MultiViews
         </Directory>
         RewriteEngine on
-        RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-        RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
-                    /cgi-bin/gitweb.cgi$3 \
+        RewriteRule ^/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+        RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+                    /cgi-bin/gitweb.cgi$2 \
                     [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
 
         IncludeOptional /etc/letsencrypt/options-ssl-apache.conf