mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
ef5c2ab908
commit
ea01ef6f80
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user