X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=systems%2Feldiron%2Fwebsites%2Fgit%2Fgitweb.nix;fp=modules%2Fprivate%2Fwebsites%2Ftools%2Fgit%2Fgitweb.nix;h=40f99e061fb4e3f91f05ccdb644235d1f2722bc9;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=ff34da51f8e577afba64acb8089e897f5b50d619;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/git/gitweb.nix b/systems/eldiron/websites/git/gitweb.nix similarity index 95% rename from modules/private/websites/tools/git/gitweb.nix rename to systems/eldiron/websites/git/gitweb.nix index ff34da5..40f99e0 100644 --- a/modules/private/websites/tools/git/gitweb.nix +++ b/systems/eldiron/websites/git/gitweb.nix @@ -41,6 +41,7 @@ rec { css=/cgit-css/cgit.css logo=/cgit-css/cgit.png favicon=/cgit-css/favicon.ico + head-include=${./cgit_js.html} root-title=Immae’s git root-desc=To go back to the old interface: https://git.immae.eu/?old @@ -114,6 +115,10 @@ rec { RewriteEngine On RewriteCond %{QUERY_STRING} ^$ RewriteRule ^/?$ /cgit [L,R=302] + + RewriteCond %{REQUEST_URI} ^(.*)(\.git)?/?$ + RewriteCond ${varDir}/repositories/%1.git/HEAD -f + RewriteRule ^(.+)$ /cgit$1 [L,R=302] ''; }; }