shithub: gitonline

Download patch

ref: a76da5509d4f84e97c5145fbd7fa2bd933d9645d
parent: dcb7b6e458c412c7e7026e2e1974ab610febea15
author: glenda <glenda@9front.local>
date: Sun Nov 29 13:14:19 EST 2020

Add mirror script. Running it will clone everything from shithub

--- a/gitonline.rc
+++ b/gitonline.rc
@@ -1,6 +1,6 @@
 #!/bin/rc
 
-SITE_TITLE='Git repository browser (mirror of shithub.us)'
+SITE_TITLE='Web mirror of shithub.us'
 
 nl='
 '
@@ -153,7 +153,7 @@
 			files=`$nl{ls -F | sed 's/\*//g'}
 			echo '<pre>'
 			for (f in $files) {
-				echo '<a href="'$f'">'$f'</a>'
+				echo '<a href="/'$repo'/browse/'$gitref'/'$f'">'$f'</a>'
 			}
 			echo '</pre>'
 		}
--- /dev/null
+++ b/mirror.rc
@@ -1,0 +1,18 @@
+#!/bin/rc
+
+webfs
+cd /usr/glenda/src/repodir
+
+repos=`{hget http://shithub.us/git/repos.html | grep '<dt><a href=' | sed 's,.*">(.*)</a></dt>,\1,g'}
+echo Mirroring $#repos at `{date} >> /sys/log/shithubmirror
+
+for (repo in $repos) {
+	if (test -d $repo) {
+		cd $repo
+		git/pull
+		cd ../../
+	}
+	if not {
+		git/clone git://shithub.us/$repo $repo
+	}
+}