pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

commit aa48fbf47506a1abfb8a9abb83a020394b247838
parent 866439bed331c2954b486a75ab0395fa8e52bde9
Author: pyratebeard <root@pyratebeard.net>
Date:   Sat,  1 Jan 2022 23:36:19 +0000

absolute_git

Diffstat:
Mentry/absolute_git.draft | 48+++++-------------------------------------------
1 file changed, 5 insertions(+), 43 deletions(-)

diff --git a/entry/absolute_git.draft b/entry/absolute_git.draft @@ -1,47 +1,9 @@ -Recently I migrated from [gitweb]() to [stagit](https://codemadness.org/stagit.html) for my [personal git](https://git.pyratebeard.net) server webpage. I liked gitweb and used it for a number of years, but after seeing [some](z3bra) [other](df20) stagit git sites I preferred the style and decided it was time for a change. +Recently I migrated from [gitweb](https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb) to [stagit](https://codemadness.org/stagit.html) for my [personal git](https://git.pyratebeard.net) server webpage. I liked gitweb and used it for a number of years, but after seeing [some](https://git.z3bra.org/) [other](https://git.2f30.org/) stagit git sites I preferred the style and decided it was time for a change. -My git server is using [git-daemon]() to expose the repos. This is really easy to set up following the [official docs](). +My git server is using `git daemon` to serve the repos. This is really easy to set up following the [Git on the Server docs](https://git-scm.com/book/en/v2/Git-on-the-Server-Git-Daemon). -Stagit doesn't take much to get working either. The [README]() is very detailed. To get started clone the stagit repo then use `make` to build and install. This then gives you the `stagit` command for creating the web content and `stagit-index` for generating the index.html page. +Stagit doesn't take much to get working either. As detailed in the [README](https://codemadness.org/git/stagit/file/README.html), to get started clone the stagit repo then use `make` to build and install. This then gives you the `stagit` command for creating the web content and `stagit-index` for generating the index.html page. -I use the following script to build my stagit content and the index.html page. -``` -#!/bin/sh +In order to make sure stagit is kept up to date I use a git [post-receive](https://git-scm.com/docs/githooks#post-receive) hook in all my repos which runs every time I push code to the server. This will keep my git web site up to date automatically. An example [post-receive script](https://codemadness.org/git/stagit/file/README.html#l97) is shown in the README. -REPOSDIR="/srv/git" -WWWBASE="/var/www/html" -BASEURL="https://git.pyratebeard.net" - -for repo in "${REPOSDIR}/"*/ ; do - # strip .git suffix - r=$(basename "${repo}") - d=$(basename "${repo}" ".git") - printf "%s... " "${d}" - - sudo mkdir -p "${WWWBASE}/${d}" - cd "${WWWBASE}/${d}" || continue - sudo stagit -c ".cache" -u "${BASEURL}/$d/" "${REPOSDIR}/${r}" - - # symlinks - sudo ln -sf log.html index.html - sudo ln -sf ../style.css style.css - sudo ln -sf ../logo.png logo.png - sudo ln -sf ../favicon.png favicon.png - - # this is a little hack to remove the - # border from icon link - for f in $(find . -type f -name "*.html") ; do - sudo sed -i 's%href=".*/"%href="/"\ style="border:\ 0px;"%' "${f}" - done -done - -sudo stagit-index "${REPOSDIR}/"*/ | sudo tee "${WWWBASE}/index.html" -``` - -In order to make sure stagit is kept up to date I use a git [post-receive]() hook in all my repos which runs the script above (called `stagitdo`) -``` -#!/bin/sh -/usr/local/bin/stagitdo -``` - -This means that everytime I push to one of my git repos my stagit website is updated automatically. +I have been really happy with stagit since moving to it and if you're looking to host your own simple git server I recommend giving stagit a shot.