Commit 142a0712 authored by Łukasz Nowak's avatar Łukasz Nowak

Merge remote-tracking branch 'origin/master' into html5as

Conflicts:
	CHANGES.txt
	component/tar/buildout.cfg
	setup.py
	slapos/recipe/downloader.py
	slapos/recipe/gitinit.py
	slapos/recipe/librecipe/execute.py
	software/gitrepo/git-http-backend.cgi.in
	software/gitrepo/gitweb.cgi.in
	software/gitrepo/gitweb.conf.in
	software/gitrepo/httpd.conf.in
	software/gitrepo/instance-gitrepo.cfg
	software/gitrepo/software.cfg
	software/lxc/instance-lxc.cfg
	software/lxc/lxc.conf.in
	software/lxc/software.cfg
parents 10796edb 8e49e678
Changes Changes
======= =======
0.64 (Unrelease) 0.65 (Unrelease)
---------------- ----------------
* No change yet. * No change yet.
0.64.2 (2012-08.28)
-------------------
* Specify description on gitinit recipe. [Antoine Catton]
0.64.1 (2012-08-28)
-------------------
* Fix: minor fix on downloader recipe in order to allow cross-device renaming.
[Antoine Catton]
0.64 (2012-08-27)
----------------
* Fix: remove "template" recipe which was collinding with slapos.recipe.template.
[Antoine Catton]
0.63 (2012-08-22) 0.63 (2012-08-22)
---------------- ----------------
......
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import glob import glob
import os import os
version = '0.63-dev' version = '0.65-dev'
name = 'slapos.cookbook' name = 'slapos.cookbook'
long_description = open("README.txt").read() + "\n" + \ long_description = open("README.txt").read() + "\n" + \
open("CHANGES.txt").read() + "\n" open("CHANGES.txt").read() + "\n"
...@@ -130,7 +130,6 @@ setup(name=name, ...@@ -130,7 +130,6 @@ setup(name=name,
'sshkeys_authority = slapos.recipe.sshkeys_authority:Recipe', 'sshkeys_authority = slapos.recipe.sshkeys_authority:Recipe',
'stunnel = slapos.recipe.stunnel:Recipe', 'stunnel = slapos.recipe.stunnel:Recipe',
'symbolic.link = slapos.recipe.symbolic_link:Recipe', 'symbolic.link = slapos.recipe.symbolic_link:Recipe',
'template = slapos.recipe.template:Recipe',
'testnode = slapos.recipe.testnode:Recipe', 'testnode = slapos.recipe.testnode:Recipe',
'tidstorage = slapos.recipe.tidstorage:Recipe', 'tidstorage = slapos.recipe.tidstorage:Recipe',
'urlparse = slapos.recipe._urlparse:Recipe', 'urlparse = slapos.recipe._urlparse:Recipe',
......
...@@ -59,7 +59,7 @@ def service(args): ...@@ -59,7 +59,7 @@ def service(args):
return 127 # Not-null return code return 127 # Not-null return code
if not args['archive']: if not args['archive']:
os.rename(tmpoutput, args['output']) shutil.move(tmpoutput, args['output'])
else: else:
# XXX: hardcoding path # XXX: hardcoding path
extract_dir = os.path.join(tmpdir, 'extract') extract_dir = os.path.join(tmpdir, 'extract')
...@@ -74,8 +74,8 @@ def service(args): ...@@ -74,8 +74,8 @@ def service(args):
if len(archive_content) == 1 and \ if len(archive_content) == 1 and \
os.path.isfile(os.path.join(extract_dir, os.path.isfile(os.path.join(extract_dir,
archive_content[0])): archive_content[0])):
os.rename(os.path.join(extract_dir, shutil.move(os.path.join(extract_dir,
archive_content[0]), archive_content[0]),
args['output']) args['output'])
else: else:
return 127 # Not-null return code return 127 # Not-null return code
......
...@@ -36,12 +36,14 @@ class Recipe(GenericBaseRecipe): ...@@ -36,12 +36,14 @@ class Recipe(GenericBaseRecipe):
def install(self): def install(self):
repolist = json.loads(self.options['repos']) repolist = json.loads(self.options['repos'])
for repo in repolist: for repo, desc in repolist.iteritems():
absolute_path = os.path.join(self.options['base-directory'], '%s.git' % repo) absolute_path = os.path.join(self.options['base-directory'], '%s.git' % repo)
if not os.path.exists(absolute_path): if not os.path.exists(absolute_path):
check_call([self.options['git-binary'], 'init', check_call([self.options['git-binary'], 'init',
'--bare', absolute_path]) '--bare', absolute_path])
check_call([self.options['git-binary'], 'config', 'http.receivepack', 'true'], # XXX: Hardcoded path
cwd=absolute_path) description_filename = os.path.join(absolute_path, 'description')
with open(description_filename, 'w') as description_file:
description_file.write(desc)
return [] return []
...@@ -48,7 +48,7 @@ def _wait_files_creation(file_list): ...@@ -48,7 +48,7 @@ def _wait_files_creation(file_list):
def execute(args): def execute(args):
"""Portable execution with process replacement""" """Portable execution with process replacement"""
# XXX: Kept for backward compatibility # XXX: Kept for backward compatibility
generic_exec([args[0], None, None]) generic_exec([args, None, None])
def execute_wait(args): def execute_wait(args):
"""Execution but after all files in args[1] exists""" """Execution but after all files in args[1] exists"""
......
gitrepo
=======
This software release allow you to get a private mono-user git
repository with web interface.
This software release only need one parameter “repos”, which is
a json object of the repos and their description.
It can receive a “title” parameter as well in order to specify
a title for gitweb interface interface.
Example
--------
::
repo = request(
software_release=gitrepo,
partiion_reference="My SlapGit",
partition_parameter_kw={
'repos': """
{
"repo": "description",
"foo": "bar"
}
""",
'title': 'optional title',
}
)
#!/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
...@@ -63,4 +63,4 @@ eggs = ...@@ -63,4 +63,4 @@ eggs =
[version] [version]
slapos.cookbook = 0.62 slapos.cookbook = 0.64.2
...@@ -57,14 +57,11 @@ path = ${tar:location}/bin/:${gzip:location}/bin/:${bzip2:location}/bin/:${xz-ut ...@@ -57,14 +57,11 @@ path = ${tar:location}/bin/:${gzip:location}/bin/:${bzip2:location}/bin/:${xz-ut
archive = true archive = true
[lxc-conf] [lxc-conf]
recipe = slapos.cookbook:template recipe = slapos.recipe.template
template = ${lxc-conf-in:location}/${lxc-conf-in:filename} url = ${lxc-conf-in:location}/${lxc-conf-in:filename}
output = $${rootdirectory:etc}/lxc.conf output = $${rootdirectory:etc}/lxc.conf
bridge = !!BRIDGE_NAME!! bridge = !!BRIDGE_NAME!!
interface = lxc$${slap-network-information:network-interface} interface = lxc$${slap-network-information:network-interface}
name = $${uuid:uuid}
rootfs = $${rootfs:downloaded-file}
requested = $${slap-connection:requested}
[passwd] [passwd]
recipe = slapos.cookbook:pwgen recipe = slapos.cookbook:pwgen
......
# %(requested)s # ${slap-connection:requested}
lxc.utsname = %(name)s lxc.utsname = ${uuid:uuid}
lxc.network.type = veth lxc.network.type = veth
lxc.network.link = %(bridge)s lxc.network.link = ${:bridge}
lxc.network.veth.pair = %(interface)s lxc.network.veth.pair = ${:interface}
lxc.network.name = eth0 lxc.network.name = eth0
lxc.network.flags = up lxc.network.flags = up
...@@ -24,6 +24,6 @@ lxc.cgroup.devices.allow = c 136:* rwm ...@@ -24,6 +24,6 @@ lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm lxc.cgroup.devices.allow = c 5:2 rwm
lxc.cgroup.devices.allow = c 254:0 rwm lxc.cgroup.devices.allow = c 254:0 rwm
lxc.rootfs = %(rootfs)s lxc.rootfs = ${rootfs:downloaded-file}
lxc.cap.drop = sys_module sys_time sys_chroot mknod lxc.cap.drop = sys_module sys_time sys_chroot mknod
...@@ -12,9 +12,6 @@ extends = ...@@ -12,9 +12,6 @@ extends =
../../component/shellinabox/buildout.cfg ../../component/shellinabox/buildout.cfg
../../component/pwgen/buildout.cfg ../../component/pwgen/buildout.cfg
find-links +=
http://www.nexedi.org/static/packages/source/slapos-lxc/
parts = parts =
lxml-python lxml-python
template template
...@@ -36,16 +33,17 @@ mode = 0644 ...@@ -36,16 +33,17 @@ mode = 0644
[template-lxc] [template-lxc]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-lxc.cfg url = ${:_profile_base_location_}/instance-lxc.cfg
md5sum = 27b9c3a9013beda84b336ea603e306bf md5sum = 056912602caa71a2af9fcae97ee6dfb9
output = ${buildout:directory}/template-lxc.cfg output = ${buildout:directory}/template-lxc.cfg
mode = 0644 mode = 0644
[lxc-conf-in] [lxc-conf-in]
recipe = hexagonit.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
filename = lxc.conf.in filename = lxc.conf.in
md5sum = e47acb30a9783d2f264b51b3c46262ae md5sum = b25334fc369e4e0f608bc64f14b0315d
download-only = true download-only = true
mode = 0644
[slapos-toolbox] [slapos-toolbox]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -54,5 +52,5 @@ eggs = ...@@ -54,5 +52,5 @@ eggs =
slapos.toolbox slapos.toolbox
[versions] [versions]
slapos.cookbook = 0.63 slapos.cookbook = 0.64.1
slapos.toolbox = 0.29.1 slapos.toolbox = 0.29.1
...@@ -21,7 +21,6 @@ exec-sitecustomize = false ...@@ -21,7 +21,6 @@ exec-sitecustomize = false
# Add location for modified non-official slapos.buildout # Add location for modified non-official slapos.buildout
find-links += find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/ http://www.nexedi.org/static/packages/source/slapos.buildout/
http://www.nexedi.org/static/packages/source/hexagonit.recipe.download/
# Use only quite well working sites. # Use only quite well working sites.
allow-hosts += allow-hosts +=
......
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