Commit f492604e authored by Łukasz Nowak's avatar Łukasz Nowak

Merge branch 'master' into erp5

Conflicts:
	component/apache/buildout.cfg
Avoid using older version of apache from master.

	component/libreoffice-bin/buildout.cfg
Drop changes which problem addressed shall be done by releasing erp5 to master.

	component/stunnel/buildout.cfg
Drop changes which problem addressed shall be done by releasing erp5 to master.

  component/xorg/buildout.cfg
Remove not needed garbage from master.

	slapos/recipe/erp5/__init__.py
Avoid cleanup removal by master.

	slapos/recipe/erp5/template/logrotate_entry.in
Remove not needed garbage from master.

Manually found wrong changes on master:

  component/noVNC/buildout.cfg
Use head instead of pinned version.

  stack/erp5.cfg
Drop changes which problem addressed shall be done by releasing erp5 to master.
parents 478ef9e7 e8bc2cbc
Changes
=======
0.17 (unreleased)
0.26 (unreleased)
-----------------
* No changes yet.
0.25 (2011-09-21)
-----------------
* mysql: Restore to default behaviour. [Antoine Catton]
* mysql: Use mysqldump instead of non trustable backup system. [Antoine Catton]
0.24 (2011-09-19)
-----------------
* mysql: Unhardcode the requested url. [Antoine Catton]
0.23 (2011-09-19)
-----------------
* Clean code in mysql recipe [Cedric de Saint Martin]
* librecipe: Provide createPromiseWrapper method. [Antoine Catton]
* kvm: Expose promisee checks to slapgrid. [Antoine Catton]
* davstorage: Initial version. [Antoine Catton]
* mysql: Support DAV backup. [Antoine Catton]
0.22 (2011-09-12)
-----------------
* Fix haproxy setup for erp5 [Sebastien Robin]
0.21 (2011-09-12)
-----------------
* Update PHP configuration to set session and date options.
[Alain Takoudjou Kamdem]
* Improve logrotate policy and haproxy config for erp5
[Sebastien Robin]
0.20 (2011-09-07)
-----------------
* Update and fix KVM/noVNC installation to be compatible with new WebSocket
protocol (HyBi-10) required by Chrome >= 14 and Firefox >= 7.
[Cedric de Saint Martin]
0.19 (2011-09-06)
-----------------
* Update PHP configuration to disable debug logging. [Cedric de Saint Martin]
0.18 (2011-08-25)
-----------------
* Repackage egg to include needed .bin files. [Cedric de Saint Martin]
0.17 (2011-08-25)
-----------------
* Add XWiki software release [Cedric de Saint Martin]
0.16 (2011-07-15)
-----------------
......
include CHANGES.txt
include slapos/recipe/erp5/template/site.zcml
recursive-include slapos/recipe *.in
recursive-include slapos/recipe *.bin
recursive-include slapos/recipe README.*.txt
......@@ -15,9 +15,9 @@ configure-options =
--with-mysql=${mariadb:location}
--with-zlib-dir=${zlib:location}
--with-mcrypt=${libmcrypt:location}
--enable-libxml
--enable-mbstring
--enable-session
--disable-all
environment =
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig
......
......@@ -41,14 +41,15 @@ configure-options = --enable-authn-alias
--enable-proxy-http
--enable-proxy-scgi
--enable-so
--enable-dav
--enable-dav-fs
--disable-ssl
--with-included-apr
--with-z=${zlib:location}
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-dbm=gdbm
--with-gdm=${gdbm:location}
--with-gdbm=${gdbm:location}
--without-ssl
--without-lber
--without-ldap
......@@ -90,6 +91,8 @@ configure-options = --disable-static
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-so
--enable-ssl
--with-included-apr
......@@ -98,8 +101,7 @@ configure-options = --disable-static
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-dbm=gdbm
--with-gdm=${gdbm:location}
--with-gdbm=${gdbm:location}
--without-lber
--without-ldap
--without-ndbm
......
[buildout]
parts =
bash
[bash]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
md5sum = 3fb927c7c33022f1c327f14a81c0d4b0
......@@ -18,7 +18,6 @@ configure-options =
--disable-ldap
--disable-ldaps
--disable-rtsp
--disable-proxy
--disable-dict
--disable-telnet
--disable-tftp
......
########################################################
# Dropbear - a secure shell client and server for *nix #
# #
# http://matt.ucc.asn.au/dropbear/dropbear.html #
########################################################
[buildout]
extends =
../zlib/buildout.cfg
parts =
dropbear
[dropbear-userspace-patch]
recipe = hexagonit.recipe.download
md5sum = 89f575b9a9586b04ef9073c9c3af13ae
url = ${:_profile_base_location_}/${:filename}
filename = userspace.patch
download-only = true
[dropbear-ipv6-patch]
recipe = hexagonit.recipe.download
md5sum = b30dd58d68829a80eee69188134382ef
url = ${:_profile_base_location_}/${:filename}
filename = ipv6-support.patch
download-only = true
[dropbear]
recipe = hexagonit.recipe.cmmi
md5sum = 0284ea239083f04c8b874e08e1aca243
url = http://matt.ucc.asn.au/dropbear/dropbear-0.53.1.tar.bz2
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-zlib=${zlib:location}
CFLAGS="-DENABLE_SINGLEUSER "
environment =
CPPFLAGS =-I${zlib:location}/include
LDFLAGS =-Wl,-rpath=${zlib:location}/lib -L${zlib:location}/lib
patches=
${dropbear-userspace-patch:location}/${dropbear-userspace-patch:filename}
${dropbear-ipv6-patch:location}/${dropbear-ipv6-patch:filename}
patch-options=
-p1
@@ -0,0 +1,56 @@
--- dropbear-0.52.orig/svr-runopts.c Wed May 13 20:56:03 2009
+++ dropbear-0.52/svr-runopts.c Wed May 13 22:20:22 2009
@@ -311,27 +311,39 @@
static void addportandaddress(char* spec) {
char *myspec = NULL;
+ char *p = NULL;
if (svr_opts.portcount < DROPBEAR_MAX_PORTS) {
/* We don't free it, it becomes part of the runopt state */
myspec = m_strdup(spec);
- /* search for ':', that separates address and port */
- svr_opts.ports[svr_opts.portcount] = strchr(myspec, ':');
-
- if (svr_opts.ports[svr_opts.portcount] == NULL) {
- /* no ':' -> the whole string specifies just a port */
- svr_opts.ports[svr_opts.portcount] = myspec;
- } else {
- /* Split the address/port */
- svr_opts.ports[svr_opts.portcount][0] = '\0';
- svr_opts.ports[svr_opts.portcount]++;
+ /* [ipv6]:port */
+ if (myspec[0] == '[' && (p = strchr(myspec, ']')) != NULL && *(p+1) == ':') {
+ *p = '\0';
+ p+=2;
+ myspec++;
+ svr_opts.ports[svr_opts.portcount] = p;
svr_opts.addresses[svr_opts.portcount] = myspec;
- }
-
- if (svr_opts.addresses[svr_opts.portcount] == NULL) {
- /* no address given -> fill in the default address */
+ } else if ((p = strchr(myspec, '.')) != NULL) {
+ if ((p = strchr(p, ':')) == NULL) {
+ /* ipv4 */
+ svr_opts.ports[svr_opts.portcount] = m_strdup(DROPBEAR_DEFPORT);
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ } else {
+ /* ipv4:port */
+ *p = '\0';
+ p++;
+ svr_opts.ports[svr_opts.portcount] = p;
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ }
+ } else if ((p = strchr(myspec, ':')) != NULL && (p = strchr(p, ':')) != NULL) {
+ /* ipv6 */
+ svr_opts.ports[svr_opts.portcount] = m_strdup(DROPBEAR_DEFPORT);
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ } else {
+ /* port */
+ svr_opts.ports[svr_opts.portcount] = myspec;
svr_opts.addresses[svr_opts.portcount] = m_strdup(DROPBEAR_DEFADDRESS);
}
diff --git a/options.h b/options.h
index d309ab4..63048e1 100644
--- a/options.h
+++ b/options.h
@@ -287,6 +287,12 @@ be overridden at runtime with -I. 0 disables idle timeouts */
/* The default path. This will often get replaced by the shell */
#define DEFAULT_PATH "/usr/bin:/bin"
+/* The prefix of dropbear environment variable overriding. */
+#define DROPBEAR_OVERRIDE_PREFIX "DROPBEAR_OVERRIDE_"
+#define DROPBEAR_OVERRIDE_PASSWORD DROPBEAR_OVERRIDE_PREFIX "PASSWORD"
+#define DROPBEAR_OVERRIDE_HOME DROPBEAR_OVERRIDE_PREFIX "HOME"
+#define DROPBEAR_OVERRIDE_SHELL DROPBEAR_OVERRIDE_PREFIX "SHELL"
+
/* Some other defines (that mostly should be left alone) are defined
* in sysoptions.h */
#include "sysoptions.h"
diff --git a/runopts.h b/runopts.h
index 83b5861..f8999b9 100644
--- a/runopts.h
+++ b/runopts.h
@@ -86,6 +86,15 @@ typedef struct svr_runopts {
int noauthpass;
int norootpass;
+#ifdef ENABLE_SINGLEUSER
+ int singleuser;
+ struct {
+ char *password;
+ char *home;
+ char *shell;
+ } singleuserenv;
+#endif /* ifdef ENABLE_SINGLEUSER */
+
#ifdef ENABLE_SVR_REMOTETCPFWD
int noremotetcp;
#endif
diff --git a/svr-auth.c b/svr-auth.c
index 87e3c5e..adb2e8b 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -126,6 +126,14 @@ void recv_msg_userauth_request() {
username = buf_getstring(ses.payload, &userlen);
+#ifdef ENABLE_SINGLEUSER
+ /* If userspace enabled, ignore username */
+ if (svr_opts.singleuser) {
+ m_free(username);
+ /* Get the current login of the user running dropbear */
+ username = m_strdup(getlogin());
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
servicename = buf_getstring(ses.payload, &servicelen);
methodname = buf_getstring(ses.payload, &methodlen);
@@ -228,6 +236,18 @@ static int checkusername(unsigned char *username, unsigned int userlen) {
}
authclear();
fill_passwd(username);
+#ifdef ENABLE_SINGLEUSER
+ if (svr_opts.singleuser) {
+ if (svr_opts.singleuserenv.home != NULL) {
+ m_free(ses.authstate.pw_dir);
+ ses.authstate.pw_dir = m_strdup(svr_opts.singleuserenv.home);
+ }
+ if (svr_opts.singleuserenv.shell != NULL) {
+ m_free(ses.authstate.pw_shell);
+ ses.authstate.pw_shell = m_strdup(svr_opts.singleuserenv.shell);
+ }
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
ses.authstate.username = m_strdup(username);
}
diff --git a/svr-runopts.c b/svr-runopts.c
index 2e836d2..1c21d7c 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -83,6 +83,9 @@ static void printhelp(const char * progname) {
"-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n"
"-K <keepalive> (0 is never, default %d)\n"
"-I <idle_timeout> (0 is never, default %d)\n"
+#ifdef ENABLE_SINGLEUSER
+ "-n Enable the single user mode.\n"
+#endif /* ifdef ENABLE_SINGLEUSER */
#ifdef DEBUG_TRACE
"-v verbose (compiled with DEBUG_TRACE)\n"
#endif
@@ -128,6 +131,12 @@ void svr_getopts(int argc, char ** argv) {
#ifndef DISABLE_ZLIB
opts.enable_compress = 1;
#endif
+#ifdef ENABLE_SINGLEUSER
+ svr_opts.singleuser = 0;
+ svr_opts.singleuserenv.password = NULL;
+ svr_opts.singleuserenv.home = NULL;
+ svr_opts.singleuserenv.shell = NULL;
+#endif /* ifdef ENABLE_SINGLEUSER */
/* not yet
opts.ipv4 = 1;
opts.ipv6 = 1;
@@ -242,6 +251,17 @@ void svr_getopts(int argc, char ** argv) {
case 'u':
/* backwards compatibility with old urandom option */
break;
+#ifdef ENABLE_SINGLEUSER
+ case 'n':
+#ifndef ENABLE_SINGLEUSER_ROOT
+ /* If current user is root */
+ if (getuid() == 0) {
+ dropbear_log(LOG_ERR, "Can't enable singleuser mode as root.");
+ }
+#endif /* ifndef ENABLE_SINGLEUSER_ROOT */
+ svr_opts.singleuser = 1;
+ break;
+#endif /* ifdef ENABLE_SINGLEUSER */
#ifdef DEBUG_TRACE
case 'v':
debug_trace = 1;
@@ -313,6 +333,20 @@ void svr_getopts(int argc, char ** argv) {
}
opts.idle_timeout_secs = val;
}
+#ifdef ENABLE_SINGLEUSER
+ if (svr_opts.singleuser) {
+ dropbear_log(LOG_INFO, "Starting dropbear as single user mode.");
+ svr_opts.singleuserenv.password = getenv(DROPBEAR_OVERRIDE_PASSWORD);
+ svr_opts.singleuserenv.home = getenv(DROPBEAR_OVERRIDE_HOME);
+ if (svr_opts.singleuserenv.home != NULL) {
+ dropbear_log(LOG_INFO, "Single user home is '%s'", svr_opts.singleuserenv.home);
+ }
+ svr_opts.singleuserenv.shell = getenv(DROPBEAR_OVERRIDE_SHELL);
+ if (svr_opts.singleuserenv.shell != NULL) {
+ dropbear_log(LOG_INFO, "Single user shell is '%s'", svr_opts.singleuserenv.shell);
+ }
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
}
static void addportandaddress(char* spec) {
[buildout]
extends =
../librsync/buildout.cfg
../patch/buildout.cfg
parts =
duplicity
[duplicity]
recipe = slapos.recipe.build
url = http://code.launchpad.net/duplicity/0.6-series/0.6.15/+download/duplicity-0.6.15.tar.gz
md5sum = 88f3c990f41fde86cd7d5af5a1bc7b81
patch = ${:_profile_base_location_}/duplicity-ipv6.patch 32c44816a9a59401e233ef622bf50223
script =
import os
import tempfile
import sys
workingdir = guessworkdir(self.extract(self.download(%(url)r, %(md5sum)r)))
os.chdir(workingdir)
self.applyPatchList('${:patch}', patch_binary='${patch:location}/bin/patch', patch_options='-p0', cwd=workingdir)
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'build_ext',
'--include-dirs', os.path.join('${librsync:location}', 'include'),
'--library-dirs', os.path.join('${librsync:location}', 'lib'),
'--rpath', os.path.join('${librsync:location}', 'lib')])
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'install',
'--prefix', %(location)r])
os.chdir(os.path.join(%(location)r, 'bin'))
paths = [os.path.join(%(location)r, 'lib', 'python%%s.%%s' %% sys.version_info[:2], 'site-packages')]
from zc.buildout.easy_install import scripts
scripts([('duplicity', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('duplicity'), extra_paths=paths)
scripts([('rdiffdir', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('rdiffdir'), extra_paths=paths)
=== modified file 'src/urlparse_2_5.py'
--- src/urlparse_2_5.py 2011-03-06 15:12:33 +0000
+++ src/urlparse_2_5.py 2011-08-31 14:21:06 +0000
@@ -109,18 +109,19 @@
password = property(get_password)
def get_hostname(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
- if ":" in netloc:
- netloc = netloc.split(":", 1)[0]
- return netloc.lower() or None
+ netloc = self.netloc.split('@')[-1]
+ if '[' in netloc and ']' in netloc:
+ return netloc.split(']')[0][1:].lower()
+ elif ':' in netloc:
+ return netloc.split(':')[0].lower()
+ elif netloc == '':
+ return None
+ else:
+ return netloc.lower()
hostname = property(get_hostname)
def get_port(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
+ netloc = self.netloc.split('@')[-1].split(']')[-1]
if ":" in netloc:
port = netloc.split(":", 1)[1]
return int(port, 10)
[buildout]
parts =
java
[java]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:plugin
directory:javaws
file:lib/rt.jar
file:bin/java
x86 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=52240 0bd27d325c5ce11ce863d982ad052f7f
x86-64 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=52242 a4d929bc4d6511290c07c3745477b77b
script =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
download_file = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = tempfile.mkdtemp(self.name)
os.chdir(extract_dir)
(download_dir, filename) = os.path.split(download_file)
auto_extract_bin = os.path.join(extract_dir, filename)
shutil.move(download_file, auto_extract_bin)
os.chmod(auto_extract_bin, 0777)
subprocess.call([auto_extract_bin])
self.cleanup_dir_list.append(extract_dir)
workdir = guessworkdir(extract_dir)
self.copyTree(os.path.join(workdir, "jre1.6.0_27"), "%(location)s")
################################################################
# OpenSSH Portable - a secure shell client and server for *nix #
# #
# http://www.openssh.com/ #
################################################################
[buildout]
extends =
../openssl/buildout.cfg
parts =
openssh
[openssh]
recipe = hexagonit.recipe.cmmi
md5sum = 0541579adf9d55abb15ef927048d372e
url = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.8p2.tar.gz
configure-option =
-I${zlib:location}/include
-L${zlib:location}/lib
-I${openssl:location}/include
-L${openssl:location}/lib
--with-ssl-dir=${openssl:location}/lib
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--libdir=lib
[buildout]
extends =
../../stack/shacache-client.cfg
../bison/buildout.cfg
../bzip2/buildout.cfg
../gdbm/buildout.cfg
../gettext/buildout.cfg
../glib/buildout.cfg
../libxml2/buildout.cfg
../libxslt/buildout.cfg
../lxml-python/buildout.cfg
../m4/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../pkgconfig/buildout.cfg
../popt/buildout.cfg
../python-2.7/buildout.cfg
../readline/buildout.cfg
../sqlite3/buildout.cfg
../swig/buildout.cfg
../zlib/buildout.cfg
parts =
slapos
cfg-environment
sh-environment
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
......@@ -26,6 +44,42 @@ include-site-packages = false
exec-sitecustomize = false
allowed-eggs-from-site-packages =
[environment]
# Note: For now original PATH is appeneded to the end, as not all tools are
# provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${popt:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkconfig:${sqlite3:location}/lib/pkconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[cfg-environment]
# Section exposes SlapOS default environment as configuration file.
recipe = collective.recipe.template
input = inline:
[environment]
PATH=${environment:PATH}
CFLAGS=${environment:CFLAGS}
CPPFLAGS=${environment:CPPFLAGS}
LDFLAGS=${environment:LDFLAGS}
PKG_CONFIG_PATH=${environment:PKG_CONFIG_PATH}
LD_LIBRARY_PATH=${environment:LD_LIBRARY_PATH}
output = ${buildout:directory}/environment.cfg
[sh-environment]
# Section exposes SlapOS default environment as sh file.
recipe = collective.recipe.template
input = inline:
export PATH="${environment:PATH}"
export CFLAGS="${environment:CFLAGS}"
export CPPFLAGS="${environment:CPPFLAGS}"
export LDFLAGS="${environment:LDFLAGS}"
export PKG_CONFIG_PATH="${environment:PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${environment:LD_LIBRARY_PATH}"
export PS1="[SlapOS env Active] $PS1"
output = ${buildout:directory}/environment.sh
[lxml-python]
python = python2.7
......@@ -38,23 +92,42 @@ eggs =
${lxml-python:egg}
slapos.core
initialization =
import os
os.environ['PATH'] = os.path.expandvars('${environment:PATH}')
# control scripts generation in order to avoid reinstalling bin/buildout
scripts =
generate-signature-key = slapos.signature:run
slapconsole = slapos.console:run
slapos-request = slapos.console:request
slapformat = slapos.format:main
slapgrid = slapos.grid.slapgrid:run
slapgrid-cp = slapos.grid.slapgrid:runComputerPartition
slapgrid-sr = slapos.grid.slapgrid:runSoftwareRelease
slapgrid-ur = slapos.grid.slapgrid:runUsageReport
slapgrid-supervisorctl = slapos.grid.svcbackend:supervisorctl
slapgrid-supervisord = slapos.grid.svcbackend:supervisord
slapproxy = slapos.proxy:main
[versions]
zc.buildout = 1.5.3-dev-SlapOS-005
Jinja2 = 2.5.5
Werkzeug = 0.6.2
zc.buildout = 1.5.3-dev-SlapOS-009
Jinja2 = 2.6
Werkzeug = 0.7.1
collective.recipe.template = 1.9
hexagonit.recipe.cmmi = 1.5.0
lxml = 2.3
meld3 = 0.6.7
netaddr = 0.7.5
setuptools = 0.6c12dev-r88846
slapos.core = 0.11
slapos.libnetworkcache = 0.2
slapos.core = 0.14
slapos.libnetworkcache = 0.9
xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.11
# slapos.core==0.14
Flask = 0.7.2
# Required by:
......@@ -62,13 +135,14 @@ Flask = 0.7.2
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.core==0.11
# slapos.core==0.14
netifaces = 0.5
# Required by:
# slapos.core==0.11
# slapos.core==0.14
supervisor = 3.0a10
# Required by:
# slapos.core==0.11
zope.interface = 3.6.4
# slapos.core==0.14
zope.interface = 3.7.0
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import glob
import os
version = '0.17-dev'
version = '0.26-dev'
name = 'slapos.cookbook'
long_description = open("README.txt").read() + "\n" + \
open("CHANGES.txt").read() + "\n"
......@@ -40,6 +40,7 @@ setup(name=name,
entry_points={
'zc.buildout': [
'download = slapos.recipe.download:Recipe',
'davstorage = slapos.recipe.davstorage:Recipe',
'erp5 = slapos.recipe.erp5:Recipe',
'erp5testnode = slapos.recipe.erp5testnode:Recipe',
'helloworld = slapos.recipe.helloworld:Recipe',
......@@ -52,10 +53,10 @@ setup(name=name,
'mysql = slapos.recipe.mysql:Recipe',
'nbdserver = slapos.recipe.nbdserver:Recipe',
'nosqltestbed = slapos.recipe.nosqltestbed:NoSQLTestBed',
'osoeslaptraining = slapos.recipe.osoeslaptraining:Request',
'osoeslaptraining.request = slapos.recipe.osoeslaptraining:Request',
'osoeslaptraining.static = slapos.recipe.osoeslaptraining:Static',
'osoeslaptraining.simple = slapos.recipe.osoeslaptraining:Simple',
'lamp = slapos.recipe.lamp:Request',
'lamp.request = slapos.recipe.lamp:Request',
'lamp.static = slapos.recipe.lamp:Static',
'lamp.simple = slapos.recipe.lamp:Simple',
'proactive = slapos.recipe.proactive:Recipe',
'sheepdogtestbed = slapos.recipe.sheepdogtestbed:SheepDogTestBed',
'siptester = slapos.recipe.siptester:SipTesterRecipe',
......
java
====
This recipe downloads and installs java in your buildout.
Buildout configuration:
-----------------------
Add this section to your buildout configuration::
[buildout]
parts =
... your other parts ...
java
...
[java]
recipe = slapos.cookbook:java
By default it will fetch Java 6u25, but you might want to install from another location or another version like this::
[java]
recipe = slapos.cookbook:java
download-url = ftp://location/to/self-extracting/java.bin
Or you can install openjdk instead.
[java]
recipe = slapos.cookbook:java
flavour = openjdk
Notes:
------
This recipe only works with linux at the moment
This recipe requires rpm2cpio and cpio to be installed on your system.
Authors:
--------
Original author: Cedric de Saint Martin - cedric.dsm [ at ] tiolive [ dot ] com
Inspired by : z3c.recipe.openoffice made by Jean-Francois Roche - jfroche@affinitic.be
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from slapos.recipe.librecipe import BaseSlapRecipe
import os
import subprocess
import pkg_resources
import zc.buildout
import zc.recipe.egg
import sys
class Recipe(BaseSlapRecipe):
def getTemplateFilename(self, template_name):
return pkg_resources.resource_filename(__name__,
'template/%s' % template_name)
def _install(self):
self.path_list = []
self.requirements, self.ws = self.egg.working_set()
document_root = self.createDataDirectory('www')
self.apache_config = self.installApache(document_root)
self.setConnectionDict(
dict(url='https://[%s]:%s/' % (self.apache_config['ip'],
self.apache_config['port']),
user=self.apache_config['user'],
password=self.apache_config['password']),
)
return self.path_list
def installApache(self, document_root, ip=None, port=None):
if ip is None:
ip=self.getGlobalIPv6Address()
if port is None:
port = '9080'
htpasswd_config = self.createHtpasswd()
ssl_config = self.createCertificate(size=2048)
apache_config = dict(
pid_file=os.path.join(self.run_directory, 'httpd.pid'),
lock_file=os.path.join(self.run_directory, 'httpd.lock'),
davlock_db=os.path.join(self.run_directory, 'davdb.lock'),
ip=ip,
port=port,
error_log=os.path.join(self.log_directory, 'httpd-error.log'),
access_log=os.path.join(self.log_directory, 'httpd-access.log'),
document_root=document_root,
modules_dir=self.options['apache_modules_dir'],
mime_types=self.options['apache_mime_file'],
server_root=self.work_directory,
email_address='admin@vifib.net',
htpasswd_file=htpasswd_config['htpasswd_file'],
ssl_certificate=ssl_config['certificate'],
ssl_key=ssl_config['key'],
)
httpd_config_file = self.createConfigurationFile('httpd.conf',
self.substituteTemplate(self.getTemplateFilename('httpd.conf.in'),
apache_config))
self.path_list.append(httpd_config_file)
apache_runner = zc.buildout.easy_install.scripts(
[('httpd', 'slapos.recipe.librecipe.execute', 'execute')],
self.ws, sys.executable, self.wrapper_directory,
arguments=[self.options['apache_binary'],
'-f', httpd_config_file,
'-DFOREGROUND',
]
)[0]
self.path_list.append(apache_runner)
return dict(ip=apache_config['ip'],
port=apache_config['port'],
user=htpasswd_config['user'],
password=htpasswd_config['password']
)
def createHtpasswd(self):
htpasswd = self.createConfigurationFile('htpasswd', '')
self.path_list.append(htpasswd)
password = self.generatePassword()
user = 'user'
subprocess.check_call([self.options['apache_htpasswd'],
'-bc', htpasswd,
user, password
])
return dict(htpasswd_file=htpasswd,
user=user,
password=password)
def createCertificate(self, size=1024, subject='/C=FR/L=Marcq-en-Baroeul/O=Nexedi'):
key_file = os.path.join(self.etc_directory, 'httpd.key')
self.path_list.append(key_file)
certificate_file = os.path.join(self.etc_directory, 'httpd.crt')
self.path_list.append(certificate_file)
subprocess.check_call([self.options['openssl_binary'],
'req', '-x509', '-nodes',
'-newkey', 'rsa:%s' % size,
'-subj', str(subject),
'-out', certificate_file,
'-keyout', key_file
])
return dict(key=key_file,
certificate=certificate_file)
ServerRoot "%(server_root)s"
Listen [%(ip)s]:%(port)s
# Needed modules
LoadModule authn_file_module "%(modules_dir)s/mod_authn_file.so"
LoadModule authz_host_module "%(modules_dir)s/mod_authz_host.so"
LoadModule authz_user_module "%(modules_dir)s/mod_authz_user.so"
LoadModule auth_basic_module "%(modules_dir)s/mod_auth_basic.so"
LoadModule auth_digest_module "%(modules_dir)s/mod_auth_digest.so"
LoadModule log_config_module "%(modules_dir)s/mod_log_config.so"
LoadModule headers_module "%(modules_dir)s/mod_headers.so"
LoadModule setenvif_module "%(modules_dir)s/mod_setenvif.so"
LoadModule ssl_module "%(modules_dir)s/mod_ssl.so"
LoadModule mime_module "%(modules_dir)s/mod_mime.so"
LoadModule dav_module "%(modules_dir)s/mod_dav.so"
LoadModule dav_fs_module "%(modules_dir)s/mod_dav_fs.so"
LoadModule dir_module "%(modules_dir)s/mod_dir.so"
ServerAdmin %(email_address)s
# Quiet Server header (if not, Apache give its life history)
# It's safer
ServerTokens ProductOnly
DocumentRoot "%(document_root)s"
PidFile "%(pid_file)s"
LockFile "%(lock_file)s"
DavLockDB "%(davlock_db)s"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory %(document_root)s>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
Dav On
# Security Rules to avoid DDoS Attacks
DavDepthInfinity Off
LimitXMLRequestBody 0
# Cross-Origin Resources Sharing
Header always set Access-Control-Max-Age "0"
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "OPTIONS, GET, HEAD, POST, PUT, DELETE, PROPFIND"
Header always set Access-Control-Allow-Headers "Content-Type, X-Requested-With, X-HTTP-Method-Override, Accept, Authorization, Depth"
SetEnvIf Origin "(.+)" ORIGIN=$1
Header always set Access-Control-Allow-Origin %%{ORIGIN}e
AuthType Basic
AuthName "WebDAV Storage"
AuthUserFile "%(htpasswd_file)s"
<LimitExcept OPTIONS>
Require valid-user
</LimitExcept>
</Directory>
ErrorLog "%(error_log)s"
LogLevel warn
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-Agent}i\"" combined
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b" common
CustomLog "%(access_log)s" common
DefaultType text/plain
TypesConfig "%(mime_types)s"
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLEngine on
SSLCertificateFile "%(ssl_certificate)s"
SSLCertificateKeyFile "%(ssl_key)s"
import logging
import os
import shutil
import zc.buildout.easy_install
import zc.buildout.download
from platform import uname
import subprocess
JAVA_URLS = {
'x86': "http://javadl.sun.com/webapps/download/AutoDL?BundleId=48334",
'x86-64': "http://javadl.sun.com/webapps/download/AutoDL?BundleId=48338"
}
# See http://java.com/en/download/manual.jsp
ARCH_MAP = {
'i386': 'x86',
'i586': 'x86',
'i686': 'x86',
'x86_64': 'x86-64'
}
ARCH_DIR_MAP = {
'x86':'x86',
'x86-64': 'x86_64'
}
class Recipe(object):
def __init__(self, buildout, name, options):
self.buildout = buildout
self.name = name
self.options = options
self.logger = logging.getLogger(self.name)
options['location'] = os.path.join(
buildout['buildout']['parts-directory'],
self.name)
options.setdefault('cpio', 'cpio')
options.setdefault('tmp-storage', options['location'] + '__unpack__')
if not options.get('download-url'):
options.setdefault('platform', self._guessPackagePlatform())
options.setdefault(
'flavour',
'oracle-jdk') # or 'openjdk'
if options['flavour'] == 'openjdk':
raise Exception('OpenJDK is not yet supported.')
else:
options['download-url'] = JAVA_URLS[options['platform']]
def _guessPackagePlatform(self):
arch = uname()[-2]
target = ARCH_MAP.get(arch)
assert target, 'Unknown architecture'
return target
def install(self):
location = self.options['location']
if os.path.exists(location):
return location
storage = self.options['tmp-storage']
download_file, is_temp = self.download()
self.extract(storage, download_file)
self.copy(storage)
shutil.rmtree(storage)
return [location,]
def download(self):
"""Download tarball. Caching if required.
"""
url = self.options['download-url']
namespace = self.options['recipe']
download = zc.buildout.download.Download(self.buildout['buildout'],
namespace=namespace,
logger=self.logger)
return download(url)
def extract(self, storage, download_file):
# Creates parts/java__something temp dir
if os.path.exists(storage):
shutil.rmtree(storage)
os.mkdir(storage)
os.chdir(storage)
# Move downloaded file into temp dir
(download_dir, filename) = os.path.split(download_file)
auto_extract_bin = os.path.join(storage, filename)
shutil.move(download_file, auto_extract_bin)
# Run auto-extract bin file
os.chmod(auto_extract_bin, 0777)
subprocess.call([auto_extract_bin])
def copy(self, storage):
"""Copy java installation into parts directory.
"""
location = self.options['location']
if os.path.exists(location):
self.logger.info('No need to re-install java part')
return False
self.logger.info("Copying unpacked contents")
java_dir = ''
for java_dir in ('java', 'jre1.6.0_25'):
if os.path.isdir(os.path.join(storage, java_dir)):
break
assert java_dir, 'Java directory seems missing.'
ignore_dir_list = []
if 'ignore' in shutil.copytree.func_code.co_varnames:
shutil.copytree(os.path.join(storage, java_dir),
location,
ignore=lambda src,names:ignore_dir_list)
else:
shutil.copytree(os.path.join(storage, java_dir),
location)
for ignore_dir in ignore_dir_list:
ignore_dir = os.path.join(location, ignore_dir)
if os.path.exists(ignore_dir):
shutil.rmtree(ignore_dir)
return True
def update(self):
pass
......@@ -37,6 +37,9 @@ import hashlib
class Recipe(BaseSlapRecipe):
# To avoid magic numbers
VNC_BASE_PORT = 5900
def _install(self):
"""
Set the connection dictionnary for the computer partition and create a list
......@@ -49,43 +52,58 @@ class Recipe(BaseSlapRecipe):
self.path_list = []
self.requirements, self.ws = self.egg.working_set()
self.cron_d = self.installCrond()
self.cron_d = self.installCrond()
self.ca_conf = self.installCertificateAuthority()
self.key_path, self.certificate_path = self.requestCertificate('noVNC')
# Install the socket_connection_attempt script
catcher = zc.buildout.easy_install.scripts(
[('check_port_listening', __name__ + 'socket_connection_attempt', 'connection_attempt')],
self.ws,
sys.executable,
self.bin_directory,
)
# Save the check_port_listening script path
check_port_listening_script = catcher[0]
# Get the port_listening_promise template path, and save it
self.port_listening_promise_path = pkg_resources.resource_filename(
__name__, 'template/port_listening_promise.in')
self.port_listening_promise_conf = dict(
check_port_listening_script=check_port_listening_script,
)
kvm_conf = self.installKvm(vnc_ip = self.getLocalIPv4Address())
vnc_port = 5900 + kvm_conf['vnc_display']
vnc_port = Recipe.VNC_BASE_PORT + kvm_conf['vnc_display']
noVNC_conf = self.installNoVnc(source_ip = self.getGlobalIPv6Address(),
source_port = 6080,
target_ip = kvm_conf['vnc_ip'],
target_port = vnc_port,
python_path = kvm_conf['python_path'])
target_port = vnc_port)
self.linkBinary()
self.computer_partition.setConnectionDict(dict(
url = "https://[%s]:%s/vnc.html?host=[%s]&port=%s&encrypt=1" % (noVNC_conf['source_ip'],
noVNC_conf['source_port'],
noVNC_conf['source_ip'],
noVNC_conf['source_port']
),
),
password = kvm_conf['vnc_passwd']))
return self.path_list
def installKvm(self, vnc_ip):
"""
Create kvm configuration dictionnary and instanciate a wrapper for kvm and
kvm controller
Create kvm configuration dictionnary and instanciate a wrapper for kvm and
kvm controller
Parameters : IP the vnc server is listening on
Returns : Dictionnary kvm_conf
"""
kvm_conf = dict(vnc_ip = vnc_ip)
connection_found = False
for tap_interface, dummy in self.parameter_dict['ip_list']:
# Get an ip associated to a tap interface
......@@ -95,13 +113,13 @@ class Recipe(BaseSlapRecipe):
raise NotImplementedError("Do not support ip without tap interface")
kvm_conf['tap_interface'] = tap_interface
# Disk path
kvm_conf['disk_path'] = os.path.join(self.data_root_directory,
'virtual.qcow2')
kvm_conf['socket_path'] = os.path.join(self.var_directory, 'qmp_socket')
# XXX Weak password
##XXX -Vivien: add an option to generate one password for all instances
##XXX -Vivien: add an option to generate one password for all instances
# and/or to input it yourself
kvm_conf['vnc_passwd'] = binascii.hexlify(os.urandom(4))
......@@ -120,7 +138,7 @@ class Recipe(BaseSlapRecipe):
int(self.options['disk_size']))], shell=True)
if retcode != 0:
raise OSError, "Disk creation failed!"
# Options nbd_ip and nbd_port are provided by slapos master
kvm_conf['nbd_ip'] = self.parameter_dict['nbd_ip']
kvm_conf['nbd_port'] = self.parameter_dict['nbd_port']
......@@ -134,41 +152,48 @@ class Recipe(BaseSlapRecipe):
kvm_conf['ram_size'] = self.options['ram_size']
kvm_conf['vnc_display'] = 1
# Instanciate KVM
kvm_template_location = pkg_resources.resource_filename(
__name__, os.path.join(
'template', 'kvm_run.in'))
kvm_runner_path = self.createRunningWrapper("kvm",
kvm_template_location = pkg_resources.resource_filename(
__name__, 'template/kvm_run.in')
kvm_runner_path = self.createRunningWrapper("kvm",
self.substituteTemplate(kvm_template_location,
kvm_conf))
self.path_list.append(kvm_runner_path)
# Instanciate KVM controller
kvm_controller_template_location = pkg_resources.resource_filename(
__name__, os.path.join(
'template',
'kvm_controller_run.in' ))
kvm_controller_runner_path = self.createRunningWrapper("kvm_controller",
kvm_controller_template_location = pkg_resources.resource_filename(
__name__, 'template/kvm_controller_run.in')
kvm_controller_runner_path = self.createRunningWrapper("kvm_controller",
self.substituteTemplate(kvm_controller_template_location,
kvm_conf))
self.path_list.append(kvm_controller_runner_path)
# Instanciate Slapmonitor
##slapmonitor_runner_path = self.instanciate_wrapper("slapmonitor",
# [database_path, pid_file_path, python_path])
# Instanciate Slapreport
##slapreport_runner_path = self.instanciate_wrapper("slapreport",
# [database_path, python_path])
# Add VNC promise
self.port_listening_promise_conf.update(
hostname=kvm_conf['vnc_ip'],
port=Recipe.VNC_BASE_PORT + kvm_conf['vnc_display'],
)
self.createPromiseWrapper("vnc_promise",
self.substituteTemplate(self.port_listening_promise_path,
self.port_listening_promise_conf,
)
)
return kvm_conf
def installNoVnc(self, source_ip, source_port, target_ip, target_port,
python_path):
def installNoVnc(self, source_ip, source_port, target_ip, target_port):
"""
Create noVNC configuration dictionnary and instanciate Websockify proxy
......@@ -181,14 +206,20 @@ class Recipe(BaseSlapRecipe):
noVNC_conf = {}
noVNC_conf['source_ip'] = source_ip
noVNC_conf['source_ip'] = source_ip
noVNC_conf['source_port'] = source_port
# Install numpy.
# XXX-Cedric : this looks like a hack. Do we have better solution, knowing
# That websockify is not an egg?
numpy = zc.buildout.easy_install.install(['numpy'], self.options['eggs-directory'])
environment = dict(PYTHONPATH='%s' % numpy.entries[0])
# Instanciate Websockify
websockify_runner_path = zc.buildout.easy_install.scripts([('websockify',
'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws,
'slapos.recipe.librecipe.execute', 'executee_wait')], self.ws,
sys.executable, self.wrapper_directory, arguments=[
[python_path.strip(),
[sys.executable.strip(),
self.options['websockify_path'],
'--web',
self.options['noVNC_location'],
......@@ -197,11 +228,22 @@ class Recipe(BaseSlapRecipe):
'--ssl-only',
'%s:%s' % (source_ip, source_port),
'%s:%s' % (target_ip, target_port)],
[self.certificate_path, self.key_path]]
[self.certificate_path, self.key_path],
environment]
)[0]
self.path_list.append(websockify_runner_path)
# Add noVNC promise
self.port_listening_promise_conf.update(hostname=noVNC_conf['source_ip'],
port=noVNC_conf['source_port'],
)
self.createPromiseWrapper("novnc_promise",
self.substituteTemplate(self.port_listening_promise_path,
self.port_listening_promise_conf,
)
)
return noVNC_conf
def linkBinary(self):
......@@ -225,7 +267,7 @@ class Recipe(BaseSlapRecipe):
os.symlink(target, link)
self.logger.debug('Created link %r -> %r' % (link, target))
self.path_list.append(link)
def installCertificateAuthority(self, ca_country_code='XX',
ca_email='xx@example.com', ca_state='State', ca_city='City',
ca_company='Company'):
......@@ -284,7 +326,7 @@ class Recipe(BaseSlapRecipe):
ca_crl=os.path.join(config['ca_dir'], 'crl'),
certificate_authority_path=config['ca_dir']
)
def requestCertificate(self, name):
hash = hashlib.sha512(name).hexdigest()
key = os.path.join(self.ca_private, hash + self.ca_key_ext)
......@@ -296,7 +338,7 @@ class Recipe(BaseSlapRecipe):
parser.set('certificate', 'certificate_file', certificate)
parser.write(open(os.path.join(self.ca_request_dir, hash), 'w'))
return key, certificate
def installCrond(self):
timestamps = self.createDataDirectory('cronstamps')
cron_output = os.path.join(self.log_directory, 'cron-output')
......
import socket
import sys
def connection_attempt():
try:
hostname, port = sys.argv[1:3]
except ValueError:
print >> sys.stderr, """Bad command line.
Usage: %s hostname|ip port""" % sys.argv[0]
sys.exit(1)
connection_okay = False
try:
s = socket.create_connection((hostname, port))
connection_okay = True
s.close()
except (socket.error, socket.timeout):
connection_okay = False
if not connection_okay:
print >> sys.stderr, "%(port)s on %(ip)s isn't listening" % {
'port': port, 'ip': hostname
}
sys.exit(127)
#!/usr/bin/env sh
"%(check_port_listening_script)s" "%(hostname)s" "%(port)s"
exit $?
......@@ -124,7 +124,7 @@ class BaseRecipe(BaseSlapRecipe):
self.path_list.append(config_file)
self.path_list.append(self.createConfigurationFile('php.ini',
self.substituteTemplate(pkg_resources.resource_filename(__name__,
'template/php.ini.in'), {})))
'template/php.ini.in'), dict(tmp_directory=self.tmp_directory))))
self.path_list.extend(zc.buildout.easy_install.scripts([(
'httpd',
__name__ + '.apache', 'runApache')], self.ws,
......
[PHP]
engine = On
safe_mode = Off
expose_php = On
expose_php = Off
error_reporting = E_ALL | E_STRICT
display_errors = On
display_startup_errors = On
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
session.save_path = "%(tmp_directory)s"
session.auto_start = 1
date.timezone = Europe/Paris
\ No newline at end of file
......@@ -60,6 +60,7 @@ class BaseSlapRecipe:
'xml_report')
self.destroy_script_location = os.path.join(self, self.work_directory,
'sbin', 'destroy')
self.promise_directory = os.path.join(self.etc_directory, 'promise')
# default directory structure information
self.default_directory_list = [
......@@ -71,6 +72,7 @@ class BaseSlapRecipe:
self.etc_directory, # CP/etc - configuration container
self.wrapper_directory, # CP/etc/run - for wrappers
self.wrapper_report_directory, # CP/etc/report - for report wrappers
self.promise_directory, # CP/etc/promise - for promise checking scripts
self.var_directory, # CP/var - partition "internal" container for logs,
# and another metadata
self.wrapper_xml_report_directory, # CP/var/xml_report - for xml_report wrappers
......@@ -243,3 +245,14 @@ class BaseSlapRecipe:
def _install(self):
"""Hook which shall be implemented in children class"""
raise NotImplementedError('Shall be implemented by subclass')
def createPromiseWrapper(self, promise_name, file_content):
"""Create a promise wrapper.
This wrapper aim to check if the software release is doing its job.
Return the promise file path.
"""
promise_path = os.path.join(self.promise_directory, promise_name)
self._writeExecutable(promise_path, file_content)
return promise_path
......@@ -39,6 +39,25 @@ def executee(args):
env[k] = v
os.execve(exec_list[0], exec_list + sys.argv[1:], env)
def executee_wait(args):
"""Portable execution with process replacement and environment manipulation"""
exec_list = list(args[0])
file_list = list(args[1])
environment = args[2]
env = os.environ.copy()
for k,v in environment.iteritems():
env[k] = v
sleep = 60
while True:
ready = True
for f in file_list:
if not os.path.exists(f):
print 'File %r does not exists, sleeping for %s' % (f, sleep)
ready = False
if ready:
break
time.sleep(sleep)
os.execve(exec_list[0], exec_list + sys.argv[1:], env)
def sig_handler(signal, frame):
print 'Received signal %r, killing children and exiting' % signal
......
......@@ -31,12 +31,18 @@ import pkg_resources
import sys
import zc.buildout
import ConfigParser
import re
class Recipe(BaseSlapRecipe):
def getTemplateFilename(self, template_name):
return pkg_resources.resource_filename(__name__,
'template/%s' % template_name)
def parseCmdArgument(self, arg):
if any([(i in arg) for i in ["'", ' ', "\\"]]):
return "'%s'" % re.sub(r"(\\|\')", r'\\\1', arg)
return arg
def _install(self):
self.path_list = []
......@@ -44,17 +50,18 @@ class Recipe(BaseSlapRecipe):
# self.cron_d is a directory, where cron jobs can be registered
self.cron_d = self.installCrond()
self.logrotate_d, self.logrotate_backup = self.installLogrotate()
mysql_conf = self.installMysqlServer(self.getLocalIPv4Address(), 45678)
self.mysql_backup_directory = mysql_conf['backup_directory']
ca_conf = self.installCertificateAuthority()
key, certificate = self.requestCertificate('MySQL')
stunnel_conf = self.installStunnel(self.getGlobalIPv6Address(),
self.getLocalIPv4Address(), 12345, mysql_conf['tcp_port'],
certificate, key, ca_conf['ca_crl'],
ca_conf['certificate_authority_path'])
self.linkBinary()
self.setConnectionDict(dict(
stunnel_ip = stunnel_conf['public_ip'],
......@@ -107,7 +114,7 @@ class Recipe(BaseSlapRecipe):
)[0]
self.path_list.append(wrapper)
return cron_d
def installLogrotate(self):
"""Installs logortate main configuration file and registers its to cron"""
logrotate_d = os.path.abspath(os.path.join(self.etc_directory,
......@@ -232,7 +239,7 @@ class Recipe(BaseSlapRecipe):
self.path_list.append(wrapper)
return stunnel_conf
def installMysqlServer(self, ip, port, database='db', user='user',
template_filename=None, mysql_conf=None):
if mysql_conf is None:
......@@ -267,16 +274,11 @@ class Recipe(BaseSlapRecipe):
mysql_conf))
mysql_script_list = []
for x_database, x_user, x_password in \
[(mysql_conf['mysql_database'],
mysql_conf['mysql_user'],
mysql_conf['mysql_password']),
]:
mysql_script_list.append(pkg_resources.resource_string(__name__,
'template/initmysql.sql.in') % {
'mysql_database': x_database,
'mysql_user': x_user,
'mysql_password': x_password})
mysql_script_list.append(pkg_resources.resource_string(__name__,
'template/initmysql.sql.in') % {
'mysql_database': mysql_conf['mysql_database'],
'mysql_user': mysql_conf['mysql_user'],
'mysql_password': mysql_conf['mysql_password']})
mysql_script_list.append('EXIT')
mysql_script = '\n'.join(mysql_script_list)
self.path_list.extend(zc.buildout.easy_install.scripts([('mysql_update',
......@@ -301,35 +303,30 @@ class Recipe(BaseSlapRecipe):
# backup configuration
backup_directory = self.createBackupDirectory('mysql')
full_backup = os.path.join(backup_directory, 'full')
incremental_backup = os.path.join(backup_directory, 'incremental')
self._createDirectory(full_backup)
self._createDirectory(incremental_backup)
innobackupex_argument_list = [self.options['perl_binary'],
self.options['innobackupex_binary'],
'--defaults-file=%s' % mysql_conf_path,
'--socket=%s' %mysql_conf['socket'].strip(), '--user=root']
environment = dict(PATH='%s' % self.bin_directory)
innobackupex_incremental = zc.buildout.easy_install.scripts([(
'innobackupex_incremental', 'slapos.recipe.librecipe.execute', 'executee')],
self.ws, sys.executable, self.bin_directory, arguments=[
innobackupex_argument_list + ['--incremental'],
environment])[0]
self.path_list.append(innobackupex_incremental)
innobackupex_full = zc.buildout.easy_install.scripts([('innobackupex_full',
'slapos.recipe.librecipe.execute', 'executee')], self.ws,
sys.executable, self.bin_directory, arguments=[
innobackupex_argument_list,
environment])[0]
self.path_list.append(innobackupex_full)
backup_controller = zc.buildout.easy_install.scripts([
('innobackupex_controller', __name__ + '.innobackupex', 'controller')],
self.ws, sys.executable, self.bin_directory,
arguments=[innobackupex_incremental, innobackupex_full, full_backup,
incremental_backup])[0]
self.path_list.append(backup_controller)
tmp_backup_directory = self.createBackupDirectory('mysql_pending')
mysqldump_cmdline_list = [self.options['mysqldump_binary'],
mysql_conf['mysql_database'],
'-u', 'root',
'-S', mysql_conf['socket'].strip(),
'--single-transaction', '--opt',
]
mysqldump_cmdline_str = ' '.join(
[self.parseCmdArgument(arg) for arg in mysqldump_cmdline_list]
)
dump_filename = 'dump.sql.gz'
dump_file = os.path.join(backup_directory, dump_filename)
tmpdump_file = os.path.join(tmp_backup_directory, dump_filename)
mysql_backup_cron = os.path.join(self.cron_d, 'mysql_backup')
open(mysql_backup_cron, 'w').write('0 0 * * * ' + backup_controller)
with open(mysql_backup_cron, 'w') as file_:
file_.write('0 0 * * * %(mysqldump)s | %(gzip)s > %(tmpdump)s' \
'&& mv %(tmpdump)s %(dumpfile)s' % {
'mysqldump': mysqldump_cmdline_str,
'gzip': self.options['gzip_binary'],
'tmpdump': self.parseCmdArgument(tmpdump_file),
'dumpfile': self.parseCmdArgument(dump_file),
}
)
self.path_list.append(mysql_backup_cron)
mysql_conf.update(backup_directory=backup_directory)
# The return could be more explicit database, user ...
return mysql_conf
import os
import sys
import time
def catdatefile(args):
directory = args[0]
try:
suffix = args[1]
except IndexError:
suffix = '.log'
f = open(os.path.join(directory,
time.strftime('%Y-%m-%d.%H:%M.%s') + suffix), 'aw')
for line in sys.stdin.read():
f.write(line)
f.close()
......@@ -35,11 +35,12 @@ import zc.buildout
class Recipe(BaseSlapRecipe):
def _install(self):
self.requirements, self.ws = self.egg.working_set()
parameter_dict = self.computer_partition.getInstanceParameterDict()
ipv4 = self.getLocalIPv4Address(parameter_dict)
ipv6 = self.getGlobalIPv6Address(parameter_dict)
ipv4 = self.getLocalIPv4Address()
ipv6 = self.getGlobalIPv6Address()
self.install_mysql_server_configuration(self.getLocalIPv4Address(parameter_dict))
self.install_mysql_server_configuration(ipv4)
port = '8900'
tomcat_home = os.path.join(self.data_root_directory, 'tomcat')
......@@ -56,8 +57,8 @@ class Recipe(BaseSlapRecipe):
shtuil.rmtree(dst)
raise
shutil.copy(self.options['hsql_location'].strip(), os.path.join(tomcat_lib,
'hsqldb.jar'))
shutil.copy(self.options['jdbc_location'].strip(), os.path.join(tomcat_lib,
'jdbc.jar'))
# headless mode
self._writeFile(os.path.join(tomcat_home, 'bin', 'setenv.sh'), '''#!/bin/sh
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
......
......@@ -49,7 +49,7 @@
Uncomment if you want to use MySQL and comment out other database configurations.
We need to set the sql_mode to a less strict value, see XWIKI-1945
-->
<property name="connection.url">jdbc:mysql://%(mysql_ip)s:%(mysql_port)s/xwiki?useServerPrepStmts=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</property>
<property name="connection.url">jdbc:mysql://%(mysql_ip)s:%(mysql_port)s/xwiki?useServerPrepStmts=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;sessionVariables=&amp;sql_mode=''</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
......
......@@ -30,9 +30,6 @@ query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
# Disable Federated by default
skip-federated
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
......
[buildout]
parts =
instance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
dcrond_binary = ${dcron:location}/sbin/crond
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
apache_binary = ${apache:location}/bin/httpd
apache_modules_dir = ${apache:location}/modules/
apache_mime_file = ${apache:location}/conf/mime.types
apache_htpasswd = ${apache:location}/bin/htpasswd
openssl_binary = ${openssl:location}/bin/openssl
[buildout]
find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
extends =
../../component/apache/buildout.cfg
../../component/dcron/buildout.cfg
../../component/logrotate/buildout.cfg
../../stack/shacache-client.cfg
../../component/lxml-python/buildout.cfg
../../component/python-2.7/buildout.cfg
# Use only quite well working sites.
allow-hosts =
*.nexedi.org
*.python.org
*.sourceforge.net
dist.repoze.org
effbot.org
github.com
peak.telecommunity.com
psutil.googlecode.com
www.dabeaz.com
parts =
template
lxml-python
apache
logrotate
dcron
eggs
instance-recipe-egg
unzip= true
[eggs]
recipe = zc.recipe.egg
eggs =
[instance-recipe]
egg = slapos.cookbook
module = davstorage
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 51b6213889573ae7b1dec0bd65384432
output = ${buildout:directory}/template.cfg
mode = 0644
[lxml-python]
python = python2.7
[versions]
zc.buildout = 1.5.3-dev-SlapOS-009
Jinja2 = 2.6
Werkzeug = 0.7.1
buildout-versions = 1.6
hexagonit.recipe.cmmi = 1.5.0
hexagonit.recipe.download = 1.5.0
meld3 = 0.6.7
slapos.cookbook = 0.24
slapos.recipe.template = 1.1
# Required by:
# slapos.core==0.14
Flask = 0.7.2
# Required by:
# slapos.cookbook==0.24
PyXML = 0.8.4
# Required by:
# slapos.recipe.template==1.1
collective.recipe.template = 1.9
# Required by:
# slapos.cookbook==0.24
# slapos.core==0.14
# xml-marshaller==0.9.7
lxml = 2.3
# Required by:
# slapos.cookbook==0.24
netaddr = 0.7.6
# Required by:
# slapos.core==0.14
netifaces = 0.4
# Required by:
# slapos.cookbook==0.24
# slapos.core==0.14
# zc.buildout==1.5.3-dev-SlapOS-009
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.24
slapos.core = 0.14
# Required by:
# slapos.core==0.14
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.24
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.24
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.14
zope.interface = 3.7.0
......@@ -77,4 +77,4 @@ xml-marshaller = 0.9.7
setuptools = 0.6c12dev-r88795
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
......@@ -15,63 +15,63 @@ command =
update-command =
[versions]
Jinja2 = 2.5.5
Werkzeug = 0.6.2
Jinja2 = 2.6
Werkzeug = 0.7.1
buildout-versions = 1.6
hexagonit.recipe.cmmi = 1.5.0
lxml = 2.3
meld3 = 0.6.7
numpy = 1.6.1
plone.recipe.command = 1.1
slapos.cookbook = 0.15
slapos.recipe.template = 1.1
z3c.recipe.scripts = 1.0.1
# Required by:
# slapos.core==0.9
# slapos.core==0.14
Flask = 0.7.2
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
PyXML = 0.8.4
# Required by:
# slapos.recipe.template==1.1
collective.recipe.template = 1.8
collective.recipe.template = 1.9
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
netaddr = 0.7.5
# Required by:
# slapos.core==0.9
# slapos.core==0.14
netifaces = 0.5
# Required by:
# slapos.cookbook==0.15
# slapos.core==0.9
# slapos.cookbook==0.20
# slapos.core==0.14
# zc.buildout==1.5.3-dev-SlapOS-005
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.15
slapos.core = 0.9
# slapos.cookbook==0.20
slapos.core = 0.14
# Required by:
# slapos.core==0.9
# slapos.core==0.14
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.9
zope.interface = 3.6.4
# slapos.core==0.14
zope.interface = 3.7.0
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
parts = instance
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
source = ${application:location}
httpd_binary = ${apache:location}/bin/httpd
[buildout]
versions = versions
parts =
template
apache
eggs
instance-recipe-egg
downloadcache-workaround
extends =
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/stack/lamp.cfg
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/component/apache/buildout.cfg
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/stack/shacache-client.cfg
[application]
recipe = hexagonit.recipe.download
url = Student shall put here url of zipped or tarballed web page or application
#md5sum = Student may put here md5sum of this file, this is good idea
#If provided tarball does not contain top directory, option shall be changed to false
#strip-top-level-dir = true
[instance-recipe]
egg = slapos.cookbook
module = lamp.static
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
#md5sum = Student shall put md5 of instance.cfg here
output = ${buildout:directory}/template.cfg
mode = 0644
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
[downloadcache-workaround]
# workaround irritating problem of hexagonit.recipe.cmmi which automatically
# creates download cache, which in turn switches builout to "semi-offline" mode
recipe = plone.recipe.command
# in hexagonit.recipe.cmmi if there is no ${buildout:download-cache} set it resolves
# to ${buildout:directory}/downloads but this variable is available late, that's
# why it is hardcoded only for required case
download-cache = ${buildout:directory}/downloads
command = [ -d ${:download-cache} ] && rm -fr ${:download-cache}/* || exit 0
update-command = ${:command}
stop-on-error = True
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
parts = instance
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
httpd_binary = ${apache:location}/bin/httpd
mysql_binary = ${mariadb:location}/bin/mysql
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
mysqld_binary = ${mariadb:location}/libexec/mysqld
[buildout]
versions = versions
parts =
template
apache-php
mariadb
eggs
instance-recipe-egg
downloadcache-workaround
extends =
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/stack/lamp.cfg
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/stack/shacache-client.cfg
[application]
recipe = hexagonit.recipe.download
url = Student shall put here url of zipped or tarballed web page or application
#md5sum = Student may put here md5sum of this file, this is good idea
#If provided tarball does not contain top directory, option shall be changed to false
#strip-top-level-dir = true
[application-template]
recipe = slapos.recipe.download
url = Student shall put here url to template file for application
#md5sum = Student may put here md5sum of this file, this is good idea
download-only = True
filename = template.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration]
location = Student shall put here relative path to application top level directory where configuration shall be created
[instance-recipe]
egg = slapos.cookbook
module = lamp.simple
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
#md5sum = Student shall put md5 of instance.cfg here
output = ${buildout:directory}/template.cfg
mode = 0644
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
[downloadcache-workaround]
# workaround irritating problem of hexagonit.recipe.cmmi which automatically
# creates download cache, which in turn switches builout to "semi-offline" mode
recipe = plone.recipe.command
# in hexagonit.recipe.cmmi if there is no ${buildout:download-cache} set it resolves
# to ${buildout:directory}/downloads but this variable is available late, that's
# why it is hardcoded only for required case
download-cache = ${buildout:directory}/downloads
command = [ -d ${:download-cache} ] && rm -fr ${:download-cache}/* || exit 0
update-command = ${:command}
stop-on-error = True
<?php
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$i = 0;
$i++;
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'Put here mysql host template key';
$cfg['Servers'][$i]['port'] = 'Put here mysql port template key';
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "wp-config.php" and fill in the values.
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'Put here mysql database name template key');
/** MySQL database username */
define('DB_USER', 'Put here mysql user template key');
/** MySQL database password */
define('DB_PASSWORD', 'Put here mysql password template key');
/** MySQL hostname */
define('DB_HOST', 'Put here mysql host template key');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
* language support.
*/
define('WPLANG', '');
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
......@@ -8,13 +8,13 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
dcrond_binary = ${dcron:location}/sbin/crond
innobackupex_binary = ${xtrabackup:location}/bin/innobackupex
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
mysql_binary = ${mariadb:location}/bin/mysql
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
mysqld_binary = ${mariadb:location}/libexec/mysqld
mysqldump_binary = ${mariadb:location}/bin/mysqldump
openssl_binary = ${openssl:location}/bin/openssl
perl_binary = ${perl:location}/bin/perl
rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
stunnel_binary = ${stunnel:location}/bin/stunnel
gzip_binary = ${gzip:location}/bin/gzip
rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
......@@ -2,7 +2,6 @@
extensions =
slapos.zcbworkarounds
slapos.rebootstrap
find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/
......@@ -13,10 +12,9 @@ extends =
../../component/logrotate/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/perl/buildout.cfg
../../component/xtrabackup/buildout.cfg
../../component/rdiff-backup/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/gzip/buildout.cfg
../../stack/shacache-client.cfg
# Use only quite well working sites.
......@@ -33,12 +31,14 @@ allow-hosts =
versions = versions
parts +=
parts =
# Create instance template
#TODO : list here all parts.
template
libxslt
eggs
gzip
rdiff-backup
instance-recipe-egg
# XXX: Workaround of SlapOS limitation
......@@ -70,14 +70,15 @@ eggs =
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 69c32a67c5640d36ee042d2cfc35843d
md5sum = 98a9939c04a1a7c7ab6a6b2c1c6e595e
output = ${buildout:directory}/template.cfg
mode = 0644
dollar = $
[versions]
slapos.cookbook = 0.9
slapos.cookbook = 0.25
# Required by slapos.cookbook==0.9
# Required by slapos.cookbook==0.25
slapos.core = 0.4
collective.recipe.template = 1.8
netaddr = 0.7.5
......@@ -89,4 +90,4 @@ hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
......@@ -86,4 +86,4 @@ hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
......@@ -66,18 +66,69 @@ output = ${buildout:directory}/template.cfg
mode = 0644
[versions]
zc.buildout = 1.5.3-dev-SlapOS-009
slapos.cookbook = 0.13
# Required by slapos.cookbook==0.13
slapos.core = 0.4
collective.recipe.template = 1.8
netaddr = 0.7.5
xml-marshaller = 0.9.7
setuptools = 0.6c12dev-r88795
Jinja2 = 2.6
Werkzeug = 0.7.1
hexagonit.recipe.cmmi = 1.5.0
meld3 = 0.6.7
rdiff-backup = 1.0.5
slapos.recipe.template = 1.1
# Required by:
# slapos.core==0.14
Flask = 0.7.2
# Required by:
# slapos.cookbook==0.13
PyXML = 0.8.4
# Required by:
# slapos.recipe.template==1.1
collective.recipe.template = 1.9
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
# Required by:
# slapos.cookbook==0.13
# slapos.core==0.14
# xml-marshaller==0.9.7
lxml = 2.3
# Required by:
# slapos.cookbook==0.13
netaddr = 0.7.6
# Required by:
# slapos.core==0.14
netifaces = 0.4
# Required by:
# slapos.cookbook==0.13
# slapos.core==0.14
# zc.buildout==1.5.3-dev-SlapOS-009
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.13
slapos.core = 0.14
# Required by:
# slapos.core==0.14
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.13
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.13
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.14
zope.interface = 3.7.0
\ No newline at end of file
[buildout]
parts =
nbdserverinstance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[nbdserverinstance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
qemu_path = ${nbdserver:location}/bin/qemu-nbd
onetimeupload_path = ${buildout:bin-directory}/onetimeupload
[buildout]
extends =
../../stack/nbd.cfg
../../stack/shacache-client.cfg
parts +=
template
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 82e948e1c0cb0d5540ef185edeef3ec3
output = ${buildout:directory}/template.cfg
mode = 0644
[versions]
# XXX-CEDRIC Quick and dirty workaround to avoid m2crypto problems.
# should not be used elsewhere unless for urgent cases.
slapos.libnetworkcache = 0.2
......@@ -39,7 +39,7 @@ location = config.inc.php
[instance-recipe]
egg = slapos.cookbook
module = osoeslaptraining.simple
module = lamp.simple
[instance-recipe-egg]
recipe = zc.recipe.egg
......
......@@ -51,4 +51,4 @@ plone.recipe.command = 1.1
slapos.libnetworkcache = 0.2
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
......@@ -30,7 +30,7 @@ location = wp-config.php
[instance-recipe]
egg = slapos.cookbook
module = osoeslaptraining.request
module = lamp.request
[instance-recipe-egg]
recipe = zc.recipe.egg
......
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
parts = instance
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
jdbc_location = ${jdbc:location}/mysql-connector-java-5.1.17/mysql-connector-java-5.1.17-bin.jar
tomcat_location = ${tomcat:location}
xwiki_location = ${xwiki:location}
java_home = ${java:location}
mysqld_binary = ${mysql-5.1:location}/libexec/mysqld
mysql_binary = ${mysql-5.1:location}/bin/mysql
mysql_install_binary = ${mysql-5.1:location}/bin/mysql_install_db
[buildout]
extends =
../../stack/tomcat.cfg
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
[instance-recipe]
egg = slapos.cookbook
module = xwiki
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = dbdc297502f0258c85fe7dfbddc8e501
output = ${buildout:directory}/template.cfg
mode = 0644
[xwiki]
recipe = hexagonit.recipe.download
url = http://download.forge.objectweb.org/xwiki/xwiki-enterprise-web-2.7.war
md5sum = c56e2cde96d28c5899a16a8270b6ff88
[versions]
slapos.cookbook = 0.18
# Required by slapos.cookbook==0.18
slapos.core = 0.13
collective.recipe.template = 1.8
netaddr = 0.7.5
xml-marshaller = 0.9.7
setuptools = 0.6c12dev-r88846
hexagonit.recipe.cmmi = 1.5.0
hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-009
......@@ -14,6 +14,17 @@ extends =
../component/dcron/buildout.cfg
../component/libpng/buildout.cfg
#XXX-Cedric : Currently, one can only access to KVM using noVNC.
# Ideally one should be able to access KVM by using either NoVNC or VNC.
# Problem is : no native crypto support in web browsers. So we have to disable ssl
# In qemu builtin vnc server, and make it available only for localhost
# so that only novnc can listen to it.
#XXX-Cedric: Check status of https://github.com/kanaka/noVNC/issues/13 to see
# When qemu has builtin support for websockets in vnc server to get rid of
# Websockify (socket <-> websocket proxy server) when it is ready.
# May solve previous XXX depending on the implementation.
parts =
template
gnutls
......@@ -87,6 +98,7 @@ recipe = z3c.recipe.scripts
eggs =
${lxml-python:egg}
slapos.cookbook
numpy
[versions]
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
[buildout]
extends =
../component/python-2.6/buildout.cfg
../component/lxml-python/buildout.cfg
../component/zlib/buildout.cfg
../component/git/buildout.cfg
# Python2.6 needed by Flask and pyopenssl
extensions =
slapos.rebootstrap
parts +=
nbdserver
pyOpenSSL-python
eggs
find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
# Use only quite well working sites.
allow-hosts =
*.nexedi.org
*.python.org
*.sourceforge.net
dist.repoze.org
effbot.org
github.com
peak.telecommunity.com
psutil.googlecode.com
www.dabeaz.com
[rebootstrap]
section = python2.6
version = 3
eggs = slapos.libnetworkcache
[nbdserver]
recipe = hexagonit.recipe.cmmi
path = ${nbdserversource:location}/
configure-options =
--disable-system
--disable-kvm
--extra-cflags="-I${zlib:location}/include"
--extra-ldflags="-L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib"
--disable-werror
[nbdserversource]
recipe=plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
command =
(${git:location}/bin/git clone --quiet http://git.erp5.org/repos/slapos.kvm.git ${:location} ) || (rm -fr ${:location} ; exit 1)
update-command =
cd ${:location} && ${git:location}/bin/git pull --quiet origin master
[instance-recipe]
egg = slapos.cookbook
module = nbdserver
[eggs]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
slapos.toolbox
slapos.cookbook
pyOpenSSL
[pyOpenSSL-python]
recipe = zc.recipe.egg:custom
egg = pyOpenSSL
include-dirs =
${openssl:location}/include/
${python2.6:location}/include/
library-dirs =
${openssl:location}/lib/
${python2.6:location}/lib/
rpath =
${openssl:location}/lib/
${python2.6:location}/lib/
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
Jinja2 = 2.5.5
Werkzeug = 0.6.2
apache-libcloud = 0.5.2
hexagonit.recipe.cmmi = 1.5.0
meld3 = 0.6.7
plone.recipe.command = 1.1
pyOpenSSL = 0.12
pycrypto = 2.3
slapos.cookbook = 0.14
slapos.recipe.template = 1.1
slapos.toolbox = 0.6
# Required by:
# slapos.core==0.9
# slapos.toolbox==0.6
Flask = 0.7.2
# Required by:
# slapos.cookbook==0.14
PyXML = 0.8.4
# Required by:
# slapos.core==0.9
argparse = 1.1
# Required by:
# slapos.recipe.template==1.1
collective.recipe.template = 1.8
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.cookbook==0.14
# slapos.core==0.9
# slapos.toolbox==0.6
# xml-marshaller==0.9.7
lxml = 2.3
# Required by:
# slapos.cookbook==0.14
netaddr = 0.7.5
# Required by:
# slapos.core==0.9
netifaces = 0.4
# Required by:
# slapos.toolbox==0.6
paramiko = 1.7.7.1
# Required by:
# slapos.toolbox==0.6
psutil = 0.3.0
# Required by:
# slapos.cookbook==0.14
# slapos.core==0.9
# slapos.toolbox==0.6
# zc.buildout==1.5.3-dev-SlapOS-005
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.14
# slapos.toolbox==0.6
slapos.core = 0.9
# Required by:
# slapos.core==0.9
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.14
# slapos.toolbox==0.6
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.14
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.9
zope.interface = 3.6.4
[buildout]
extends =
../component/lxml-python/buildout.cfg
../component/java/buildout.cfg
../component/mysql-5.1/buildout.cfg
../component/python-2.7/buildout.cfg
../stack/shacache-client.cfg
find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/
# Use only quite well working sites.
allow-hosts =
*.nexedi.org
*.python.org
*.sourceforge.net
dist.repoze.org
effbot.org
github.com
peak.telecommunity.com
psutil.googlecode.com
www.dabeaz.com
parts =
template
libxslt
eggs
instance-recipe-egg
tomcat
java
hsql
jdbc
mysql-5.1
[hsql]
recipe = hexagonit.recipe.download
url = http://hsqldb.org/support/hsqldb_16.zip
md5sum = 80db09c75053085dad198590daf0785c
[jdbc]
recipe = hexagonit.recipe.download
url = http://download.softagency.net/mysql/Downloads/Connector-J/mysql-connector-java-5.1.17.zip
md5sum = 22e1aff6104bb9006f8744a02bf73124
[tomcat]
recipe = hexagonit.recipe.download
strip-top-level-dir = true
url = http://apache.multidist.com/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip
md5sum = 082a0707985b6c029920d4d6d5ec11cd
[eggs]
recipe = zc.recipe.egg
python = python2.7
eggs =
${lxml-python:egg}
slapos.cookbook
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