for my $c (@commits) {
my $short = substr($c->{hash}, 0, 8);
my $show_url = "$BASE_URL/git4ai-show/$repo/$c->{hash}";
- my $tree_url = "$BASE_URL/git4ai-ls-tree/$repo/$c->{hash}/0/r$rand";
+ my $tree_url = "$BASE_URL/git4ai-ls-tree/$repo/$c->{hash}";
print "<tr>";
print "<td><a href=\"$show_url\">$short</a></td>";
print "<td><a href=\"$tree_url\">tree</a></td>";
<p>Файлов: $total, показаны $offset — @{[$offset + scalar @page]}</p>
HTML
-print "<a href=\"$BASE_URL/gitai-ls-tree/$repo/$commit_id/$prev/r$rand\">← выше</a> "
+print "<a href=\"$BASE_URL/git4ai-ls-tree/$repo/$commit_id/$prev\">← выше</a> "
if $offset > 0;
-print "<a href=\"$BASE_URL/gitai-ls-tree/$repo/$commit_id/$next/r$rand\">ниже →</a>"
+print "<a href=\"$BASE_URL/git4ai-ls-tree/$repo/$commit_id/$next\">ниже →</a>"
if $next < $total;
print "\n<table border='1' cellpadding='4'>\n";
print "<tr><th>Блоб</th><th>Размер</th><th>Файл</th></tr>\n";
for my $f (@page) {
- my $raw_url = "$BASE_URL/gitai-cat-file/$repo/$f->{hash}/r$rand";
+ my $raw_url = "$BASE_URL/git4ai-cat-file/$repo/$f->{hash}";
my $short = substr($f->{hash}, 0, 8);
printf "<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n",
$raw_url, $short, $f->{size}, $f->{name};
<!DOCTYPE html>
<html>
<head><meta charset="utf-8">
-<title>gitai: $repo / $branch</title>
+<title>git4ai: $repo / $branch</title>
</head>
<body>
<p>Прочитав коммит лог, ты сможешь посмотреть на ls-tree для заданного коммита по ссылке вида https://gitweb.nataraj.world/git4ai-ls-tree/$repo/[commit_id]</p>
-<p>Так же посмотреть на блобы упомянуте в ls-tree по ссылке вида https://gitweb.nataraj.world/gitai-raw/$repo/[blob_id]</p>
+<p>Так же посмотреть на блобы упомянуте в ls-tree по ссылке вида https://gitweb.nataraj.world/git4ai-raw/$repo/[blob_id]</p>
<p>А так же на diff самих коммитов по ссылке вида https://gitweb.nataraj.world/git4ai-show/$repo/[commit_id]</p>
rewrite ^/git4ai/([^/]+)/([^/]+)$ /git4ai/$1/$2/-/- last;
}
+
+location ~ "^/git4ai-show/([^/]+)/([^/]+)$" {
+ rewrite ^/git4ai-show/([^/]+)/([^/]+)$ /git4ai-show/$1/-/$2/- last;
+}
+
+
+# repo id
+location ~ "^/git4ai-ls-tree/([^/]+)/([^/]+)$" {
+ return 302 https://gitweb.nataraj.world/git4ai-ls-tree/$1/-/$2/0/$request_id;
+ add_header Cache-Control "no-store" always;
+}
+
+# repo id offset
+location ~ "^/git4ai-ls-tree/([^/]+)/([^/]+)/([^/]+)$" {
+ return 302 https://gitweb.nataraj.world/git4ai-ls-tree/$1/-/$2/$3/$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;