From: Matt Birkholz Date: Fri, 22 Dec 2023 23:27:47 +0000 (-0700) Subject: Punt CGit! X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=5cf677673c175059b48528a559a84b21e0c06231;p=Network Punt CGit! --- diff --git a/README.org b/README.org index 50b3a95..4b0b0c0 100644 --- a/README.org +++ b/README.org @@ -377,52 +377,6 @@ web site =/favicon.ico=. state: restarted #+END_SRC -** Configure CGit on Front - -CGit is handled similarly, modifying =/etc/cgitrc= to reference a -~CGIT_SCANPATH~ environment variable set by Apache re-write rules. -The resulting Apache directives are given in ~apache-cgit~ and the -Ansible tasks in ~apache-cgit-tasks~, for both Front and Core. - -#+NAME: apache-cgit -#+CAPTION: ~apache-cgit~ -#+BEGIN_SRC conf - -ScriptAlias /cgit/ /usr/lib/cgit/cgit.cgi/ -Alias /cgit-css/ /usr/share/cgit/ - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - -RewriteRule ^/cgit?(/.*)$ \ - /cgit$1 [QSA,E=CGIT_SCANPATH:/var/www/git/,L,PT] -RewriteRule ^/\~([^\/]+)/cgit(/.*)?$ \ - /cgit$2 [QSA,E=CGIT_SCANPATH:/home/$1/Public/Git/,L,PT] -#+END_SRC - -#+NAME: apache-cgit-tasks -#+CAPTION: ~apache-cgi-tasks~ -#+BEGIN_SRC conf -- name: Install CGit. - become: yes - apt: pkg=cgit - -- name: Disable CGit default configuration. - become: yes - command: - cmd: a2disconf -q cgit - removes: /etc/apache2/conf-enabled/cgit.conf - -- name: Override CGit scan path. - become: yes - lineinfile: - path: /etc/cgitrc - regexp: "^scan-path *=" - line: "scan-path=$CGIT_SCANPATH" - notify: Restart Apache2. -#+END_SRC - ** Configure Apache for Abbey Documentation Some of the directives added to the =-vhost.conf= file are needed by @@ -476,11 +430,11 @@ Luckily there is support for this in the institutional configuration. The abbey simply creates a =birchwood-abbey.net-vhost.conf= file in =/etc/apache2/sites-available/=. -The following task adds the [[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], -[[apache-gitweb][~apache-gitweb~]], and [[apache-cgit][~apache-cgit~]] directives described above to the -=-vhost.conf= file, and includes =options-ssl-apache.conf= from -=/etc/letsencrypt/=. The rest of the Let's Encrypt configuration is -discussed in the following [[*Install Let's Encrypt][Install Let's Encrypt]] section. +The following task adds the [[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], and +[[apache-gitweb][~apache-gitweb~]] directives described above to the =-vhost.conf= file, +and includes =options-ssl-apache.conf= from =/etc/letsencrypt/=. The +rest of the Let's Encrypt configuration is discussed in the following +[[*Install Let's Encrypt][Install Let's Encrypt]] section. #+CAPTION: =roles_t/abbey-front/tasks/main.yml= #+BEGIN_SRC conf :tangle roles_t/abbey-front/tasks/main.yml :noweb yes @@ -494,14 +448,11 @@ discussed in the following [[*Install Let's Encrypt][Install Let's Encrypt]] sec <> <> <> - <> IncludeOptional /etc/letsencrypt/options-ssl-apache.conf dest: /etc/apache2/sites-available/{{ domain_name }}-vhost.conf notify: Restart Apache2. <> - -<> #+END_SRC #+CAPTION: =roles_t/abbey-front/handlers/main.yml= @@ -913,7 +864,7 @@ services on Front and Core. See [[Configure Git Daemon on Front]] and The Apache2 configuration on Core specifies three web sites (live, test, and campus). The live and test sites must operate just like the site on Front. Their configurations include the same [[apache-abbey][~apache-abbey~]], -[[apache-photos][~apache-photos~]], [[apache-gitweb][~apache-gitweb~]], and [[apache-cgit][~apache-cgit~]] used on Front. +[[apache-photos][~apache-photos~]], and [[apache-gitweb][~apache-gitweb~]] used on Front. #+CAPTION: =roles_t/abbey-core/tasks/main.yml= #+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml :noweb yes @@ -927,7 +878,6 @@ site on Front. Their configurations include the same [[apache-abbey][~apache-ab <> <> <> - <> dest: /etc/apache2/sites-available/live-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. @@ -941,14 +891,11 @@ site on Front. Their configurations include the same [[apache-abbey][~apache-ab <> <> <> - <> dest: /etc/apache2/sites-available/test-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. <> - -<> #+END_SRC #+CAPTION: =roles_t/abbey-core/handlers/main.yml= @@ -963,8 +910,7 @@ The institute serves its =/usr/share/doc/= on the house (campus) web site. This is a debugging convenience, making some HTML documentation more accessible, especially the documentation of software installed on Core and not on typical desktop clients. Also included: the Apache2 -directives that enable user Git publishing with Gitweb and CGit -(defined [[apache-gitweb][here]] and [[apache-cgit][here]] respectively). +directives that enable user Git publishing with Gitweb (defined [[apache-gitweb][here]]). #+CAPTION: =roles_t/abbey-core/tasks/main.yml= #+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml :noweb yes @@ -978,7 +924,6 @@ directives that enable user Git publishing with Gitweb and CGit Options Indexes <> - <> dest: /etc/apache2/sites-available/www-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. diff --git a/roles_t/abbey-core/tasks/main.yml b/roles_t/abbey-core/tasks/main.yml index c4ca669..6eafa5f 100644 --- a/roles_t/abbey-core/tasks/main.yml +++ b/roles_t/abbey-core/tasks/main.yml @@ -74,18 +74,6 @@ RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \ /cgi-bin/gitweb.cgi$3 \ [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT] - - ScriptAlias /cgit/ /usr/lib/cgit/cgit.cgi/ - Alias /cgit-css/ /usr/share/cgit/ - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - - RewriteRule ^/cgit?(/.*)$ \ - /cgit$1 [QSA,E=CGIT_SCANPATH:/var/www/git/,L,PT] - RewriteRule ^/\~([^\/]+)/cgit(/.*)?$ \ - /cgit$2 [QSA,E=CGIT_SCANPATH:/home/$1/Public/Git/,L,PT] dest: /etc/apache2/sites-available/live-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. @@ -120,18 +108,6 @@ RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \ /cgi-bin/gitweb.cgi$3 \ [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT] - - ScriptAlias /cgit/ /usr/lib/cgit/cgit.cgi/ - Alias /cgit-css/ /usr/share/cgit/ - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - - RewriteRule ^/cgit?(/.*)$ \ - /cgit$1 [QSA,E=CGIT_SCANPATH:/var/www/git/,L,PT] - RewriteRule ^/\~([^\/]+)/cgit(/.*)?$ \ - /cgit$2 [QSA,E=CGIT_SCANPATH:/home/$1/Public/Git/,L,PT] dest: /etc/apache2/sites-available/test-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. @@ -177,24 +153,6 @@ dest: /etc/gitweb.conf mode: u=rw,g=r,o=r -- name: Install CGit. - become: yes - apt: pkg=cgit - -- name: Disable CGit default configuration. - become: yes - command: - cmd: a2disconf -q cgit - removes: /etc/apache2/conf-enabled/cgit.conf - -- name: Override CGit scan path. - become: yes - lineinfile: - path: /etc/cgitrc - regexp: "^scan-path *=" - line: "scan-path=$CGIT_SCANPATH" - notify: Restart Apache2. - - name: Configure house website. become: yes copy: @@ -214,18 +172,6 @@ RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \ /cgi-bin/gitweb.cgi$3 \ [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT] - - ScriptAlias /cgit/ /usr/lib/cgit/cgit.cgi/ - Alias /cgit-css/ /usr/share/cgit/ - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - - RewriteRule ^/cgit?(/.*)$ \ - /cgit$1 [QSA,E=CGIT_SCANPATH:/var/www/git/,L,PT] - RewriteRule ^/\~([^\/]+)/cgit(/.*)?$ \ - /cgit$2 [QSA,E=CGIT_SCANPATH:/home/$1/Public/Git/,L,PT] dest: /etc/apache2/sites-available/www-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. diff --git a/roles_t/abbey-front/tasks/main.yml b/roles_t/abbey-front/tasks/main.yml index 1aba984..07ff9ce 100644 --- a/roles_t/abbey-front/tasks/main.yml +++ b/roles_t/abbey-front/tasks/main.yml @@ -78,18 +78,6 @@ RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \ /cgi-bin/gitweb.cgi$3 \ [QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT] - - ScriptAlias /cgit/ /usr/lib/cgit/cgit.cgi/ - Alias /cgit-css/ /usr/share/cgit/ - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - - RewriteRule ^/cgit?(/.*)$ \ - /cgit$1 [QSA,E=CGIT_SCANPATH:/var/www/git/,L,PT] - RewriteRule ^/\~([^\/]+)/cgit(/.*)?$ \ - /cgit$2 [QSA,E=CGIT_SCANPATH:/home/$1/Public/Git/,L,PT] IncludeOptional /etc/letsencrypt/options-ssl-apache.conf dest: /etc/apache2/sites-available/{{ domain_name }}-vhost.conf notify: Restart Apache2. @@ -135,24 +123,6 @@ dest: /etc/gitweb.conf mode: u=rw,g=r,o=r -- name: Install CGit. - become: yes - apt: pkg=cgit - -- name: Disable CGit default configuration. - become: yes - command: - cmd: a2disconf -q cgit - removes: /etc/apache2/conf-enabled/cgit.conf - -- name: Override CGit scan path. - become: yes - lineinfile: - path: /etc/cgitrc - regexp: "^scan-path *=" - line: "scan-path=$CGIT_SCANPATH" - notify: Restart Apache2. - - name: Configure Apache log archival. become: yes lineinfile: