repo2html/README.md

87 lines
2.3 KiB
Markdown
Raw Normal View History

2022-12-02 16:41:55 -05:00
# repo2html
2022-12-02 17:13:34 -05:00
a post-receive hook that generates an html view of a git repository.
2022-12-02 16:41:55 -05:00
## features
- static html files
- no background process other than git-daemon
- default repository view is an html-rendered README.md file
2022-12-02 16:41:55 -05:00
## caveats
- 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?)
2022-12-02 16:41:55 -05:00
## disclaimer
no one is liable if this software breaks, deletes, corrupts, or ruins anything
2022-12-02 16:41:55 -05:00
## requirements
2022-12-02 16:54:38 -05:00
- [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
2022-12-02 16:54:38 -05:00
**note**: if you have chicken scheme installed, then you can install the eggs
above by running `sudo make dependencies`.
2022-12-02 16:41:55 -05:00
## quickstart
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
2022-12-02 16:41:55 -05:00
## compilation
2022-12-02 16:49:37 -05:00
sudo make dependencies
make
sudo make install
2022-12-02 16:41:55 -05:00
2022-12-02 17:34:21 -05:00
## server setup
2022-12-02 16:41:55 -05:00
TODO (git user, ssh, ufw ports, web directory, git-daemon, mkdir /home/git/projects, post-receive hook, systemd service)
## usage
TODO: just talk about how the post-receive hook works. shouldn't be too long
2022-12-02 16:41:55 -05:00
## configuration
TODO: describe environment variables in post-receive hook
2022-12-02 16:41:55 -05:00
## todos
- ☐ nav link: License (look for LICENSE file)
- ☐ nav link: Contributors
2022-12-02 16:41:55 -05:00
## hopes
- ☐ clickable line numbers in source files
- ☐ render images
- ☐ make repos with more files and directories less daunting (recursively generate a files list page for each directory in a repo?)
- ☐ nav link: Releases
2022-12-02 16:41:55 -05:00
TODO