commit 345a104c5e89fd6c2e5136e8baccc78abd2ef796
parent faacb3c32b00c617621d0030d2bdaef1b10a0684
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 10 May 2024 11:41:40 -0700
gitout_index: Add Mastodon self-verification link
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/grm b/grm
@@ -23,6 +23,9 @@ GRM_OWNER="Chris Bracken"
# default url prefix (without ending slash)
GRM_URL_PREFIX="https://git.bracken.jp"
+# Add Mastodon verification URL to index header.
+ME_URL="https://bsd.network/@cbracken"
+
# path of the post-receive hooks for gitout
GRM_POSTRECV_HOOK="/home/git/git_infra/post-receive"
GRM_POSTRECV_HOOKS_DIR="/home/git/git_infra/post-receive.d"
@@ -82,7 +85,7 @@ rebuild_index() {
-print \
| sort -f \
| sed -e 's/"/"\\""/g' -e 's/.*/"&"/' \
- | xargs gitout_index \
+ | xargs gitout_index -m "${ME_URL}" \
> "${web_root}/index.html" && \
echo "[index] done!"
}
@@ -170,7 +173,7 @@ grm_remove() {
fi
done
# only rebuild index if gitout exists
- command -v gitout_index >/dev/null && rebuild_index &
+ command -v gitout_index -m "${ME_URL}" >/dev/null && rebuild_index &
wait
}
diff --git a/post-receive.d/gitout b/post-receive.d/gitout
@@ -2,6 +2,9 @@
export LC_CTYPE="en_US.UTF-8"
+# Add Mastodon verification URL to index header.
+me_url="https://bsd.network/@cbracken"
+
# HTML root directory into which gitout will write.
www_root="/usr/local/www/git.bracken.jp"
@@ -59,7 +62,7 @@ if [ -e "${repo_dir}/git-daemon-export-ok" ]; then
-print \
| sort -f \
| sed -e 's/"/"\\""/g' -e 's/.*/"&"/' \
- | xargs gitout_index \
+ | xargs gitout_index -m "$me_url" \
> "${www_root}/index.html"
# Rebuild the pages for the repo (including for unlisted repos).