smarthttp.conf.tmpl (1096B)
1 <VirtualHost *:443> 2 ServerName git.in0rdr.ch 3 4 ErrorLog /dev/stderr 5 TransferLog /dev/stdout 6 7 SSLCertificateFile "/etc/letsencrypt/live/git.in0rdr.ch/fullchain.pem" 8 SSLCertificateKeyFile "/etc/letsencrypt/live/git.in0rdr.ch/privkey.pem" 9 10 # Enable CGI for Smart HTTP 11 # https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP 12 #sed -E -i 's~(\s)*#(LoadModule cgi_module modules/mod_cgi.so)~\1\2~g' /etc/apache2/httpd.conf 13 LoadModule cgi_module modules/mod_cgi.so 14 15 SetEnv GIT_PROJECT_ROOT /srv/git 16 #SetEnv GIT_HTTP_EXPORT_ALL 17 ScriptAlias / /usr/libexec/git-core/git-http-backend/ 18 19 <Directory "/usr/libexec"> 20 AllowOverride None 21 Options None 22 Require all granted 23 </Directory> 24 25 <Files "git-http-backend"> 26 AuthType Basic 27 AuthName "Git Access" 28 AuthUserFile /srv/git/.htpasswd 29 Require expr !(%{QUERY_STRING} -strmatch '*service=git-receive-pack*' || %{REQUEST_URI} =~ m#/git-receive-pack$#) 30 Require valid-user 31 </Files> 32 33 <Location "/private"> 34 AuthType Basic 35 AuthName "Git Access" 36 AuthUserFile /srv/git/.htpasswd 37 Require valid-user 38 </Location> 39 </VirtualHost>