From de8d06726cae205ead43f8b1ac07ecc59a07363b Mon Sep 17 00:00:00 2001 From: RATDAD Date: Fri, 12 Dec 2025 01:49:48 -0500 Subject: Edited README, omitted /cgit.cgi/ from urls, added HTTP Basic Auth --- opt/auth.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 opt/auth.sh (limited to 'opt/auth.sh') diff --git a/opt/auth.sh b/opt/auth.sh new file mode 100644 index 0000000..6d87868 --- /dev/null +++ b/opt/auth.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Check if we're enabling basic auth. +if [ "$HTTP_AUTH_PASSWORD" != "" ]; then + echo "AuthType Basic +AuthName \"CGit\" +AuthUserFile /srv/www/htdocs/cgit/.htpasswd +Require valid-user" > /srv/www/htdocs/cgit/.htaccess +htpasswd -c -b /srv/www/htdocs/cgit/.htpasswd $HTTP_AUTH_USER $HTTP_AUTH_PASSWORD +fi \ No newline at end of file -- cgit v1.2.3-70-g09d2