Commit 298b664d authored by Antoine Catton's avatar Antoine Catton

Fix gitrepo profile

parent d4ed74a9
#!/usr/bin/env sh #!/usr/bin/env sh
GIT_PROJECT_ROOT="%(projectdir)s" GIT_HTTP_EXPORT_ALL= exec "%(githttpbackend)s" $@ ## This is a very dirty hack
export PATH_INFO="$${REDIRECT_URL:-$PATH_INFO}"
GIT_PROJECT_ROOT='${git-repos:base-directory}' GIT_HTTP_EXPORT_ALL= exec '${:githttpbackend}' $@
#!/usr/bin/env sh #!/usr/bin/env sh
GITWEB_CONFIG="%(gitwebconf)s" exec "%(perl)s" "%(gitweb)s" $@ GITWEB_CONFIG='${gitweb-conf:output}' exec '${:perl}' '${:gitweb}' $@
$projectroot = '%(projectdir)s'; $projectroot = '${git-repos:base-directory}';
$site_name = '%(sitename)s'; $site_name = '${slap-parameter:title}';
# Beautiful URLs # Beautiful URLs
$feature{'pathinfo'}{'default'} = [1]; $feature{'pathinfo'}{'default'} = [1];
PidFile "%(pidfile)s" PidFile "${:pid-file}"
Listen %(ip)s:%(port)s Listen ${slap-network-information:global-ipv6}:${:port}
ServerAdmin someone@email ServerAdmin someone@email
ErrorLog "%(errorlog)s" ErrorLog "${:error-log}"
LogLevel warn LogLevel warn
ScriptSock "%(cgidsock)s" ScriptSock "${:cgid-sock}"
<Directory /> <Directory />
AllowOverride None AllowOverride None
...@@ -13,38 +13,41 @@ ScriptSock "%(cgidsock)s" ...@@ -13,38 +13,41 @@ ScriptSock "%(cgidsock)s"
Deny from all Deny from all
</Directory> </Directory>
Alias "/static/" "%(gitwebstaticdir)s" Alias "/static/" "${:gitweb-static-dir}"
<Directory "%(gitwebstaticdir)s"> <Directory "${:gitweb-static-dir}">
Options FollowSymLinks Options FollowSymLinks
Order deny,allow Order deny,allow
Allow from all Allow from all
</Directory> </Directory>
# This is Static Accelerated git pull # This is Static Accelerated git pull
AliasMatch "^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$" "%(projectdir)s/$1" AliasMatch "^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$" "${:project-dir}/$1"
AliasMatch "^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$" "%(projectdir)s/$1" AliasMatch "^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$" "${:project-dir}/$1"
# When it can't be statically delivered, we rely on git-http-backend # When it can't be statically delivered, we rely on git-http-backend
ScriptAliasMatch \ ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \ "(?x)^/(.*/(HEAD | \
info/refs | \ info/refs | \
objects/info/[^/]+ | \ objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \ git-(upload|receive)-pack))(/push)?$" \
"%(githttpbackend)s/$1" "${:git-http-backend}/$1"
# Everything else is gitweb interface # Everything else is gitweb interface
ScriptAlias "/" "%(gitwebscript)s/" ScriptAlias "/" "${:gitweb-script}/"
<Location /> <Location />
Order deny,allow Order deny,allow
Allow from all Allow from all
RewriteEngine On
RewriteCond %{QUERY_STRING} service=git-receive-pack
RewriteRule ^(.*)$ $1/push [END]
</Location> </Location>
<LocationMatch "^/.*/git-receive-pack$"> <LocationMatch "(^/.*/git-receive-pack|/push)$">
AuthType Basic AuthType Basic
AuthName "Git Push Access" AuthName "Git Push Access"
AuthBasicProvider file AuthBasicProvider file
AuthUserFile "%(passwdfile)s" AuthUserFile "${:passwd-file}"
Require valid-user Require valid-user
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
</LocationMatch> </LocationMatch>
...@@ -60,4 +63,5 @@ LoadModule authz_user_module modules/mod_authz_user.so ...@@ -60,4 +63,5 @@ LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgid_module modules/mod_cgid.so LoadModule cgid_module modules/mod_cgid.so
LoadModule env_module modules/mod_env.so LoadModule env_module modules/mod_env.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule unixd_module modules/mod_unixd.so LoadModule unixd_module modules/mod_unixd.so
...@@ -5,12 +5,19 @@ develop-eggs-directory = ${buildout:develop-eggs-directory} ...@@ -5,12 +5,19 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
parts = parts =
httpd
publish publish
httpd
httpd-conf
gitweb-conf
gitweb-cgi
git-http-backend-cgi
htpasswd
pwgen
git-repos
[publish] [publish]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
url = http://$${pwgen:user}:$${pwgen:password}@[$${httpd-conf:ip}]:$${httpd-conf:port}/ url = http://$${pwgen:user}:$${pwgen:password}@[$${slap-network-information:global-ipv6}]:$${httpd-conf:port}/
[httpd] [httpd]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -19,48 +26,42 @@ output = $${basedirectory:services}/httpd ...@@ -19,48 +26,42 @@ output = $${basedirectory:services}/httpd
[httpd-conf] [httpd-conf]
recipe = slapos.cookbook:template recipe = slapos.recipe.template
template = ${template-httpd-conf:location}/${template-httpd-conf:filename} url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
output = $${rootdirectory:etc}/httpd.conf output = $${rootdirectory:etc}/httpd.conf
pidfile = $${basedirectory:run}/httpd.pid pid-file = $${basedirectory:run}/httpd.pid
errorlog = $${basedirectory:log}/httpd-errorlog.log error-log = $${basedirectory:log}/httpd-errorlog.log
gitwebstaticdir = ${gitweb:location}/share/gitweb/static/ gitweb-static-dir = ${gitweb:location}/share/gitweb/static/
gitwebscript = $${gitweb-cgi:output} gitweb-script = $${gitweb-cgi:output}
githttpbackend = $${git-http-backend-cgi:output} git-http-backend = $${git-http-backend-cgi:output}
cgidsock = $${basedirectory:run}/cgid.sock cgid-sock = $${basedirectory:run}/cgid.sock
projectdir = $${gitweb-conf:projectdir} project-dir = $${git-repos:base-directory}
passwdfile = $${htpasswd:output} passwd-file = $${htpasswd:output}
ip = $${slap-network-information:global-ipv6}
port = 8080 port = 8080
[gitweb-conf] [gitweb-conf]
recipe = slapos.cookbook:template recipe = slapos.recipe.template
template = ${template-gitweb-conf:location}/${template-gitweb-conf:filename} url = ${template-gitweb-conf:location}/${template-gitweb-conf:filename}
output = $${rootdirectory:etc}/gitweb.conf output = $${rootdirectory:etc}/gitweb.conf
projectdir = $${git-repos:base-directory}
sitename = $${slap-parameter:title}
[gitweb-cgi] [gitweb-cgi]
recipe = slapos.cookbook:template recipe = slapos.recipe.template
template = ${template-gitweb-cgi:location}/${template-gitweb-cgi:filename} url = ${template-gitweb-cgi:location}/${template-gitweb-cgi:filename}
output = $${rootdirectory:bin}/gitweb.cgi output = $${rootdirectory:bin}/gitweb.cgi
mode = 700 mode = 700
perl = ${perl:location}/bin/perl perl = ${perl:location}/bin/perl
gitweb = ${gitweb:location}/share/gitweb/gitweb.cgi gitweb = ${gitweb:location}/share/gitweb/gitweb.cgi
gitwebconf = $${gitweb-conf:output}
[git-http-backend-cgi] [git-http-backend-cgi]
recipe = slapos.cookbook:template recipe = slapos.recipe.template
template = ${template-git-http-backend-cgi:location}/${template-git-http-backend-cgi:filename} url = ${template-git-http-backend-cgi:location}/${template-git-http-backend-cgi:filename}
output = $${rootdirectory:bin}/git-http-backend.cgi output = $${rootdirectory:bin}/git-http-backend.cgi
mode = 700 mode = 700
projectdir = $${git-repos:base-directory}
githttpbackend = ${git:location}/libexec/git-core/git-http-backend githttpbackend = ${git:location}/libexec/git-core/git-http-backend
......
...@@ -27,7 +27,7 @@ mode = 0644 ...@@ -27,7 +27,7 @@ mode = 0644
[template-gitrepo] [template-gitrepo]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-gitrepo.cfg url = ${:_profile_base_location_}/instance-gitrepo.cfg
md5sum = 79ebc1f23443562b3facd4945f031fcf md5sum = 2ad8457628996bf0b71d80e10b3b5aa9
output = ${buildout:directory}/template-gitrepo.cfg output = ${buildout:directory}/template-gitrepo.cfg
mode = 0644 mode = 0644
...@@ -39,22 +39,22 @@ download-only = true ...@@ -39,22 +39,22 @@ download-only = true
[template-gitweb-cgi]] [template-gitweb-cgi]]
<= template-download <= template-download
filename = gitweb.cgi.in filename = gitweb.cgi.in
md5sum = 977d23296605d6a7f33f4f83d5bd29c8 md5sum = 5c720202053bfba06eec6e97d8d47cd0
[template-gitweb-conf] [template-gitweb-conf]
<= template-download <= template-download
filename = gitweb.conf.in filename = gitweb.conf.in
md5sum = bdf4b9e616e7b8e436040304bf1ac312 md5sum = d3cb0c16f54da0ea02ac982dd59d7924
[template-git-http-backend-cgi] [template-git-http-backend-cgi]
<= template-download <= template-download
filename = git-http-backend.cgi.in filename = git-http-backend.cgi.in
md5sum = 814393f919dd0204c913aa77e6183b9c md5sum = 7e0562b0ce8d48bc8f6b422850dc53af
[template-httpd-conf] [template-httpd-conf]
<= template-download <= template-download
filename = httpd.conf.in filename = httpd.conf.in
md5sum = 442ffed44a671eb3c5810a6bfa8a3515 md5sum = e5e6a6de32323248d11918934f6aad99
[collective-recipe-cmd] [collective-recipe-cmd]
recipe = zc.recipe.egg recipe = zc.recipe.egg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment