]> zackmdavis.net Git - An_Algorithmic_Lucidity.git/commitdiff
GitWeb
authorZack M. Davis <code@zackmdavis.net>
Thu, 16 Jul 2026 18:27:11 +0000 (11:27 -0700)
committerZack M. Davis <code@zackmdavis.net>
Thu, 16 Jul 2026 18:27:11 +0000 (11:27 -0700)
provisioning/gitweb.conf [new file with mode: 0644]
provisioning/nginx_siteconf

diff --git a/provisioning/gitweb.conf b/provisioning/gitweb.conf
new file mode 100644 (file)
index 0000000..5909e33
--- /dev/null
@@ -0,0 +1,33 @@
+# path to git projects (<project>.git)
+$projectroot = "/home/blogmistress/gitweb-projects";
+
+# directory to use for temp files
+$git_temp = "/tmp";
+
+# target of the home link on top of all pages
+#$home_link = $my_uri || "/";
+
+# html text to include at home page
+#$home_text = "indextext.html";
+
+# file with project list; by default, simply scan the projectroot dir.
+#$projects_list = $projectroot;
+
+# Absolute (not relative) paths, and under /blog/gitweb-static rather than
+# gitweb's default "static/..." -- gitweb here uses query-string URLs
+# (?p=repo.git;a=summary), not PATH_INFO style, so it never emits a <base
+# href> to fix up relative resolution. A relative "static/gitweb.css"
+# resolves against the current page's own path (e.g. /blog/source/), landing
+# on /blog/source/static/gitweb.css, which nginx routes into the gitweb.cgi
+# fastcgi handler (there's no location more specific than /blog/source), and
+# gitweb silently ignores the bogus extra path and re-renders the project
+# list as HTML -- so the "stylesheet" comes back as text/html and never
+# applies. Absolute paths sidestep this regardless of gitweb's URL style.
+@stylesheets = ("/blog/gitweb-static/gitweb.css");
+$javascript = "/blog/gitweb-static/gitweb.js";
+$logo = "/blog/gitweb-static/git-logo.png";
+$favicon = "/blog/gitweb-static/git-favicon.png";
+
+# git-diff-tree(1) options to use for generated patches
+#@diff_opts = ("-M");
+@diff_opts = ();
index 3d341cd6b72663bd37a522ccd58d1ba404ba469c..40d95da220979bb26b67b78f83c78d4eff87443a 100644 (file)
@@ -95,7 +95,12 @@ server {
             fastcgi_pass  unix:/run/fcgiwrap.socket;
         }
 
-        location /blog/static { # gitweb static files
+        # gitweb's own CSS/JS/logo/favicon. Named gitweb-static (not the
+        # generic-sounding static) so it can't be mistaken for a general
+        # blog static-asset path; gitweb.conf (see provisioning/gitweb.conf)
+        # points @stylesheets/$javascript/$logo/$favicon at this path
+        # absolutely, rather than relying on gitweb's relative default.
+        location /blog/gitweb-static {
             alias /usr/share/gitweb/static/;
             try_files $uri $uri/ =404;
         }