gitpages

A collection of scripts to securely webhost and publish git repositories.
git clone https://scm.kuandu.systems/git-raw/gitpages.git
Log | Files | Refs | README | LICENSE

commit 2d6cd57eb017f5228693b29073fb3bd83d91ef51
parent 584233d1e6ca207101046dc8fafe0347c1652c1e
Author: Fred Großkopf <fred@kuandu.systems>
Date:   Wed, 29 Apr 2026 10:28:27 +0200

Update post-receive.hook template

Diffstat:
Mpost-receive.hook | 28+++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/post-receive.hook b/post-receive.hook @@ -1,26 +1,8 @@ #!/bin/sh +# +# Place this in: /var/git/repos/<repo>.git/hooks/post-receive -set -eu +QUEUE_FILE="/var/spool/gitpages-update-queue" -RAW_DST="${RAW_DST:-/var/www/htdocs/scm.mydomain.com/git-raw}" -HTML_DST="${HTML_DST:-/var/www/htdocs/scm.mydomain.com/git}" -CONFIG_FILE="${CONFIG_FILE:-/home/user/gitpages.conf}" -ASSETS_DIR="${ASSETS_DIR:-/home/user/assets}" - -repo_path="$(pwd)" -repo="$(basename "$repo_path")" - -check_dir() { - [ -d "$1" ] || { - printf 'error: %s is not a directory\n' "$1" >&2 - exit 1 - } -} - -check_dir "$RAW_DST" -check_dir "$HTML_DST" - -printf 'Updating web view for %s\n' "$repo" - -/home/user/bin/mirror-git "$repo_path" "$RAW_DST" -/home/user/bin/gitpages -c "$CONFIG_FILE" "$RAW_DST/$repo" "$HTML_DST" "$ASSETS_DIR" +# Append the full path of the current directory to the queue +echo "$PWD" >> "$QUEUE_FILE"