gitweb: avoid global environment variables in Apache configuration

Closes #1671

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa 2019-10-25 13:54:51 +03:00 committed by Sunil Mohan Adapa
parent ef5c2ab908
commit ea01ef6f80
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -7,16 +7,6 @@
## mod_rewrite
##
# Make gitweb work with custom FreedomBox configuration.
SetEnv GITWEB_CONFIG /etc/gitweb-freedombox.conf
# Configure git-http-backend to work with our repository path.
SetEnv GIT_PROJECT_ROOT /var/lib/git
# Tell git-http-backend to work with all the projects even when they don't have
# the file 'git-daemon-export-ok'.
SetEnv GIT_HTTP_EXPORT_ALL
# All git operations are handled by git-http-backend CGI script. Rest of the
# HTTP requests (say sent by the browser) are handled by gitweb.
ScriptAliasMatch \
@ -31,6 +21,9 @@ ScriptAliasMatch \
Alias /gitweb /usr/share/gitweb
<Directory /usr/share/gitweb>
# Make gitweb work with custom FreedomBox configuration.
SetEnv GITWEB_CONFIG /etc/gitweb-freedombox.conf
<If "%{HTTP_COOKIE} =~ /auth_pubtkt=.*tokens.*(admin|git-access)/">
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
@ -53,6 +46,13 @@ Alias /gitweb /usr/share/gitweb
</Directory>
<Directory /usr/lib/git-core/>
# Configure git-http-backend to work with our repository path.
SetEnv GIT_PROJECT_ROOT /var/lib/git
# Tell git-http-backend to work with all the projects even when they don't
# have the file 'git-daemon-export-ok'.
SetEnv GIT_HTTP_EXPORT_ALL
# Authentication is required when performing git push (git send-pack).
SetEnvIfExpr "%{QUERY_STRING} =~ /service=git-receive-pack/" AUTHREQUIRED
SetEnvIfExpr "%{REQUEST_URI} =~ /git-receive-pack$/" AUTHREQUIRED