updated readme

- renamed post-receive.sample to post-receive
- fixed file permissions on post-receive file
This commit is contained in:
m455 2022-12-04 00:44:52 -05:00
parent b9c3c29162
commit 3f2f056f8c
3 changed files with 43 additions and 17 deletions

View file

@ -4,28 +4,54 @@ a post-receive hook that generates an html view of a git repository.
## features ## features
TODO - static html files
- no background process other than git-daemon
- default repository view is an html-rendered README.md file
## caveats ## 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 ## disclaimer
TODO no one is liable if this software breaks, deletes, corrupts, or ruins anything
## requirements ## requirements
- [chicken scheme](https://call-cc.org/) - [chicken scheme](https://call-cc.org/)
- [utf8 egg](https://wiki.call-cc.org/eggref/5/utf8) - [utf8 egg](https://wiki.call-cc.org/eggref/5/utf8)
- [lowdown egg](https://wiki.call-cc.org/eggref/5/lowdown) - [lowdown egg](https://wiki.call-cc.org/eggref/5/lowdown)
- git
**note**: if you have chicken scheme installed, then you can install the eggs **note**: if you have chicken scheme installed, then you can install the eggs
above by running `sudo make dependencies`. above by running `sudo make dependencies`.
## quickstart ## 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 <path/to/bare/git/repository>/hooks/
chmod u+x <path/to/bare/git/repository>/hooks/post-receive
then in a git repository on your local machine, run git remote add origin git@<example.com>:~/projects/<repository-name>
git push
## compilation ## compilation
@ -39,11 +65,11 @@ TODO (git user, ssh, ufw ports, web directory, git-daemon, mkdir /home/git/proje
## usage ## usage
TODO TODO: just talk about how the post-receive hook works. shouldn't be too long
## configuration ## configuration
TODO TODO: describe environment variables in post-receive hook
## todos ## todos

11
post-receive Normal file
View file

@ -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

View file

@ -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