commit more
authorShane <chown_tee@proton.me>
Sun, 11 Jan 2026 00:58:18 +0000 (00:58 +0000)
committerShane <chown_tee@proton.me>
Sun, 11 Jan 2026 00:58:18 +0000 (00:58 +0000)
Makefile
etc/gitweb.conf [new file with mode: 0644]
scripts/deploy.sh

index 719f17baa4de836e66025dd65ee1cf1c4eaf242d..3b3e6ffae5a9dd92e6b98a3d6bbd68a96bf0fcfd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -80,6 +80,8 @@ ifdef SUDO_USER
                echo "secrets.conf is ENCRYPTED, skipping."; \
                rm -f /tmp/nginx-staging/secrets.conf; \
        fi
+       # Copy gitweb.conf if it exists
+       [ -f etc/gitweb.conf ] && cp etc/gitweb.conf /tmp/nginx-staging/
        cp scripts/deploy.sh /tmp/nginx-staging/
        chmod -R a+rX /tmp/nginx-staging
 else
diff --git a/etc/gitweb.conf b/etc/gitweb.conf
new file mode 100644 (file)
index 0000000..9559e09
--- /dev/null
@@ -0,0 +1,31 @@
+# path to git projects (<project>.git)
+$projectroot = "/srv/git";
+
+# 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;
+
+# stylesheet to use
+@stylesheets = ("/static/gitweb.css");
+
+# javascript code for gitweb
+$javascript = "static/gitweb.js";
+
+# logo to use
+$logo = "/static/git-logo.png";
+
+# the 'favicon'
+$favicon = "/static/git-favicon.png";
+
+# git-diff-tree(1) options to use for generated patches
+#@diff_opts = ("-M");
+
+@diff_opts = ("-M", "-C");
index d1c213c351a4202a803bb5ac66d2bc3d275950bb..89a5f261f168d11b4b2048f10f7f6996ecd2a10f 100755 (executable)
@@ -63,6 +63,15 @@ fi
 if sudo nginx -t; then
     echo "Configuration is valid. Reloading Nginx..."
     sudo nginx -s reload
+
+    # Deploy gitweb.conf if it exists in staging
+    if [ -f "$STAGING_DIR/gitweb.conf" ]; then
+        echo "Deploying gitweb.conf..."
+        # Backup existing
+        [ -f /etc/gitweb.conf ] && sudo cp /etc/gitweb.conf $BACKUP_DIR/gitweb.conf
+        sudo cp "$STAGING_DIR/gitweb.conf" /etc/gitweb.conf
+    fi
+
     echo "✓ Deployment successful."
 else
     echo "✗ Configuration failed validation! Rolling back..."