caddy-git-server
Caddy module that provides a git server.
<!DOCTYPE html>
<html class="h-full bg-gray-100">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>caddy-git-server</title>
</head>
<body class="bg-gray-100">
<!-- full-width container with bg -->
<div class="bg-white shadow-sm">
<!-- Header -->
<div class="px-8 pt-2 mb-4 2xl:px-0 max-w-7xl mx-auto">
<div class="flex flex-wrap justify-between items-center">
<p class="text-2xl">caddy-git-server</p>
<p class="font-mono text-xs bg-gray-200 px-1 hidden sm:block"><span class="text-orange-600">git</span> clone <span class="font-bold">https://localhost/git/caddy-git-server.git</span></p>
</div>
<div class="flex flex-wrap justify-between items-center">
<p class="font-xs text-gray-500">Provides a `git_server` caddy module for serving git repositories.</p>
<select class="px-4">
<option>main</option>
<option>master</option>
<option>trunk</option>
<option>reallylongbranchname</option>
</select>
</div>
<div class="flex flex-row flex-nowrap justify-start">
<a href="tree.html"><div class="cursor-pointer px-2 pt-1 border-b-2 border-orange-400">Tree</div></a>
<a href="log.html"><div class="cursor-pointer px-2 pt-1 hover:border-b-2">Log</div></a>
<div class="cursor-pointer px-2 pt-1 hover:border-b-2">Diff</div>
</div>
</div>
</div>
<!-- max-width content container -->
<div class="max-w-7xl mx-auto">
<!-- Tree View -->
<div class="px-4 divide-y-2 max-w-full bg-white shadow-sm rounded-sm">
<ol role="list" class="flex items-center space-x-4 py-2 text-md font-medium text-gray-900">
<li>
<div>
<p class="cursor-default ml-4">caddy-git-server</p>
</div>
</li>
<li>
<div class="flex items-center">
<svg class="size-5 shrink-0 text-gray-300" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path d="M5.555 17.776l8-16 .894.448-8 16-.894-.448z" />
</svg>
<p class="cursor-default ml-4">folder</p>
</div>
</li>
</ol>
<table class="table-fixed w-full">
<!-- <thead class="">
<tr>
<td>caddy-git-server > folder > file</td>
</tr>
</thead> -->
<tbody class="divide-y text-sm font-medium text-gray-500 text-nowrap">
<tr>
<td class="py-2 pr-3 pl-4 text-gray-900 w-2/3 sm:w-1/4">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5 inline mr-2">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.99 7.5 8.24 3.75m0 0L4.49 7.5m3.75-3.75v16.499h11.25" />
</svg>
..
</td>
<td class="py-2 px-3"></td>
<td class="py-2 px-3 w-1/3 sm:w-1/6"></td>
</tr>
<tr>
<td class="py-2 pr-3 pl-4 text-gray-900 text-nowrap">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5 inline mr-2">
<path d="M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z" />
</svg>
assets/
</td>
<td class="py-2 px-3 invisible sm:visible truncate">Initial commit</td>
<td class="py-2 px-3 text-right">Yesterday</td>
</tr>
<tr>
<td class="py-2 pr-3 pl-4 text-gray-900">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5 inline mr-2">
<path d="M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z" />
</svg>
templates/
</td>
<td class="py-2 px-3 invisible sm:visible truncate">Initial commit ggggg gggggggg gggggg gggggggggg gggggggg ggggggg ggggg ggggggggg gggggggggg gggggg ggggg gggggg ggggg gggggggg gggggg ggggg</td>
<td class="py-2 px-3 text-right">Yesterday</td>
</tr>
<tr>
<td class="py-2 pr-3 pl-4 text-gray-900">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5 inline mr-2">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" />
</svg>
<a href="/blob.html">caddy-git-server.go</a></td>
<td class="py-2 px-3 invisible sm:visible truncate">oooooooooooooooooooooooooooooooooooooooooooooooooi</td>
<td class="py-2 px-3 text-right">Just Now</td>
</tr>
<tr>
<td class="py-2 pr-3 pl-4 text-gray-900">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5 inline mr-2">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" />
</svg>
README.txt</td>
<td class="py-2 px-3 invisible sm:visible truncate">oooooooooooooooooooooooooooooooooooooooooooooooooi</td>
<td class="py-2 px-3 text-right">Just Now</td>
</tr>
</tbody>
</table>
</div>
<!-- README -->
<div class="mt-4 max-w-full bg-white shadow-sm rounded-sm">
<p class="pt-2 pb-1 mx-4 px-4 text-lg border-b-2">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5 inline mr-2">
<path fill-rule="evenodd" d="M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z" clip-rule="evenodd" />
<path d="M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z" />
</svg>
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-5 inline mr-2">
<path d="M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z" />
</svg> -->
README.txt
</p>
<pre class="text-sm py-4 px-8 overflow-x-auto">
# caddy-git-server
Provides a `git_server` caddy module for serving git repositories.
This module implements the necessary git http transfer protocols to serve
clone-able git repositories. This allows you to self host your code with a
simple caddy server + config.
## Installation
You must build a custom version of caddy to use this module. Luckily, the
[`xcaddy`](https://github.com/caddyserver/xcaddy) command makes this easy:
xcaddy build --with github.com/Rex--/caddy-git-server
</pre>
</div>
<!-- Footer -->
<div class="mt-4 sticky top-[100vh]">
<div class="px-3 py-2 text-md text-center">
Served with
<img src="cgs-icon.png" class="size-6 inline mx-1">
<a href="https://git.mckinnon.ninja/caddy-git-server" class="font-medium underline">
caddy-git-server
</a>
</div>
</div>
</div>
</body>
</html>