commit 28d9eb606251f46e6561456dad9b8b28993bc2f4
Author: Oshgnacknak <osh@oshgnacknak.de>
Date: Sun, 25 Oct 2020 13:12:56 +0100
Initial Commit
Diffstat:
6 files changed, 177 insertions(+), 0 deletions(-)
diff --git a/README b/README
@@ -0,0 +1,4 @@
+oshgit
+======
+
+Shell scripts based on stagit to manage OSHs git repositories.
diff --git a/build.sh b/build.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# - Makes index for repositories in a single directory.
+# - Makes static pages for each repository directory.
+#
+# NOTE, things to do manually (once) before running this script:
+# - copy style.css, logo.png and favicon.png manually, a style.css example
+# is included.
+#
+# - write clone url, for example "git://git.codemadness.org/dir" to the "url"
+# file for each repo.
+# - write owner of repo to the "owner" file.
+# - write description in "description" file.
+
+here=$(realpath $(dirname $0))
+repos=$(realpath $here)/../*.git/
+output=/var/www/html
+
+echo Building repository list to $output
+stagit-index $repos > $output/index.html
+cp $here/style.css $output/style.css
+cp $here/logo.png $output/logo.png
+ln -sf $output/logo.png $output/favicon.png
+
+for repo in ${@:-$repos}; do
+ dir="$output/$(basename $repo .git)"
+ repo=$(realpath $repo)
+
+ mkdir -p $dir
+ pushd $dir
+
+ echo Building html for $repo to $dir
+ stagit -c ".cache" $repo
+
+ ln -sf log.html index.html
+ ln -sf $output/style.css style.css
+ ln -sf $output/logo.png logo.png
+ ln -sf $output/logo.png favicon.png
+
+ popd
+done
+
+chgrp www-data $output -R
+chmod 770 $output -R
diff --git a/logo.png b/logo.png
Binary files differ.
diff --git a/new-repo.sh b/new-repo.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+for name in $@; do
+ dir="../$name.git"
+ url="ssh://osh@192.168.2.6:/~/git/$name.git"
+
+ mkdir $dir
+ git -C $dir init --bare
+
+ echo "Oshgnacknak" > $dir/owner
+ echo $url > $dir/url
+ ${EDITOR:-vi} $dir/description
+ ln -sr post-receive.sh $dir/hooks/post-receive
+
+ ./build.sh $dir
+ echo "Clone: $url"
+done
diff --git a/post-receive.sh b/post-receive.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+../oshgit/build.sh $PWD
diff --git a/style.css b/style.css
@@ -0,0 +1,106 @@
+body {
+ color: #000;
+ background-color: #fff;
+ font-family: monospace;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-size: 1em;
+ margin: 0;
+}
+
+img, h1, h2 {
+ vertical-align: middle;
+}
+
+img {
+ border: 0;
+}
+
+a:target {
+ background-color: #ccc;
+}
+
+a.d,
+a.h,
+a.i,
+a.line {
+ text-decoration: none;
+}
+
+#blob a {
+ color: #777;
+}
+
+#blob a:hover {
+ color: blue;
+ text-decoration: none;
+}
+
+table thead td {
+ font-weight: bold;
+}
+
+table td {
+ padding: 0 0.4em;
+}
+
+#content table td {
+ vertical-align: top;
+ white-space: nowrap;
+}
+
+#branches tr:hover td,
+#tags tr:hover td,
+#index tr:hover td,
+#log tr:hover td,
+#files tr:hover td {
+ background-color: #eee;
+}
+
+#index tr td:nth-child(2),
+#tags tr td:nth-child(3),
+#branches tr td:nth-child(3),
+#log tr td:nth-child(2) {
+ white-space: normal;
+}
+
+td.num {
+ text-align: right;
+}
+
+.desc {
+ color: #777;
+}
+
+hr {
+ border: 0;
+ border-top: 1px solid #777;
+ height: 1px;
+}
+
+pre {
+ font-family: monospace;
+}
+
+pre a.h {
+ color: #00a;
+}
+
+.A,
+span.i,
+pre a.i {
+ color: #070;
+}
+
+.D,
+span.d,
+pre a.d {
+ color: #e00;
+}
+
+pre a.h:hover,
+pre a.i:hover,
+pre a.d:hover {
+ text-decoration: none;
+}