diff --git a/README.md b/README.md index af40924..6138a77 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,54 @@ a post-receive hook that generates an html view of a git repository. ## features -TODO +- static html files +- no background process other than git-daemon +- default repository view is an html-rendered README.md file ## caveats -TODO +- binary file contents are just... shown +- images don't render +- directory tree is shown as a flat list of files, so git repositories with + many files and directories will look awful +- no commit log (yet?) +- no line numbers (yet?) ## disclaimer -TODO +no one is liable if this software breaks, deletes, corrupts, or ruins anything ## requirements - [chicken scheme](https://call-cc.org/) - [utf8 egg](https://wiki.call-cc.org/eggref/5/utf8) - [lowdown egg](https://wiki.call-cc.org/eggref/5/lowdown) +- git **note**: if you have chicken scheme installed, then you can install the eggs above by running `sudo make dependencies`. ## quickstart -TODO + on your server, run the following commands, changing anything occurs between angled brackets ("<" and ">"): + adduser git + mkdir /var/www/git + chown git:git /var/www/git + cp git-daemon.service /etc/systemd/system/ + ufw allow 9418 + systemctl enable --now git-daemon.service + su - git + mkdir projects + clone this repository + cd into this repository + sudo make dependencies + make + sudo make install + edit the post-receive file + cp post-receive /hooks/ + chmod u+x /hooks/post-receive + then in a git repository on your local machine, run git remote add origin git@:~/projects/ + git push ## compilation @@ -39,11 +65,11 @@ TODO (git user, ssh, ufw ports, web directory, git-daemon, mkdir /home/git/proje ## usage -TODO +TODO: just talk about how the post-receive hook works. shouldn't be too long ## configuration -TODO +TODO: describe environment variables in post-receive hook ## todos diff --git a/post-receive b/post-receive new file mode 100644 index 0000000..f07d1b9 --- /dev/null +++ b/post-receive @@ -0,0 +1,11 @@ +#!/bin/sh + +# - place this file in the 'hooks' directory of a bare git repository +# - this assumes that repo2html is in your path + +export GIT_WWW=/var/www/git/ +export GIT_WWW_CLONE_URL=git://git.example.com +export GIT_WWW_TITLE=git.example.com +export GIT_WWW_DESCRIPTION="sherry's git repositories" +export GIT_WWW_H1=git.example.com +repo2html diff --git a/post-receive.sample b/post-receive.sample deleted file mode 100755 index f6c3a81..0000000 --- a/post-receive.sample +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# place this file in the 'hooks' directory of a bare git repository -# this assumes that repo2html is in your path - -export GIT_WWW=/var/www/git/ -export GIT_WWW_CLONE_URL=git://git.m455.casa -export GIT_WWW_TITLE=git.m455.casa -export GIT_WWW_DESCRIPTION="m455's git repositories" -export GIT_WWW_H1=git.m455.casa -repo2html