Commit 1049bbd0 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'master' into slapmonitor

Conflicts:
	stack/lamp/buildout.cfg
	stack/lamp/instance-apache-php.cfg
parents cae1e12e 2f9873a2
Changes Changes
======= =======
0.52 (Unreleased) 0.55 (Unreleased)
----------------- -----------------
* No change yet. * No change yet.
0.54.1 (2012-06-18)
-----------------
* Fix 0.54 release containing wrong code in request.py
0.54 (2012-06-18)
-----------------
* Apache frontend: won't block sending slave informations to SlapOS Master
in case of problem from one slave instance.[Cedric de Saint Martin]
* Apache frontend will send IP informations for slaves in case slave is about
custom domain. [Cedric de Saint Martin]
* Ability to use LAMP applications without configuration. [Cedric de Saint
Martin]
* Users can specify custom domain in LAMP applications. [Cedric de Saint
Martin]
0.53 (2012-06-07)
-----------------
* Switch slaprunner into generic recipe, and add cloud9 recipe. [Cedric de
Saint Martin]
0.52 (2012-05-16)
-----------------
* Request bugfix: Correct default software_type (was: RootInstanceSoftware).
[Cedric de Saint Martin]
* Request will raise again if requested instance is not ready
[Romain Courteaud]
* Apache Frontend: assume apache is available from standard ports.
Consequence: url connection parameter of slave instance doesn't contain
port. [Cedric de Saint Martin]
* Apache Frontend bugfix: correctly detect slave instance type (zope).
[Cedric de Saint Martin]
* Apache Frontend: "default" slave instances are available through http
in addition to https. [Cedric de Saint Martin]
* Apache Frontend: Configuration: Add mod_deflate and set ProxyPreserveHost
[Cedric de Saint Martin]
0.51 (2012-05-14) 0.51 (2012-05-14)
----------------- -----------------
......
...@@ -14,6 +14,13 @@ parts = ...@@ -14,6 +14,13 @@ parts =
[cloud9] [cloud9]
<= cloud9-git <= cloud9-git
[node-sm]
recipe = slapos.recipe.build:npm
packages = sm
node = nodejs
environment =
PATH=${nodejs:location}/bin:%(PATH)s
[cloud9-git] [cloud9-git]
# Online IDE written in javascript/node.js # Online IDE written in javascript/node.js
# URL : c9.io # URL : c9.io
...@@ -21,12 +28,13 @@ parts = ...@@ -21,12 +28,13 @@ parts =
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location} # NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
commit = 97db1467c517d265438684bd2a70b0b76ee282f6 commit = 4bde3206ac0dc1e5736cb18a42851e203a6cc68f
repository = https://github.com/ajaxorg/cloud9.git repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git git-binary = ${git:location}/bin/git
npm-binary = ${nodejs-0.4:location}/bin/node ${npm:location}/bin/npm npm-binary = ${nodejs:location}/bin/node ${nodejs:location}/bin/npm
command = export GIT_SSL_NO_VERIFY=true; (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${:git-binary} submodule update --init && cd support/jsdav && PATH=${nodejs-0.4:location}/bin:$PATH LDFLAGS=-L${libxml2:location}/lib ${:npm-binary} install) || (rm -fr ${:location}; exit 1) environment = export GIT_SSL_NO_VERIFY=true; export PATH=${nodejs:location}/bin:$PATH; export LDFLAGS=-L${libxml2:location}/lib;
command = ${:environment} (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${node-sm:location}/node_modules/.bin/sm install && ${:npm-binary} install) || (rm -fr ${:location}; exit 1)
update-command = update-command =
[cloud9-npm] [cloud9-npm]
...@@ -36,10 +44,10 @@ update-command = ...@@ -36,10 +44,10 @@ update-command =
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location} # NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = slapos.recipe.npm recipe = slapos.recipe.npm
# Node part has to be specified, otherwise system node is used. # Node part has to be specified, otherwise system node is used.
node = nodejs-0.6 node = nodejs
# List of packages to install # List of packages to install
packages = packages =
cloud9 cloud9==0.7
# Specify environment jsDAV (dependency of cloud9) needs libxml2 # Specify environment jsDAV (dependency of cloud9) needs libxml2
environment = environment =
LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib
[buildout]
extends =
../openssl/buildout.cfg
../curl/buildout.cfg
../erlang/buildout.cfg
../icu/buildout.cfg
../spidermonkey/buildout.cfg
parts = couchdb
[couchdb]
recipe = hexagonit.recipe.cmmi
url = http://mir2.ovh.net/ftp.apache.org/dist//couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz
md5sum = cd126219b9cb69a4c521abd6960807a6
configure-options =
--with-erlang=${erlang:location}/lib/erlang/usr/include
--with-js-include=${spidermonkey-1.7:location}/include
--with-js-lib=${erlang:location}/lib
--enable-js-trunk
environment-section = couchdb-environ
[couchdb-environ]
PATH = ${erlang:location}/bin:${icu4c:location}/bin:${curl:location}/bin:%(PATH)s
# XXX: Gotta put everything on the same line. If not, it won't compile
CFLAGS = -I${icu4c:location}/include -I${spidermonkey-1.7:location}/include -I${curl:location}/include
LDFLAGS = -L${icu4c:location}/lib -Wl,-rpath=${icu4c:location}/lib -L${spidermonkey-1.7:location}/lib -Wl,-rpath=${spidermonkey-1.7:location}/lib -L${curl:location}/lib -Wl,-rpath=${curl:location}/lib
[buildout] [buildout]
parts = extends =
erlang ../openssl/buildout.cfg
../ncurses/buildout.cfg
../zlib/buildout.cfg
../java/buildout.cfg
parts = erlang
[erlang] [erlang]
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://www.erlang.org/download/otp_src_R14B03.tar.gz url = http://www.erlang.org/download/otp_src_R14B04.tar.gz
md5sum = 7979e662d11476b97c462feb7c132fb7 md5sum = 4b469729f103f52702bfb1fb24529dc0
configure-options =
--with-ssl=${openssl:location}
--with-java
--enable-dynamic-ssl-lib
--enable-shared-zlib
--enable-native-libs
environment=
PATH=${java-sdk-1.6.0:location}/bin:%(PATH)s
CFLAGS=-I${ncurses:location}/include -I${zlib:location}/include/
LDFLAGS=-L${ncurses:location}/lib/ -L${zlib:location}/lib/ -Wl,-rpath=${ncurses:location}/lib/ -Wl,-rpath=${zlib:location}/lib/
make-options =
-j1
...@@ -6,25 +6,24 @@ extends = ...@@ -6,25 +6,24 @@ extends =
../curl/buildout.cfg ../curl/buildout.cfg
../libexpat/buildout.cfg ../libexpat/buildout.cfg
../openssl/buildout.cfg ../openssl/buildout.cfg
../perl/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
parts = parts =
git git
[git] [git]
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://git-core.googlecode.com/files/git-1.7.8.4.tar.gz url = http://git-core.googlecode.com/files/git-1.7.10.4.tar.gz
md5sum = e6c3319d76d52a830af395046fc56143 md5sum = 68319d593d051ef76c26e945bbd2d7ac
configure-options = configure-options =
--with-curl=${curl:location} --with-curl=${curl:location}
--with-openssl=${openssl:location} --with-openssl=${openssl:location}
--with-zlib=${zlib:location} --with-zlib=${zlib:location}
--with-expat=${libexpat:location} --with-expat=${libexpat:location}
--with-perl=${perl:location}/bin/perl
--without-python --without-python
--without-tcltk --without-tcltk
environment = environment =
PATH=${curl:location}/bin:%(PATH)s NO_PERL=y
PATH=${curl:location}/bin:${gettext:location}/bin:%(PATH)s
CPPFLAGS=-I${zlib:location}/include CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-L${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-L${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${zlib:location}/lib
[buildout]
parts = icu4c
[icu4c]
recipe = hexagonit.recipe.cmmi
location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-src.tgz
md5sum = ea93970a0275be6b42f56953cd332c17
configure-command = source/configure
configure-options = --prefix=${:location}
...@@ -23,6 +23,13 @@ md5sum = d65f61829cfbcd5062f49db2b00bd6fe ...@@ -23,6 +23,13 @@ md5sum = d65f61829cfbcd5062f49db2b00bd6fe
filename = mysql_create_system_tables__no_test.patch filename = mysql_create_system_tables__no_test.patch
download-only = true download-only = true
[mariadb-handler_socket-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = be3bd5a5cc5fc56a398e6762494c8232
filename = plugin_handler_socket_libhsclient_fatal.patch
download-only = true
[mariadb] [mariadb]
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
version = 5.3.5-ga version = 5.3.5-ga
...@@ -57,6 +64,7 @@ configure-options = ...@@ -57,6 +64,7 @@ configure-options =
patch-options = -p0 patch-options = -p0
patches = patches =
${mariadb-no_test-patch:location}/${mariadb-no_test-patch:filename} ${mariadb-no_test-patch:location}/${mariadb-no_test-patch:filename}
${mariadb-handler_socket-patch:location}/${mariadb-handler_socket-patch:filename}
environment = environment =
CPPFLAGS=-I${ncurses:location}/include -I${readline5:location}/include CPPFLAGS=-I${ncurses:location}/include -I${readline5:location}/include
LDFLAGS=-Wl,-rpath=${libevent:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${readline5:location}/lib -Wl,-rpath=${readline5:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-Wl,-rpath=${libevent:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${readline5:location}/lib -Wl,-rpath=${readline5:location}/lib -Wl,-rpath=${zlib:location}/lib
......
# inspired by handlersocket-1.0.6-80-g88bf1e0-1.1-nmu.diff by gregoa@debian.org
Description: add missing include to avoid FTBFS with gcc 4.7
bug-debian: http://bugs.debian.org/667198
More informations: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667198
Author: gregor herrmann <gregoa@debian.org>
--- plugin/handler_socket/libhsclient/fatal.cpp
+++ plugin/handler_socket/libhsclient/fatal.cpp
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <syslog.h>
+#include <unistd.h>
#include "fatal.hpp"
...@@ -12,8 +12,8 @@ parts = ...@@ -12,8 +12,8 @@ parts =
[nodejs] [nodejs]
# Server-side Javascript. # Server-side Javascript.
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://nodejs.org/dist/v0.6.12/node-v0.6.12.tar.gz url = http://nodejs.org/dist/v0.6.19/node-v0.6.19.tar.gz
md5sum = a12766ae4003c9712927d1fa134ed9f6 md5sum = f5669a9717422b811c6bad1cc961b1e5
configure-options = configure-options =
--openssl-includes=${openssl:location}/include --openssl-includes=${openssl:location}/include
--openssl-libpath=${openssl:location}/lib --openssl-libpath=${openssl:location}/lib
......
...@@ -123,14 +123,14 @@ hexagonit.recipe.cmmi = 1.5.0 ...@@ -123,14 +123,14 @@ hexagonit.recipe.cmmi = 1.5.0
lxml = 2.3.4 lxml = 2.3.4
meld3 = 0.6.8 meld3 = 0.6.8
netaddr = 0.7.6 netaddr = 0.7.6
slapos.core = 0.24 slapos.core = 0.25
slapos.libnetworkcache = 0.12 slapos.libnetworkcache = 0.12
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1 z3c.recipe.scripts = 1.0.1
zc.recipe.egg = 1.3.2 zc.recipe.egg = 1.3.2
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
Flask = 0.8 Flask = 0.8
# Required by: # Required by:
...@@ -138,11 +138,11 @@ Flask = 0.8 ...@@ -138,11 +138,11 @@ Flask = 0.8
hexagonit.recipe.download = 1.5.0 hexagonit.recipe.download = 1.5.0
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
netifaces = 0.8 netifaces = 0.8
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
# slapos.libnetworkcache==0.12 # slapos.libnetworkcache==0.12
# supervisor==3.0a12 # supervisor==3.0a12
# zc.buildout==1.6.0-dev-SlapOS-004 # zc.buildout==1.6.0-dev-SlapOS-004
...@@ -150,9 +150,9 @@ netifaces = 0.8 ...@@ -150,9 +150,9 @@ netifaces = 0.8
setuptools = 0.6c12dev-r88846 setuptools = 0.6c12dev-r88846
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
supervisor = 3.0a12 supervisor = 3.0a12
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
zope.interface = 3.8.0 zope.interface = 3.8.0
[buildout]
parts = spidermonkey
[spidermonkey-1.7]
recipe = slapos.recipe.build
url = ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
md5sum = 5571134c3863686b623ebe4e6b1f6fe6
slapos_promise =
directory:include/
directory:bin/
file:bin/js
statlib:lib/libjs.a
file:lib/libjs.so
script =
url = self.download(self.options['url'], self.options['md5sum'])
extract_dir = self.extract(url)
workdir = os.path.join(guessworkdir(extract_dir), 'src')
env.update(JS_DIST=self.options['location'])
call(['make', '-f', 'Makefile.ref'], cwd=workdir, env=env)
call(['make', '-f', 'Makefile.ref', 'export'], cwd=workdir, env=env)
[spidermonkey]
<= spidermonkey-1.7
...@@ -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.52-dev' version = '0.55'
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"
...@@ -49,6 +49,7 @@ setup(name=name, ...@@ -49,6 +49,7 @@ setup(name=name,
'certificate_authority.request = slapos.recipe.certificate_authority:Request', 'certificate_authority.request = slapos.recipe.certificate_authority:Request',
'check_port_listening = slapos.recipe.check_port_listening:Recipe', 'check_port_listening = slapos.recipe.check_port_listening:Recipe',
'check_url_available = slapos.recipe.check_url_available:Recipe', 'check_url_available = slapos.recipe.check_url_available:Recipe',
'cloud9 = slapos.recipe.cloud9:Recipe',
'cron = slapos.recipe.dcron:Recipe', 'cron = slapos.recipe.dcron:Recipe',
'cron.d = slapos.recipe.dcron:Part', 'cron.d = slapos.recipe.dcron:Part',
'davstorage = slapos.recipe.davstorage:Recipe', 'davstorage = slapos.recipe.davstorage:Recipe',
......
...@@ -33,6 +33,7 @@ import zc.buildout ...@@ -33,6 +33,7 @@ import zc.buildout
import zc.recipe.egg import zc.recipe.egg
import ConfigParser import ConfigParser
import re import re
import traceback
class Recipe(BaseSlapRecipe): class Recipe(BaseSlapRecipe):
...@@ -71,20 +72,14 @@ class Recipe(BaseSlapRecipe): ...@@ -71,20 +72,14 @@ class Recipe(BaseSlapRecipe):
slave_dict = {} slave_dict = {}
service_dict = {} service_dict = {}
# Check if default port
if frontend_port_number is 443 or frontend_port_number is 80:
port_snippet = ""
else:
port_snippet = ":%s" % frontend_port_number
for slave_instance in slave_instance_list: for slave_instance in slave_instance_list:
backend_url = slave_instance.get("url", None) backend_url = slave_instance.get("url", None)
reference = slave_instance.get("slave_reference") reference = slave_instance.get("slave_reference")
# Set scheme (http? https?) # Set scheme (http? https?)
# Future work may allow to choose between http and https (or both?) # Future work may allow to choose between http and https (or both?)
scheme = 'https://' scheme = 'http://'
self.logger.info('processing slave instance: %s' % reference) self.logger.info('Processing slave instance: %s' % reference)
# Check for mandatory slave fields # Check for mandatory slave fields
if backend_url is None: if backend_url is None:
...@@ -93,10 +88,18 @@ class Recipe(BaseSlapRecipe): ...@@ -93,10 +88,18 @@ class Recipe(BaseSlapRecipe):
continue continue
# Check for custom domain (like mypersonaldomain.com) # Check for custom domain (like mypersonaldomain.com)
# If no custom domain, use generated one # If no custom domain, use generated one.
domain = slave_instance.get('custom_domain', # Note: if we get an empty custom_domain parameter, we ignore it
"%s.%s" % (reference.replace("-", "").lower(), frontend_domain_name)) domain = slave_instance.get('custom_domain')
slave_dict[reference] = "%s%s%s/" % (scheme, domain, port_snippet) if isinstance(domain, basestring):
domain = domain.strip()
if domain is None or domain.strip() == '':
domain = "%s.%s" % (reference.replace("-", "").lower(),
frontend_domain_name)
# Define the URL where the instance will be available
# WARNING: we use default ports (443, 80) here.
slave_dict[reference] = "%s%s/" % (scheme, domain)
# Check if we want varnish+stunnel cache. # Check if we want varnish+stunnel cache.
if slave_instance.get("enable_cache", "").upper() in ('1', 'TRUE'): if slave_instance.get("enable_cache", "").upper() in ('1', 'TRUE'):
...@@ -113,7 +116,7 @@ class Recipe(BaseSlapRecipe): ...@@ -113,7 +116,7 @@ class Recipe(BaseSlapRecipe):
# rule structure. # rule structure.
# So we will have one RewriteMap for normal websites, and one # So we will have one RewriteMap for normal websites, and one
# RewriteMap for Zope Virtual Host Monster websites. # RewriteMap for Zope Virtual Host Monster websites.
if slave_instance.get("type", "").lower() in ('zope'): if slave_instance.get("type", "").lower() in ['zope']:
rewrite_rule_zope_list.append(rewrite_rule) rewrite_rule_zope_list.append(rewrite_rule)
else: else:
rewrite_rule_list.append(rewrite_rule) rewrite_rule_list.append(rewrite_rule)
...@@ -153,13 +156,24 @@ class Recipe(BaseSlapRecipe): ...@@ -153,13 +156,24 @@ class Recipe(BaseSlapRecipe):
# Send connection informations about each slave # Send connection informations about each slave
for reference, url in slave_dict.iteritems(): for reference, url in slave_dict.iteritems():
self.setConnectionDict(dict(site_url=url), reference) self.logger.debug("Sending connection parameters of slave "
"instance: %s" % reference)
try:
connection_dict = {
'frontend_ipv6_address': self.getGlobalIPv6Address(),
'frontend_ipv4_address': self.getLocalIPv4Address(),
'site_url': url
}
self.setConnectionDict(connection_dict, reference)
except:
self.logger.fatal("Error while sending slave %s informations: %s",
reference, traceback.format_exc())
# Then set it for master instance # Then set it for master instance
self.setConnectionDict( self.setConnectionDict(
dict(site_url=apache_parameter_dict["site_url"], dict(site_url=apache_parameter_dict["site_url"],
domain_ipv6_address=self.getGlobalIPv6Address(), frontend_ipv6_address=self.getGlobalIPv6Address(),
domain_ipv4_address=self.getLocalIPv4Address())) frontend_ipv4_address=self.getLocalIPv4Address()))
# Promises # Promises
promise_config = dict( promise_config = dict(
...@@ -455,7 +469,7 @@ class Recipe(BaseSlapRecipe): ...@@ -455,7 +469,7 @@ class Recipe(BaseSlapRecipe):
return stunnel_conf return stunnel_conf
def installFrontendApache(self, ip_list, key, certificate, name, def installFrontendApache(self, ip_list, key, certificate, name,
port, plain_http_port=8080, port=4443, plain_http_port=8080,
rewrite_rule_list=[], rewrite_rule_zope_list=[], rewrite_rule_list=[], rewrite_rule_zope_list=[],
access_control_string=None): access_control_string=None):
# Create htdocs, populate it with default 404 document # Create htdocs, populate it with default 404 document
......
...@@ -34,6 +34,7 @@ CustomLog "%(access_log)s" common ...@@ -34,6 +34,7 @@ CustomLog "%(access_log)s" common
#LoadModule authz_core_module modules/mod_authz_core.so #LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so LoadModule log_config_module modules/mod_log_config.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule setenvif_module modules/mod_setenvif.so LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_module modules/mod_proxy.so
...@@ -89,19 +90,12 @@ Header append Vary User-Agent ...@@ -89,19 +90,12 @@ Header append Vary User-Agent
# SSL Configuration # SSL Configuration
%(ssl_snippet)s %(ssl_snippet)s
# Dummy virtualhost redirecting to https. Note: will work only if https listens
# on standard port (443)
<VirtualHost *:%(plain_http_port)s>
RewriteEngine On
# Not using HTTPS? Ask that guy over there.
RewriteRule ^/(.*)$ https://%%{SERVER_NAME}%%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:%(https_port)s> <VirtualHost *:%(https_port)s>
SSLEngine on SSLEngine on
SSLProxyEngine on SSLProxyEngine on
# Rewrite part # Rewrite part
ProxyVia On ProxyVia On
ProxyPreserveHost On
ProxyTimeout 600 ProxyTimeout 600
RewriteEngine On RewriteEngine On
...@@ -122,6 +116,21 @@ Header append Vary User-Agent ...@@ -122,6 +116,21 @@ Header append Vary User-Agent
ErrorDocument 404 /notfound.html ErrorDocument 404 /notfound.html
</VirtualHost> </VirtualHost>
<VirtualHost *:%(plain_http_port)s>
RewriteEngine On
ProxyPreserveHost On
# We accept generic (i.e not lamp) backends on http
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
RewriteRule ^/(.*)$ ${apachemapgeneric:%%{SERVER_NAME}}/$1 [L,P]
# Not using HTTPS? Ask that guy over there.
# Dummy redirection to https. Note: will work only if https listens
# on standard port (443).
RewriteRule ^/(.*)$ https://%%{SERVER_NAME}%%{REQUEST_URI}
</VirtualHost>
# Include configuration file not operated by slapos. This file won't be erased # Include configuration file not operated by slapos. This file won't be erased
# or changed when slapgrid is ran. It can be freely customized by node admin. # or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_conf)s Include %(custom_apache_conf)s
...@@ -85,6 +85,8 @@ class Recipe(GenericBaseRecipe): ...@@ -85,6 +85,8 @@ class Recipe(GenericBaseRecipe):
with open(secret_key_filename, 'r') as secret_key_file: with open(secret_key_filename, 'r') as secret_key_file:
secret_key = secret_key_file.read() secret_key = secret_key_file.read()
# Generate application configuration file
if self.options.get('template'):
application_conf = dict(mysql_database=self.options['mysql-database'], application_conf = dict(mysql_database=self.options['mysql-database'],
mysql_user=self.options['mysql-username'], mysql_user=self.options['mysql-username'],
mysql_password=self.options['mysql-password'], mysql_password=self.options['mysql-password'],
......
##############################################################################
#
# 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 GenericBaseRecipe
import os
class Recipe(GenericBaseRecipe):
"""Deploy a fully operational cloud9 service."""
def _options(self, options):
self.ip = options['ip'].strip()
self.port = options['port'].strip()
self.git = options['git-binary'].strip()
self.node_executable = options['node-binary'].strip()
self.cloud9 = options['cloud9'].strip()
self.workdir = options['working-directory'].strip()
self.wrapper = options['wrapper'].strip()
# Set cloud9 access URL
options['access-url'] = 'http://[%s]:%s' % (self.ip, self.port)
def install(self):
path_list = []
environment = {
'PATH': os.path.dirname(self.git) + ':' + os.environ['PATH'],
}
cloud9_args = [self.node_executable, self.cloud9, '-l', self.ip, '-p',
self.port, '-w', self.workdir]
wrapper = self.createPythonScript(self.wrapper,
'slapos.recipe.librecipe.execute.executee',
(cloud9_args, environment)
)
path_list.append(wrapper)
return path_list
...@@ -36,8 +36,10 @@ import pkg_resources ...@@ -36,8 +36,10 @@ import pkg_resources
import zc.buildout import zc.buildout
class GenericBaseRecipe(object): class GenericBaseRecipe(object):
"""Boilerplate class providing helpful methods for all SlapOS recipes. """Boilerplate class for all Buildout recipes providing helpful methods like
Can be used to extend SlapOS recipes to ease development""" creating configuration file, creating wrappers, generating passwords, etc.
Can be extended in SlapOS recipes to ease development.
"""
TRUE_VALUES = ['y', 'yes', '1', 'true'] TRUE_VALUES = ['y', 'yes', '1', 'true']
FALSE_VALUES = ['n', 'no', '0', 'false'] FALSE_VALUES = ['n', 'no', '0', 'false']
......
...@@ -57,7 +57,7 @@ class Recipe(object): ...@@ -57,7 +57,7 @@ class Recipe(object):
self.logger.debug("No parameter to return to main instance." self.logger.debug("No parameter to return to main instance."
"Be careful about that...") "Be careful about that...")
software_type = 'RootInstanceSoftware' software_type = 'RootSoftwareInstance'
if 'software-type' in options: if 'software-type' in options:
software_type = options['software-type'] software_type = options['software-type']
...@@ -92,12 +92,14 @@ class Recipe(object): ...@@ -92,12 +92,14 @@ class Recipe(object):
try: try:
status = self.instance.getState() status = self.instance.getState()
except slapmodule.NotFoundError: except slapmodule.NotFoundError:
status = "not ready yet, please try again" status = 'not ready yet, please try again'
# XXX-Cedric : currently raise an error. So swallow it...
except AttributeError: except AttributeError:
status = "unknown" status = 'unknown'
self.logger.error("Connection parameter %s not found. " error_message = 'Connection parameter %s not found. '\
"Status of requested instance is : %s." % (self.failed, status)) 'Requested instance is currently %s. If this error persists, '\
'check status of this instance.' % (self.failed, status)
self.logger.error(error_message)
raise KeyError(error_message)
return [] return []
update = install update = install
...@@ -24,74 +24,70 @@ ...@@ -24,74 +24,70 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import BaseSlapRecipe from slapos.recipe.librecipe import GenericBaseRecipe
import os import os
import pkg_resources
import sys
import zc.buildout
import zc.recipe.egg
class Recipe(GenericBaseRecipe):
def _options(self, options):
self.ipv4 = options['ipv4'].strip()
self.ipv6 = options['ipv6'].strip()
self.proxy_port = options['proxy_port'].strip()
self.runner_port = options['runner_port'].strip()
self.workdir = options['working-directory'].strip()
self.software_directory = options['software-directory'].strip()
self.instance_directory = options['instance-directory'].strip()
self.partition_amount = options['partition-amount'].strip()
self.cloud9_url = options['cloud9-url'].strip()
# Set slaprunner access URL
options['access-url'] = 'http://[%s]:%s' % (self.ipv6, self.runner_port)
def install(self):
path_list = []
class Recipe(BaseSlapRecipe):
def _install(self):
self.path_list = []
self.requirements, self.ws = self.egg.working_set()
ipv4 = self.getLocalIPv4Address()
ipv6 = self.getGlobalIPv6Address()
proxy_port = '50000'
runner_port = '50000'
cloud9_port = '30000'
workdir = self.createDataDirectory('runner')
software_root = os.path.join(workdir, 'software')
instance_root = os.path.join(workdir, 'instance')
configuration = dict( configuration = dict(
software_root=software_root, software_root=self.software_directory,
instance_root=instance_root, instance_root=self.instance_directory,
master_url='http://%s:%s/' % (ipv4, proxy_port), master_url='http://%s:%s/' % (self.ipv4, self.proxy_port),
computer_id='slaprunner', computer_id='slaprunner',
partition_amount=7, partition_amount=self.partition_amount,
slapgrid_sr=self.options['slapgrid_sr'], slapgrid_sr=self.options['slapgrid_sr'],
slapgrid_cp=self.options['slapgrid_cp'], slapgrid_cp=self.options['slapgrid_cp'],
slapproxy=self.options['slapproxy'], slapproxy=self.options['slapproxy'],
supervisor=self.options['supervisor'], supervisor=self.options['supervisor'],
supervisord_config=os.path.join(instance_root, 'etc', supervisord_config=os.path.join(self.instance_directory, 'etc',
'supervisord.conf'), 'supervisord.conf'),
runner_workdir=workdir, runner_workdir=self.workdir,
runner_host=ipv6, runner_host=self.ipv6,
runner_port=runner_port, runner_port=self.runner_port,
ipv4_address=ipv4, ipv4_address=self.ipv4,
ipv6_address=ipv6, ipv6_address=self.ipv6,
proxy_host=ipv4, proxy_host=self.ipv4,
proxy_port=proxy_port, proxy_port=self.proxy_port,
proxy_database=os.path.join(workdir, 'proxy.db'), proxy_database=os.path.join(self.workdir, 'proxy.db'),
git=self.options['git'], git=self.options['git-binary'],
cloud9_url='http://[%s]:%s' % (ipv6, cloud9_port),
ssh_client=self.options['ssh_client'], ssh_client=self.options['ssh_client'],
public_key=self.options['public_key'], public_key=self.options['public_key'],
private_key=self.options['private_key'], private_key=self.options['private_key'],
cloud9_url=self.cloud9_url
) )
config_file = self.createConfigurationFile('slapos.cfg',
self.substituteTemplate(pkg_resources.resource_filename(__name__, config_file = self.createFile(self.options['slapos.cfg'],
'template/slapos.cfg.in'), configuration)) self.substituteTemplate(self.getTemplateFilename('slapos.cfg.in'),
self.path_list.append(config_file) configuration))
path_list.append(config_file)
environment = dict( environment = dict(
PATH=os.path.dirname(self.options['git']) + ':' + os.environ['PATH'], PATH=os.path.dirname(self.options['git-binary']) + ':' + os.environ['PATH'],
GIT_SSH=self.options['ssh_client'] GIT_SSH=self.options['ssh_client']
) )
workdir = os.path.join(workdir, 'project')
if not os.path.exists(workdir):
os.mkdir(workdir)
launch_args = [self.options['slaprunner'].strip(), config_file, '--debug'] launch_args = [self.options['slaprunner'].strip(), config_file, '--debug']
cloud9_args = [self.options['node-bin'].strip(), self.options['cloud9'].strip(),
'-l', ipv6, '-p', cloud9_port, '-w', workdir] wrapper = self.createPythonScript(self.options['wrapper'],
self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner', 'slapos.recipe.librecipe.execute.executee',
'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable, (launch_args, environment)
self.wrapper_directory, arguments=[launch_args, environment])) )
self.path_list.extend(zc.buildout.easy_install.scripts([('cloud9IDE', path_list.append(wrapper)
'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable,
self.wrapper_directory, arguments=[cloud9_args, environment])) return path_list
self.setConnectionDict(dict(slaprunner_url='http://[%s]:%s' % (ipv6, runner_port),
cloud9_url='http://[%s]:%s' % (ipv6, cloud9_port)))
return self.path_list
...@@ -3,6 +3,7 @@ software_root = %(software_root)s ...@@ -3,6 +3,7 @@ software_root = %(software_root)s
instance_root = %(instance_root)s instance_root = %(instance_root)s
master_url = %(master_url)s master_url = %(master_url)s
computer_id = %(computer_id)s computer_id = %(computer_id)s
maximal_delay = 0
[slapformat] [slapformat]
partition_amount = %(partition_amount)s partition_amount = %(partition_amount)s
......
...@@ -61,7 +61,7 @@ buildout-versions = 1.7 ...@@ -61,7 +61,7 @@ buildout-versions = 1.7
hexagonit.recipe.cmmi = 1.5.0 hexagonit.recipe.cmmi = 1.5.0
meld3 = 0.6.8 meld3 = 0.6.8
rdiff-backup = 1.0.5 rdiff-backup = 1.0.5
slapos.cookbook = 0.50 slapos.cookbook = 0.52
slapos.recipe.template = 2.3 slapos.recipe.template = 2.3
# Required by: # Required by:
...@@ -69,21 +69,21 @@ slapos.recipe.template = 2.3 ...@@ -69,21 +69,21 @@ slapos.recipe.template = 2.3
Flask = 0.8 Flask = 0.8
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
PyXML = 0.8.4 PyXML = 0.8.4
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
inotifyx = 0.2.0 inotifyx = 0.2.0
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
# slapos.core==0.24 # slapos.core==0.24
# xml-marshaller==0.9.7 # xml-marshaller==0.9.7
lxml = 2.3.4 lxml = 2.3.4
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
netaddr = 0.7.6 netaddr = 0.7.6
# Required by: # Required by:
...@@ -91,14 +91,14 @@ netaddr = 0.7.6 ...@@ -91,14 +91,14 @@ netaddr = 0.7.6
netifaces = 0.8 netifaces = 0.8
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
# slapos.core==0.24 # slapos.core==0.24
# zc.buildout==1.6.0-dev-SlapOS-004 # zc.buildout==1.6.0-dev-SlapOS-004
# zc.recipe.egg==1.3.2 # zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846 setuptools = 0.6c12dev-r88846
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
slapos.core = 0.24 slapos.core = 0.24
# Required by: # Required by:
...@@ -106,16 +106,16 @@ slapos.core = 0.24 ...@@ -106,16 +106,16 @@ slapos.core = 0.24
supervisor = 3.0a12 supervisor = 3.0a12
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.cookbook==0.50 # slapos.cookbook==0.52
zc.recipe.egg = 1.3.2 zc.recipe.egg = 1.3.2
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.24
zope.interface = 3.8.0 zope.interface = 4.0.0
[networkcache] [networkcache]
# Cedric de Saint Martin signature certificate # Cedric de Saint Martin signature certificate
......
[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
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
This diff is collapsed.
[buildout] [buildout]
versions = versions
parts =
template
apache-php
mariadb
eggs
instance-recipe-egg
downloadcache-workaround
extends = extends =
../../stack/lamp.cfg ../../stack/lamp/buildout.cfg
../../stack/shacache-client.cfg
[application] [application]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
url = http://ftp.drupal.org/files/projects/drupal-7.8.tar.gz url = http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz
md5sum = e0226b56e8d5c57c6b126e8ed5866b1f md5sum = af7abd95c03ecad4e1567ed94a438334
[instance-recipe] [application-template]
egg = slapos.cookbook recipe = slapos.recipe.download
module = lamp.simple url = ${:_profile_base_location_}/settings.php.in
md5sum = add9e4e96094a9d3fb7cf0f4d26ae544
[template] download-only = True
# Default template for the instance. filename = template.in
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 mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[instance-recipe-egg] [application-configuration]
recipe = zc.recipe.egg location = sites/default/default.settings.php
eggs = ${instance-recipe:egg}
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-010
Jinja2 = 2.6
MySQL-python = 1.2.3
Werkzeug = 0.8.1
apache-libcloud = 0.5.2
buildout-versions = 1.7
hexagonit.recipe.cmmi = 1.5.0
meld3 = 0.6.7
plone.recipe.command = 1.1
slapos.cookbook = 0.34
slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2
slapos.toolbox = 0.10
# Required by:
# slapos.core==0.18
# slapos.toolbox==0.10
Flask = 0.8
# Required by:
# slapos.cookbook==0.34
PyXML = 0.8.4
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.cookbook==0.34
# slapos.core==0.18
# slapos.toolbox==0.10
# xml-marshaller==0.9.7
lxml = 2.3.1
# Required by:
# slapos.cookbook==0.34
netaddr = 0.7.6
# Required by:
# slapos.core==0.18
netifaces = 0.5
# Required by:
# slapos.toolbox==0.10
paramiko = 1.7.7.1
# Required by:
# slapos.toolbox==0.10
psutil = 0.3.0
# Required by:
# slapos.cookbook==0.34
# slapos.core==0.18
# slapos.toolbox==0.10
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.34
# slapos.toolbox==0.10
slapos.core = 0.18
# Required by:
# slapos.core==0.18
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.34
# slapos.toolbox==0.10
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.34
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.18
zope.interface = 3.8.0
[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
kvm
===
Introduction
------------
This software release is used to deploy Slaprunner instances.
Slaprunner is an all-in-one IDE used to develop and test profiles and recipes for SlapOS.
Parameters
----------
authorized-key
~~~~~~~~~~~~~~
You need to specify your SSH public key in order to connect to the SSH server of this instance.
Example of parameter XML::
<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="authorized-key">ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdNp7qZMVAzNc07opHshiIFDmJpYXQpetfcSgUj39a409d42PpsJElp7WsAE/x0nN6gUIoWIl7UiAlMzf6bKEJGJVSOZEPTmiJVlgK1Gp+kE0x9yNcncYg7p38Jny0daVA/NkkpAFyRsAm5kLGzyLtaCcktSvy0cJuy7WSSHU05pd1f8Y8thofE9g5t+/JA2VZvipxPkRfkFAG3aOAGLULlTImTSDFSDFGSDFG5F6mMnl7yvY2d6vEHVBu+K+aKmAwZVfCUwtSpa/tq3i2Lppjrw3UfrxbQSFHZCkzefr+u+l4YYe+tJrX7rYJYXD7LIfZfdSeFTlHFaN/yI1 user@host.local</parameter>
</instance>
[buildout]
parts =
cloud9
slaprunner
sshkeys-dropbear
dropbear-server-add-authorized-key
sshkeys-authority
publish-connection-informations
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
# Create all needed directories
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
[directory]
recipe = slapos.cookbook:mkdirectory
sshkeys = $${rootdirectory:srv}/sshkeys
services = $${rootdirectory:etc}/run/
ssh = $${rootdirectory:etc}/ssh/
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log/
services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
[runnerdirectory]
recipe = slapos.cookbook:mkdirectory
home = $${rootdirectory:srv}/runner/
project = $${:home}/project
software-root = $${:home}/software
instance-root = $${:home}/instance
# Deploy cloud9 and slaprunner
[cloud9]
recipe = slapos.cookbook:cloud9
ip = $${slap-network-information:global-ipv6}
port = 30000
wrapper = $${basedirectory:services}/cloud9
working-directory = $${runnerdirectory:home}
git-binary = ${git:location}/bin/git
node-binary = ${nodejs:location}/bin/node
cloud9 = ${cloud9:location}/server.js
[slaprunner]
recipe = slapos.cookbook:slaprunner
slaprunner = ${buildout:directory}/bin/slaprunner
slapgrid_sr = ${buildout:directory}/bin/slapgrid-sr
slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp
slapproxy = ${buildout:directory}/bin/slapproxy
supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
git-binary = ${git:location}/bin/git
slapos.cfg = $${rootdirectory:etc}/slapos.cfg
working-directory = $${runnerdirectory:home}
project-directory = $${runnerdirectory:project}
software-directory = $${runnerdirectory:software-root}
instance-directory = $${runnerdirectory:instance-root}
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
proxy_port = 50000
runner_port = 50000
partition-amount = 7
cloud9-url = $${cloud9:access-url}
wrapper = $${basedirectory:services}/slaprunner
# Deploy dropbear (minimalist ssh server)
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
keys = $${directory:sshkeys}/keys/
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
wrapper = $${basedirectory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey
[dropbear-server]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${directory:ssh}
wrapper = $${rootdirectory:bin}/raw_sshd
shell = /bin/bash
rsa-keyfile = $${directory:ssh}/server_key.rsa
dropbear-binary = ${dropbear:location}/sbin/dropbear
[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-server:wrapper}
public-key = $${dropbear-server:rsa-keyfile}.pub
private-key = $${dropbear-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd
[dropbear-server-add-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key}
# Request frontend
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:request
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = $${slaprunner:access-url}
return = site_url
# Send informations to SlapOS Master
[publish-connection-informations]
recipe = slapos.cookbook:publish
backend_url = $${slaprunner:access-url}
url = $${request-frontend:connection-site_url}
cloud9_url = $${cloud9:access-url}
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
[slap-parameter]
# Default value if no ssh key is specified
authorized-key =
[buildout] [buildout]
parts = parts =
instance switch_softwaretype
sshkeys-authority
sshkeys-dropbear
dropbear-client
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[instance] [switch_softwaretype]
recipe = ${instance-recipe:egg}:${instance-recipe:module} recipe = slapos.cookbook:softwaretype
slaprunner = ${buildout:directory}/bin/slaprunner default = ${template-runner:output}
slapgrid_sr = ${buildout:directory}/bin/slapgrid-sr \ No newline at end of file
slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp
slapproxy = ${buildout:directory}/bin/slapproxy
supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
git = ${git:location}/bin/git
node-bin = ${nodejs-0.4:location}/bin/node
cloud9 = ${cloud9:location}/bin/cloud9.js
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
keys = $${directory:sshkeys}/keys/
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
wrapper = $${directory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey
[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-client:wrapper}
public-key = $${dropbear-client:identity-file}.pub
private-key = $${dropbear-client:identity-file}
wrapper = $${rootdirectory:bin}/dbclient
[dropbear-client]
recipe = slapos.cookbook:dropbear.client
dbclient-binary = ${dropbear:location}/bin/dbclient
identity-file = $${directory:ssh}/id_rsa
wrapper = $${rootdirectory:bin}/dbclient_raw
home = $${rootdirectory:etc}/ssh/
force-host-key = True
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
[directory]
recipe = slapos.cookbook:mkdirectory
sshkeys = $${rootdirectory:srv}/sshkeys
services = $${rootdirectory:etc}/run/
ssh = $${rootdirectory:etc}/ssh/
\ No newline at end of file
[buildout] [buildout]
extensions =
buildout-versions
extends = extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/flask.cfg ../../stack/flask.cfg
...@@ -14,28 +10,23 @@ extends = ...@@ -14,28 +10,23 @@ extends =
parts = parts =
template template
eggs eggs
instance-recipe-egg slapos-cookbook
dropbear
versions = versions
[instance-recipe]
egg = slapos.cookbook
module = slaprunner
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs = ${instance-recipe:egg}
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
md5sum = 7cfd248cdc6fa6cbb4957d25a0aed884 md5sum = 5307e4200f044ae57b504ad68444491c
[eggs] [template-runner]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg
md5sum = 0ddddd0be595df4fb15d55e566cc3bc3
mode = 0644
[slapos-cookbook]
eggs += eggs +=
slapos.libnetworkcache slapos.libnetworkcache
slapos.toolbox slapos.toolbox
...@@ -60,98 +51,102 @@ signature-certificate-list = ...@@ -60,98 +51,102 @@ signature-certificate-list =
-----END CERTIFICATE----- -----END CERTIFICATE-----
[versions] [versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-003
Jinja2 = 2.6 Jinja2 = 2.6
Pygments = 1.5
Werkzeug = 0.8.3 Werkzeug = 0.8.3
apache-libcloud = 0.8.0 apache-libcloud = 0.10.1
async = 0.6.1 async = 0.6.1
buildout-versions = 1.7 buildout-versions = 1.7
docutils = 0.9
gitdb = 0.5.4 gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.5.0 hexagonit.recipe.cmmi = 1.5.1
ipython = 0.12.1
meld3 = 0.6.8 meld3 = 0.6.8
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pycrypto = 2.5 pycrypto = 2.6
slapos.cookbook = 0.45 slapos.cookbook = 0.53
slapos.libnetworkcache = 0.12 slapos.libnetworkcache = 0.12
slapos.recipe.template = 2.3 slapos.recipe.build = 0.9
slapos.toolbox = 0.20 slapos.recipe.template = 2.4
slapos.toolbox = 0.24
smmap = 0.8.2 smmap = 0.8.2
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
Flask = 0.8 Flask = 0.8
# Required by: # Required by:
# slapos.toolbox==0.20 # slapos.toolbox==0.24
GitPython = 0.3.2.RC1 GitPython = 0.3.2.RC1
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
PyXML = 0.8.4 PyXML = 0.8.4
# Required by: # Required by:
# slapos.toolbox==0.20 # netaddr==0.7.7
Sphinx = 1.1.3
# Required by:
# slapos.toolbox==0.24
atomize = 0.1.1 atomize = 0.1.1
# Required by: # Required by:
# slapos.toolbox==0.20 # slapos.toolbox==0.24
feedparser = 5.1.1 feedparser = 5.1.2
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
inotifyx = 0.2.0 inotifyx = 0.2.0
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
# slapos.core==0.24 # slapos.core==0.25
# xml-marshaller==0.9.7 # xml-marshaller==0.9.7
lxml = 2.3.4 lxml = 2.3.4
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
netaddr = 0.7.6 netaddr = 0.7.7
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
netifaces = 0.8 netifaces = 0.8
# Required by: # Required by:
# slapos.toolbox==0.20 # slapos.toolbox==0.24
paramiko = 1.7.7.1 paramiko = 1.7.7.2
# Required by: # Required by:
# slapos.toolbox==0.20 # slapos.toolbox==0.24
psutil = 0.4.1 psutil = 0.4.1
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
# slapos.core==0.24 # slapos.core==0.25
# slapos.libnetworkcache==0.12 # slapos.libnetworkcache==0.12
# slapos.toolbox==0.20 # slapos.toolbox==0.24
# supervisor==3.0a12 # supervisor==3.0a12
# zc.buildout==1.6.0-dev-SlapOS-003 # zc.buildout==1.6.0-dev-SlapOS-004
# zc.recipe.egg==1.3.2 # zc.recipe.egg==1.3.2
# zope.interface==3.8.0 # zope.interface==4.0.1
setuptools = 0.6c12dev-r88846 setuptools = 0.6c12dev-r88846
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
slapos.core = 0.24 slapos.core = 0.25
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
supervisor = 3.0a12 supervisor = 3.0a12
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.cookbook==0.45 # slapos.cookbook==0.53
zc.recipe.egg = 1.3.2 zc.recipe.egg = 1.3.2
# Required by: # Required by:
# slapos.core==0.24 # slapos.core==0.25
zope.interface = 3.8.0 zope.interface = 4.0.1
\ No newline at end of file
...@@ -13,7 +13,7 @@ url = http://wordpress.org/latest.tar.gz ...@@ -13,7 +13,7 @@ url = http://wordpress.org/latest.tar.gz
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/wp-config.php.in url = ${:_profile_base_location_}/wp-config.php.in
md5sum = ${application-configuration:md5sum} md5sum = 0d62b28125ca3c780db0b547199953f2
download-only = True download-only = True
filename = template.in filename = template.in
mode = 0644 mode = 0644
...@@ -21,8 +21,3 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_} ...@@ -21,8 +21,3 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration] [application-configuration]
location = wp-config.php location = wp-config.php
md5sum = 3859841a4ad6ed23744d6bc5a01321e0
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-003
...@@ -88,3 +88,5 @@ if ( !defined('ABSPATH') ) ...@@ -88,3 +88,5 @@ if ( !defined('ABSPATH') )
/** Sets up WordPress vars and included files. */ /** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php'); require_once(ABSPATH . 'wp-settings.php');
remove_action( 'template_redirect', 'redirect_canonical' );
\ No newline at end of file
# Warning: this file is deprecated and is here only for compatiblity.
# If you extend this file, you should probably extend stack/lamp/buildout.cfg
# Instead.
# Only reason to use this file is when your PHP application uses "delete",
# "rename" or any feature of lampconfigure (not yet ported to new stack).
[buildout] [buildout]
parts = parts =
template template
...@@ -20,9 +27,6 @@ extends = ...@@ -20,9 +27,6 @@ extends =
../component/pycrypto-python/buildout.cfg ../component/pycrypto-python/buildout.cfg
../component/mysql-python/buildout.cfg ../component/mysql-python/buildout.cfg
../stack/slapos.cfg ../stack/slapos.cfg
../component/python-2.7/buildout.cfg
# python-2.7 component is here only for compatibility with old software.cfg.
# It is not needed and should not be used in LAMP-based software.cfg
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
......
...@@ -19,6 +19,7 @@ extends = ...@@ -19,6 +19,7 @@ extends =
../../component/mariadb/buildout.cfg ../../component/mariadb/buildout.cfg
../../component/apache/buildout.cfg ../../component/apache/buildout.cfg
../../component/apache-php/buildout.cfg ../../component/apache-php/buildout.cfg
../../component/dash/buildout.cfg
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/glib/buildout.cfg ../../component/glib/buildout.cfg
...@@ -34,12 +35,7 @@ extends = ...@@ -34,12 +35,7 @@ extends =
../../component/mysql-python/buildout.cfg ../../component/mysql-python/buildout.cfg
../../component/dropbear/buildout.cfg ../../component/dropbear/buildout.cfg
../slapos.cfg ../slapos.cfg
../../component/python-2.7/buildout.cfg
../../component/dash/buildout.cfg ../../component/dash/buildout.cfg
# python-2.7 component is here only for compatibility with old software.cfg.
# It is not needed and should not be used in LAMP-based software.cfg
versions = versions
[mariadb] [mariadb]
# Compile dir is for plugins, there's no plugin in LAMP # Compile dir is for plugins, there's no plugin in LAMP
...@@ -69,7 +65,7 @@ mode = 0644 ...@@ -69,7 +65,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-php.cfg url = ${:_profile_base_location_}/instance-apache-php.cfg
output = ${buildout:directory}/template-apache-php.cfg output = ${buildout:directory}/template-apache-php.cfg
md5sum = 3bdba795df03affe6a62201019b995a4 md5sum = b5fe314c3437151bb048ada9b37f9318
mode = 0644 mode = 0644
[template-apache-backup] [template-apache-backup]
...@@ -121,6 +117,14 @@ output = ${buildout:directory}/template-pull-backup.cfg ...@@ -121,6 +117,14 @@ output = ${buildout:directory}/template-pull-backup.cfg
md5sum = 9aab30ba5aa23a37d4b507e7c414be00 md5sum = 9aab30ba5aa23a37d4b507e7c414be00
mode = 0644 mode = 0644
# Dummy parts in case no application configuration file is needed
[application-template]
filename =
location =
[application-configuration]
location =
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
...@@ -183,3 +187,105 @@ signature-certificate-list = ...@@ -183,3 +187,105 @@ signature-certificate-list =
Gn9t8mdVQflNqOlAMkOlUv1ZugCt9rXYQOV7rrEYJBWirn43BOMn9Flp2nibblby Gn9t8mdVQflNqOlAMkOlUv1ZugCt9rXYQOV7rrEYJBWirn43BOMn9Flp2nibblby
If1a2ZoqHRxoNo2yTmm7TSYRORWVS+vvfjY= If1a2ZoqHRxoNo2yTmm7TSYRORWVS+vvfjY=
-----END CERTIFICATE----- -----END CERTIFICATE-----
[versions]
Jinja2 = 2.6
Pygments = 1.5
Werkzeug = 0.8.3
apache-libcloud = 0.10.1
async = 0.6.1
buildout-versions = 1.7
docutils = 0.9.1
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.5.1
ipython = 0.12.1
meld3 = 0.6.8
pycrypto = 2.6
rdiff-backup = 1.0.5
slapos.cookbook = 0.54.1
slapos.recipe.build = 0.9
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4
slapos.toolbox = 0.24
smmap = 0.8.2
# Required by:
# slapos.core==0.25
# slapos.toolbox==0.24
Flask = 0.8
# Required by:
# slapos.toolbox==0.24
GitPython = 0.3.2.RC1
# Required by:
# slapos.cookbook==0.54.1
PyXML = 0.8.4
# Required by:
# netaddr==0.7.7
Sphinx = 1.1.3
# Required by:
# slapos.toolbox==0.24
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.24
feedparser = 5.1.2
# Required by:
# slapos.cookbook==0.54.1
inotifyx = 0.2.0
# Required by:
# slapos.cookbook==0.54.1
# slapos.core==0.25
# xml-marshaller==0.9.7
lxml = 2.3.4
# Required by:
# slapos.cookbook==0.54.1
netaddr = 0.7.7
# Required by:
# slapos.core==0.25
netifaces = 0.8
# Required by:
# slapos.toolbox==0.24
paramiko = 1.7.7.2
# Required by:
# slapos.toolbox==0.24
psutil = 0.4.1
# Required by:
# slapos.cookbook==0.54.1
# slapos.core==0.25
# slapos.toolbox==0.24
# zc.buildout==1.6.0-dev-SlapOS-006
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.54.1
# slapos.toolbox==0.24
slapos.core = 0.25
# Required by:
# slapos.core==0.25
supervisor = 3.0a12
# Required by:
# slapos.cookbook==0.54.1
# slapos.toolbox==0.24
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.54.1
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.25
zope.interface = 4.0.1
This diff is collapsed.
[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]
# XXX-Cedric : use official tarball from kvm website
# (new kvm code does not seem to need special patch)
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] [buildout]
extends = extends =
../component/nodejs/buildout.cfg ../component/nodejs/buildout.cfg
../component/lxml-python/buildout.cfg
../stack/slapos.cfg ../stack/slapos.cfg
versions = versions
parts = parts =
eggs
nodejs nodejs
npm
[eggs]
recipe = zc.recipe.egg
eggs =
slapos.cookbook
${lxml-python:egg}
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
# Software Releases or Stacks can safely extend this stack. # Software Releases or Stacks can safely extend this stack.
[buildout] [buildout]
# It is good idea for developers to add explicitely this part in their profile
parts += slapos-cookbook
# Generate list of automatically chosen eggs version # Generate list of automatically chosen eggs version
extensions += extensions +=
buildout-versions buildout-versions
...@@ -41,8 +44,6 @@ allow-hosts += ...@@ -41,8 +44,6 @@ allow-hosts +=
# development / fast switching environment for whole software # development / fast switching environment for whole software
unzip = true unzip = true
parts += slapos-cookbook
versions = versions versions = versions
# Install slapos.cookbook containing all officials recipes # Install slapos.cookbook containing all officials recipes
...@@ -57,4 +58,4 @@ eggs = ...@@ -57,4 +58,4 @@ eggs =
# https://github.com/SlapOS/hexagonit.recipe.download # https://github.com/SlapOS/hexagonit.recipe.download
hexagonit.recipe.download = 1.5.1-dev-slapos-001 hexagonit.recipe.download = 1.5.1-dev-slapos-001
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-004 zc.buildout = 1.6.0-dev-SlapOS-006
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