--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $GIT_ROOT = '/var/lib/git';
+my $BASE_URL = 'https://gitweb.nataraj.world';
+
+print "Content-Type: text/html; charset=utf-8\r\n";
+print "Cache-Control: no-store, no-cache, must-revalidate\r\n";
+print "\r\n";
+
+opendir(my $dh, $GIT_ROOT) or die "Cannot open $GIT_ROOT: $!";
+my @repos = sort grep { /\.git$/ && -d "$GIT_ROOT/$_" } readdir($dh);
+closedir($dh);
+
+print <<HTML;
+<!DOCTYPE html>
+<html>
+<head><meta charset="utf-8">
+<title>git repositories</title>
+</head>
+<body>
+<h2>git repositories</h2>
+<ul>
+HTML
+
+for my $repo (@repos) {
+ my $branches_url = "$BASE_URL/git4ai-branches/$repo";
+ print "<li><a href=\"$branches_url\">$repo</a></li>\n";
+}
+
+print "</ul>\n</body></html>\n";
~^/git4ai-log/ /srv/cgi/git4ai-log.pl;
~^/git4ai-ls-tree/ /srv/cgi/git4ai-ls-tree.pl;
~^/git4ai-branches/ /srv/cgi/git4ai-branches.pl;
+ ~^/git4ai-repos/ /srv/cgi/git4ai-repos.pl;
~^/git4ai/ /srv/cgi/git4ai.pl;
}
add_header Cache-Control "no-store" always;
}
+location ~ "^/git4ai-repos$" {
+ return 302 https://gitweb.nataraj.world/git4ai-repos/-/-/-/-/$request_id;
+ add_header Cache-Control "no-store" always;
+}
+
# repo branch id offset nonce
location ~ "^/git4ai[^/]*/([a-zA-Z0-9._-]+)/([a-zA-Z0-9._-]+|-)/([0-9a-f]{4,40}|-)/([0-9]+|-)(?:/([a-zA-Z0-9]+))?$" {
set $git_repo $1;