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
=======
0.64 (Unrelease)
0.65 (Unrelease)
----------------
* 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)
----------------
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import glob
import os
version = '0.63-dev'
version = '0.65-dev'
name = 'slapos.cookbook'
long_description = open("README.txt").read() + "\n" + \
open("CHANGES.txt").read() + "\n"
......@@ -130,7 +130,6 @@ setup(name=name,
'sshkeys_authority = slapos.recipe.sshkeys_authority:Recipe',
'stunnel = slapos.recipe.stunnel:Recipe',
'symbolic.link = slapos.recipe.symbolic_link:Recipe',
'template = slapos.recipe.template:Recipe',
'testnode = slapos.recipe.testnode:Recipe',
'tidstorage = slapos.recipe.tidstorage:Recipe',
'urlparse = slapos.recipe._urlparse:Recipe',
......
......@@ -59,7 +59,7 @@ def service(args):
return 127 # Not-null return code
if not args['archive']:
os.rename(tmpoutput, args['output'])
shutil.move(tmpoutput, args['output'])
else:
# XXX: hardcoding path
extract_dir = os.path.join(tmpdir, 'extract')
......@@ -74,8 +74,8 @@ def service(args):
if len(archive_content) == 1 and \
os.path.isfile(os.path.join(extract_dir,
archive_content[0])):
os.rename(os.path.join(extract_dir,
archive_content[0]),
shutil.move(os.path.join(extract_dir,
archive_content[0]),
args['output'])
else:
return 127 # Not-null return code
......
......@@ -36,12 +36,14 @@ class Recipe(GenericBaseRecipe):
def install(self):
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)
if not os.path.exists(absolute_path):
check_call([self.options['git-binary'], 'init',
'--bare', absolute_path])
check_call([self.options['git-binary'], 'config', 'http.receivepack', 'true'],
cwd=absolute_path)
# XXX: Hardcoded path
description_filename = os.path.join(absolute_path, 'description')
with open(description_filename, 'w') as description_file:
description_file.write(desc)
return []
......@@ -48,7 +48,7 @@ def _wait_files_creation(file_list):
def execute(args):
"""Portable execution with process replacement"""
# XXX: Kept for backward compatibility
generic_exec([args[0], None, None])
generic_exec([args, None, None])
def execute_wait(args):
"""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
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
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
$feature{'pathinfo'}{'default'} = [1];
PidFile "%(pidfile)s"
Listen %(ip)s:%(port)s
PidFile "${:pid-file}"
Listen ${slap-network-information:global-ipv6}:${:port}
ServerAdmin someone@email
ErrorLog "%(errorlog)s"
ErrorLog "${:error-log}"
LogLevel warn
ScriptSock "%(cgidsock)s"
ScriptSock "${:cgid-sock}"
<Directory />
AllowOverride None
......@@ -13,38 +13,41 @@ ScriptSock "%(cgidsock)s"
Deny from all
</Directory>
Alias "/static/" "%(gitwebstaticdir)s"
<Directory "%(gitwebstaticdir)s">
Alias "/static/" "${:gitweb-static-dir}"
<Directory "${:gitweb-static-dir}">
Options FollowSymLinks
Order deny,allow
Allow from all
</Directory>
# This is Static Accelerated git pull
AliasMatch "^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$" "%(projectdir)s/$1"
AliasMatch "^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$" "%(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))$" "${:project-dir}/$1"
# When it can't be statically delivered, we rely on git-http-backend
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \
"%(githttpbackend)s/$1"
git-(upload|receive)-pack))(/push)?$" \
"${:git-http-backend}/$1"
# Everything else is gitweb interface
ScriptAlias "/" "%(gitwebscript)s/"
ScriptAlias "/" "${:gitweb-script}/"
<Location />
Order deny,allow
Allow from all
RewriteEngine On
RewriteCond %{QUERY_STRING} service=git-receive-pack
RewriteRule ^(.*)$ $1/push [END]
</Location>
<LocationMatch "^/.*/git-receive-pack$">
<LocationMatch "(^/.*/git-receive-pack|/push)$">
AuthType Basic
AuthName "Git Push Access"
AuthBasicProvider file
AuthUserFile "%(passwdfile)s"
AuthUserFile "${:passwd-file}"
Require valid-user
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
</LocationMatch>
......@@ -60,4 +63,5 @@ LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule env_module modules/mod_env.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule unixd_module modules/mod_unixd.so
......@@ -5,12 +5,19 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
parts =
httpd
publish
httpd
httpd-conf
gitweb-conf
gitweb-cgi
git-http-backend-cgi
htpasswd
pwgen
git-repos
[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]
recipe = slapos.cookbook:wrapper
......@@ -19,48 +26,42 @@ output = $${basedirectory:services}/httpd
[httpd-conf]
recipe = slapos.cookbook:template
template = ${template-httpd-conf:location}/${template-httpd-conf:filename}
recipe = slapos.recipe.template
url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
output = $${rootdirectory:etc}/httpd.conf
pidfile = $${basedirectory:run}/httpd.pid
errorlog = $${basedirectory:log}/httpd-errorlog.log
gitwebstaticdir = ${gitweb:location}/share/gitweb/static/
gitwebscript = $${gitweb-cgi:output}
githttpbackend = $${git-http-backend-cgi:output}
cgidsock = $${basedirectory:run}/cgid.sock
projectdir = $${gitweb-conf:projectdir}
passwdfile = $${htpasswd:output}
ip = $${slap-network-information:global-ipv6}
pid-file = $${basedirectory:run}/httpd.pid
error-log = $${basedirectory:log}/httpd-errorlog.log
gitweb-static-dir = ${gitweb:location}/share/gitweb/static/
gitweb-script = $${gitweb-cgi:output}
git-http-backend = $${git-http-backend-cgi:output}
cgid-sock = $${basedirectory:run}/cgid.sock
project-dir = $${git-repos:base-directory}
passwd-file = $${htpasswd:output}
port = 8080
[gitweb-conf]
recipe = slapos.cookbook:template
template = ${template-gitweb-conf:location}/${template-gitweb-conf:filename}
recipe = slapos.recipe.template
url = ${template-gitweb-conf:location}/${template-gitweb-conf:filename}
output = $${rootdirectory:etc}/gitweb.conf
projectdir = $${git-repos:base-directory}
sitename = $${slap-parameter:title}
[gitweb-cgi]
recipe = slapos.cookbook:template
template = ${template-gitweb-cgi:location}/${template-gitweb-cgi:filename}
recipe = slapos.recipe.template
url = ${template-gitweb-cgi:location}/${template-gitweb-cgi:filename}
output = $${rootdirectory:bin}/gitweb.cgi
mode = 700
perl = ${perl:location}/bin/perl
gitweb = ${gitweb:location}/share/gitweb/gitweb.cgi
gitwebconf = $${gitweb-conf:output}
[git-http-backend-cgi]
recipe = slapos.cookbook:template
template = ${template-git-http-backend-cgi:location}/${template-git-http-backend-cgi:filename}
recipe = slapos.recipe.template
url = ${template-git-http-backend-cgi:location}/${template-git-http-backend-cgi:filename}
output = $${rootdirectory:bin}/git-http-backend.cgi
mode = 700
projectdir = $${git-repos:base-directory}
githttpbackend = ${git:location}/libexec/git-core/git-http-backend
......
......@@ -27,7 +27,7 @@ mode = 0644
[template-gitrepo]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-gitrepo.cfg
md5sum = 79ebc1f23443562b3facd4945f031fcf
md5sum = 2ad8457628996bf0b71d80e10b3b5aa9
output = ${buildout:directory}/template-gitrepo.cfg
mode = 0644
......@@ -39,22 +39,22 @@ download-only = true
[template-gitweb-cgi]]
<= template-download
filename = gitweb.cgi.in
md5sum = 977d23296605d6a7f33f4f83d5bd29c8
md5sum = 5c720202053bfba06eec6e97d8d47cd0
[template-gitweb-conf]
<= template-download
filename = gitweb.conf.in
md5sum = bdf4b9e616e7b8e436040304bf1ac312
md5sum = d3cb0c16f54da0ea02ac982dd59d7924
[template-git-http-backend-cgi]
<= template-download
filename = git-http-backend.cgi.in
md5sum = 814393f919dd0204c913aa77e6183b9c
md5sum = 7e0562b0ce8d48bc8f6b422850dc53af
[template-httpd-conf]
<= template-download
filename = httpd.conf.in
md5sum = 442ffed44a671eb3c5810a6bfa8a3515
md5sum = e5e6a6de32323248d11918934f6aad99
[collective-recipe-cmd]
recipe = zc.recipe.egg
......@@ -63,4 +63,4 @@ eggs =
[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
archive = true
[lxc-conf]
recipe = slapos.cookbook:template
template = ${lxc-conf-in:location}/${lxc-conf-in:filename}
recipe = slapos.recipe.template
url = ${lxc-conf-in:location}/${lxc-conf-in:filename}
output = $${rootdirectory:etc}/lxc.conf
bridge = !!BRIDGE_NAME!!
interface = lxc$${slap-network-information:network-interface}
name = $${uuid:uuid}
rootfs = $${rootfs:downloaded-file}
requested = $${slap-connection:requested}
[passwd]
recipe = slapos.cookbook:pwgen
......
# %(requested)s
# ${slap-connection:requested}
lxc.utsname = %(name)s
lxc.utsname = ${uuid:uuid}
lxc.network.type = veth
lxc.network.link = %(bridge)s
lxc.network.veth.pair = %(interface)s
lxc.network.link = ${:bridge}
lxc.network.veth.pair = ${:interface}
lxc.network.name = eth0
lxc.network.flags = up
......@@ -24,6 +24,6 @@ lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 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
......@@ -12,9 +12,6 @@ extends =
../../component/shellinabox/buildout.cfg
../../component/pwgen/buildout.cfg
find-links +=
http://www.nexedi.org/static/packages/source/slapos-lxc/
parts =
lxml-python
template
......@@ -36,16 +33,17 @@ mode = 0644
[template-lxc]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-lxc.cfg
md5sum = 27b9c3a9013beda84b336ea603e306bf
md5sum = 056912602caa71a2af9fcae97ee6dfb9
output = ${buildout:directory}/template-lxc.cfg
mode = 0644
[lxc-conf-in]
recipe = hexagonit.recipe.download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
filename = lxc.conf.in
md5sum = e47acb30a9783d2f264b51b3c46262ae
md5sum = b25334fc369e4e0f608bc64f14b0315d
download-only = true
mode = 0644
[slapos-toolbox]
recipe = zc.recipe.egg
......@@ -54,5 +52,5 @@ eggs =
slapos.toolbox
[versions]
slapos.cookbook = 0.63
slapos.cookbook = 0.64.1
slapos.toolbox = 0.29.1
......@@ -21,7 +21,6 @@ exec-sitecustomize = false
# Add location for modified non-official slapos.buildout
find-links +=
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.
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