Commit 29b1ed65 authored by Alain Takoudjou's avatar Alain Takoudjou

Merge branch 'master' into 1.0

parents ad9855fc 97d763dc
...@@ -11,13 +11,10 @@ extends = ...@@ -11,13 +11,10 @@ extends =
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://toxygen.net/6tunnel/6tunnel-0.11rc2.tar.gz url = http://toxygen.net/6tunnel/6tunnel-0.11rc2.tar.gz
md5sum = 74e02d4f0704b3083a01feda66033449 md5sum = 74e02d4f0704b3083a01feda66033449
configure-command = pre-configure =
aclocal aclocal
autoheader autoheader
automake --foreign automake --foreign
autoconf autoconf
./configure
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment = environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:%(PATH)s PATH=${autoconf:location}/bin:${automake:location}/bin:%(PATH)s
...@@ -33,9 +33,10 @@ recipe = slapos.recipe.cmmi ...@@ -33,9 +33,10 @@ recipe = slapos.recipe.cmmi
version = 2.4.16 version = 2.4.16
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2 url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 2b19cd338fd526dd5a63c57b1e9bfee2 md5sum = 2b19cd338fd526dd5a63c57b1e9bfee2
configure-command = cp -ar ${apr:location}/apr-${apr:version} srclib/apr/; cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util; ./configure pre-configure =
configure-options = --prefix=${buildout:parts-directory}/${:_buildout_section_name_} cp -ar ${apr:location}/apr-${apr:version} srclib/apr/ &&
--disable-static cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util
configure-options = --disable-static
--enable-authn-alias --enable-authn-alias
--enable-bucketeer --enable-bucketeer
--enable-cache --enable-cache
......
...@@ -7,12 +7,9 @@ extends = ...@@ -7,12 +7,9 @@ extends =
../ncurses/buildout.cfg ../ncurses/buildout.cfg
../perl/buildout.cfg ../perl/buildout.cfg
[aspell-common-dictionary] [aspell-dictionary-common]
location = ${buildout:parts-directory}/${:_buildout_section_name_} recipe = slapos.recipe.cmmi
recipe = plone.recipe.command configure-command = ./configure --vars ASPELL=${aspell:location}/bin/aspell PREZIP=${aspell:location}/bin/prezip-bin
command = mkdir -p ${:location}
update-command = ${:command}
stop-on-error = yes
[aspell] [aspell]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
...@@ -24,7 +21,6 @@ environment = ...@@ -24,7 +21,6 @@ environment =
LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
[aspell-en-dictionary] [aspell-en-dictionary]
recipe = slapos.recipe.cmmi <= aspell-dictionary-common
url = ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-7.1-0.tar.bz2 url = ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-7.1-0.tar.bz2
md5sum = beba5e8f3afd3ed1644653bb685b2dfb md5sum = beba5e8f3afd3ed1644653bb685b2dfb
configure-command = ./configure --vars ASPELL=${aspell:location}/bin/aspell PREZIP=${aspell:location}/bin/prezip-bin
...@@ -6,7 +6,7 @@ parts = babeld ...@@ -6,7 +6,7 @@ parts = babeld
[babeld] [babeld]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://lab.nexedi.cn/rafael/babeld/repository/archive.tar.gz?ref=v1.6.0-nxd1 url = https://lab.nexedi.com/rafael/babeld/repository/archive.tar.gz?ref=v1.6.0-nxd1
md5sum = 1f269d01321103873b8d245df19984f0 md5sum = 1f269d01321103873b8d245df19984f0
configure-command = configure-command =
echo "No configure.." echo "No configure.."
......
...@@ -17,7 +17,7 @@ extends = ...@@ -17,7 +17,7 @@ extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
[download-boinc] [download-boinc]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = http://boinc.berkeley.edu/dl/boinc_7.0.28_x86_64-pc-linux-gnu.sh url = http://boinc.berkeley.edu/dl/boinc_7.0.28_x86_64-pc-linux-gnu.sh
md5sum = efdfd115ae69227ceb6118ca09777988 md5sum = efdfd115ae69227ceb6118ca09777988
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
...@@ -36,7 +36,7 @@ ld_library = ${curl:location}/lib:${openssl:location}/lib:${zlib:location}/lib ...@@ -36,7 +36,7 @@ ld_library = ${curl:location}/lib:${openssl:location}/lib:${zlib:location}/lib
location = ${buildout:parts-directory}/BOINC location = ${buildout:parts-directory}/BOINC
[boinc-patch] [boinc-patch]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/boinc-abs-path.patch url = ${:_profile_base_location_}/boinc-abs-path.patch
md5sum = 412acedfbcdc8a9a7f196a02465da248 md5sum = 412acedfbcdc8a9a7f196a02465da248
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
......
...@@ -11,7 +11,7 @@ setup = ${cloudooo-repository:location} ...@@ -11,7 +11,7 @@ setup = ${cloudooo-repository:location}
[cloudooo-repository] [cloudooo-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/cloudooo.git repository = https://lab.nexedi.com/nexedi/cloudooo.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -10,7 +10,7 @@ recipe = slapos.recipe.cmmi ...@@ -10,7 +10,7 @@ recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz url = http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz
md5sum = abed135279f87ad6762ce57ff6d89c41 md5sum = abed135279f87ad6762ce57ff6d89c41
configure-options = configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_} --enable-install-program=tr,basename,uname,cat,cp,ls -enable-install-program=tr,basename,uname,cat,cp,ls
environment = environment =
PATH=${xz-utils:location}/bin:%(PATH)s PATH=${xz-utils:location}/bin:%(PATH)s
LDFLAGS=-Wl,--as-needed -L${gmp:location}/lib -Wl,-rpath=${gmp:location}/lib LDFLAGS=-Wl,--as-needed -L${gmp:location}/lib -Wl,-rpath=${gmp:location}/lib
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
parts = cpio parts = cpio
[cpio] [cpio]
patch-options = -p1
patches =
${:_profile_base_location_}/cpio-drop.gets.patch#6c79cb9caf407063543efff93647c450
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.bz2 url = http://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.bz2
md5sum = 20fc912915c629e809f80b96b2e75d7d md5sum = 93eea9f07c0058c097891c73e4955456
diff -ur cpio-2.11.orig/gnu/stdio.in.h cpio-2.11/gnu/stdio.in.h
--- cpio-2.11.orig/gnu/stdio.in.h 2010-03-10 10:27:03.000000000 +0100
+++ cpio-2.11/gnu/stdio.in.h 2012-07-23 13:04:56.075242094 +0200
@@ -139,7 +139,9 @@
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
#undef gets
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
...@@ -14,13 +14,11 @@ recipe = slapos.recipe.cmmi ...@@ -14,13 +14,11 @@ recipe = slapos.recipe.cmmi
url = ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz url = ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz
md5sum = a7f4e5e559a0e37b3ffc438c9456e425 md5sum = a7f4e5e559a0e37b3ffc438c9456e425
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = pre-configure =
"${libtool:location}/bin/libtoolize" -c -f && "${libtool:location}/bin/libtoolize" -c -f &&
"${automake:location}/bin/aclocal" -I "${libtool:location}/share/aclocal" -I config -I cmulocal && "${automake:location}/bin/aclocal" -I "${libtool:location}/share/aclocal" -I config -I cmulocal &&
"${automake:location}/bin/automake" -c -a -f && "${automake:location}/bin/automake" -c -a -f
./configure
configure-options = configure-options =
--prefix=${:location}
--disable-digest --disable-digest
--disable-gssapi --disable-gssapi
--disable-otp --disable-otp
......
...@@ -20,7 +20,6 @@ md5sum = 0284ea239083f04c8b874e08e1aca243 ...@@ -20,7 +20,6 @@ md5sum = 0284ea239083f04c8b874e08e1aca243
url = http://matt.ucc.asn.au/dropbear/releases/dropbear-0.53.1.tar.bz2 url = http://matt.ucc.asn.au/dropbear/releases/dropbear-0.53.1.tar.bz2
configure-options = configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-zlib=${zlib:location} --with-zlib=${zlib:location}
CFLAGS="-DENABLE_SINGLEUSER -D__DIRTY_NO_SHELL_CHECKING" CFLAGS="-DENABLE_SINGLEUSER -D__DIRTY_NO_SHELL_CHECKING"
......
[buildout]
parts =
firewalld-patch
extends =
../pkgconfig/buildout.cfg
../autoconf/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
../intltool/buildout.cfg
../gettext/buildout.cfg
../glib/buildout.cfg
../m4/buildout.cfg
../python-slip/buildout.cfg
../dbus/buildout.cfg
../python-2.7/buildout.cfg
../libffi/buildout.cfg
../flex/buildout.cfg
../bison/buildout.cfg
[firewalld]
recipe = slapos.recipe.cmmi
url = https://github.com/t-woerner/firewalld/archive/v0.3.14.2.tar.gz
md5sum = b8f81b536ede502721f69300d374447b
python-egg = ${buildout:parts-directory}/${:_buildout_section_name_}/lib/python2.7/site-packages
pre-configure =
sed -i -E 's,(^SUBDIRS *=.*) doc(\b.*),\1\2,' Makefile.am
aclocal -I${pkgconfig:location}/share/aclocal -I${gettext:location}/share/aclocal -I${libtool:location}/share/aclocal
./autogen.sh
environment =
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig
PATH=${autoconf:location}/bin:${automake:location}/bin:${pkgconfig:location}/bin:${libtool:location}/bin:${intltool:location}/bin:${gettext:location}/bin:${glib:location}/bin:%(PATH)s
CPPFLAGS=-I${gettext:location}/include
LDFLAGS=-L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib
PYTHON=${python2.7:location}/bin/python2.7
M4=${m4:location}/bin/m4
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${gettext:location}/share/aclocal:${libtool:location}/share/aclocal:${glib:location}/share/aclocal:${intltool:location}/share/aclocal
FIREWALLD_DEVEL_ENV=${buildout:parts-directory}/${:_buildout_section_name_}/src
PYTHONPATH=${buildout:parts-directory}/${:_buildout_section_name_}/src
[dbus-python]
recipe = slapos.recipe.cmmi
version = 1.2.0
url = http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${:version}.tar.gz
md5sum = b09cd2d1a057cc432ce944de3fc06bf7
python-egg = ${buildout:parts-directory}/${:_buildout_section_name_}/lib/python2.7/site-packages
environment =
PKG_CONFIG_PATH=${dbus:location}/lib/pkgconfig:${dbus-glib:location}/lib/pkgconfig:${glib:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:%(PATH)s
DBUS_CFLAGS=-I${dbus:location}/include/dbus-1.0 -I${dbus:location}/lib/dbus-1.0/include
DBUS_LIBS=-L${dbus:location}/lib -ldbus-1
DBUS_GLIB_CFLAGS=-I${dbus-glib:location}/include/dbus-1.0
DBUS_GLIB_LIBS=-L${dbus-glib:location}/lib -ldbus-glib-1
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib
PYTHON=${python2.7:location}/bin/python2.7
PYTHON_INCLUDES=-I${python2.7:location}/include/python2.7
PYTHON_LIBS=-L${python2.7:location}/lib -lpython2.7
[gobject-introspection]
recipe = slapos.recipe.cmmi
url = https://github.com/GNOME/gobject-introspection/archive/GOBJECT_INTROSPECTION_1_45_2.tar.gz
pre-configure =
libtoolize -c -f
aclocal -I${pkgconfig:location}/share/aclocal -I${gettext:location}/share/aclocal -I${libtool:location}/share/aclocal
./autogen.sh
configure-options =
--disable-static
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${pkgconfig:location}/bin:${libtool:location}/bin:${intltool:location}/bin:${gettext:location}/bin:${glib:location}/bin:${flex:location}/bin:${bison:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
M4=${m4:location}/bin/m4
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${gettext:location}/share/aclocal:${libtool:location}/share/aclocal:${glib:location}/share/aclocal:${intltool:location}/share/aclocal
PYTHON=${python2.7:location}/bin/python2.7
GLIB_CFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include
GLIB_LIBS=-L${glib:location}/lib -lglib-2.0 -lintl -lgobject-2.0
FFI_CFLAGS=-I${libffi:location}/include
FFI_LIBS=-L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
GIR_DIR=${buildout:parts-directory}/${:_buildout_section_name_}/share/gir-1.0
[pygobject3]
recipe = slapos.recipe.cmmi
url = http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.10/pygobject-3.10.2.tar.xz
python-egg = ${buildout:parts-directory}/${:_buildout_section_name_}/lib/python2.7/site-packages
md5sum = f311155be8510df6ad8e4edf1cb463d4
pre-configure =
sed -i 's#/usr/local#${gobject-introspection:location}#g' ${gobject-introspection:location}/lib/pkgconfig/gobject-introspection-1.0.pc
configure-options =
--disable-static
--disable-cairo
--with-python=${python2.7:location}/bin/python2.7
environment =
PATH=${pkgconfig:location}/bin:${libtool:location}/bin:${glib:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${gobject-introspection:location}/lib/pkgconfig
PYTHON=${python2.7:location}/bin/python2.7
FFI_CFLAGS=-I${libffi:location}/include
FFI_LIBS=-L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include -I${gettext:location}/include -I${libffi:location}/include
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib
# GLIB_CFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include
# GLIB_LIBS=-L${glib:location}/lib -lgobject-2.0 -lgthread-2.0 -pthread -lrt -lglib-2.0
GIO_LIBS=-L${glib:location}/lib -lgio-2.0
GI_CFLAGS=-I${gobject-introspection:location}/include/gobject-introspection-1.0
GI_LIBS=-L${gobject-introspection:location}/lib -lgirepository-1.0
[trusted-config]
recipe = hexagonit.recipe.download
url = https://raw.githubusercontent.com/t-woerner/firewalld/v0.3.14/config/zones/trusted.xml
download-only = true
filename = trusted.xml
md5sum = 893752ba2e93a1e96334dfee19f884ad
[firewalld-patch]
recipe = plone.recipe.command
python = ${buildout:directory}/bin/${firewalld-eggs:interpreter}
command =
sed -i 's#/usr/bin/python -Es#${:python}#' ${firewalld:location}/bin/firewall-cmd
sed -i 's#/usr/bin/python -Es#${:python}#' ${firewalld:location}/sbin/firewalld
sed -i 's#DefaultZone=public#DefaultZone=trusted#' ${firewalld:location}/etc/firewalld/firewalld.conf
sed -i 's#/usr/lib/firewalld#${firewalld:location}/lib/firewalld#' ${firewalld:location}/lib/python2.7/site-packages/firewall/config/__init__.py
sed -i 's#/usr/share/#${firewalld:location}/share#' ${firewalld:location}/lib/python2.7/site-packages/firewall/config/__init__.py
sed -i "s#import sys#import sys, os\n\nos.environ['GI_TYPELIB_PATH'] = '${gobject-introspection:location}/lib/girepository-1.0/'#" ${:python}
sed -i 's#<syslog/>#<!-- no syslog -->#' ${dbus:location}/etc/dbus-1/system.conf
sed -i 's#<user>messagebus</user>#<user>slapsoft</user>#' ${dbus:location}/etc/dbus-1/system.conf
cp -f ${firewalld:location}/lib/firewalld/zones/trusted.xml ${firewalld:location}/etc/firewalld/zones/
cp -f ${firewalld:location}/etc/dbus-1/system.d/FirewallD.conf ${dbus:location}/etc/dbus-1/system.d/
mkdir -p ${buildout:directory}/sbin
update-command = ${:command}
[firewalld-eggs]
recipe = zc.recipe.egg:scripts
interpreter = python.eggs
eggs =
decorator
six
${python-slip-egg:eggs}
extra-paths =
${dbus-python:python-egg}
${firewalld:python-egg}
${pygobject3:python-egg}
...@@ -11,6 +11,7 @@ url = https://rubygems.org/rubygems/rubygems-2.4.8.zip ...@@ -11,6 +11,7 @@ url = https://rubygems.org/rubygems/rubygems-2.4.8.zip
ruby-executable = ${ruby:location}/bin/ruby ruby-executable = ${ruby:location}/bin/ruby
gems = gems =
fluentd==0.12.15 fluentd==0.12.15
fluent-plugin-td==0.10.27
gem-options = --no-ri --no-rdoc --with-icu-lib=${icu:location}/lib/ --with-icu-dir=${icu:location}/ gem-options = --no-ri --no-rdoc --with-icu-lib=${icu:location}/lib/ --with-icu-dir=${icu:location}/
environment = environment =
LDFLAGS = -L${icu:location}/lib -Wl,-rpath=${icu:location}/lib LDFLAGS = -L${icu:location}/lib -Wl,-rpath=${icu:location}/lib
......
...@@ -13,8 +13,8 @@ parts = ...@@ -13,8 +13,8 @@ parts =
[freetype] [freetype]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.bz2 url = http://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.bz2
md5sum = 2a7a314927011d5030903179cf183be0 md5sum = 35cb8f4d9e5906847901bb39324c2f80
pkg_config_depends = ${zlib:location}/lib/pkgconfig:${libpng:location}/lib/pkgconfig pkg_config_depends = ${zlib:location}/lib/pkgconfig:${libpng:location}/lib/pkgconfig
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-options = configure-options =
...@@ -24,5 +24,3 @@ environment = ...@@ -24,5 +24,3 @@ environment =
PKG_CONFIG_PATH=${:pkg_config_depends} PKG_CONFIG_PATH=${:pkg_config_depends}
CPPFLAGS=-I${bzip2:location}/include -I${zlib:location}/include CPPFLAGS=-I${bzip2:location}/include -I${zlib:location}/include
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
make-targets =
install && ln -s . ${:location}/include/freetype2/freetype
...@@ -10,8 +10,8 @@ extends = ...@@ -10,8 +10,8 @@ extends =
[gettext] [gettext]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.5.1.tar.lz url = http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.6.tar.lz
md5sum = 153d3c541f4a1a284b365a8cd65875c9 md5sum = 45b2a123cdc7cef54df98152a0da3fcc
configure-options = configure-options =
--disable-static --disable-static
......
...@@ -32,8 +32,8 @@ environment = ...@@ -32,8 +32,8 @@ environment =
[ghostscript-9] [ghostscript-9]
<= ghostscript-common <= ghostscript-common
url = http://downloads.ghostscript.com/public/ghostscript-9.16.tar.bz2 url = http://downloads.ghostscript.com/public/ghostscript-9.18.tar.bz2
md5sum = 21732fd6e39acc283bc623b8842cbfbb md5sum = aa125af368d89b3dbd15fc379f13375f
[ghostscript-fonts] [ghostscript-fonts]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
......
...@@ -16,8 +16,8 @@ parts = ...@@ -16,8 +16,8 @@ parts =
[git] [git]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://www.kernel.org/pub/software/scm/git/git-2.5.1.tar.xz url = https://www.kernel.org/pub/software/scm/git/git-2.5.3.tar.xz
md5sum = 55b9c496ea2d87148a2bfe1b6f6edd02 md5sum = e69b41f2d0a93f3d3dc5eb19196e4e5c
configure-options = configure-options =
--with-curl=${curl:location} --with-curl=${curl:location}
--with-openssl=${openssl:location} --with-openssl=${openssl:location}
......
...@@ -13,8 +13,8 @@ extends = ...@@ -13,8 +13,8 @@ extends =
[groonga] [groonga]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://packages.groonga.org/source/groonga/groonga-5.0.7.tar.gz url = http://packages.groonga.org/source/groonga/groonga-5.0.8.tar.gz
md5sum = 389d5353a18ff5f48ccf65a576c7b2d1 md5sum = ccb36449fdd62c61367f3ed5e830aec3
# temporary patch to respect more tokens in natural language mode. # temporary patch to respect more tokens in natural language mode.
patches = patches =
${:_profile_base_location_}/groonga.patch#9ed02fbe8400402d3eab47eee149978b ${:_profile_base_location_}/groonga.patch#9ed02fbe8400402d3eab47eee149978b
......
...@@ -16,9 +16,10 @@ patches = ...@@ -16,9 +16,10 @@ patches =
${:_profile_base_location_}/CVE-2014-9029.patch#d69195cf17878f024cc0b580045ec314 ${:_profile_base_location_}/CVE-2014-9029.patch#d69195cf17878f024cc0b580045ec314
${:_profile_base_location_}/CVE-2014-8137.patch#bc5103b9a33315538106bf6652383a10 ${:_profile_base_location_}/CVE-2014-8137.patch#bc5103b9a33315538106bf6652383a10
${:_profile_base_location_}/CVE-2014-8138.patch#bfb9604fe84b6e686fea29bd760cf34d ${:_profile_base_location_}/CVE-2014-8138.patch#bfb9604fe84b6e686fea29bd760cf34d
# jasper configure script is not executable by default configure-options =
configure-command = --disable-static
/bin/sh ./configure --prefix=${buildout:parts-directory}/${:_buildout_section_name_} --disable-static --enable-shared --disable-opengl --enable-shared
--disable-opengl
environment = environment =
CPPFLAGS=-I${libjpeg:location}/include CPPFLAGS=-I${libjpeg:location}/include
LDFLAGS=-L${libjpeg:location}/lib -Wl,-rpath=${libjpeg:location}/lib LDFLAGS=-L${libjpeg:location}/lib -Wl,-rpath=${libjpeg:location}/lib
[buildout] [buildout]
parts = leptonica parts = leptonica
extends = extends =
../libtool/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
../libjpeg/buildout.cfg ../libjpeg/buildout.cfg
../libpng/buildout.cfg ../libpng/buildout.cfg
...@@ -13,13 +12,11 @@ extends = ...@@ -13,13 +12,11 @@ extends =
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://leptonica.googlecode.com/files/leptonica-1.68.tar.gz url = http://leptonica.googlecode.com/files/leptonica-1.68.tar.gz
md5sum = 5cd7092f9ff2ca7e3f3e73bfcd556403 md5sum = 5cd7092f9ff2ca7e3f3e73bfcd556403
configure-command = configure-options =
./autogen.sh --disable-static
./configure --prefix=${buildout:parts-directory}/${:_buildout_section_name_} --disable-static
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/leptonica-1.69-zlib-include.patch#cff3dc942075190939b407c38e0d3201 ${:_profile_base_location_}/leptonica-1.69-zlib-include.patch#cff3dc942075190939b407c38e0d3201
environment = environment =
ACLOCAL_ARGS=-I${libtool:location}/share/aclocal
CPPFLAGS=-I${zlib:location}/include -I${libjpeg:location}/include -I${libpng:location}/include -I${libtiff:location}/include -I${webp:location}/include -I${giflib:location}/include CPPFLAGS=-I${zlib:location}/include -I${libjpeg:location}/include -I${libpng:location}/include -I${libtiff:location}/include -I${webp:location}/include -I${giflib:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libjpeg:location}/lib -Wl,-rpath=${libjpeg:location}/lib -L${libpng:location}/lib -Wl,-rpath=${libpng:location}/lib -L${libtiff:location}/lib -Wl,-rpath=${libtiff:location}/lib -L${webp:location}/lib -Wl,-rpath=${webp:location}/lib -L${giflib:location}/lib -Wl,-rpath=${giflib:location}/lib LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libjpeg:location}/lib -Wl,-rpath=${libjpeg:location}/lib -L${libpng:location}/lib -Wl,-rpath=${libpng:location}/lib -L${libtiff:location}/lib -Wl,-rpath=${libtiff:location}/lib -L${webp:location}/lib -Wl,-rpath=${webp:location}/lib -L${giflib:location}/lib -Wl,-rpath=${giflib:location}/lib
...@@ -18,15 +18,15 @@ environment = ...@@ -18,15 +18,15 @@ environment =
[libpng12] [libpng12]
<= libpng-common <= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.2.52.tar.xz url = http://download.sourceforge.net/libpng/libpng-1.2.53.tar.xz
md5sum = 49d5c71929bf69a172147c47b9309fbe md5sum = 7d18a74e6fd2029aee76ccd00e00a9e6
[libpng15] [libpng15]
<= libpng-common <= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.5.21.tar.xz url = http://download.sourceforge.net/libpng/libpng-1.5.23.tar.xz
md5sum = 22eaa2e90352fcd153bed0cdecf542cb md5sum = 725f9b98143450df03decf08b4bc42e3
[libpng] [libpng]
<= libpng-common <= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.6.16.tar.xz url = http://download.sourceforge.net/libpng/libpng-1.6.18.tar.xz
md5sum = 23b7286b5d4a86de950fd2ffc5cac742 md5sum = 6a57c8e0f5469b9c9949a4b43d57b3a1
...@@ -4,8 +4,8 @@ parts = ...@@ -4,8 +4,8 @@ parts =
[libtasn1] [libtasn1]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.5.tar.gz url = http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.7.tar.gz
md5sum = 81d272697545e82d39f6bd14854b68f0 md5sum = 12d10ca4ae0a3b95f7aa06a076da39ec
configure-options = configure-options =
--disable-static --disable-static
--disable-gtk-doc-html --disable-gtk-doc-html
...@@ -11,7 +11,7 @@ parts = ...@@ -11,7 +11,7 @@ parts =
[dream-repository.git] [dream-repository.git]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/dream.git repository = https://lab.nexedi.com/nexedi/dream.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
develop = true develop = true
......
...@@ -20,15 +20,16 @@ parts = ...@@ -20,15 +20,16 @@ parts =
[mariadb] [mariadb]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
version = 10.0.21 version = 10.1.8
url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http:/ftp.osuosl.org/pub/mariadb url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http:/ftp.osuosl.org/pub/mariadb
md5sum = 956561f3798d1fe8dfbe4b665287a87a md5sum = 9ba0aaabba40153d83e70edcc1aa43a8
location = ${buildout:parts-directory}/${:_buildout_section_name_}
patch-options = -p0 patch-options = -p0
patches = patches =
${:_profile_base_location_}/mariadb_10.0.8_create_system_tables__no_test.patch#a176d491cf45fccd53ee397c70393bc4 ${:_profile_base_location_}/mariadb_10.1.8_create_system_tables__no_test.patch#d2f337e76b290071daf8985a79bda82a
configure-command = ${cmake:location}/bin/cmake configure-command = ${cmake:location}/bin/cmake
configure-options = configure-options =
-DCMAKE_INSTALL_PREFIX=${buildout:parts-directory}/${:_buildout_section_name_} -DCMAKE_INSTALL_PREFIX=${:location}
-DBUILD_CONFIG=mysql_release -DBUILD_CONFIG=mysql_release
-DDEFAULT_CHARSET=utf8 -DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_unicode_ci -DDEFAULT_COLLATION=utf8_unicode_ci
...@@ -52,16 +53,20 @@ environment = ...@@ -52,16 +53,20 @@ environment =
CMAKE_INCLUDE_PATH=${libaio:location}/include:${libaio:location}/include:${libxml2:location}/include:${ncurses:location}/include:${openssl:location}/include:${pcre:location}/include:${readline5:location}/include:${zlib:location}/include CMAKE_INCLUDE_PATH=${libaio:location}/include:${libaio:location}/include:${libxml2:location}/include:${ncurses:location}/include:${openssl:location}/include:${pcre:location}/include:${readline5:location}/include:${zlib:location}/include
CMAKE_LIBRARY_PATH=${libaio:location}/lib:{libaio:location}/lib:${libxml2:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${pcre:location}/lib:${readline5:location}/lib:${zlib:location}/lib CMAKE_LIBRARY_PATH=${libaio:location}/lib:{libaio:location}/lib:${libxml2:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${pcre:location}/lib:${readline5:location}/lib:${zlib:location}/lib
LDFLAGS=-L${jemalloc:location}/lib -Wl,-rpath=${jemalloc:location}/lib -L${libaio:location}/lib -Wl,-rpath=${libaio:location}/lib -L${pcre:location}/lib -L${zlib:location}/lib LDFLAGS=-L${jemalloc:location}/lib -Wl,-rpath=${jemalloc:location}/lib -L${libaio:location}/lib -Wl,-rpath=${libaio:location}/lib -L${pcre:location}/lib -L${zlib:location}/lib
post-install =
mkdir -p ${:location}/include/wsrep &&
cp -p wsrep/wsrep_api.h ${:location}/include/wsrep
[mroonga-mariadb] [mroonga-mariadb]
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users. # mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/ # http://mroonga.github.com/
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://packages.groonga.org/source/mroonga/mroonga-5.06.tar.gz url = http://packages.groonga.org/source/mroonga/mroonga-5.08.tar.gz
md5sum = 15597acfb1375c931e7b5588511c17bb md5sum = 65011c1da8700c4950d11dea7355b32d
configure-command = mkdir fake_mariadb_source && ln -s ${mariadb:location}/include/mysql/private fake_mariadb_source/sql && ./configure pre-configure =
mkdir fake_mariadb_source &&
ln -s ${mariadb:location}/include/mysql/private fake_mariadb_source/sql
configure-options = configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-mysql-source=fake_mariadb_source --with-mysql-source=fake_mariadb_source
--with-mysql-config=${mariadb:location}/bin/mysql_config --with-mysql-config=${mariadb:location}/bin/mysql_config
--disable-static --disable-static
...@@ -69,6 +74,7 @@ configure-options = ...@@ -69,6 +74,7 @@ configure-options =
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/mroonga_boolean.patch#36645770ae612515b74b90884ecc59fc ${:_profile_base_location_}/mroonga_boolean.patch#36645770ae612515b74b90884ecc59fc
${:_profile_base_location_}/mroonga_5.08_mariadb_10.1.8.patch#ead45e0fbb4cf3c2d39ece012793d3c4
environment = environment =
PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
CPPFLAGS=-I${groonga:location}/include/groonga -I${pcre:location}/include CPPFLAGS=-I${groonga:location}/include/groonga -I${pcre:location}/include
......
...@@ -5,8 +5,8 @@ circumstances as it is checked first. ...@@ -5,8 +5,8 @@ circumstances as it is checked first.
See http://bugs.debian.org/301741 See http://bugs.debian.org/301741
and http://bugs.mysql.com/bug.php?id=6901 and http://bugs.mysql.com/bug.php?id=6901
--- scripts/mysql_system_tables_data.sql.orig 2013-11-05 17:46:05.000000000 +0100 --- scripts/mysql_system_tables_data.sql.orig 2015-10-15 17:43:45.000000000 +0200
+++ scripts/mysql_system_tables_data.sql 2013-11-08 09:28:34.707291508 +0100 +++ scripts/mysql_system_tables_data.sql 2015-10-19 16:44:16.121393390 +0200
@@ -30,8 +30,6 @@ @@ -30,8 +30,6 @@
-- Fill "db" table with default grants for anyone to -- Fill "db" table with default grants for anyone to
-- access database 'test' and 'test_%' if "db" table didn't exist -- access database 'test' and 'test_%' if "db" table didn't exist
...@@ -17,9 +17,9 @@ and http://bugs.mysql.com/bug.php?id=6901 ...@@ -17,9 +17,9 @@ and http://bugs.mysql.com/bug.php?id=6901
DROP TABLE tmp_db; DROP TABLE tmp_db;
@@ -43,8 +41,6 @@ @@ -43,8 +41,6 @@
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N' FROM dual WHERE @current_hostname != 'localhost'; REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0 FROM dual WHERE @current_hostname != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N'); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0);
REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N'); REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0);
-INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES ('localhost','');
-INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; -INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
......
commit 4a40e81d17d1df28cfeca56d3d9c8f26d0132cfa
Author: Kouhei Sutou <kou@clear-code.com>
Date: Sun Oct 18 17:23:28 2015 +0900
Use public API
It fixes a build error on MariaDB 10.1.8.
diff --git a/ha_mroonga.cpp b/ha_mroonga.cpp
index 819de30..bfd9631 100644
--- a/ha_mroonga.cpp
+++ b/ha_mroonga.cpp
@@ -9620,13 +9620,13 @@ void ha_mroonga::check_count_skip(key_part_map start_key_part_map,
if (where->type() == Item::FUNC_ITEM) {
Item_func *func_item = static_cast<Item_func *>(where);
- if (func_item->arg_count == 0) {
+ if (func_item->argument_count() == 0) {
break;
}
target = func_item->key_item();
where = where->next;
if (func_item->arguments()[0] == where) {
- uint n_args = func_item->arg_count;
+ uint n_args = func_item->argument_count();
for (; n_args > 0; --n_args) {
where = where->next;
}
...@@ -8,31 +8,34 @@ extends = ...@@ -8,31 +8,34 @@ extends =
../libtool/buildout.cfg ../libtool/buildout.cfg
../pkgconfig/buildout.cfg ../pkgconfig/buildout.cfg
../xorg/buildout.cfg ../xorg/buildout.cfg
../xz-utils/buildout.cfg
parts = parts =
mesa mesa
[mesa] [mesa]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = ftp://ftp.freedesktop.org/pub/mesa/10.3.2/MesaLib-10.3.2.tar.bz2 url = ftp://ftp.freedesktop.org/pub/mesa/11.0.3/mesa-11.0.3.tar.xz
md5sum = c0a2a975899c4e7485124b388c16cd2f md5sum = bf9118bf0fbf360715cfe60baf7a1db5
configure-options = configure-options =
--disable-static --disable-static
--disable-gles1
--disable-gles2
--disable-dri --disable-dri
--disable-dri3 --disable-dri3
--disable-egl --disable-egl
--disable-gbm --disable-gbm
--disable-xvmc --disable-xvmc
--disable-vdpau --disable-vdpau
--disable-va
--enable-xlib-glx --enable-xlib-glx
--disable-gallium-gbm
--disable-shared-glapi --disable-shared-glapi
--disable-driglx-direct --disable-driglx-direct
--disable-gallium-llvm --disable-gallium-llvm
--with-gallium-drivers= --with-gallium-drivers=
--with-dri-drivers= --with-dri-drivers=
environment = environment =
PATH=${autoconf:location}/bin:${bison:location}/bin:${flex:location}/bin:${pkgconfig:location}/bin:%(PATH)s PATH=${autoconf:location}/bin:${bison:location}/bin:${flex:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${damageproto:location}/lib/pkgconfig:${fixesproto:location}/lib/pkgconfig:${glproto:location}/lib/pkgconfig:${kbproto:location}/lib/pkgconfig:${libX11:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig:${libXext:location}/lib/pkgconfig:${libexpat:location}/lib/pkgconfig:${libxcb:location}/lib/pkgconfig:${xdamage:location}/lib/pkgconfig:${xextproto:location}/lib/pkgconfig:${xfixes:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig PKG_CONFIG_PATH=${damageproto:location}/lib/pkgconfig:${fixesproto:location}/lib/pkgconfig:${glproto:location}/lib/pkgconfig:${kbproto:location}/lib/pkgconfig:${libX11:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig:${libXext:location}/lib/pkgconfig:${libexpat:location}/lib/pkgconfig:${libxcb:location}/lib/pkgconfig:${xdamage:location}/lib/pkgconfig:${xextproto:location}/lib/pkgconfig:${xfixes:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig
PYTHON2=${buildout:executable} PYTHON2=${buildout:executable}
ACLOCAL=${automake:location}/bin/aclocal -I${libtool:location}/share/aclocal -I${pkgconfig:location}/share/aclocal ACLOCAL=${automake:location}/bin/aclocal -I${libtool:location}/share/aclocal -I${pkgconfig:location}/share/aclocal
......
...@@ -11,7 +11,6 @@ configure-options = ...@@ -11,7 +11,6 @@ configure-options =
--with-shared --with-shared
--without-ada --without-ada
--without-manpages --without-manpages
--without-progs
--without-tests --without-tests
--without-normal --without-normal
--without-debug --without-debug
......
...@@ -8,8 +8,8 @@ extends = ...@@ -8,8 +8,8 @@ extends =
[openldap] [openldap]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.40.tgz url = http://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.42.tgz
md5sum = 423c1f23d2a0cb96b3e9baf7e9d7dda7 md5sum = 47c8e2f283647a6105b8b0325257e922
configure-options = configure-options =
--disable-static --disable-static
--disable-slapd --disable-slapd
......
...@@ -10,6 +10,6 @@ parts = ...@@ -10,6 +10,6 @@ parts =
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
version = 2.2.15 version = 2.2.15
url = http://www.percona.com/redir/downloads/percona-toolkit/${:version}/tarball/percona-toolkit-${:version}.tar.gz url = http://www.percona.com/redir/downloads/percona-toolkit/${:version}/tarball/percona-toolkit-${:version}.tar.gz
md5sum = 8ccaf3d497c463d593b0101a01f5dccf md5sum = 022f40dadaea9025820530ea1f986192
configure-command = configure-command =
${perl:location}/bin/perl Makefile.PL ${perl:location}/bin/perl Makefile.PL
...@@ -25,4 +25,4 @@ configure-command = ...@@ -25,4 +25,4 @@ configure-command =
-Dusethreads -Dusethreads
environment = environment =
PATH=${patch:location}/bin:%(PATH)s PATH=${patch:location}/bin:%(PATH)s
post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#539cb3cd0d1090f7f30a8e5a82b37854:post_make_hook post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#28d12de5c9c7985e65233d56817e3bec:post_make_hook
...@@ -20,5 +20,8 @@ def post_make_hook(options, buildout): ...@@ -20,5 +20,8 @@ def post_make_hook(options, buildout):
# matches[0] is a prefix of "location" # matches[0] is a prefix of "location"
# For the symlink, we want the relative path. # For the symlink, we want the relative path.
rel_link = os.path.relpath(os.path.dirname(matches[0]), location) rel_link = os.path.relpath(os.path.dirname(matches[0]), location)
os.symlink(rel_link, os.path.join(location, "libs-c")) simlink_location = os.path.join(location, "libs-c")
if os.path.islink(simlink_location):
os.unlink(simlink_location)
os.symlink(rel_link, simlink_location)
print "Created symlink \"libs-c\" to", rel_link print "Created symlink \"libs-c\" to", rel_link
...@@ -14,17 +14,17 @@ extends = ...@@ -14,17 +14,17 @@ extends =
[pkgconfig] [pkgconfig]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz url = http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz
md5sum = aa3c86e67551adc3ac865160e34a2a0d md5sum = 77f27dce7ef88d0634d0d6f90e03a77f
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
# build pkg-config twice so that second configure can use pkg-config # build pkg-config twice so that second configure can use pkg-config
# to compute GLIB_CFLAGS and GLIB_LIBS. # to compute GLIB_CFLAGS and GLIB_LIBS.
configure-command = pre-configure =
./configure --prefix=${:location} --with-installed-glib --with-installed-popt && make && ./configure ./configure --prefix=${:location} --with-installed-glib --with-installed-popt && make
configure-options = configure-options =
--prefix=${:location}
--with-installed-glib --with-installed-glib
--with-installed-popt --with-installed-popt
--disable-host-tool
environment = environment =
PATH=.:%(PATH)s PATH=.:%(PATH)s
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig
......
...@@ -40,6 +40,7 @@ executable = ${:prefix}/bin/python${:version} ...@@ -40,6 +40,7 @@ executable = ${:prefix}/bin/python${:version}
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7 ${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7
${:_profile_base_location_}/pytracemalloc_pep445.patch#46662cf0ccc7cb7cfb8289bbfd68b21a
url = url =
http://python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz http://python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz
configure-options = configure-options =
......
diff -urN Python-2.7.10.ORIG/Include/objimpl.h Python-2.7.10/Include/objimpl.h
--- Python-2.7.10.ORIG/Include/objimpl.h 2015-05-24 01:08:59.000000000 +0900
+++ Python-2.7.10/Include/objimpl.h 2015-10-13 17:31:13.771317208 +0900
@@ -98,10 +98,8 @@
PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t);
PyAPI_FUNC(void) PyObject_Free(void *);
-
/* Macros */
-#ifdef WITH_PYMALLOC
-#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */
+#if defined(WITH_PYMALLOC) && defined(PYMALLOC_DEBUG)
PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes);
PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes);
PyAPI_FUNC(void) _PyObject_DebugFree(void *p);
@@ -115,28 +113,17 @@
PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes);
PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes);
PyAPI_FUNC(void) _PyMem_DebugFree(void *p);
-#define PyObject_MALLOC _PyObject_DebugMalloc
-#define PyObject_Malloc _PyObject_DebugMalloc
-#define PyObject_REALLOC _PyObject_DebugRealloc
-#define PyObject_Realloc _PyObject_DebugRealloc
-#define PyObject_FREE _PyObject_DebugFree
-#define PyObject_Free _PyObject_DebugFree
+#endif
-#else /* WITH_PYMALLOC && ! PYMALLOC_DEBUG */
#define PyObject_MALLOC PyObject_Malloc
#define PyObject_REALLOC PyObject_Realloc
#define PyObject_FREE PyObject_Free
-#endif
-
-#else /* ! WITH_PYMALLOC */
-#define PyObject_MALLOC PyMem_MALLOC
-#define PyObject_REALLOC PyMem_REALLOC
-#define PyObject_FREE PyMem_FREE
-
-#endif /* WITH_PYMALLOC */
-
#define PyObject_Del PyObject_Free
-#define PyObject_DEL PyObject_FREE
+#define PyObject_DEL PyObject_Free
+
+#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */
+PyAPI_FUNC(void) _PyObject_DebugMallocStats(void);
+#endif
/* for source compatibility with 2.2 */
#define _PyObject_Del PyObject_Free
diff -urN Python-2.7.10.ORIG/Include/pymem.h Python-2.7.10/Include/pymem.h
--- Python-2.7.10.ORIG/Include/pymem.h 2015-05-24 01:09:00.000000000 +0900
+++ Python-2.7.10/Include/pymem.h 2015-10-13 17:31:13.771317208 +0900
@@ -11,6 +11,11 @@
extern "C" {
#endif
+PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
+PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
+PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
+
+
/* BEWARE:
Each interface exports both functions and macros. Extension modules should
@@ -49,21 +54,17 @@
performed on failure (no exception is set, no warning is printed, etc).
*/
-PyAPI_FUNC(void *) PyMem_Malloc(size_t);
-PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
-PyAPI_FUNC(void) PyMem_Free(void *);
+PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
+PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
+PyAPI_FUNC(void) PyMem_Free(void *ptr);
+
+PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
+PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
no longer supported. They used to call PyErr_NoMemory() on failure. */
/* Macros. */
-#ifdef PYMALLOC_DEBUG
-/* Redirect all memory operations to Python's debugging allocator. */
-#define PyMem_MALLOC _PyMem_DebugMalloc
-#define PyMem_REALLOC _PyMem_DebugRealloc
-#define PyMem_FREE _PyMem_DebugFree
-
-#else /* ! PYMALLOC_DEBUG */
/* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
for malloc(0), which would be treated as an error. Some platforms
@@ -71,13 +72,9 @@
pymalloc. To solve these problems, allocate an extra byte. */
/* Returns NULL to indicate error if a negative size or size larger than
Py_ssize_t can represent is supplied. Helps prevents security holes. */
-#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
- : malloc((n) ? (n) : 1))
-#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
- : realloc((p), (n) ? (n) : 1))
-#define PyMem_FREE free
-
-#endif /* PYMALLOC_DEBUG */
+#define PyMem_MALLOC(n) PyMem_Malloc(n)
+#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
+#define PyMem_FREE(p) PyMem_Free(p)
/*
* Type-oriented memory interface
@@ -115,6 +112,67 @@
#define PyMem_Del PyMem_Free
#define PyMem_DEL PyMem_FREE
+typedef enum {
+ /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
+ PYMEM_DOMAIN_RAW,
+
+ /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */
+ PYMEM_DOMAIN_MEM,
+
+ /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */
+ PYMEM_DOMAIN_OBJ
+} PyMemAllocatorDomain;
+
+typedef struct {
+ /* user context passed as the first argument to the 3 functions */
+ void *ctx;
+
+ /* allocate a memory block */
+ void* (*malloc) (void *ctx, size_t size);
+
+ /* allocate or resize a memory block */
+ void* (*realloc) (void *ctx, void *ptr, size_t new_size);
+
+ /* release a memory block */
+ void (*free) (void *ctx, void *ptr);
+} PyMemAllocator;
+
+/* Get the memory block allocator of the specified domain. */
+PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain,
+ PyMemAllocator *allocator);
+
+/* Set the memory block allocator of the specified domain.
+
+ The new allocator must return a distinct non-NULL pointer when requesting
+ zero bytes.
+
+ For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL
+ is not held when the allocator is called.
+
+ If the new allocator is not a hook (don't call the previous allocator), the
+ PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks
+ on top on the new allocator. */
+PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
+ PyMemAllocator *allocator);
+
+/* Setup hooks to detect bugs in the following Python memory allocator
+ functions:
+
+ - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
+ - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free()
+ - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
+
+ Newly allocated memory is filled with the byte 0xCB, freed memory is filled
+ with the byte 0xDB. Additionnal checks:
+
+ - detect API violations, ex: PyObject_Free() called on a buffer allocated
+ by PyMem_Malloc()
+ - detect write before the start of the buffer (buffer underflow)
+ - detect write after the end of the buffer (buffer overflow)
+
+ The function does nothing if Python is not compiled is debug mode. */
+PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
+
#ifdef __cplusplus
}
#endif
diff -urN Python-2.7.10.ORIG/Objects/object.c Python-2.7.10/Objects/object.c
--- Python-2.7.10.ORIG/Objects/object.c 2015-05-24 01:09:22.000000000 +0900
+++ Python-2.7.10/Objects/object.c 2015-10-13 17:31:13.771317208 +0900
@@ -2335,27 +2335,6 @@
Py_ssize_t (*_Py_abstract_hack)(PyObject *) = PyObject_Size;
-/* Python's malloc wrappers (see pymem.h) */
-
-void *
-PyMem_Malloc(size_t nbytes)
-{
- return PyMem_MALLOC(nbytes);
-}
-
-void *
-PyMem_Realloc(void *p, size_t nbytes)
-{
- return PyMem_REALLOC(p, nbytes);
-}
-
-void
-PyMem_Free(void *p)
-{
- PyMem_FREE(p);
-}
-
-
/* These methods are used to control infinite recursion in repr, str, print,
etc. Container objects that may recursively contain themselves,
e.g. builtin dictionaries and lists, should used Py_ReprEnter() and
diff -urN Python-2.7.10.ORIG/Objects/obmalloc.c Python-2.7.10/Objects/obmalloc.c
--- Python-2.7.10.ORIG/Objects/obmalloc.c 2015-05-24 01:09:22.000000000 +0900
+++ Python-2.7.10/Objects/obmalloc.c 2015-10-13 17:37:24.665726972 +0900
@@ -18,6 +18,281 @@
#endif
#endif
+/* Python's malloc wrappers (see pymem.h) */
+
+#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */
+/* Forward declaration */
+static void* _PyMem_DebugMallocCtx(void *ctx, size_t size);
+static void _PyMem_DebugFreeCtx(void *ctx, void *p);
+static void* _PyMem_DebugReallocCtx(void *ctx, void *ptr, size_t size);
+
+static void _PyMem_DebugCheckAddress(char api_id, const void *p);
+#endif
+
+#ifdef WITH_PYMALLOC
+
+#ifdef MS_WINDOWS
+# include <windows.h>
+#elif defined(HAVE_MMAP)
+# include <sys/mman.h>
+# ifdef MAP_ANONYMOUS
+# define ARENAS_USE_MMAP
+# endif
+#endif
+
+/* Forward declaration */
+static void* _PyObject_Malloc(void *ctx, size_t size);
+static void _PyObject_Free(void *ctx, void *p);
+static void* _PyObject_Realloc(void *ctx, void *ptr, size_t size);
+#endif
+
+
+static void *
+_PyMem_RawMalloc(void *ctx, size_t size)
+{
+ /* PyMem_Malloc(0) means malloc(1). Some systems would return NULL
+ for malloc(0), which would be treated as an error. Some platforms would
+ return a pointer with no memory behind it, which would break pymalloc.
+ To solve these problems, allocate an extra byte. */
+ if (size == 0)
+ size = 1;
+ return malloc(size);
+}
+
+static void *
+_PyMem_RawRealloc(void *ctx, void *ptr, size_t size)
+{
+ if (size == 0)
+ size = 1;
+ return realloc(ptr, size);
+}
+
+static void
+_PyMem_RawFree(void *ctx, void *ptr)
+{
+ free(ptr);
+}
+
+#define PYRAW_FUNCS _PyMem_RawMalloc, _PyMem_RawRealloc, _PyMem_RawFree
+#ifdef WITH_PYMALLOC
+#define PYOBJECT_FUNCS _PyObject_Malloc, _PyObject_Realloc, _PyObject_Free
+#else
+#define PYOBJECT_FUNCS PYRAW_FUNCS
+#endif
+
+#ifdef PYMALLOC_DEBUG
+typedef struct {
+ /* We tag each block with an API ID in order to tag API violations */
+ char api_id;
+ PyMemAllocator alloc;
+} debug_alloc_api_t;
+static struct {
+ debug_alloc_api_t raw;
+ debug_alloc_api_t mem;
+ debug_alloc_api_t obj;
+} _PyMem_Debug = {
+ {'r', {NULL, PYRAW_FUNCS}},
+ {'m', {NULL, PYRAW_FUNCS}},
+ {'o', {NULL, PYOBJECT_FUNCS}}
+ };
+
+#define PYDEBUG_FUNCS _PyMem_DebugMallocCtx, _PyMem_DebugReallocCtx, _PyMem_DebugFreeCtx
+#endif
+
+static PyMemAllocator _PyMem_Raw = {
+#ifdef PYMALLOC_DEBUG
+ &_PyMem_Debug.raw, PYDEBUG_FUNCS
+#else
+ NULL, PYRAW_FUNCS
+#endif
+ };
+
+static PyMemAllocator _PyMem = {
+#ifdef PYMALLOC_DEBUG
+ &_PyMem_Debug.mem, PYDEBUG_FUNCS
+#else
+ NULL, PYRAW_FUNCS
+#endif
+ };
+
+static PyMemAllocator _PyObject = {
+#ifdef PYMALLOC_DEBUG
+ &_PyMem_Debug.obj, PYDEBUG_FUNCS
+#else
+ NULL, PYOBJECT_FUNCS
+#endif
+ };
+
+#undef PYRAW_FUNCS
+#undef PYOBJECT_FUNCS
+#undef PYDEBUG_FUNCS
+
+void
+PyMem_SetupDebugHooks(void)
+{
+#ifdef PYMALLOC_DEBUG
+ PyMemAllocator alloc;
+
+ alloc.malloc = _PyMem_DebugMallocCtx;
+ alloc.realloc = _PyMem_DebugReallocCtx;
+ alloc.free = _PyMem_DebugFreeCtx;
+
+ if (_PyMem_Raw.malloc != _PyMem_DebugMallocCtx) {
+ alloc.ctx = &_PyMem_Debug.raw;
+ PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &_PyMem_Debug.raw.alloc);
+ PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
+ }
+
+ if (_PyMem.malloc != _PyMem_DebugMallocCtx) {
+ alloc.ctx = &_PyMem_Debug.mem;
+ PyMem_GetAllocator(PYMEM_DOMAIN_MEM, &_PyMem_Debug.mem.alloc);
+ PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
+ }
+
+ if (_PyObject.malloc != _PyMem_DebugMallocCtx) {
+ alloc.ctx = &_PyMem_Debug.obj;
+ PyMem_GetAllocator(PYMEM_DOMAIN_OBJ, &_PyMem_Debug.obj.alloc);
+ PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);
+ }
+#endif
+}
+
+void
+PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+{
+ switch(domain)
+ {
+ case PYMEM_DOMAIN_RAW: *allocator = _PyMem_Raw; break;
+ case PYMEM_DOMAIN_MEM: *allocator = _PyMem; break;
+ case PYMEM_DOMAIN_OBJ: *allocator = _PyObject; break;
+ default:
+ /* unknown domain */
+ allocator->ctx = NULL;
+ allocator->malloc = NULL;
+ allocator->realloc = NULL;
+ allocator->free = NULL;
+ }
+}
+
+void
+PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+{
+ switch(domain)
+ {
+ case PYMEM_DOMAIN_RAW: _PyMem_Raw = *allocator; break;
+ case PYMEM_DOMAIN_MEM: _PyMem = *allocator; break;
+ case PYMEM_DOMAIN_OBJ: _PyObject = *allocator; break;
+ /* ignore unknown domain */
+ }
+
+}
+
+void *
+PyMem_RawMalloc(size_t size)
+{
+ /*
+ * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
+ * Most python internals blindly use a signed Py_ssize_t to track
+ * things without checking for overflows or negatives.
+ * As size_t is unsigned, checking for size < 0 is not required.
+ */
+ if (size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+
+ return _PyMem_Raw.malloc(_PyMem_Raw.ctx, size);
+}
+
+void*
+PyMem_RawRealloc(void *ptr, size_t new_size)
+{
+ /* see PyMem_RawMalloc() */
+ if (new_size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+ return _PyMem_Raw.realloc(_PyMem_Raw.ctx, ptr, new_size);
+}
+
+void PyMem_RawFree(void *ptr)
+{
+ _PyMem_Raw.free(_PyMem_Raw.ctx, ptr);
+}
+
+void *
+PyMem_Malloc(size_t size)
+{
+ /* see PyMem_RawMalloc() */
+ if (size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+ return _PyMem.malloc(_PyMem.ctx, size);
+}
+
+void *
+PyMem_Realloc(void *ptr, size_t new_size)
+{
+ /* see PyMem_RawMalloc() */
+ if (new_size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+ return _PyMem.realloc(_PyMem.ctx, ptr, new_size);
+}
+
+void
+PyMem_Free(void *ptr)
+{
+ _PyMem.free(_PyMem.ctx, ptr);
+}
+
+char *
+_PyMem_RawStrdup(const char *str)
+{
+ size_t size;
+ char *copy;
+
+ size = strlen(str) + 1;
+ copy = PyMem_RawMalloc(size);
+ if (copy == NULL)
+ return NULL;
+ memcpy(copy, str, size);
+ return copy;
+}
+
+char *
+_PyMem_Strdup(const char *str)
+{
+ size_t size;
+ char *copy;
+
+ size = strlen(str) + 1;
+ copy = PyMem_Malloc(size);
+ if (copy == NULL)
+ return NULL;
+ memcpy(copy, str, size);
+ return copy;
+}
+
+void *
+PyObject_Malloc(size_t size)
+{
+ /* see PyMem_RawMalloc() */
+ if (size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+ return _PyObject.malloc(_PyObject.ctx, size);
+}
+
+void *
+PyObject_Realloc(void *ptr, size_t new_size)
+{
+ /* see PyMem_RawMalloc() */
+ if (new_size > (size_t)PY_SSIZE_T_MAX)
+ return NULL;
+ return _PyObject.realloc(_PyObject.ctx, ptr, new_size);
+}
+
+void
+PyObject_Free(void *ptr)
+{
+ _PyObject.free(_PyObject.ctx, ptr);
+}
+
+
#ifdef WITH_PYMALLOC
#ifdef HAVE_MMAP
@@ -581,7 +856,7 @@
return NULL; /* overflow */
#endif
nbytes = numarenas * sizeof(*arenas);
- arenaobj = (struct arena_object *)realloc(arenas, nbytes);
+ arenaobj = (struct arena_object *)PyMem_Realloc(arenas, nbytes);
if (arenaobj == NULL)
return NULL;
arenas = arenaobj;
@@ -785,9 +1060,8 @@
* Unless the optimizer reorders everything, being too smart...
*/
-#undef PyObject_Malloc
-void *
-PyObject_Malloc(size_t nbytes)
+static void *
+_PyObject_Malloc(void *ctx, size_t nbytes)
{
block *bp;
poolp pool;
@@ -802,15 +1076,6 @@
#endif
/*
- * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
- * Most python internals blindly use a signed Py_ssize_t to track
- * things without checking for overflows or negatives.
- * As size_t is unsigned, checking for nbytes < 0 is not required.
- */
- if (nbytes > PY_SSIZE_T_MAX)
- return NULL;
-
- /*
* This implicitly redirects malloc(0).
*/
if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) {
@@ -983,15 +1248,14 @@
*/
if (nbytes == 0)
nbytes = 1;
- return (void *)malloc(nbytes);
+ return PyMem_Malloc(nbytes);
}
/* free */
-#undef PyObject_Free
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
-void
-PyObject_Free(void *p)
+static void
+_PyObject_Free(void *ctx, void *p)
{
poolp pool;
block *lastfree;
@@ -1211,7 +1475,7 @@
redirect:
#endif
/* We didn't allocate this address. */
- free(p);
+ PyMem_Free(p);
}
/* realloc. If p is NULL, this acts like malloc(nbytes). Else if nbytes==0,
@@ -1219,10 +1483,9 @@
* return a non-NULL result.
*/
-#undef PyObject_Realloc
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
-void *
-PyObject_Realloc(void *p, size_t nbytes)
+static void *
+_PyObject_Realloc(void *ctx, void *p, size_t nbytes)
{
void *bp;
poolp pool;
@@ -1232,16 +1495,7 @@
#endif
if (p == NULL)
- return PyObject_Malloc(nbytes);
-
- /*
- * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
- * Most python internals blindly use a signed Py_ssize_t to track
- * things without checking for overflows or negatives.
- * As size_t is unsigned, checking for nbytes < 0 is not required.
- */
- if (nbytes > PY_SSIZE_T_MAX)
- return NULL;
+ return _PyObject_Malloc(ctx, nbytes);
#ifdef WITH_VALGRIND
/* Treat running_on_valgrind == -1 the same as 0 */
@@ -1269,10 +1523,10 @@
}
size = nbytes;
}
- bp = PyObject_Malloc(nbytes);
+ bp = _PyObject_Malloc(ctx, nbytes);
if (bp != NULL) {
memcpy(bp, p, size);
- PyObject_Free(p);
+ _PyObject_Free(ctx, p);
}
return bp;
}
@@ -1290,40 +1544,17 @@
* at p. Instead we punt: let C continue to manage this block.
*/
if (nbytes)
- return realloc(p, nbytes);
+ return PyMem_Realloc(p, nbytes);
/* C doesn't define the result of realloc(p, 0) (it may or may not
* return NULL then), but Python's docs promise that nbytes==0 never
* returns NULL. We don't pass 0 to realloc(), to avoid that endcase
* to begin with. Even then, we can't be sure that realloc() won't
* return NULL.
*/
- bp = realloc(p, 1);
+ bp = PyMem_Realloc(p, 1);
return bp ? bp : p;
}
-#else /* ! WITH_PYMALLOC */
-
-/*==========================================================================*/
-/* pymalloc not enabled: Redirect the entry points to malloc. These will
- * only be used by extensions that are compiled with pymalloc enabled. */
-
-void *
-PyObject_Malloc(size_t n)
-{
- return PyMem_MALLOC(n);
-}
-
-void *
-PyObject_Realloc(void *p, size_t n)
-{
- return PyMem_REALLOC(p, n);
-}
-
-void
-PyObject_Free(void *p)
-{
- PyMem_FREE(p);
-}
#endif /* WITH_PYMALLOC */
#ifdef PYMALLOC_DEBUG
@@ -1343,10 +1574,6 @@
#define DEADBYTE 0xDB /* dead (newly freed) memory */
#define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */
-/* We tag each block with an API ID in order to tag API violations */
-#define _PYMALLOC_MEM_ID 'm' /* the PyMem_Malloc() API */
-#define _PYMALLOC_OBJ_ID 'o' /* The PyObject_Malloc() API */
-
static size_t serialno = 0; /* incremented on each debug {m,re}alloc */
/* serialno is always incremented via calling this routine. The point is
@@ -1429,58 +1656,18 @@
p[2*S+n: 2*S+n+S]
Copies of FORBIDDENBYTE. Used to catch over- writes and reads.
p[2*S+n+S: 2*S+n+2*S]
- A serial number, incremented by 1 on each call to _PyObject_DebugMalloc
- and _PyObject_DebugRealloc.
+ A serial number, incremented by 1 on each call to _PyMem_DebugMalloc
+ and _PyMem_DebugRealloc.
This is a big-endian size_t.
If "bad memory" is detected later, the serial number gives an
excellent way to set a breakpoint on the next run, to capture the
instant at which this block was passed out.
*/
-/* debug replacements for the PyMem_* memory API */
-void *
-_PyMem_DebugMalloc(size_t nbytes)
-{
- return _PyObject_DebugMallocApi(_PYMALLOC_MEM_ID, nbytes);
-}
-void *
-_PyMem_DebugRealloc(void *p, size_t nbytes)
-{
- return _PyObject_DebugReallocApi(_PYMALLOC_MEM_ID, p, nbytes);
-}
-void
-_PyMem_DebugFree(void *p)
-{
- _PyObject_DebugFreeApi(_PYMALLOC_MEM_ID, p);
-}
-
-/* debug replacements for the PyObject_* memory API */
-void *
-_PyObject_DebugMalloc(size_t nbytes)
-{
- return _PyObject_DebugMallocApi(_PYMALLOC_OBJ_ID, nbytes);
-}
-void *
-_PyObject_DebugRealloc(void *p, size_t nbytes)
-{
- return _PyObject_DebugReallocApi(_PYMALLOC_OBJ_ID, p, nbytes);
-}
-void
-_PyObject_DebugFree(void *p)
-{
- _PyObject_DebugFreeApi(_PYMALLOC_OBJ_ID, p);
-}
-void
-_PyObject_DebugCheckAddress(const void *p)
-{
- _PyObject_DebugCheckAddressApi(_PYMALLOC_OBJ_ID, p);
-}
-
-
-/* generic debug memory api, with an "id" to identify the API in use */
-void *
-_PyObject_DebugMallocApi(char id, size_t nbytes)
+static void *
+_PyMem_DebugMallocCtx(void *ctx, size_t nbytes)
{
+ debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
uchar *p; /* base address of malloc'ed block */
uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */
size_t total; /* nbytes + 4*SST */
@@ -1491,14 +1678,14 @@
/* overflow: can't represent total as a size_t */
return NULL;
- p = (uchar *)PyObject_Malloc(total);
+ p = (uchar *)api->alloc.malloc(api->alloc.ctx, total);
if (p == NULL)
return NULL;
/* at p, write size (SST bytes), id (1 byte), pad (SST-1 bytes) */
write_size_t(p, nbytes);
- p[SST] = (uchar)id;
- memset(p + SST + 1 , FORBIDDENBYTE, SST-1);
+ p[SST] = (uchar)api->api_id;
+ memset(p + SST + 1, FORBIDDENBYTE, SST-1);
if (nbytes > 0)
memset(p + 2*SST, CLEANBYTE, nbytes);
@@ -1516,35 +1703,37 @@
Then fills the original bytes with DEADBYTE.
Then calls the underlying free.
*/
-void
-_PyObject_DebugFreeApi(char api, void *p)
+static void
+_PyMem_DebugFreeCtx(void *ctx, void *p)
{
+ debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
uchar *q = (uchar *)p - 2*SST; /* address returned from malloc */
size_t nbytes;
if (p == NULL)
return;
- _PyObject_DebugCheckAddressApi(api, p);
+ _PyMem_DebugCheckAddress(api->api_id, p);
nbytes = read_size_t(q);
nbytes += 4*SST;
if (nbytes > 0)
memset(q, DEADBYTE, nbytes);
- PyObject_Free(q);
+ api->alloc.free(api->alloc.ctx, q);
}
-void *
-_PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
+static void *
+_PyMem_DebugReallocCtx(void *ctx, void *p, size_t nbytes)
{
- uchar *q = (uchar *)p;
+ debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
+ uchar *q = (uchar *)p, *oldq;
uchar *tail;
size_t total; /* nbytes + 4*SST */
size_t original_nbytes;
int i;
if (p == NULL)
- return _PyObject_DebugMallocApi(api, nbytes);
+ return _PyMem_DebugMallocCtx(ctx, nbytes);
- _PyObject_DebugCheckAddressApi(api, p);
+ _PyMem_DebugCheckAddress(api->api_id, p);
bumpserialno();
original_nbytes = read_size_t(q - 2*SST);
total = nbytes + 4*SST;
@@ -1552,24 +1741,26 @@
/* overflow: can't represent total as a size_t */
return NULL;
- if (nbytes < original_nbytes) {
- /* shrinking: mark old extra memory dead */
- memset(q + nbytes, DEADBYTE, original_nbytes - nbytes + 2*SST);
- }
-
/* Resize and add decorations. We may get a new pointer here, in which
* case we didn't get the chance to mark the old memory with DEADBYTE,
* but we live with that.
*/
- q = (uchar *)PyObject_Realloc(q - 2*SST, total);
+ oldq = q;
+ q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total);
if (q == NULL)
return NULL;
+ if (q == oldq && nbytes < original_nbytes) {
+ /* shrinking: mark old extra memory dead */
+ memset(q + nbytes, DEADBYTE, original_nbytes - nbytes);
+ }
+
write_size_t(q, nbytes);
- assert(q[SST] == (uchar)api);
+ assert(q[SST] == (uchar)api->api_id);
for (i = 1; i < SST; ++i)
assert(q[SST + i] == FORBIDDENBYTE);
q += 2*SST;
+
tail = q + nbytes;
memset(tail, FORBIDDENBYTE, SST);
write_size_t(tail + SST, serialno);
@@ -1588,8 +1779,8 @@
* and call Py_FatalError to kill the program.
* The API id, is also checked.
*/
- void
-_PyObject_DebugCheckAddressApi(char api, const void *p)
+static void
+_PyMem_DebugCheckAddress(char api, const void *p)
{
const uchar *q = (const uchar *)p;
char msgbuf[64];
@@ -1935,3 +2126,44 @@
arenas[arenaindex_temp].address != 0;
}
#endif
+
+
+#if defined(WITH_PYMALLOC) && defined(PYMALLOC_DEBUG)
+/* Dummy functions only present to keep the same ABI with the vanilla Python
+ compiled in debug mode: they are not used in practice. See issue:
+ https://github.com/haypo/pytracemalloc/issues/1 */
+
+void* _PyMem_DebugMalloc(size_t nbytes)
+{ return PyMem_RawMalloc(nbytes); }
+
+void* _PyMem_DebugRealloc(void *p, size_t nbytes)
+{ return PyMem_RawRealloc(p, nbytes); }
+
+void _PyObject_DebugFree(void *p)
+{ return PyObject_Free(p); }
+
+void* _PyObject_DebugMalloc(size_t nbytes)
+{ return PyObject_Malloc(nbytes); }
+
+void* _PyObject_DebugRealloc(void *p, size_t nbytes)
+{ return PyObject_Realloc(p, nbytes); }
+
+void _PyMem_DebugFree(void *p)
+{ PyMem_RawFree(p); }
+
+void _PyObject_DebugCheckAddress(const void *p)
+{}
+
+void * _PyObject_DebugMallocApi(char api, size_t nbytes)
+{ return PyObject_Malloc(nbytes); }
+
+void * _PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
+{ return PyObject_Realloc(p, nbytes); }
+
+void _PyObject_DebugFreeApi(char api, void *p)
+{ return PyObject_Free(p); }
+
+void _PyObject_DebugCheckAddressApi(char api, const void *p)
+{}
+#endif
+
diff -urN Python-2.7.10.ORIG/Python/pythonrun.c Python-2.7.10/Python/pythonrun.c
--- Python-2.7.10.ORIG/Python/pythonrun.c 2015-05-24 01:09:24.000000000 +0900
+++ Python-2.7.10/Python/pythonrun.c 2015-10-13 17:31:13.771317208 +0900
@@ -137,6 +137,41 @@
return flag;
}
+static void
+inittracemalloc(void)
+{
+ PyObject *mod = NULL, *res = NULL;
+ char *p, *endptr;
+ long nframe;
+
+ p = Py_GETENV("PYTHONTRACEMALLOC");
+ if (p == NULL || *p == '\0')
+ return;
+
+ endptr = p;
+ nframe = strtol(p, &endptr, 10);
+ if (*endptr != '\0' || nframe < 1 || nframe > 100000)
+ Py_FatalError("PYTHONTRACEMALLOC: invalid number of frames");
+
+ mod = PyImport_ImportModule("_tracemalloc");
+ if (mod == NULL)
+ goto error;
+
+ res = PyObject_CallMethod(mod, "start", "i", (int)nframe);
+ if (res == NULL)
+ goto error;
+
+ goto done;
+
+error:
+ fprintf(stderr, "failed to start tracemalloc:\n");
+ PyErr_Print();
+
+done:
+ Py_XDECREF(mod);
+ Py_XDECREF(res);
+}
+
void
Py_InitializeEx(int install_sigs)
{
@@ -266,6 +301,8 @@
_PyGILState_Init(interp, tstate);
#endif /* WITH_THREAD */
+ inittracemalloc();
+
if (!Py_NoSiteFlag)
initsite(); /* Module site */
[buildout]
extends =
../libyaml/buildout.cfg
[python-PyYAML]
recipe = zc.recipe.egg:custom
egg = PyYAML
rpath =
${libyaml:location}/lib/
include-dirs =
${libyaml:location}/include
library-dirs =
${libyaml:location}/lib
...@@ -4,10 +4,10 @@ parts = python-setuptools ...@@ -4,10 +4,10 @@ parts = python-setuptools
[setuptools-download] [setuptools-download]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
download-only = true download-only = true
package_suffix = setuptools-1.4.2 package_suffix = setuptools-18.4
filename = ${:package_suffix}.tar.gz filename = ${:package_suffix}.tar.gz
url = https://pypi.python.org/packages/source/s/setuptools/${:filename} url = https://pypi.python.org/packages/source/s/setuptools/${:filename}
md5sum = 13951be6711438073fbe50843e7f141f md5sum = 214c6c43bd7035e870c1beab402c48e7
mode = 0644 mode = 0644
[python-setuptools] [python-setuptools]
......
[buildout]
parts =
python-slip-egg
[python-slip]
recipe = slapos.recipe.cmmi
url = https://fedorahosted.org/released/python-slip/python-slip-0.6.1.tar.bz2
md5sum = a6d8ee96245fc21785d4c1c062c85f2f
configure-command = true
make-targets =
make-binary =
make all
cp -ax . ${:slip}/
cp -ax . ${:slip.dbus}/
cp -ax . ${:slip.gtk}/
sed -i '/setup(name="slip.dbus"/,/"gtk", "pango"])/d' ${:slip}/setup.py
sed -i '/setup(name="slip"/,/selinux"])/d' ${:slip.dbus}/setup.py
sed -i '/if sys.version_info.major/,/"gtk", "pango"])/d' ${:slip.dbus}/setup.py
sed -i '/setup(name="slip"/,/xml.etree.ElementTree"])/d' ${:slip.gtk}/setup.py
slip = ${buildout:parts-directory}/slip
slip.dbus = ${buildout:parts-directory}/slip.dbus
slip.gtk = ${buildout:parts-directory}/slip.gtk
[slip.gtk-develop]
recipe = zc.recipe.egg:develop
setup = ${python-slip:slip.gtk}
egg-name = slip.gtk
[slip.dbus-develop]
recipe = zc.recipe.egg:develop
setup = ${python-slip:slip.dbus}
egg-name = slip.dbus
[slip-develop]
recipe = zc.recipe.egg:develop
setup = ${python-slip:slip}
egg-name = slip
[python-slip-egg]
recipe = zc.recipe.egg
eggs =
${slip-develop:egg-name}
${slip.dbus-develop:egg-name}
${slip.gtk-develop:egg-name}
...@@ -15,8 +15,8 @@ extends = ...@@ -15,8 +15,8 @@ extends =
[kvm] [kvm]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
# qemu-kvm and qemu are now the same since 1.3. # qemu-kvm and qemu are now the same since 1.3.
url = http://wiki.qemu-project.org/download/qemu-2.2.1.tar.bz2 url = http://wiki.qemu-project.org/download/qemu-2.4.0.tar.bz2
md5sum = 833ff4457062456d38d6567f802ffef4 md5sum = 186ee8194140a484a455f8e3c74589f4
configure-options = configure-options =
--target-list="$(uname -m 2>/dev/null|sed 's,^i[456]86$,i386,')-softmmu" --target-list="$(uname -m 2>/dev/null|sed 's,^i[456]86$,i386,')-softmmu"
--enable-system --enable-system
...@@ -29,9 +29,9 @@ configure-options = ...@@ -29,9 +29,9 @@ configure-options =
--disable-curl --disable-curl
--enable-kvm --enable-kvm
--disable-docs --disable-docs
--enable-vnc
--enable-vnc-png --enable-vnc-png
--disable-vnc-jpeg --disable-vnc-jpeg
--enable-vnc-ws
--extra-cflags="-I${gnutls:location}/include -I${libuuid:location}/include -I${zlib:location}/include -I${libpng:location}/include" --extra-cflags="-I${gnutls:location}/include -I${libuuid:location}/include -I${zlib:location}/include -I${libpng:location}/include"
--extra-ldflags="-Wl,-rpath -Wl,${glib:location}/lib -L${glib:location}/lib -Wl,-rpath -Wl,${gnutls:location}/lib -L${gnutls:location}/lib -Wl,-rpath -Wl,${gpg-error:location}/lib -L${gpg-error:location}/lib -L${gettext:location}/lib -Wl,-rpath -Wl,${gettext:location}/lib -Wl,-rpath -Wl,${libpng:location}/lib -L${libpng:location}/lib -L${libuuid:location}/lib -Wl,-rpath -Wl,${libuuid:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -lpng -lz -lgnutls" --extra-ldflags="-Wl,-rpath -Wl,${glib:location}/lib -L${glib:location}/lib -Wl,-rpath -Wl,${gnutls:location}/lib -L${gnutls:location}/lib -Wl,-rpath -Wl,${gpg-error:location}/lib -L${gpg-error:location}/lib -L${gettext:location}/lib -Wl,-rpath -Wl,${gettext:location}/lib -Wl,-rpath -Wl,${libpng:location}/lib -L${libpng:location}/lib -L${libuuid:location}/lib -Wl,-rpath -Wl,${libuuid:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -lpng -lz -lgnutls"
--disable-werror --disable-werror
...@@ -43,9 +43,9 @@ environment = ...@@ -43,9 +43,9 @@ environment =
[debian-amd64-netinst.iso] [debian-amd64-netinst.iso]
# Download the installer of Debian 8 (Jessie) # Download the installer of Debian 8 (Jessie)
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = http://cdimage.debian.org/debian-cd/8.1.0/amd64/iso-cd/debian-8.1.0-amd64-netinst.iso url = http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso
filename = ${:_buildout_section_name_} filename = ${:_buildout_section_name_}
md5sum = 1a311f9afb68d6365211b13b4342c40b md5sum = 762eb3dfc22f85faf659001ebf270b4f
download-only = true download-only = true
mode = 0644 mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
...@@ -9,12 +9,14 @@ extends = ...@@ -9,12 +9,14 @@ extends =
../sqlite3/buildout.cfg ../sqlite3/buildout.cfg
../swig/buildout.cfg ../swig/buildout.cfg
../patch/buildout.cfg ../patch/buildout.cfg
../firewalld/buildout.cfg
parts = parts =
slapos slapos
cfg-environment cfg-environment
sh-environment sh-environment
py py
firewalld-patch
...@@ -76,14 +78,16 @@ rpath = ...@@ -76,14 +78,16 @@ rpath =
############################################# #############################################
[slapos] [slapos]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg}
${python-cffi:egg} ${python-cffi:egg}
${python-PyYAML:egg}
${python-cliff:egg}
${python-cryptography:egg} ${python-cryptography:egg}
pyOpenSSL pyOpenSSL
slapos.libnetworkcache slapos.libnetworkcache
zc.buildout zc.buildout
${lxml-python:egg}
slapos.core slapos.core
initialization = initialization =
......
...@@ -20,13 +20,15 @@ patch-options = ...@@ -20,13 +20,15 @@ patch-options =
patches = patches =
${:_profile_base_location_}/tesseract-3.00-gcc-4.7-build.patch#ca80db3ec489c547b03f3ee48879c1b1 ${:_profile_base_location_}/tesseract-3.00-gcc-4.7-build.patch#ca80db3ec489c547b03f3ee48879c1b1
${:_profile_base_location_}/tesseract-3.01-remove-bom.patch#2e691858cb492b7c17d23bf0912b3d24 ${:_profile_base_location_}/tesseract-3.01-remove-bom.patch#2e691858cb492b7c17d23bf0912b3d24
configure-command = pre-configure =
libtoolize -f -c libtoolize -f -c
aclocal -I ${libtool:location}/share/aclocal -I config aclocal -I ${libtool:location}/share/aclocal -I config
autoheader -f autoheader -f
automake -c -a -f automake -c -a -f
autoconf -Wno-portability autoconf -Wno-portability
./configure --prefix=${buildout:parts-directory}/${:_buildout_section_name_} --disable-static --datarootdir=${tesseract-eng-traineddata:location} configure-options =
--disable-static
--datarootdir=${tesseract-eng-traineddata:location}
# XXX: tesseract seems not easily configurable at runtime about where to find # XXX: tesseract seems not easily configurable at runtime about where to find
# its trained data, so we set its datarootdir above to a controlled location # its trained data, so we set its datarootdir above to a controlled location
......
[buildout] [buildout]
extends = extends =
../../component/lua/buildout.cfg ../../component/lua/buildout.cfg
../../component/hwloc/buildout.cfg
../../component/pkgconfig/buildout.cfg ../../component/pkgconfig/buildout.cfg
../../component/libtool/buildout.cfg ../../component/libtool/buildout.cfg
../../component/make/buildout.cfg ../../component/make/buildout.cfg
...@@ -23,7 +22,6 @@ recipe = slapos.recipe.cmmi ...@@ -23,7 +22,6 @@ recipe = slapos.recipe.cmmi
url = http://apache.claz.org/trafficserver/trafficserver-4.2.3.tar.bz2 url = http://apache.claz.org/trafficserver/trafficserver-4.2.3.tar.bz2
md5sum = 1d06a6e9063ceea3f19dbb84752ec710 md5sum = 1d06a6e9063ceea3f19dbb84752ec710
configure-options = configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-openssl=${openssl:location} --with-openssl=${openssl:location}
--with-xml=libxml2 --with-xml=libxml2
--with-libxml2=${libxml2:location} --with-libxml2=${libxml2:location}
......
...@@ -12,7 +12,7 @@ location = ${userhosts-get:location}/userhosts ...@@ -12,7 +12,7 @@ location = ${userhosts-get:location}/userhosts
[userhosts-get] [userhosts-get]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/userhosts.git repository = https://lab.nexedi.com/nexedi/userhosts.git
revision = d3080ad4b82c91dc14fd2ad2a8e9b2512e600c2a revision = d3080ad4b82c91dc14fd2ad2a8e9b2512e600c2a
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
location = ${buildout:parts-directory}/userhosts location = ${buildout:parts-directory}/userhosts
...@@ -24,7 +24,7 @@ PATH = ${git:location}/bin:%(PATH)s ...@@ -24,7 +24,7 @@ PATH = ${git:location}/bin:%(PATH)s
[wendelin.core-repository] [wendelin.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/wendelin.core.git repository = https://lab.nexedi.com/nexedi/wendelin.core.git
# dir is pretty name as top-level -dev recipe # dir is pretty name as top-level -dev recipe
location = ${buildout:parts-directory}/wendelin.core-dev location = ${buildout:parts-directory}/wendelin.core-dev
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -274,8 +274,8 @@ environment = ...@@ -274,8 +274,8 @@ environment =
[pixman] [pixman]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://xorg.freedesktop.org/archive/individual/lib/pixman-0.33.2.tar.bz2 url = http://xorg.freedesktop.org/archive/individual/lib/pixman-0.32.8.tar.bz2
md5sum = 837f48ecedb96f2d558f0d5763e9447b md5sum = 18d6b62abdb7bc0f8e6b0ddf48986b2c
configure-options = configure-options =
--disable-static --disable-static
......
...@@ -49,6 +49,11 @@ httpd_port = %(httpd-port)s ...@@ -49,6 +49,11 @@ httpd_port = %(httpd-port)s
netcat_bin = '%(netcat-binary)s'.strip() netcat_bin = '%(netcat-binary)s'.strip()
cluster_doc_host = '%(cluster-doc-host)s' cluster_doc_host = '%(cluster-doc-host)s'
cluster_doc_port = %(cluster-doc-port)s cluster_doc_port = %(cluster-doc-port)s
language = '%(language)s'
language_list = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
'fo', 'fr', 'fr-be', 'fr-ca', 'fr-ch', 'hr', 'hu', 'is', 'it', 'ja', 'lt',
'lv', 'mk', 'nl', 'nl-be', 'no', 'pl', 'pt', 'pt-br', 'ru', 'sl', 'sv',
'th', 'tr']
def md5Checksum(file_path): def md5Checksum(file_path):
with open(file_path, 'rb') as fh: with open(file_path, 'rb') as fh:
...@@ -246,6 +251,8 @@ if tap_network_parameter == [] and nat_network_parameter == []: ...@@ -246,6 +251,8 @@ if tap_network_parameter == [] and nat_network_parameter == []:
print 'Warning : No network interface defined.' print 'Warning : No network interface defined.'
else: else:
kvm_argument_list += nat_network_parameter + tap_network_parameter kvm_argument_list += nat_network_parameter + tap_network_parameter
if language in language_list:
kvm_argument_list.extend(['-k', language])
for disk in additional_disk_list: for disk in additional_disk_list:
kvm_argument_list.extend([ kvm_argument_list.extend([
......
...@@ -33,7 +33,7 @@ class Recipe(GenericBaseRecipe): ...@@ -33,7 +33,7 @@ class Recipe(GenericBaseRecipe):
def _options(self, options): def _options(self, options):
self.directory = options.copy() self.directory = options.copy()
del self.directory['recipe'] del self.directory['recipe']
self.mode = int(self.directory.pop('mode', '700'), 8) self.mode = int(self.directory.pop('mode', '0777'), 8)
def install(self): def install(self):
for path in sorted(self.directory.itervalues()): for path in sorted(self.directory.itervalues()):
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
from zc.buildout import UserError from zc.buildout import UserError
...@@ -50,6 +51,13 @@ class NeoBaseRecipe(GenericBaseRecipe): ...@@ -50,6 +51,13 @@ class NeoBaseRecipe(GenericBaseRecipe):
#'-n', options['name'], #'-n', options['name'],
'-c', options['cluster'], '-c', options['cluster'],
] ]
if options['ssl']:
etc = os.path.join(self.buildout['buildout']['directory'], 'etc', '')
option_list += (
'--ca', etc + 'ca.crt',
'--cert', etc + 'neo.crt',
'--key', etc + 'neo.key',
)
option_list.extend(self._getOptionList()) option_list.extend(self._getOptionList())
return [self.createPythonScript( return [self.createPythonScript(
options['wrapper'], options['wrapper'],
......
...@@ -65,7 +65,7 @@ class ServerHandler(SimpleHTTPRequestHandler): ...@@ -65,7 +65,7 @@ class ServerHandler(SimpleHTTPRequestHandler):
logging.info('Writing recieved content to file %s' % file_path) logging.info('Writing recieved content to file %s' % file_path)
try: try:
with open(file_path, method) as myfile: with open(file_path, method) as myfile:
myfile.write(content.decode('utf-8')) myfile.write(content)
logging.info('Done.') logging.info('Done.')
except IOError as e: except IOError as e:
logging.error('Something happened while processing \'writeFile\'. The message is %s' % logging.error('Something happened while processing \'writeFile\'. The message is %s' %
......
...@@ -26,7 +26,7 @@ git-executable = ${git:location}/bin/git ...@@ -26,7 +26,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = agent3 branch = agent3
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -54,7 +54,7 @@ md5sum = 7c5c43eb98d5a11961d72fce97a8e67b ...@@ -54,7 +54,7 @@ md5sum = 7c5c43eb98d5a11961d72fce97a8e67b
mode = 0644 mode = 0644
[script] [script]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
zc.buildout zc.buildout
slapos.core slapos.core
......
...@@ -73,7 +73,7 @@ md5sum = c5695762361b801c284ee23a150cd1f1 ...@@ -73,7 +73,7 @@ md5sum = c5695762361b801c284ee23a150cd1f1
mode = 0644 mode = 0644
[template-httpd-conf] [template-httpd-conf]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/${:filename} url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644 mode = 0644
filename = apache.conf.in filename = apache.conf.in
...@@ -86,6 +86,5 @@ numpy = 1.6.2 ...@@ -86,6 +86,5 @@ numpy = 1.6.2
# websockify 0.4.1 doesn't install well # websockify 0.4.1 doesn't install well
websockify = 0.3.0 websockify = 0.3.0
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
z3c.recipe.mkdir = 0.5 z3c.recipe.mkdir = 0.5
...@@ -5,35 +5,35 @@ extends = common.cfg ...@@ -5,35 +5,35 @@ extends = common.cfg
PyRSS2Gen = 1.1 PyRSS2Gen = 1.1
apache-libcloud = 0.18.0 apache-libcloud = 0.18.0
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
ecdsa = 0.13 ecdsa = 0.13
gitdb = 0.6.4 gitdb = 0.6.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pycrypto = 2.6.1 pycrypto = 2.6.1
rdiff-backup = 1.0.5
slapos.recipe.template = 2.8 slapos.recipe.template = 2.8
slapos.toolbox = 0.51 slapos.toolbox = 0.52
smmap = 0.9.0 smmap = 0.9.0
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
GitPython = 1.0.1 GitPython = 1.0.1
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
atomize = 0.2.0 atomize = 0.2.0
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
feedparser = 5.2.1 feedparser = 5.2.1
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
lockfile = 0.10.2 lockfile = 0.10.2
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.toolbox==0.51 # slapos.toolbox==0.52
rpdb = 0.1.5 rpdb = 0.1.5
...@@ -28,5 +28,4 @@ mode = 0644 ...@@ -28,5 +28,4 @@ mode = 0644
[versions] [versions]
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
...@@ -32,7 +32,7 @@ app-name = upper_case ...@@ -32,7 +32,7 @@ app-name = upper_case
version = 1.00 version = 1.00
[template-base] [template-base]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
download-only = true download-only = true
mode = 0644 mode = 0644
......
...@@ -78,7 +78,7 @@ app-name = upper_case ...@@ -78,7 +78,7 @@ app-name = upper_case
version = 1.00 version = 1.00
[template-base] [template-base]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
download-only = true download-only = true
mode = 0644 mode = 0644
...@@ -124,7 +124,7 @@ md5sum = 42985a425369e4f93211cfaad21d8eb8 ...@@ -124,7 +124,7 @@ md5sum = 42985a425369e4f93211cfaad21d8eb8
mode = 0644 mode = 0644
[description-file] [description-file]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
mode = 0644 mode = 0644
url = ${:_profile_base_location_}/condor_job/submit url = ${:_profile_base_location_}/condor_job/submit
filename = submit filename = submit
...@@ -132,7 +132,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_} ...@@ -132,7 +132,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
md5sum = 8180d88348b89b55216f8dd4475a9eea md5sum = 8180d88348b89b55216f8dd4475a9eea
[executable] [executable]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
mode = 0774 mode = 0774
url = ${:_profile_base_location_}/condor_job/simple url = ${:_profile_base_location_}/condor_job/simple
filename = simple filename = simple
......
...@@ -28,7 +28,7 @@ mode = 0644 ...@@ -28,7 +28,7 @@ mode = 0644
branch = request.product branch = request.product
[eggs] [eggs]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
collective.recipe.environment collective.recipe.environment
cns.recipe.symlink cns.recipe.symlink
......
...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git ...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git ...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -25,7 +25,7 @@ initialization = ...@@ -25,7 +25,7 @@ initialization =
${manpy:initialization} ${manpy:initialization}
[dream_interpreter] [dream_interpreter]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = ${manpy:eggs} eggs = ${manpy:eggs}
interpreter = dream_interpreter interpreter = dream_interpreter
initialization = initialization =
...@@ -51,12 +51,10 @@ tablib = 0.10.0 ...@@ -51,12 +51,10 @@ tablib = 0.10.0
MySQL-python = 1.2.5 MySQL-python = 1.2.5
# indirect dependancies # indirect dependancies
collective.recipe.template = 1.11
cp.recipe.cmd = 0.5 cp.recipe.cmd = 0.5
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.template = 2.7 slapos.recipe.template = 2.8
zope.exceptions = 4.0.7 zope.exceptions = 4.0.7
zope.testing = 4.1.3 zope.testing = 4.1.3
zc.recipe.testrunner = 2.0.0 zc.recipe.testrunner = 2.0.0
zope.testrunner = 4.4.6 zope.testrunner = 4.4.6
z3c.recipe.scripts = 1.0.1
...@@ -220,6 +220,13 @@ ...@@ -220,6 +220,13 @@
}, },
"storage-dict": { "storage-dict": {
"description": "Storage configuration. For NEO, 'logfile' is automatically set (see http://git.erp5.org/gitweb/neoppod.git/blob/HEAD:/neo/client/component.xml for other settings).", "description": "Storage configuration. For NEO, 'logfile' is automatically set (see http://git.erp5.org/gitweb/neoppod.git/blob/HEAD:/neo/client/component.xml for other settings).",
"properties": {
"ssl": {
"description": "For external NEO. Pass false if you want to disable SSL or pass custom values for ca/cert/key.",
"default": true,
"type": "boolean"
}
},
"additionalProperties": {"type": "string"}, "additionalProperties": {"type": "string"},
"type": "object" "type": "object"
} }
......
...@@ -63,7 +63,7 @@ output = ${buildout:directory}/template-etherpad-lite.cfg ...@@ -63,7 +63,7 @@ output = ${buildout:directory}/template-etherpad-lite.cfg
mode = 0644 mode = 0644
[template-conf] [template-conf]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/${:filename} url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644 mode = 0644
filename = settings.json.in filename = settings.json.in
...@@ -71,7 +71,7 @@ md5sum = 19ab39e6b3256c82fd54ce074488b136 ...@@ -71,7 +71,7 @@ md5sum = 19ab39e6b3256c82fd54ce074488b136
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template-run-script] [template-run-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/${:filename} url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644 mode = 0644
filename = run.sh.in filename = run.sh.in
......
...@@ -19,7 +19,7 @@ git-executable = ${git:location}/bin/git ...@@ -19,7 +19,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -19,7 +19,7 @@ git-executable = ${git:location}/bin/git ...@@ -19,7 +19,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -35,7 +35,7 @@ md5sum = 41cb6178f760238ca276854873ef9364 ...@@ -35,7 +35,7 @@ md5sum = 41cb6178f760238ca276854873ef9364
mode = 0644 mode = 0644
[template_nginx_conf] [template_nginx_conf]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/nginx_conf.in url = ${:_profile_base_location_}/templates/nginx_conf.in
md5sum = 61dc4c82bf48563228ce4dea6c5c6319 md5sum = 61dc4c82bf48563228ce4dea6c5c6319
filename = nginx_conf.in filename = nginx_conf.in
...@@ -43,7 +43,7 @@ mode = 0644 ...@@ -43,7 +43,7 @@ mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template_launcher] [template_launcher]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/launcher.in url = ${:_profile_base_location_}/templates/launcher.in
md5sum = acf5bb55ceac2e826259d28ed5c1de3a md5sum = acf5bb55ceac2e826259d28ed5c1de3a
filename = launcher.in filename = launcher.in
...@@ -51,7 +51,7 @@ mode = 0644 ...@@ -51,7 +51,7 @@ mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template_downloader] [template_downloader]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/downloader.in url = ${:_profile_base_location_}/templates/downloader.in
md5sum = 9779e2db6c73d282f802b3407b390ede md5sum = 9779e2db6c73d282f802b3407b390ede
filename = downloader.in filename = downloader.in
...@@ -59,7 +59,7 @@ mode = 0644 ...@@ -59,7 +59,7 @@ mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template_mime_types] [template_mime_types]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/mime_types.in url = ${:_profile_base_location_}/templates/mime_types.in
md5sum = 4ef94a7b458d885cd79ba0b930a5727e md5sum = 4ef94a7b458d885cd79ba0b930a5727e
filename = mime_types.in filename = mime_types.in
...@@ -75,7 +75,6 @@ rdiff-backup = 1.0.5 ...@@ -75,7 +75,6 @@ rdiff-backup = 1.0.5
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.40.4 slapos.toolbox = 0.40.4
smmap = 0.8.2 smmap = 0.8.2
z3c.recipe.scripts = 1.0.1
plone.recipe.command = 1.1 plone.recipe.command = 1.1
# Required by: # Required by:
...@@ -92,4 +91,4 @@ feedparser = 5.1.3 ...@@ -92,4 +91,4 @@ feedparser = 5.1.3
# Required by: # Required by:
# slapos.toolbox==0.40.2 # slapos.toolbox==0.40.2
paramiko = 1.15.2 paramiko = 1.15.3
...@@ -46,6 +46,5 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8 ...@@ -46,6 +46,5 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
[versions] [versions]
PyRSS2Gen = 1.1 PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.template = 2.7 slapos.recipe.template = 2.8
...@@ -43,7 +43,7 @@ parts = ...@@ -43,7 +43,7 @@ parts =
#XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu #XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu
[eggs] [eggs]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
websockify websockify
...@@ -98,7 +98,7 @@ mode = 0644 ...@@ -98,7 +98,7 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2 url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644 mode = 644
md5sum = 52e115fe1aaf232994af9037bf7c292c md5sum = 90309e9a1efe6d6b981a27f503c86277
download-only = true download-only = true
on-update = true on-update = true
...@@ -106,7 +106,7 @@ on-update = true ...@@ -106,7 +106,7 @@ on-update = true
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in
mode = 644 mode = 644
md5sum = 5700de1cadde0b5bede78f08e215f47a md5sum = 0e06ef2879454eee140fe00e167a01d5
download-only = true download-only = true
on-update = true on-update = true
...@@ -114,7 +114,7 @@ on-update = true ...@@ -114,7 +114,7 @@ on-update = true
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-resilient.cfg.jinja2 url = ${:_profile_base_location_}/instance-kvm-resilient.cfg.jinja2
mode = 644 mode = 644
md5sum = 7071b61a862ee681c2e4323e6435e98d md5sum = 450a50069f5617993ac8de47d533d653
download-only = true download-only = true
on-update = true on-update = true
......
...@@ -24,13 +24,13 @@ git-executable = ${git:location}/bin/git ...@@ -24,13 +24,13 @@ git-executable = ${git:location}/bin/git
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -54,4 +54,6 @@ command = ...@@ -54,4 +54,6 @@ command =
slapos.cookbook = slapos.cookbook =
slapos.core = slapos.core =
slapos.toolbox = slapos.toolbox =
erp5.util = erp5.util =
\ No newline at end of file # XXX Fix lockfile 0.11.0 requirement (pbr!=0.7,<1.0,>=0.6)
lockfile = 0.10.2
\ No newline at end of file
...@@ -122,6 +122,25 @@ ...@@ -122,6 +122,25 @@
}, },
"type": "object" "type": "object"
}, },
"fw-restricted-access": {
"title": "Restrict all access to VM with firewall.",
"description": "When Firewall is enabled, this parameter define if only vm of this cluster and authorized sources ip should have access to cluster.",
"type": "string",
"enum": ["on", "off"],
"default": "off"
},
"fw-authorized-sources": {
"title": "List of IP/Network address authorized to cluster.",
"description": "When Firewall is enabled, this contain the list of IP address to authorize for access to all VM of this cluster.",
"type": "array",
"optional": true
},
"fw-reject-sources": {
"title": "List of IP/Network address rejected, if 'Restrict all access' is off.",
"description": "When Firewall is enabled, this contain the list of IP address which should not access to all VM of this cluster.",
"type": "array",
"optional": true
},
"authorized-keys": { "authorized-keys": {
"title": "Public keys for virtual machines.", "title": "Public keys for virtual machines.",
"description": "Set the list of public keys to add in your virtual machine. The public key file will be available in the VM via url http://10.0.2.100/authorized_keys if you keep the NAT interface enabled", "description": "Set the list of public keys to add in your virtual machine. The public key file will be available in the VM via url http://10.0.2.100/authorized_keys if you keep the NAT interface enabled",
...@@ -198,6 +217,12 @@ ...@@ -198,6 +217,12 @@
"description": "Simulate a multi node NUMA system. If mem and cpus are omitted, resources are split equally. Each numa option are separated by space: node,nodeid=4,cpus=40-49,mem=64g node,nodeid=1,cpus=10-19,mem=128g. Set this option if you know what you're doing.", "description": "Simulate a multi node NUMA system. If mem and cpus are omitted, resources are split equally. Each numa option are separated by space: node,nodeid=4,cpus=40-49,mem=64g node,nodeid=1,cpus=10-19,mem=128g. Set this option if you know what you're doing.",
"type": "string" "type": "string"
}, },
"keyboard-layout-language": {
"title": "Use keyboard layout language",
"description": "Use keyboard layout language (for example fr for French). Can be usefull with VNC display",
"type": "string",
"enum": ["ar", "da", "de", "de-ch", "en-gb", "en-us", "es", "et", "fi", "fo", "fr", "fr-be", "fr-ca", "fr-ch", "hr", "hu", "is", "it", "ja", "lt", "lv", "mk", "nl", "nl-be", "no", "pl", "pt", "pt-br", "ru", "sl", "sv", "th", "tr"]
},
"nbd-host": { "nbd-host": {
"title": "NBD hostname or IP", "title": "NBD hostname or IP",
"description": "hostname (or IP) of the NBD server containing the boot image.", "description": "hostname (or IP) of the NBD server containing the boot image.",
......
...@@ -74,6 +74,13 @@ config-enable-monitor = True ...@@ -74,6 +74,13 @@ config-enable-monitor = True
config-document-host = ${apache-conf:ip} config-document-host = ${apache-conf:ip}
config-document-port = ${apache-conf:port} config-document-port = ${apache-conf:port}
config-document-path = ${hash-code:passwd} config-document-path = ${hash-code:passwd}
config-keyboard-layout-language = {{ dumps(kvm_parameter_dict.get('keyboard-layout-language', '')) }}
{% set authorized_source_list = slapparameter_dict.get('fw-authorized-sources', []) -%}
{% set rejected_source_list = slapparameter_dict.get('fw-reject-sources', []) -%}
sla-fw_authorized_sources = {{ authorized_source_list | join(' ') }}
sla-fw_rejected_sources = {{ rejected_source_list | join(' ') }}
sla-fw_restricted_access = {{ dumps(slapparameter_dict.get('fw-restricted-access', 'off')) }}
return = return =
backend-url backend-url
......
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
"description": "Simulate a multi node NUMA system. If mem and cpus are omitted, resources are split equally. Each numa option are separated by space: node,nodeid=4,cpus=40-49,mem=64g node,nodeid=1,cpus=10-19,mem=128g. Set this option if you know what you're doing.", "description": "Simulate a multi node NUMA system. If mem and cpus are omitted, resources are split equally. Each numa option are separated by space: node,nodeid=4,cpus=40-49,mem=64g node,nodeid=1,cpus=10-19,mem=128g. Set this option if you know what you're doing.",
"type": "string" "type": "string"
}, },
"keyboard-layout-language": {
"title": "Use keyboard layout language",
"description": "Use keyboard layout language (for example fr for French). Can be usefull with VNC display",
"type": "string",
"enum": ["ar", "da", "de", "de-ch", "en-gb", "en-us", "es", "et", "fi", "fo", "fr", "fr-be", "fr-ca", "fr-ch", "hr", "hu", "is", "it", "ja", "lt", "lv", "mk", "nl", "nl-be", "no", "pl", "pt", "pt-br", "ru", "sl", "sv", "th", "tr"]
},
"nbd-host": { "nbd-host": {
"title": "NBD hostname", "title": "NBD hostname",
......
...@@ -34,7 +34,7 @@ return = ...@@ -34,7 +34,7 @@ return =
# XXX: return ALL parameters (like nat rules), through jinja # XXX: return ALL parameters (like nat rules), through jinja
backend-url url ip backend-url url ip
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend-url = ${request-kvm:connection-backend-url} backend-url = ${request-kvm:connection-backend-url}
url = ${request-kvm:connection-url} url = ${request-kvm:connection-url}
......
...@@ -186,6 +186,7 @@ cluster-doc-host = ...@@ -186,6 +186,7 @@ cluster-doc-host =
cluster-doc-port = 0 cluster-doc-port = 0
{% endif -%} {% endif -%}
netcat-binary = {{ netcat_bin }} netcat-binary = {{ netcat_bin }}
language = ${slap-parameter:keyboard-layout-language}
[kvm-vnc-promise] [kvm-vnc-promise]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
...@@ -567,3 +568,6 @@ authorized-key = ...@@ -567,3 +568,6 @@ authorized-key =
# send some content which will be accessible to the vm through static url: http://10.0.2.100/data # send some content which will be accessible to the vm through static url: http://10.0.2.100/data
data-to-vm = data-to-vm =
# Change keyboard layout language
keyboard-layout-language =
#!/usr/bin/env python
# Parse Ansible result log file and and generate a report
import os, time
import json
import sqlite3
from datetime import datetime, timedelta
import sys
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr',
'response', 'status_code', 'url', 'dest']
class ansibleReport(object):
def __init__(self, db_path,
ansible_log_dir,
name):
self.db_path = db_path
self.ansible_log_dir = ansible_log_dir
self.name = name
self.result_OK = '127.0.0.1_OK'
self.result_failed = '127.0.0.1_FAILED'
self.result_failed_ignore = '127.0.0.1_FAILED_INGORED' # tipo in ansible log upload pluging
self.date_format = '%Y-%m-%d %H:%M:%S'
self.day_format = '%Y-%m-%d'
self._init_db()
def _init_db(self):
db = sqlite3.connect(self.db_path)
c = db.cursor()
c.executescript("""
CREATE TABLE IF NOT EXISTS ansible_report (
name VARCHAR(40),
reportdate VARCHAR(15),
createdate VARCHAR(15),
status VARCHAR(20),
success_count INTEGER,
ignored_count INTEGER,
failed_count INTEGER,
ignored TEXT,
failed TEXT,
success TEXT);
""")
db.commit()
db.close()
def connect_db(self):
db = sqlite3.connect(self.db_path)
return db
def insertEntryDb(self, table_name, data_dict):
db = self.connect_db()
columns = data_dict.keys()
entries = ', '.join(columns)
values = '?' + ', ?' * (len(columns)-1)
sql_string = "insert into %s(%s) values (%s)" % (
table_name, entries, values)
tuple_data = ()
for key in columns:
tuple_data += (data_dict[key],)
db.execute(sql_string, tuple_data)
db.commit()
db.close()
def selectEntriesDb(self, fields=[], start_date=None, limit=0, success=None, order='DESC', where=""):
db = self.connect_db()
entries = ', '.join(fields) if fields else '*'
query = "select %s from ansible_report " % entries
where = " and %s" % where if where else ""
if not start_date:
start_date = datetime.utcnow().strftime(self.day_format)
tuple_values = (start_date,)
if success is not None:
status = 'OK' if success else 'FAILLED'
query += "where createdate>=? and status=? %s order by createdate %s" % (where, order)
tuple_values += (status,)
else:
query += "where createdate>=? %s order by createdate %s" % (where, order)
if limit:
query += " limit ?"
tuple_values += (limit,)
rows = db.cursor().execute(query, tuple_values)
#db.close()
if rows:
return [list(row) for row in rows]
return []
def truncateEntriesDb(self, table_name, on_field, to_value, operator='<'):
db = self.connect_db()
query = "delete from %s where %s%s?" % (table_name, on_field,
operator)
db.execute(query, (to_value,))
db.commit()
db.close()
def getLogString(self, res, head=False):
log = ""
if type(res) == type(dict()):
log = '%s, args [%s]\n' % (res['invocation']['module_name'],
res['invocation']['module_args'])
if head:
return log
for field in FIELDS:
if field in res.keys():
# use default encoding, check out sys.setdefaultencoding
log += '\n{0}:\n{1}'.format(field, res[field])
return log
def _read_file(self, filepath):
content = '[]'
with open(filepath, 'r') as f:
content = f.read()
return content
def saveResult(self):
date = datetime.utcnow().strftime(self.date_format)
files_list = os.listdir(self.ansible_log_dir)
if not len(files_list):
return
to_date = (datetime.now() - timedelta(days=2)).strftime(self.date_format)
cmp_file = os.path.join(self.ansible_log_dir, files_list.pop())
modification_date = datetime.fromtimestamp(
os.path.getmtime(cmp_file)
).strftime(self.date_format)
# Get the latest insert date
result = self.selectEntriesDb(['reportdate'], start_date=to_date, limit=1)
if len(result):
latest_date = result[0][0]
if latest_date >= modification_date:
return
file_map = dict(
success_file=os.path.join(self.ansible_log_dir, self.result_OK),
failed_file=os.path.join(self.ansible_log_dir, self.result_failed),
ignored_file=os.path.join(self.ansible_log_dir, self.result_failed_ignore))
data = dict(name=self.name, status='FAILED',
reportdate=modification_date, createdate=date,
success_count=0, ignored_count=0,
failed_count=0, success="",
failed="", ignored="")
for category in ('failed', 'success', 'ignored'):
file_category = file_map['%s_file' % category]
if os.path.exists(file_category):
text_content = self._read_file(file_category)
count = len(json.loads(text_content))
if count > 0:
data['%s_count' % category] = count
data[category] = text_content
if data['failed_count'] == 0:
data['status'] = 'OK'
self.insertEntryDb('ansible_report', data)
def getAnsibleReport(self, start_date=None, limit=0, success=None, order='DESC', category=None, head=False, only_state=True):
"""Get one or many entries from the ansible report table.
"""
where = ""
get_content = category is not None
fields = ['name', 'reportdate', 'createdate', 'status', 'success_count',
'ignored_count', 'failed_count']
if category:
where = " %s_count>0" % category
if not only_state:
fields.append(category)
rows = self.selectEntriesDb(fields=fields, start_date=start_date,
limit=limit, success=success, order=order,
where=where)
result_dict = {}
if category and not only_state:
last_pos = len(fields) -1
for i in range (0, len(rows)):
message = ""
message_list = json.loads(rows[i][last_pos])
for msg in message_list:
message += '%s\n\n' % self.getLogString(msg, head=head)
rows[i][last_pos] = message
else:
return {}
return rows
if __name__ == "__main__":
json = """{
"status": "OK",
"message": "kvm-1: OK(114) FAILED(0) IGNORED(2)",
"description": "Ansible playbook report in kvm-1. Execution date is: 2015-08-28 17:42:01."
}"""
parameter_dict = json.loads(sys.argv[1])
with open(parameter_dict['status_path'], 'w') as status_file:
status_file.write(json)
\ No newline at end of file
...@@ -13,7 +13,6 @@ ecdsa = 0.13 ...@@ -13,7 +13,6 @@ ecdsa = 0.13
gitdb = 0.6.4 gitdb = 0.6.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pycrypto = 2.6.1 pycrypto = 2.6.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.7 slapos.recipe.template = 2.7
smmap = 0.9.0 smmap = 0.9.0
erp5.util = 0.4.43 erp5.util = 0.4.43
...@@ -45,7 +44,7 @@ numpy = 1.9.2 ...@@ -45,7 +44,7 @@ numpy = 1.9.2
# Required by: # Required by:
# slapos.toolbox==0.48 # slapos.toolbox==0.48
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.toolbox==0.48 # slapos.toolbox==0.48
......
...@@ -12,7 +12,7 @@ md5sum = Student may put here md5sum of this file, this is good idea ...@@ -12,7 +12,7 @@ md5sum = Student may put here md5sum of this file, this is good idea
strip-top-level-dir = true strip-top-level-dir = true
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/REPLACE_ME_BY_APPLICATION_TEMPLATE_NAME url = ${:_profile_base_location_}/template/REPLACE_ME_BY_APPLICATION_TEMPLATE_NAME
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
filename = template.in filename = template.in
......
...@@ -34,7 +34,7 @@ Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=A ...@@ -34,7 +34,7 @@ Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=A
Header set Access-Control-Allow-Credentials "true" Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" Header set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST"
Header set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" Header set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization"
Header set Access-Control-Expose-Headers "Content-Disposition, Content-Type, Content-Length, WWW-Authenticate, WWW-Logout, Location, Date, Last-Modified, ETag, Accept-Ranges, Content-Range"
# SSL Configuration # SSL Configuration
......
# DESTINATION
<match td.*.*>
type tdlog
apikey YOUR_API_KEY
auto_create_table
buffer_type file
buffer_path {{ fluentd_log_directory }}/td-agent/buffer/td
<secondary>
type file
path {{ fluentd_log_directory }}/failed_records
</secondary>
</match>
## match tag=debug.** and dump to console
<match debug.**>
type stdout
</match>
<source>
type tail
path {{ crawl_log_directory }}/*/*ping.log.20*
pos_file {{ crawl_log_directory }}/tail_in_ping.pos
tag slapos.monitor.networktest.ping.ipv4
format /^(?<time>[^;]*);(?<logtype>[^;]*);(?<computer_name>[^;]*);(?<type>[^;]*);(?<name_or_ip>[^;]*);(?<code>[^;]*);(?<average>[^;]*);(?<packet_lost>[^;]*);(?<extra>[^;]*)$/
read_from_head true
</source>
<source>
type tail
path {{ crawl_log_directory }}/*/*ping6.log.20*
pos_file {{ crawl_log_directory }}/tail_in_ping6.pos
tag slapos.monitor.networktest.ping.ipv6
format /^(?<time>[^;]*);(?<logtype>[^;]*);(?<computer_name>[^;]*);(?<type>[^;]*);(?<name_or_ip>[^;]*);(?<code>[^;]*);(?<average>[^;]*);(?<packet_lost>[^;]*);(?<extra>[^;]*)$/
read_from_head true
</source>
<match slapos.monitor.networktest.ping.*>
type copy
{% for slave_instance in slave_instance_list -%}
{% if slave_instance.get("ping_ip_list") -%}
<store>
type grep
regexp1 name_or_ip ^{{ slave_instance.get("ping_ip_list") }}$
add_tag_prefix {{ slave_instance.get("slave_reference") }}
</store>
{% endif -%}
{% if slave_instance.get("ping6_ip_list") -%}
<store>
type grep
regexp1 name_or_ip ^{{ slave_instance.get("ping6_ip_list") }}$
add_tag_prefix {{ slave_instance.get("slave_reference") }}
</store>
{% endif -%}
{% endfor -%}
</match>
{% for slave_instance in slave_instance_list -%}
<match {{ slave_instance.get("slave_reference") }}.slapos.monitor.networktest.ping.ipv6>
type file
path {{ network_user_logs }}/{{ slave_instance.get("slave_reference") }}/ping6/log
append true
include_time_key true
include_tag_key true
format json
</match>
<match {{ slave_instance.get("slave_reference") }}.slapos.monitor.networktest.ping.ipv4>
type file
path {{ network_user_logs }}/{{ slave_instance.get("slave_reference") }}/ping/log
append true
include_time_key true
include_tag_key true
format json
</match>
{% endfor -%}
<source>
type tail
path {{ network_user_logs }}/*/ping*/log/*.log
pos_file {{ crawl_log_directory }}/tail_in_ping6.pos
tag slapos.wendelin.networktest
format json
read_from_head true
</source>
{% set wendelin_streamtool_uri = slapparameter_dict.get('wendelin-streamtool-uri', '') -%}
{% set wendelin_password = slapparameter_dict.get('wendelin-password', '') -%}
{% set wendelin_user = slapparameter_dict.get('wendelin-user', '') -%}
{% if wendelin_streamtool_uri and wendelin_password and wendelin_user -%}
<match slapos.wendelin.networktest>
@type wendelin
@id wendelin_out
streamtool_uri {{ wendelin_streamtool_uri }}
user {{ wendelin_user }}
password {{ wendelin_password }}
buffer_type memory
flush_interval 20s
</match>
{% endif -%}
## SOURCE
<source>
type forward
</source>
## live debugging agent
<source>
type debug_agent
bind 127.0.0.1
port 24230
</source>
[buildout]
extends = {{ instance_base_monitor }}
parts +=
slave-test-configuration
[jinja2-template-base] [jinja2-template-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -20,15 +15,11 @@ extensions = jinja2.ext.do ...@@ -20,15 +15,11 @@ extensions = jinja2.ext.do
extra-context = extra-context =
section slave_information slap-parameter section slave_information slap-parameter
[monitor-directory]
network-user-logs = ${:private-directory}/network-user-logs/
{% for slave_instance in slave_instance_list -%}
user-log-{{ slave_instance.get('slave_reference') }}-folder = ${:private-directory}/network-user-logs/{{ slave_instance.get('slave_reference') }}
{% endfor -%}
{% set part_list = [] -%} {% set part_list = [] -%}
# Publish information for each slave # Publish information for each slave
{% set directory_list = [] -%}
{% for slave_instance in slave_instance_list -%} {% for slave_instance in slave_instance_list -%}
{% set publish_section_title = 'publish-%s' % slave_instance.get('slave_reference') -%} {% set publish_section_title = 'publish-%s' % slave_instance.get('slave_reference') -%}
{% do part_list.append(publish_section_title) -%} {% do part_list.append(publish_section_title) -%}
...@@ -39,8 +30,79 @@ log-access-url = ${monitor-frontend:connection-site_url}/{{ slave_instance.get(' ...@@ -39,8 +30,79 @@ log-access-url = ${monitor-frontend:connection-site_url}/{{ slave_instance.get('
log-access-url-v6 = ${monitor-parameters:url}/{{ slave_instance.get('slave_reference') }} log-access-url-v6 = ${monitor-parameters:url}/{{ slave_instance.get('slave_reference') }}
{% endfor %} {% endfor %}
{% set data_source_dict = slapparameter_dict.get('data-source', None) -%}
{% set cron_min_count = 0 -%}
{% if data_source_dict %}
{% for entry in data_source_dict -%}
{% set cron_min_count = cron_min_count + 1 -%}
{% set cron_min = cron_min_count%60 -%}
{% do part_list.append('cron-crawl-' + entry) -%}
{% do directory_list.append(entry) -%}
[cron-crawl-{{ entry }}]
<= cron
recipe = slapos.cookbook:cron.d
name = cron-crawler-{{ entry }}
frequency = * * * * *
command = cd ${monitor-directory:crawl-log}/{{ entry }} && ${crawler-bin:wrapper-path} {{ data_source_dict.get(entry) }}
{% endfor %}
{% endif %}
[monitor-directory]
fluentd-log = ${:log}/fluentd
crawl-log = ${:srv}/crawlog
network-user-logs = ${:private-directory}/network-user-logs/
{% for slave_instance in slave_instance_list -%}
user-log-{{ slave_instance.get('slave_reference') }}-folder = ${:private-directory}/network-user-logs/{{ slave_instance.get('slave_reference') }}
user-log-{{ slave_instance.get('slave_reference') }}-ping-folder = ${:private-directory}/network-user-logs/{{ slave_instance.get('slave_reference') }}/ping
user-log-{{ slave_instance.get('slave_reference') }}-ping6-folder = ${:private-directory}/network-user-logs/{{ slave_instance.get('slave_reference') }}/ping6
{% endfor -%}
{% for directory in directory_list %}
{{ '%s = ${:crawl-log}/%s' % (directory, directory) }}
{% endfor %}
[crawler-bin]
recipe = slapos.cookbook:wrapper
command-line =
{{ wget_bin }} --no-check-certificate -l1 -r -nd --timestamp
wrapper-path = ${monitor-directory:bin}/log-crawler
parameters-extra = true
[buildout] [buildout]
extends = {{ instance_base_monitor }}
parts += parts +=
slave-test-configuration
fluentd-wrapper
{% for part in part_list %} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
{% endfor %} {% endfor %}
[fluentd-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ fluentd_location }}/bin/fluentd -l ${monitor-directory:log}/fluend.log -c ${fluentd-conf-configuration:rendered}
wrapper-path = ${monitor-directory:service}/fluentd
environment =
GEM_PATH={{ fluentd_location }}/lib/ruby/gems/1.8/
[fluentd-conf-configuration]
recipe = slapos.recipe.template:jinja2
template = {{ fluent_conf_output }}
rendered = ${monitor-directory:etc}/fluentd.cfg
mode = 0744
context =
key slapparameter_dict slap-configuration:configuration
key slave_instance_list slap-parameters:slave-instance-list
key fluentd_log_directory monitor-directory:fluentd-log
key crawl_log_directory monitor-directory:crawl-log
key network_user_logs monitor-directory:network-user-logs
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
...@@ -19,8 +19,8 @@ context = key buildout buildout:bin-directory ...@@ -19,8 +19,8 @@ context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key monitor_template_output slap-configuration:monitor_template_output raw monitor_template_output ${monitor-template:output}
key network_benck_cfg_output slap-configuration:network_benck_cfg_output raw network_benck_cfg_output ${network-bench-cfg:output}
mode = 0644 mode = 0644
[instance-base-distributor] [instance-base-distributor]
...@@ -35,16 +35,16 @@ context = import json_module json ...@@ -35,16 +35,16 @@ context = import json_module json
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key instance_base_monitor instance-base-monitor:rendered key instance_base_monitor instance-base-monitor:rendered
key slave_instance_list slap-configuration:slave-instance-list key slave_instance_list slap-configuration:slave-instance-list
key template_json_distributor_test slap-configuration:json_test_template raw template_json_distributor_test ${json-test-template:destination}
raw fluent_conf_output ${fluentd-agent-conf:output}
raw fluentd_location ${fluentd:location}
raw wget_bin ${wget:location}/bin/wget
mode = 0644 mode = 0644
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id} computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id} partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url} url = $${slap-connection:server-url}
key = $${slap-connection:key-file} key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file} cert = $${slap-connection:cert-file}
monitor_template_output = ${monitor-template:output}
network_benck_cfg_output = ${network-bench-cfg:output}
json_test_template = ${json-test-template:destination}
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
extends = extends =
../../component/pycurl/buildout.cfg ../../component/pycurl/buildout.cfg
../../component/wget/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../component/fluentd/buildout.cfg ../../component/fluentd/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
parts = parts =
wget
slapos-cookbook slapos-cookbook
slapos-toolbox slapos-toolbox
network-bench-cfg network-bench-cfg
...@@ -16,26 +18,27 @@ parts = ...@@ -16,26 +18,27 @@ parts =
template-monitor template-monitor
eggs eggs
fluentd fluentd
fluentd-agent-conf
[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
md5sum = 9225d232336515091191146cd34f30b9 md5sum = b38c5da7dd4165154a8817f76015e374
mode = 0644 mode = 0644
[template-monitor] [template-monitor]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2 url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2
destination = ${buildout:directory}/template-monitor.cfg destination = ${buildout:directory}/template-monitor.cfg
md5sum = 810ed8199682068e27b62659d7fa101f md5sum = 810ed8199682068e27b62659d7fa101f
mode = 0644 mode = 0644
[template-monitor-distributor] [template-monitor-distributor]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-monitor-distributor.cfg.jinja2 url = ${:_profile_base_location_}/instance-monitor-distributor.cfg.jinja2
destination = ${buildout:directory}/template-monitor-distributor.cfg destination = ${buildout:directory}/template-monitor-distributor.cfg
md5sum = c012cf53a3f66c319db2a5d8226fa627 md5sum = d1253cf11c2b335b8bec5807e821d537
mode = 0644 mode = 0644
[json-test-template] [json-test-template]
...@@ -53,7 +56,7 @@ md5sum = 876f18b159fbd9325332d0f42e9172ac ...@@ -53,7 +56,7 @@ md5sum = 876f18b159fbd9325332d0f42e9172ac
[monitor-httpd-template] [monitor-httpd-template]
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
md5sum = 25b5bfc7f9c2891c4a0923d6e08568a8 md5sum = 22133e9aa5f52d7818b2fd1fd0415a00
[network-bench-cfg] [network-bench-cfg]
recipe = slapos.recipe.template recipe = slapos.recipe.template
...@@ -62,6 +65,13 @@ md5sum = cfcbf2002b8eff5153e2bf68ed24b720 ...@@ -62,6 +65,13 @@ md5sum = cfcbf2002b8eff5153e2bf68ed24b720
output = ${buildout:directory}/template-network-bench-cfg.in output = ${buildout:directory}/template-network-bench-cfg.in
mode = 0644 mode = 0644
[fluentd-agent-conf]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/fluentd-agent.conf.jinja2.in
md5sum = c9da9f22a1cd1fedcf7d659cba916400
output = ${buildout:directory}/fluentd-agent.conf.jinja2.in
mode = 0644
[slapos-toolbox] [slapos-toolbox]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
...@@ -73,8 +83,13 @@ scripts = ...@@ -73,8 +83,13 @@ scripts =
networkbench networkbench
onetimedownload onetimedownload
[fluentd]
gems +=
fluent-plugin-wendelin==0.1.alpha1
fluent-plugin-grep==0.3.4
[eggs] [eggs]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
cns.recipe.symlink cns.recipe.symlink
slapos.cookbook slapos.cookbook
...@@ -87,7 +102,6 @@ PyRSS2Gen = 1.1 ...@@ -87,7 +102,6 @@ PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.template = 2.7 slapos.recipe.template = 2.7
z3c.recipe.scripts = 1.0.1
rubygemsrecipe = 0.2.1 rubygemsrecipe = 0.2.1
pycurl = 7.19.5.1 pycurl = 7.19.5.1
...@@ -112,7 +126,7 @@ feedparser = 5.1.3 ...@@ -112,7 +126,7 @@ feedparser = 5.1.3
# Required by: # Required by:
# slapos.toolbox==0.52 # slapos.toolbox==0.52
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.toolbox==0.52 # slapos.toolbox==0.52
...@@ -122,4 +136,3 @@ lockfile = 0.10.2 ...@@ -122,4 +136,3 @@ lockfile = 0.10.2
# slapos.toolbox==0.52 # slapos.toolbox==0.52
rpdb = 0.1.5 rpdb = 0.1.5
...@@ -10,6 +10,7 @@ wrapper = ${directory:etc_run}/neoadmin ...@@ -10,6 +10,7 @@ wrapper = ${directory:etc_run}/neoadmin
logfile = ${directory:log}/neoadmin.log logfile = ${directory:log}/neoadmin.log
ip = ${publish:ip} ip = ${publish:ip}
port = ${publish:port-admin} port = ${publish:port-admin}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }} cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters = ${publish:masters} masters = ${publish:masters}
......
...@@ -35,6 +35,20 @@ ...@@ -35,6 +35,20 @@
}, },
"type": "object" "type": "object"
}, },
"ssl": {
"description": "Enable SSL. All nodes look for 3 files in ~/etc: ca.crt, neo.crt, neo.key. Waiting that SlapOS provides a way to manage certificates, the user must deploy them manually, or use the temporary _ca/_cert/_key parameters.",
"default": true,
"type": "boolean"
},
"_ca": {
"type": "string"
},
"_cert": {
"type": "string"
},
"_key": {
"type": "string"
},
"node-list": { "node-list": {
"description": "List of dictionaries containing parameters for each node.", "description": "List of dictionaries containing parameters for each node.",
"items": { "items": {
......
...@@ -10,6 +10,7 @@ wrapper = ${directory:etc_run}/neomaster ...@@ -10,6 +10,7 @@ wrapper = ${directory:etc_run}/neomaster
logfile = ${directory:log}/neomaster.log logfile = ${directory:log}/neomaster.log
ip = ${publish:ip} ip = ${publish:ip}
port = ${publish:port-master} port = ${publish:port-master}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }} cluster = {{ dumps(slapparameter_dict['cluster']) }}
partitions = {{ slapparameter_dict['partitions'] }} partitions = {{ slapparameter_dict['partitions'] }}
replicas = {{ slapparameter_dict['replicas'] }} replicas = {{ slapparameter_dict['replicas'] }}
......
...@@ -41,7 +41,7 @@ context = section parameter_dict my-cnf-parameters ...@@ -41,7 +41,7 @@ context = section parameter_dict my-cnf-parameters
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
# TODO: make port a partition parameter # TODO: make port a partition parameter
ip = {{ (ipv4_set | list)[0] }} ip = {{ "[%s]" % list(ipv6_set)[0] if ipv6_set else list(ipv4_set)[0] }}
{% set admin = slapparameter_dict.get('admin', 2050) -%} {% set admin = slapparameter_dict.get('admin', 2050) -%}
{% set master = slapparameter_dict.get('master', 2051) -%} {% set master = slapparameter_dict.get('master', 2051) -%}
{% if master -%} {% if master -%}
...@@ -61,10 +61,26 @@ masters = {{ ' '.join(sorted(master_list)) }} ...@@ -61,10 +61,26 @@ masters = {{ ' '.join(sorted(master_list)) }}
admins = {{ ' '.join(sorted(admin_list)) }} admins = {{ ' '.join(sorted(admin_list)) }}
{%- endif %} {%- endif %}
{#- Hack to deploy SSL certs via instance parameters #}
{%- for name, pem in zip(('ca.crt', 'neo.crt', 'neo.key'),
slapparameter_dict['ssl']) %}
{%- if pem %}
[{{ section(name) }}]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/{{name}}
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = {{dumps(pem)}}
{%- endif %}
{%- endfor %}
{#- endhack #}
[neo-storage] [neo-storage]
recipe = slapos.cookbook:neoppod.storage recipe = slapos.cookbook:neoppod.storage
binary = {{ bin_directory }}/neostorage binary = {{ bin_directory }}/neostorage
ip = ${publish:ip} ip = ${publish:ip}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }} cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters = ${publish:masters} masters = ${publish:masters}
database-adapter = MySQL database-adapter = MySQL
......
...@@ -42,6 +42,11 @@ config-cluster = {{ parameter_dict['cluster'] }} ...@@ -42,6 +42,11 @@ config-cluster = {{ parameter_dict['cluster'] }}
{% set replicas = parameter_dict.get('replicas', 0) -%} {% set replicas = parameter_dict.get('replicas', 0) -%}
config-partitions = {{ dumps(parameter_dict.get('partitions', 12)) }} config-partitions = {{ dumps(parameter_dict.get('partitions', 12)) }}
config-replicas = {{ dumps(replicas) }} config-replicas = {{ dumps(replicas) }}
config-ssl = {{ dumps((
parameter_dict.get('_ca'),
parameter_dict.get('_cert'),
parameter_dict.get('_key'),
) if parameter_dict.get('ssl', 1) else ()) }}
config-upstream-cluster = {{ dumps(parameter_dict.get('upstream-cluster', '')) }} config-upstream-cluster = {{ dumps(parameter_dict.get('upstream-cluster', '')) }}
config-upstream-masters = {{ dumps(parameter_dict.get('upstream-masters', '')) }} config-upstream-masters = {{ dumps(parameter_dict.get('upstream-masters', '')) }}
software-type = {{ software_type }} software-type = {{ software_type }}
......
...@@ -13,27 +13,43 @@ extends = ...@@ -13,27 +13,43 @@ extends =
#LXML #LXML
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
#END LXML #END LXML
../../component/python-2.7/buildout.cfg
../../component/mariadb/buildout.cfg
../../component/mysql-python/buildout.cfg ../../component/mysql-python/buildout.cfg
../../component/pycrypto-python/buildout.cfg
parts = parts =
# keep neoppod first so that ZODB3 is built correctly,
# before any other section that would depend on it
neoppod-develop
neoppod
slapos-deps-eggs slapos-deps-eggs
slapos-cookbook-develop slapos-cookbook-develop
slapos-cookbook slapos-cookbook
# NEO & dependencies
python2.7
mariadb
mysql-python
neoppod
[slapos.cookbook-repository] [neoppod-repository]
branch = erp5-cluster recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/neoppod.git
git-executable = ${git:location}/bin/git
[neoppod-develop]
recipe = zc.recipe.egg:develop
setup = ${neoppod-repository:location}
[neoppod]
recipe = zc.recipe.egg
eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb]
${mysql-python:egg}
ZODB3
ZODB3-patches =
${:_profile_base_location_}/../../component/egg-patch/ZODB3-3.10.5.patch
ZODB3-patch-options = -p1
[slapos-deps-eggs] [slapos-deps-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${python-PyYAML:egg}
${pycrypto-python:egg}
${python-cliff:egg}
slapos.toolbox slapos.toolbox
scripts = scripts =
slapos-kill slapos-kill
...@@ -74,32 +90,41 @@ context = ...@@ -74,32 +90,41 @@ context =
[root-common] [root-common]
<= download-base-neo <= download-base-neo
md5sum = 26193dbb132d340c8ba919a616449a17 md5sum = f3259726bd5d824c569dc7db6b7d26a0
[instance-neo-admin] [instance-neo-admin]
<= download-base-neo <= download-base-neo
md5sum = 16d11f0fe74de06aebbadcff3527db1c md5sum = f030a25d320f2edf0186b69bfa521228
[instance-neo-master] [instance-neo-master]
<= download-base-neo <= download-base-neo
md5sum = 023f08763dbba2319f58e5c597f7761d md5sum = 82f3f76f54ee9db355966a7ada61f56e
[instance-neo-storage-mysql] [instance-neo-storage-mysql]
<= download-base-neo <= download-base-neo
md5sum = 5a61039c7a980e24519e1bbb1252e662 md5sum = 84b1150ce30ec827485f9c17debd6b44
[template-neo-my-cnf] [template-neo-my-cnf]
<= download-base-neo <= download-base-neo
url = ${:_profile_base_location_}/my.cnf.in url = ${:_profile_base_location_}/my.cnf.in
md5sum = febd3ed58043ce1367b86cf6e4e69700 md5sum = febd3ed58043ce1367b86cf6e4e69700
[neoppod]
recipe = zc.recipe.egg
eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb]
ZODB3
ZODB3-patches = ${:_profile_base_location_}/../../component/egg-patch/ZODB3-3.10.5.patch
ZODB3-patch-options = -p1
[versions] [versions]
# patched eggs MySQL-python = 1.2.5
slapos.recipe.template = 2.8
# patched egg
ZODB3 = 3.10.5+SlapOSPatched001 ZODB3 = 3.10.5+SlapOSPatched001
# Required by slapos.toolbox==0.52
slapos.toolbox = 0.52
apache-libcloud = 0.18.0
atomize = 0.2.0
ecdsa = 0.13
feedparser = 5.2.1
GitPython = 1.0.1
gitdb = 0.6.4
lockfile = 0.10.2
paramiko = 1.15.3
pycrypto = 2.6.1
rpdb = 0.1.5
smmap = 0.9.0
##
...@@ -20,3 +20,12 @@ context = ...@@ -20,3 +20,12 @@ context =
[cluster] [cluster]
<= download-base-neo <= download-base-neo
md5sum = ee8401a4e7d82bf488a57e3399f9ce48 md5sum = ee8401a4e7d82bf488a57e3399f9ce48
[versions]
# To match ERP5
transaction = 1.1.1
ZConfig = 2.9.1
zc.lockfile = 1.0.2
zdaemon = 2.0.7
zope.event = 3.5.2
##
...@@ -62,6 +62,5 @@ mode = 0644 ...@@ -62,6 +62,5 @@ mode = 0644
[versions] [versions]
PyRSS2Gen = 1.1 PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.template = 2.7 slapos.recipe.template = 2.8
...@@ -164,7 +164,7 @@ miniupnpc = 1.9 ...@@ -164,7 +164,7 @@ miniupnpc = 1.9
# Required by: # Required by:
# slapos.toolbox==0.47.3 # slapos.toolbox==0.47.3
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.toolbox==0.47.3 # slapos.toolbox==0.47.3
......
...@@ -52,7 +52,7 @@ context = ...@@ -52,7 +52,7 @@ context =
[slapos-configuration-file-template] [slapos-configuration-file-template]
# Download the template of slapos.cfg # Download the template of slapos.cfg
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/slapos.cfg.in url = ${:_profile_base_location_}/template/slapos.cfg.in
#md5sum = #md5sum =
target = ${buildout:directory}/slapos.cfg.in target = ${buildout:directory}/slapos.cfg.in
...@@ -61,7 +61,7 @@ mode = 0644 ...@@ -61,7 +61,7 @@ mode = 0644
[httpd-configuration-file-template] [httpd-configuration-file-template]
# Download the template of httpd.conf # Download the template of httpd.conf
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/httpd.conf.in url = ${:_profile_base_location_}/template/httpd.conf.in
mode = 0644 mode = 0644
#md5sum = #md5sum =
......
...@@ -11,5 +11,4 @@ extends = common.cfg ...@@ -11,5 +11,4 @@ extends = common.cfg
Pygments = 1.6 Pygments = 1.6
collective.recipe.environment = 0.2.0 collective.recipe.environment = 0.2.0
collective.recipe.template = 1.10 collective.recipe.template = 1.10
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.7 slapos.recipe.template = 2.7
...@@ -29,7 +29,7 @@ git-executable = ${git:location}/bin/git ...@@ -29,7 +29,7 @@ git-executable = ${git:location}/bin/git
[vifib] [vifib]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -50,23 +50,23 @@ repository = http://git.erp5.org/repos/slapos.git ...@@ -50,23 +50,23 @@ repository = http://git.erp5.org/repos/slapos.git
[slapos.core-repository] [slapos.core-repository]
<= git-clone-repository <= git-clone-repository
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
[slapos.package-repository] [slapos.package-repository]
<= git-clone-repository <= git-clone-repository
repository = http://git.erp5.org/repos/slapos.package.git repository = https://lab.nexedi.com/nexedi/slapos.package.git
[slapos.recipe.template-repository] [slapos.recipe.template-repository]
<= git-clone-repository <= git-clone-repository
repository = http://git.erp5.org/repos/slapos.recipe.template.git repository = https://lab.nexedi.com/nexedi/slapos.recipe.template.git
[slapos.recipe.build-repository] [slapos.recipe.build-repository]
<= git-clone-repository <= git-clone-repository
repository = http://git.erp5.org/repos/slapos.recipe.build.git repository = https://lab.nexedi.com/nexedi/slapos.recipe.build.git
[slapos.recipe.cmmi-repository] [slapos.recipe.cmmi-repository]
<= git-clone-repository <= git-clone-repository
repository = http://git.erp5.org/repos/slapos.recipe.cmmi.git repository = https://lab.nexedi.com/nexedi/slapos.recipe.cmmi.git
[erp5-util-repository] [erp5-util-repository]
<= git-clone-repository <= git-clone-repository
......
...@@ -88,7 +88,7 @@ md5sum = 994e355d713f90bcc17e4b54da65f354 ...@@ -88,7 +88,7 @@ md5sum = 994e355d713f90bcc17e4b54da65f354
mode = 0644 mode = 0644
[template-resilient] [template-resilient]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2 url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
md5sum = aa9a99235571729ab93360c4712efa12 md5sum = aa9a99235571729ab93360c4712efa12
filename = instance-resilient.cfg.jinja2 filename = instance-resilient.cfg.jinja2
...@@ -119,7 +119,7 @@ filename = httpd_conf.in ...@@ -119,7 +119,7 @@ filename = httpd_conf.in
mode = 0644 mode = 0644
[template_launcher] [template_launcher]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/launcher.in url = ${:_profile_base_location_}/launcher.in
md5sum = 525e37ea8b2acf6209869999b15071a6 md5sum = 525e37ea8b2acf6209869999b15071a6
filename = launcher.in filename = launcher.in
...@@ -190,7 +190,7 @@ filename = monitor-check-webrunner-internal-instances.py ...@@ -190,7 +190,7 @@ filename = monitor-check-webrunner-internal-instances.py
mode = 0644 mode = 0644
[eggs] [eggs]
recipe = z3c.recipe.scripts recipe = zc.recipe.egg
eggs = eggs =
collective.recipe.environment collective.recipe.environment
cns.recipe.symlink cns.recipe.symlink
......
...@@ -16,7 +16,7 @@ parts = ...@@ -16,7 +16,7 @@ parts =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = slaprunner-paas branch = slaprunner-paas
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
develop = true develop = true
...@@ -53,7 +53,7 @@ setup = ${erp5.util-repository:location} ...@@ -53,7 +53,7 @@ setup = ${erp5.util-repository:location}
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
develop = true develop = true
...@@ -67,3 +67,5 @@ setup = ${slapos.core-repository:location} ...@@ -67,3 +67,5 @@ setup = ${slapos.core-repository:location}
slapos.cookbook = slapos.cookbook =
slapos.core = slapos.core =
slapos.toolbox = slapos.toolbox =
# XXX Fix lockfile 0.11.0 requirement (pbr!=0.7,<1.0,>=0.6)
lockfile = 0.10.2
...@@ -12,15 +12,12 @@ PyRSS2Gen = 1.1 ...@@ -12,15 +12,12 @@ PyRSS2Gen = 1.1
apache-libcloud = 0.18.0 apache-libcloud = 0.18.0
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0 collective.recipe.environment = 0.2.0
collective.recipe.template = 1.12
ecdsa = 0.13 ecdsa = 0.13
erp5.util = 0.4.43 erp5.util = 0.4.43
gitdb = 0.6.4 gitdb = 0.6.4
gunicorn = 19.3.0 gunicorn = 19.3.0
plone.recipe.command = 1.1
prettytable = 0.7.2 prettytable = 0.7.2
pycrypto = 2.6.1 pycrypto = 2.6.1
slapos.recipe.download = 1.0.dev-r3447
slapos.recipe.template = 2.8 slapos.recipe.template = 2.8
slapos.toolbox = 0.52 slapos.toolbox = 0.52
smmap = 0.9.0 smmap = 0.9.0
...@@ -43,7 +40,7 @@ lockfile = 0.10.2 ...@@ -43,7 +40,7 @@ lockfile = 0.10.2
# Required by: # Required by:
# slapos.toolbox==0.52 # slapos.toolbox==0.52
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.toolbox==0.52 # slapos.toolbox==0.52
......
...@@ -69,7 +69,6 @@ download-cache = ...@@ -69,7 +69,6 @@ download-cache =
# Generate list of automatically chosen eggs version # Generate list of automatically chosen eggs version
extensions += extensions +=
buildout-versions buildout-versions
mr.developer
# Separate from site eggs # Separate from site eggs
allowed-eggs-from-site-packages = allowed-eggs-from-site-packages =
......
...@@ -16,7 +16,7 @@ extends = ...@@ -16,7 +16,7 @@ extends =
../../stack/lamp.cfg ../../stack/lamp.cfg
[mediawiki-patch] [mediawiki-patch]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/patch/mediawiki-1.17.0.config.patch url = ${:_profile_base_location_}/patch/mediawiki-1.17.0.config.patch
md5sum = fd606666ac9fc54cb84cda8cf08edef4 md5sum = fd606666ac9fc54cb84cda8cf08edef4
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
...@@ -62,7 +62,6 @@ meld3 = 0.6.7 ...@@ -62,7 +62,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -47,7 +47,6 @@ meld3 = 0.6.7 ...@@ -47,7 +47,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -27,7 +27,7 @@ md5sum = 42985a425369e4f93211cfaad21d8eb8 ...@@ -27,7 +27,7 @@ md5sum = 42985a425369e4f93211cfaad21d8eb8
mode = 0644 mode = 0644
[description-file] [description-file]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
mode = 0644 mode = 0644
url = ${:_profile_base_location_}/template/submit url = ${:_profile_base_location_}/template/submit
filename = submit filename = submit
...@@ -35,7 +35,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_} ...@@ -35,7 +35,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
md5sum = 8180d88348b89b55216f8dd4475a9eea md5sum = 8180d88348b89b55216f8dd4475a9eea
[executable] [executable]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
mode = 0774 mode = 0774
url = ${:_profile_base_location_}/template/simple url = ${:_profile_base_location_}/template/simple
filename = simple filename = simple
...@@ -60,7 +60,6 @@ pytz = 2013b ...@@ -60,7 +60,6 @@ pytz = 2013b
slapos.core = 0.35.1 slapos.core = 0.35.1
slapos.recipe.build = 0.11.6 slapos.recipe.build = 0.11.6
slapos.recipe.cmmi = 0.1.1 slapos.recipe.cmmi = 0.1.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
slapos.cookbook=0.78.1 slapos.cookbook=0.78.1
...@@ -91,4 +90,4 @@ unittest2 = 0.5.1 ...@@ -91,4 +90,4 @@ unittest2 = 0.5.1
# Required by: # Required by:
# slapos.core==0.35.1 # slapos.core==0.35.1
zope.interface = 4.0.5 zope.interface = 4.0.5
\ No newline at end of file
...@@ -18,7 +18,7 @@ url = http://freefr.dl.sourceforge.net/project/coppermine/Coppermine/1.5.x/cpg1. ...@@ -18,7 +18,7 @@ url = http://freefr.dl.sourceforge.net/project/coppermine/Coppermine/1.5.x/cpg1.
md5sum = 76402aea7821aaaf67c571869373186e md5sum = 76402aea7821aaaf67c571869373186e
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/coppermine.inc.php.in url = ${:_profile_base_location_}/template/coppermine.inc.php.in
md5sum = c97345b7f3c060b825e1925e2be3c2c1 md5sum = c97345b7f3c060b825e1925e2be3c2c1
filename = template.in filename = template.in
...@@ -57,7 +57,6 @@ meld3 = 0.6.7 ...@@ -57,7 +57,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -12,7 +12,7 @@ md5sum = a910ebb2fcca13c0337ed672304c4ad4 ...@@ -12,7 +12,7 @@ md5sum = a910ebb2fcca13c0337ed672304c4ad4
strip-top-level-dir = true strip-top-level-dir = true
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/mysql.conf.php.in url = ${:_profile_base_location_}/mysql.conf.php.in
md5sum = 11c6793aa8c5bf7151886d1670796a22 md5sum = 11c6793aa8c5bf7151886d1670796a22
download-only = True download-only = True
......
...@@ -18,7 +18,7 @@ url = http://download.dotclear.net/latest-2.0.tar.gz ...@@ -18,7 +18,7 @@ url = http://download.dotclear.net/latest-2.0.tar.gz
md5sum = 4ca12cbd12228ceee0b7c0f697e1ff09 md5sum = 4ca12cbd12228ceee0b7c0f697e1ff09
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/dotclear.inc.php.in url = ${:_profile_base_location_}/template/dotclear.inc.php.in
md5sum = c97345b7f3c060b825e1925e2be3c2c1 md5sum = c97345b7f3c060b825e1925e2be3c2c1
filename = template.in filename = template.in
...@@ -57,7 +57,6 @@ meld3 = 0.6.7 ...@@ -57,7 +57,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -18,7 +18,7 @@ url = http://downloads.sourceforge.net/project/dotproject/dotproject/dotProject% ...@@ -18,7 +18,7 @@ url = http://downloads.sourceforge.net/project/dotproject/dotproject/dotProject%
md5sum = d283fad3fc541e7ffda07151efc64bf8 md5sum = d283fad3fc541e7ffda07151efc64bf8
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/config.inc.php.in url = ${:_profile_base_location_}/template/config.inc.php.in
md5sum = b78545a6928978c5990021ac68e26be0 md5sum = b78545a6928978c5990021ac68e26be0
filename = template.in filename = template.in
...@@ -57,7 +57,6 @@ meld3 = 0.6.7 ...@@ -57,7 +57,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -24,7 +24,7 @@ recipe = cp.recipe.cmd ...@@ -24,7 +24,7 @@ recipe = cp.recipe.cmd
install_cmd = patch ${application:location}/modules/system/system.theme.css <${download-patch-hide-dbsetup:location}/${download-patch-hide-dbsetup:filename} install_cmd = patch ${application:location}/modules/system/system.theme.css <${download-patch-hide-dbsetup:location}/${download-patch-hide-dbsetup:filename}
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/settings.php.in url = ${:_profile_base_location_}/settings.php.in
md5sum = b0ef5548c3ac1de8ca56882e51e6eb6d md5sum = b0ef5548c3ac1de8ca56882e51e6eb6d
download-only = True download-only = True
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -11,7 +11,7 @@ md5sum = f3b15616e1111f0114b084cdaa0dc3cd ...@@ -11,7 +11,7 @@ md5sum = f3b15616e1111f0114b084cdaa0dc3cd
strip-top-level-dir = false strip-top-level-dir = false
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/config-form.php.in url = ${:_profile_base_location_}/config-form.php.in
md5sum = a32f1c8b14b8de2ecae40e71f710f384 md5sum = a32f1c8b14b8de2ecae40e71f710f384
download-only = True download-only = True
......
...@@ -24,7 +24,7 @@ url = ${:_profile_base_location_}/configure-fluxbb.py ...@@ -24,7 +24,7 @@ url = ${:_profile_base_location_}/configure-fluxbb.py
filename = configure-fluxbb.py filename = configure-fluxbb.py
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/config.inc.php.in url = ${:_profile_base_location_}/template/config.inc.php.in
filename = template.in filename = template.in
mode = 0644 mode = 0644
......
...@@ -11,7 +11,7 @@ md5sum = 3f9cfb11c09c457a0f0a8fa1563b45a7 ...@@ -11,7 +11,7 @@ md5sum = 3f9cfb11c09c457a0f0a8fa1563b45a7
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/dummy-config.php.in url = ${:_profile_base_location_}/dummy-config.php.in
md5sum = d41d8cd98f00b204e9800998ecf8427e md5sum = d41d8cd98f00b204e9800998ecf8427e
download-only = True download-only = True
......
...@@ -29,7 +29,7 @@ eggs = ...@@ -29,7 +29,7 @@ eggs =
slapos.toolbox slapos.toolbox
[watermarkadmin.ini.in] [watermarkadmin.ini.in]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/${:_buildout_section_name_} url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
md5sum = 2edc2acd102a465a0f21d8cd982ba4bf md5sum = 2edc2acd102a465a0f21d8cd982ba4bf
download-only = true download-only = true
...@@ -38,7 +38,7 @@ mode = 0644 ...@@ -38,7 +38,7 @@ mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[nginx.conf.in] [nginx.conf.in]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/${:_buildout_section_name_} url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
md5sum = 7e41dfcb633ce52be42457ffd5b123d8 md5sum = 7e41dfcb633ce52be42457ffd5b123d8
download-only = true download-only = true
......
...@@ -9,7 +9,7 @@ md5sum = 3aa7d7b58bfa4eec3c3724209894d14e ...@@ -9,7 +9,7 @@ md5sum = 3aa7d7b58bfa4eec3c3724209894d14e
strip-top-level-dir = false strip-top-level-dir = false
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/database.xml-in url = ${:_profile_base_location_}/database.xml-in
md5sum = 6ae063318a251b70ae7d037e3ae375d6 md5sum = 6ae063318a251b70ae7d037e3ae375d6
download-only = True download-only = True
......
...@@ -22,7 +22,7 @@ develop = ...@@ -22,7 +22,7 @@ develop =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -34,7 +34,7 @@ git-executable = ${git:location}/bin/git ...@@ -34,7 +34,7 @@ git-executable = ${git:location}/bin/git
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -14,7 +14,7 @@ extends = ...@@ -14,7 +14,7 @@ extends =
../../stack/lamp.cfg ../../stack/lamp.cfg
[lifetype-patch] [lifetype-patch]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/lifetype_for_mysql5.patch url = ${:_profile_base_location_}/lifetype_for_mysql5.patch
md5sum = c52bea61ea452b9f3caa82426a5819e5 md5sum = c52bea61ea452b9f3caa82426a5819e5
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
......
...@@ -28,7 +28,7 @@ develop = ...@@ -28,7 +28,7 @@ develop =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -40,13 +40,13 @@ git-executable = ${git:location}/bin/git ...@@ -40,13 +40,13 @@ git-executable = ${git:location}/bin/git
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[slapos.recipe.maarch-repository] [slapos.recipe.maarch-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.recipe.maarch.git repository = https://lab.nexedi.com/nexedi/slapos.recipe.maarch.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -45,7 +45,6 @@ meld3 = 0.6.7 ...@@ -45,7 +45,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -20,7 +20,7 @@ md5sum = 5a2741b5881f3f229a788958dc6cdf10 ...@@ -20,7 +20,7 @@ md5sum = 5a2741b5881f3f229a788958dc6cdf10
extract-directory = files_to_upload extract-directory = files_to_upload
[configure-script] [configure-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/configure.py url = ${:_profile_base_location_}/configure.py
md5sum = f7e1766468f7a8d51d311541164c3ff4 md5sum = f7e1766468f7a8d51d311541164c3ff4
...@@ -28,7 +28,7 @@ filename = configure.py ...@@ -28,7 +28,7 @@ filename = configure.py
mode = 0744 mode = 0744
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/net2ftp.inc.php.in url = ${:_profile_base_location_}/template/net2ftp.inc.php.in
md5sum = 5ad3b2b42affd83229f0666c480b90cb md5sum = 5ad3b2b42affd83229f0666c480b90cb
filename = template.in filename = template.in
...@@ -70,7 +70,6 @@ meld3 = 0.6.7 ...@@ -70,7 +70,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -11,7 +11,7 @@ md5sum = 79ddfc24f01bc843a8275463e63e96b0 ...@@ -11,7 +11,7 @@ md5sum = 79ddfc24f01bc843a8275463e63e96b0
strip-top-level-dir = true strip-top-level-dir = true
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/config-form.php.in url = ${:_profile_base_location_}/config-form.php.in
md5sum = 5d6ee1a23e1a5e762412a4867095b9e1 md5sum = 5d6ee1a23e1a5e762412a4867095b9e1
download-only = True download-only = True
......
...@@ -47,7 +47,6 @@ meld3 = 0.6.7 ...@@ -47,7 +47,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -49,7 +49,6 @@ meld3 = 0.6.7 ...@@ -49,7 +49,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -14,7 +14,7 @@ extends = ...@@ -14,7 +14,7 @@ extends =
../../stack/lamp.cfg ../../stack/lamp.cfg
[phpbms-patch] [phpbms-patch]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/phpbms_for_mysql5.patch url = ${:_profile_base_location_}/phpbms_for_mysql5.patch
md5sum = ddf323ac00e9e486cea8b8cc4277e065 md5sum = ddf323ac00e9e486cea8b8cc4277e065
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
...@@ -32,7 +32,7 @@ on_update = true ...@@ -32,7 +32,7 @@ on_update = true
cmds= patch -d ${application:location} -p1 < ${phpbms-patch:location}/${phpbms-patch:filename} cmds= patch -d ${application:location} -p1 < ${phpbms-patch:location}/${phpbms-patch:filename}
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/settings.php.in url = ${:_profile_base_location_}/template/settings.php.in
filename = template.in filename = template.in
mode = 0644 mode = 0644
......
...@@ -25,7 +25,7 @@ filename = configure-phpfin.py ...@@ -25,7 +25,7 @@ filename = configure-phpfin.py
download-only = True download-only = True
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/connection.inc.in url = ${:_profile_base_location_}/template/connection.inc.in
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
download-only = True download-only = True
......
...@@ -17,7 +17,7 @@ url = http://flomoto.free.fr/phpip/phpip_11-05-11.tar.gz ...@@ -17,7 +17,7 @@ url = http://flomoto.free.fr/phpip/phpip_11-05-11.tar.gz
md5sum = 94fe615f61fbb5ef0fcbf60a44ac5093 md5sum = 94fe615f61fbb5ef0fcbf60a44ac5093
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/database.php.in url = ${:_profile_base_location_}/template/database.php.in
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
download-only = True download-only = True
......
...@@ -25,7 +25,7 @@ url = http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.10/phpM ...@@ -25,7 +25,7 @@ url = http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.10/phpM
md5sum = cb7a632fb4f10a180ead15f7f90087f1 md5sum = cb7a632fb4f10a180ead15f7f90087f1
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/phpmyadmin.inc.php.in url = ${:_profile_base_location_}/phpmyadmin.inc.php.in
md5sum = caab45c34c75661c214f4628ff545bb4 md5sum = caab45c34c75661c214f4628ff545bb4
filename = template.in filename = template.in
...@@ -57,7 +57,6 @@ meld3 = 0.6.7 ...@@ -57,7 +57,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -19,7 +19,7 @@ md5sum = d448586c651c811a137280b435c4e05c ...@@ -19,7 +19,7 @@ md5sum = d448586c651c811a137280b435c4e05c
extract-directory = html extract-directory = html
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/phpnuke.inc.php.in url = ${:_profile_base_location_}/template/phpnuke.inc.php.in
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
filename = template.in filename = template.in
...@@ -58,7 +58,6 @@ meld3 = 0.6.7 ...@@ -58,7 +58,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -18,7 +18,7 @@ url = http://piwigo.org/download/dlcounter.php?code=latest ...@@ -18,7 +18,7 @@ url = http://piwigo.org/download/dlcounter.php?code=latest
md5sum = 13870130dcdda90bf2d2e3c20a49b04f md5sum = 13870130dcdda90bf2d2e3c20a49b04f
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/piwigo.inc.php.in url = ${:_profile_base_location_}/template/piwigo.inc.php.in
md5sum = 8ca6d1408b468c6836cd0edaf02688e5 md5sum = 8ca6d1408b468c6836cd0edaf02688e5
download-only = True download-only = True
...@@ -58,7 +58,6 @@ meld3 = 0.6.7 ...@@ -58,7 +58,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -48,7 +48,6 @@ meld3 = 0.6.7 ...@@ -48,7 +48,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -14,7 +14,7 @@ extends = ...@@ -14,7 +14,7 @@ extends =
../../stack/lamp.cfg ../../stack/lamp.cfg
[pixelpost-patch] [pixelpost-patch]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/pixelpost_for_mysql5.patch url = ${:_profile_base_location_}/pixelpost_for_mysql5.patch
md5sum = 100883ebbe4973883a710996b91f5d23 md5sum = 100883ebbe4973883a710996b91f5d23
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
......
...@@ -49,7 +49,6 @@ meld3 = 0.6.7 ...@@ -49,7 +49,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -23,7 +23,7 @@ url = http://www-sop.inria.fr/oasis/amedro/public/PABundle.tar.gz ...@@ -23,7 +23,7 @@ url = http://www-sop.inria.fr/oasis/amedro/public/PABundle.tar.gz
#md5sum = 776f78e9058d4b5dc86351bf45305c45 #md5sum = 776f78e9058d4b5dc86351bf45305c45
#[java-download] #[java-download]
#recipe = slapos.recipe.download #recipe = slapos.recipe.build:download
## 64bit self extracting ## 64bit self extracting
##url = http://javadl.sun.com/webapps/download/AutoDL?BundleId=43875 ##url = http://javadl.sun.com/webapps/download/AutoDL?BundleId=43875
##md5sum = e4143387e31838a51df76774d102f49a ##md5sum = e4143387e31838a51df76774d102f49a
......
...@@ -18,7 +18,7 @@ url = http://punbb.informer.com/download/punbb-1.3.6.tar.gz ...@@ -18,7 +18,7 @@ url = http://punbb.informer.com/download/punbb-1.3.6.tar.gz
md5sum = 7bb3f570cb6a61f8c3e3e25e750fd29d md5sum = 7bb3f570cb6a61f8c3e3e25e750fd29d
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/punbb.inc.php.in url = ${:_profile_base_location_}/template/punbb.inc.php.in
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
filename = template.in filename = template.in
...@@ -57,7 +57,6 @@ meld3 = 0.6.7 ...@@ -57,7 +57,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -47,7 +47,6 @@ meld3 = 0.6.7 ...@@ -47,7 +47,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -46,7 +46,6 @@ meld3 = 0.6.7 ...@@ -46,7 +46,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -95,7 +95,7 @@ md5sum = 4ea69039e41ff45bffe8f2620bdf187c ...@@ -95,7 +95,7 @@ md5sum = 4ea69039e41ff45bffe8f2620bdf187c
mode = 0644 mode = 0644
[template-download] [template-download]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/${:filename} url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644 mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
...@@ -178,7 +178,6 @@ docutils = 0.10 ...@@ -178,7 +178,6 @@ docutils = 0.10
gitdb = 0.5.4 gitdb = 0.5.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pycrypto = 2.6 pycrypto = 2.6
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.34.0 slapos.toolbox = 0.34.0
smmap = 0.8.2 smmap = 0.8.2
......
...@@ -25,7 +25,7 @@ develop = ...@@ -25,7 +25,7 @@ develop =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -37,7 +37,7 @@ git-executable = ${git:location}/bin/git ...@@ -37,7 +37,7 @@ git-executable = ${git:location}/bin/git
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -12,7 +12,7 @@ md5sum = efd7eec1629db379896fb7e74bba400e ...@@ -12,7 +12,7 @@ md5sum = efd7eec1629db379896fb7e74bba400e
strip-top-level-dir = true strip-top-level-dir = true
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/config.php.in url = ${:_profile_base_location_}/template/config.php.in
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
filename = template.in filename = template.in
...@@ -24,7 +24,7 @@ location = config.php ...@@ -24,7 +24,7 @@ location = config.php
[sql-script] [sql-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/script/tt-rss.sql url = ${:_profile_base_location_}/script/tt-rss.sql
#md5sum = c4d5f87d8f02cad3f20e679160195f48 #md5sum = c4d5f87d8f02cad3f20e679160195f48
...@@ -33,7 +33,7 @@ mode = 0744 ...@@ -33,7 +33,7 @@ mode = 0744
# XXX Should disappear and be integrated into apachephpconfigure # XXX Should disappear and be integrated into apachephpconfigure
[configure-script] [configure-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/configure-tt-rss.py url = ${:_profile_base_location_}/configure-tt-rss.py
#md5sum = c4d5f87d8f02cad3f20e679160195f48 #md5sum = c4d5f87d8f02cad3f20e679160195f48
......
...@@ -37,7 +37,7 @@ branch = interaction-drop ...@@ -37,7 +37,7 @@ branch = interaction-drop
[vifib] [vifib]
<= erp5 <= erp5
branch = master branch = master
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
revision = revision =
[local-bt5-repository] [local-bt5-repository]
......
...@@ -17,7 +17,7 @@ url = http://sunet.dl.sourceforge.net/project/xellplan/xellplan/xellplan-1.3/xel ...@@ -17,7 +17,7 @@ url = http://sunet.dl.sourceforge.net/project/xellplan/xellplan/xellplan-1.3/xel
md5sum = 37880217917367eb2d4a0a33c4a7fb65 md5sum = 37880217917367eb2d4a0a33c4a7fb65
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/sfx.php.in url = ${:_profile_base_location_}/template/sfx.php.in
filename = template.in filename = template.in
mode = 0644 mode = 0644
......
...@@ -47,7 +47,6 @@ meld3 = 0.6.7 ...@@ -47,7 +47,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -21,7 +21,7 @@ md5sum = e0a5fb39078321ced7f5a9c193f30927 ...@@ -21,7 +21,7 @@ md5sum = e0a5fb39078321ced7f5a9c193f30927
strip-top-level-dir = true strip-top-level-dir = true
[configure-script] [configure-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/configure.py url = ${:_profile_base_location_}/configure.py
filename = configure.py filename = configure.py
...@@ -59,7 +59,6 @@ meld3 = 0.6.7 ...@@ -59,7 +59,6 @@ meld3 = 0.6.7
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.cookbook = 0.34 slapos.cookbook = 0.34
slapos.recipe.build = 0.7 slapos.recipe.build = 0.7
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.10 slapos.toolbox = 0.10
......
...@@ -18,7 +18,7 @@ url = http://ci.zikula.org/job/Zikula-1.2.8/17/artifact/build/archive/Zikula-1.2 ...@@ -18,7 +18,7 @@ url = http://ci.zikula.org/job/Zikula-1.2.8/17/artifact/build/archive/Zikula-1.2
md5sum = bc453d665605f954f1497586ccd6d267 md5sum = bc453d665605f954f1497586ccd6d267
[configure-script] [configure-script]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/configure-zikula.py url = ${:_profile_base_location_}/configure-zikula.py
md5sum = c4d5f87d8f02cad3f20e679160195f48 md5sum = c4d5f87d8f02cad3f20e679160195f48
......
...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git ...@@ -20,7 +20,7 @@ git-executable = ${git:location}/bin/git
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -11,7 +11,3 @@ parts += wendelin.core-dev ...@@ -11,7 +11,3 @@ parts += wendelin.core-dev
# tell erp5 to use -dev eggs instead of released ones # tell erp5 to use -dev eggs instead of released ones
eggs -= ${wendelin.core:egg} eggs -= ${wendelin.core:egg}
eggs += ${wendelin.core-dev:egg} eggs += ${wendelin.core-dev:egg}
# kill -USR1 <runzope-pid> -> traceback of all threads -> stdout
# ( logged to slappartX/.slappartX_zope-Y.log )
Products.signalstack
...@@ -47,7 +47,7 @@ bt5_list = erp5_full_text_myisam_catalog erp5_configurator_standard erp5_configu ...@@ -47,7 +47,7 @@ bt5_list = erp5_full_text_myisam_catalog erp5_configurator_standard erp5_configu
[wendelin] [wendelin]
<= erp5 <= erp5
repository = https://lab.nexedi.cn/nexedi/wendelin.git repository = https://lab.nexedi.com/nexedi/wendelin.git
branch = master branch = master
revision = 02a2de4fec0253f349b8a78128e97040454b5b2d revision = 02a2de4fec0253f349b8a78128e97040454b5b2d
...@@ -63,6 +63,6 @@ scipy = 0.15.1 ...@@ -63,6 +63,6 @@ scipy = 0.15.1
pandas = 0.16.1 pandas = 0.16.1
msgpack-python = 0.4.6 msgpack-python = 0.4.6
numpy = 1.9.2 numpy = 1.9.2
wendelin.core = 0.4 wendelin.core = 0.5
ipython = 3.2.0 ipython = 3.2.0
matplotlib = 1.4.3 matplotlib = 1.4.3
...@@ -26,7 +26,7 @@ develop = ...@@ -26,7 +26,7 @@ develop =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = https://lab.nexedi.com/nexedi/slapos.toolbox.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -38,7 +38,7 @@ git-executable = ${git:location}/bin/git ...@@ -38,7 +38,7 @@ git-executable = ${git:location}/bin/git
[slapos.core-repository] [slapos.core-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.cn/nexedi/slapos.core.git repository = https://lab.nexedi.com/nexedi/slapos.core.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
......
...@@ -7,7 +7,7 @@ url = http://wordpress.org/wordpress-3.5.1.tar.gz ...@@ -7,7 +7,7 @@ url = http://wordpress.org/wordpress-3.5.1.tar.gz
md5sum = 409889c98b13cbdbb9fd121df859ae3e md5sum = 409889c98b13cbdbb9fd121df859ae3e
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/wp-config.php.in url = ${:_profile_base_location_}/wp-config.php.in
md5sum = 0d62b28125ca3c780db0b547199953f2 md5sum = 0d62b28125ca3c780db0b547199953f2
download-only = True download-only = True
......
...@@ -46,7 +46,7 @@ output = ${buildout:directory}/template-mariadb.cfg ...@@ -46,7 +46,7 @@ output = ${buildout:directory}/template-mariadb.cfg
mode = 0644 mode = 0644
[template-httpd-conf] [template-httpd-conf]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/${:filename} url = ${:_profile_base_location_}/template/${:filename}
mode = 0644 mode = 0644
filename = apache.in filename = apache.in
...@@ -69,7 +69,6 @@ apache-libcloud = 0.12.4 ...@@ -69,7 +69,6 @@ apache-libcloud = 0.12.4
async = 0.6.1 async = 0.6.1
gitdb = 0.5.4 gitdb = 0.5.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.40.4 slapos.toolbox = 0.40.4
smmap = 0.8.2 smmap = 0.8.2
...@@ -88,4 +87,4 @@ feedparser = 5.1.3 ...@@ -88,4 +87,4 @@ feedparser = 5.1.3
# Required by: # Required by:
# slapos.toolbox==0.40.2 # slapos.toolbox==0.40.2
paramiko = 1.15.2 paramiko = 1.15.3
[buildout] [buildout]
find-links +=
http://www.owlfish.com/software/wsgiutils/download.html
# Separate from site eggs # Separate from site eggs
allowed-eggs-from-site-packages = allowed-eggs-from-site-packages =
include-site-packages = false include-site-packages = false
......
[buildout] [buildout]
find-links +=
http://www.owlfish.com/software/wsgiutils/download.html
extends = extends =
# Exact version of Zope # Exact version of Zope
https://raw.github.com/zopefoundation/Zope/2.13.22/versions.cfg https://raw.github.com/zopefoundation/Zope/2.13.22/versions.cfg
...@@ -29,7 +26,6 @@ extends = ...@@ -29,7 +26,6 @@ extends =
../../component/percona-toolkit/buildout.cfg ../../component/percona-toolkit/buildout.cfg
../../component/patch/buildout.cfg ../../component/patch/buildout.cfg
../../component/pillow/buildout.cfg ../../component/pillow/buildout.cfg
../../component/pycrypto-python/buildout.cfg
../../component/pysvn-python/buildout.cfg ../../component/pysvn-python/buildout.cfg
../../component/python-ldap-python/buildout.cfg ../../component/python-ldap-python/buildout.cfg
../../component/rdiff-backup/buildout.cfg ../../component/rdiff-backup/buildout.cfg
...@@ -52,8 +48,9 @@ extends = ...@@ -52,8 +48,9 @@ extends =
../../component/6tunnel/buildout.cfg ../../component/6tunnel/buildout.cfg
../../component/findutils/buildout.cfg ../../component/findutils/buildout.cfg
../../component/userhosts/buildout.cfg ../../component/userhosts/buildout.cfg
../../software/neoppod/software-common.cfg
../../component/postfix/buildout.cfg ../../component/postfix/buildout.cfg
../../software/neoppod/software-common.cfg
# keep neoppod extends last
parts += parts +=
erp5-util-develop erp5-util-develop
...@@ -121,7 +118,6 @@ parts += ...@@ -121,7 +118,6 @@ parts +=
genbt5list genbt5list
# some additional utils # some additional utils
slapos-toolbox
zodbanalyze zodbanalyze
# Create instance template # Create instance template
...@@ -146,7 +142,7 @@ mode = 755 ...@@ -146,7 +142,7 @@ mode = 755
[template-mariadb] [template-mariadb]
<= download-base <= download-base
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 4d46ab5aa651a39c4021de6f647e8be9 md5sum = fbc39d333bf70894f6f9d094515a2a4a
link-binary = link-binary =
${coreutils:location}/bin/basename ${coreutils:location}/bin/basename
${coreutils:location}/bin/cat ${coreutils:location}/bin/cat
...@@ -162,12 +158,12 @@ link-binary = ...@@ -162,12 +158,12 @@ link-binary =
[template-kumofs] [template-kumofs]
<= download-base <= download-base
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 7d9760fe65f454700342eeffec14c884 md5sum = 763db0c4a94649296e74fe1f53c03940
[template-cloudooo] [template-cloudooo]
<= download-base <= download-base
filename = instance-cloudoo.cfg.in filename = instance-cloudoo.cfg.in
md5sum = 8468648aa91712f0349baa1ad0c8ccdf md5sum = 1b515056c5892a86d4ece252ad114a97
[template-zope-conf] [template-zope-conf]
<= download-base <= download-base
...@@ -187,7 +183,7 @@ md5sum = dd779e54d22105702aa72cadc994d957 ...@@ -187,7 +183,7 @@ md5sum = dd779e54d22105702aa72cadc994d957
[template-mariadb-initial-setup] [template-mariadb-initial-setup]
<= download-base <= download-base
filename = mariadb_initial_setup.sql.in filename = mariadb_initial_setup.sql.in
md5sum = b8d2d9af0c4cab45c8337aeac28d5fae md5sum = 6465212fdc7fe9076a0c929d9f14da14
[template-create-erp5-site] [template-create-erp5-site]
<= download-base <= download-base
...@@ -224,7 +220,7 @@ recipe = slapos.recipe.template:jinja2 ...@@ -224,7 +220,7 @@ recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 4d043c96d70b35d1fbbd8120d8edee7c md5sum = 540956c635acc9707045510c11f80016
mode = 640 mode = 640
context = context =
key mariadb_link_binary template-mariadb:link-binary key mariadb_link_binary template-mariadb:link-binary
...@@ -290,6 +286,7 @@ context = ...@@ -290,6 +286,7 @@ context =
key template_kumofs template-kumofs:target key template_kumofs template-kumofs:target
key template_mariadb template-mariadb:target key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_monitor monitor-template:rendered
key template_my_cnf template-my-cnf:target key template_my_cnf template-my-cnf:target
key template_postfix template-postfix:target key template_postfix template-postfix:target
key template_postfix_aliases template-postfix-aliases:target key template_postfix_aliases template-postfix-aliases:target
...@@ -305,20 +302,29 @@ context = ...@@ -305,20 +302,29 @@ context =
key xfixes_location xfixes:location key xfixes_location xfixes:location
key zlib_location zlib:location key zlib_location zlib:location
[monitor-template-dummy]
<= download-base
# This is a placeholder, to be overriden by extending monitor SR
filename = dummy.cfg
md5sum = d41d8cd98f00b204e9800998ecf8427e
[monitor-template]
rendered = ${monitor-template-dummy:target}
[template-erp5] [template-erp5]
<= download-base <= download-base
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 60cdf98d996f220d66daa11452c3f4bf md5sum = 78c2db733e72c4197a90e8be1ff15098
[template-zeo] [template-zeo]
<= download-base <= download-base
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = 9670cf63099e2c520017a23defff51a4 md5sum = 985c0010db6b553a89dbdb31353c56f5
[template-zope] [template-zope]
<= download-base <= download-base
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 44c4aa068cffe2c1d8320d59e6d1c499 md5sum = 07d5d0df5d16b46602760a8673d4395b
link-binary = link-binary =
${aspell:location}/bin/aspell ${aspell:location}/bin/aspell
${dmtx-utils:location}/bin/dmtxwrite ${dmtx-utils:location}/bin/dmtxwrite
...@@ -342,7 +348,7 @@ link-binary = ...@@ -342,7 +348,7 @@ link-binary =
[template-balancer] [template-balancer]
<= download-base <= download-base
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 3628f0ba358e7ee96a8d0185c4775911 md5sum = 28c04f599cdbdfa97f2a67156f4f6b67
[template-apache-conf] [template-apache-conf]
<= download-base <= download-base
...@@ -452,6 +458,7 @@ eggs = ...@@ -452,6 +458,7 @@ eggs =
${pysvn-python:egg} ${pysvn-python:egg}
${pycrypto-python:egg} ${pycrypto-python:egg}
lock_file lock_file
PyStemmer
PyXML PyXML
Pympler Pympler
SOAPpy SOAPpy
...@@ -496,6 +503,7 @@ eggs = ...@@ -496,6 +503,7 @@ eggs =
jsonschema jsonschema
# Needed for checking ZODB Components source code # Needed for checking ZODB Components source code
pylint pylint
pytracemalloc
neoppod[client] neoppod[client]
# Zope # Zope
...@@ -562,9 +570,7 @@ Products.DCWorkflow-patch-options = -p1 ...@@ -562,9 +570,7 @@ Products.DCWorkflow-patch-options = -p1
[zodbanalyze] [zodbanalyze]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs = erp5.util
ZODB3
erp5.util
entry-points = entry-points =
zodbanalyze=erp5.util.zodbanalyze:main zodbanalyze=erp5.util.zodbanalyze:main
scripts = zodbanalyze scripts = zodbanalyze
...@@ -578,20 +584,19 @@ setup = ${erp5:location} ...@@ -578,20 +584,19 @@ setup = ${erp5:location}
branch = branch =
revision = f1545ad0e6db238d22fd8c84a149b004ab6b8f03 revision = f1545ad0e6db238d22fd8c84a149b004ab6b8f03
[slapos-toolbox] [slapos-deps-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs +=
${lxml-python:egg}
slapos.toolbox
slapos.toolbox[zodbpack] slapos.toolbox[zodbpack]
scripts +=
scripts =
is-local-tcp-port-opened is-local-tcp-port-opened
onetimedownload onetimedownload
slapos-kill
zodbpack zodbpack
[versions] [versions]
# See ../../software/neoppod/software-common.cfg for versions common with NEO:
# neoppod, MySQL-python, slapos.recipe.template & [slapos-deps-eggs]
# patched eggs # patched eggs
Acquisition = 2.13.8+SlapOSPatched001 Acquisition = 2.13.8+SlapOSPatched001
Products.DCWorkflow = 2.2.4+SlapOSPatched001 Products.DCWorkflow = 2.2.4+SlapOSPatched001
...@@ -604,7 +609,7 @@ cloudooo = 1.2.5-dev ...@@ -604,7 +609,7 @@ cloudooo = 1.2.5-dev
# use newer version than specified in ZTK # use newer version than specified in ZTK
PasteDeploy = 1.5.2 PasteDeploy = 1.5.2
Pygments = 2.0.2 Pygments = 2.0.2
coverage = 3.7.1 coverage = 4.0.1
zope.dottedname = 4.1.0 zope.dottedname = 4.1.0
# test_UserManagerInterfaces in testERP5Security fails with 1.10.0. # test_UserManagerInterfaces in testERP5Security fails with 1.10.0.
...@@ -621,7 +626,7 @@ SOAPpy = 0.12.0nxd001 ...@@ -621,7 +626,7 @@ SOAPpy = 0.12.0nxd001
# CMF 2.3 is not yet supported. # CMF 2.3 is not yet supported.
Products.CMFCalendar = 2.2.3 Products.CMFCalendar = 2.2.3
Products.CMFCore = 2.2.8 Products.CMFCore = 2.2.9
Products.CMFDefault = 2.2.4 Products.CMFDefault = 2.2.4
Products.CMFTopic = 2.2.1 Products.CMFTopic = 2.2.1
Products.CMFUid = 2.2.1 Products.CMFUid = 2.2.1
...@@ -636,102 +641,91 @@ zope.app.publication = 3.14.0 ...@@ -636,102 +641,91 @@ zope.app.publication = 3.14.0
zope.app.testing = 3.8.1 zope.app.testing = 3.8.1
# Pinned versions # Pinned versions
MySQL-python = 1.2.5 Pillow = 3.0.0
Pillow = 2.9.0
Products.CMFActionIcons = 2.1.3 Products.CMFActionIcons = 2.1.3
Products.DCWorkflowGraph = 0.4.1 Products.DCWorkflowGraph = 0.4.1
Products.ExternalEditor = 1.1.0 Products.ExternalEditor = 2.0.0
Products.GenericSetup = 1.7.7 Products.GenericSetup = 1.8.0
Products.LongRequestLogger = 1.1.0 Products.LongRequestLogger = 1.1.post1
Products.MimetypesRegistry = 2.0.8 Products.MimetypesRegistry = 2.0.8
Products.PluginRegistry = 1.3 Products.PluginRegistry = 1.3
Products.TIDStorage = 5.4.9 Products.TIDStorage = 5.4.9
PyPDF2 = 1.25.1 PyPDF2 = 1.25.1
PyStemmer = 1.3.0
PyXML = 0.8.5 PyXML = 0.8.5
Pympler = 0.4.2 Pympler = 0.4.2
StructuredText = 2.11.1 StructuredText = 2.11.1
WSGIUtils = 0.7 WSGIUtils = 0.7
apache-libcloud = 0.18.0 astroid = 1.3.8
astroid = 1.3.6
chardet = 2.3.0 chardet = 2.3.0
collective.recipe.template = 1.11
csp-eventlet = 0.7.0 csp-eventlet = 0.7.0
ecdsa = 0.13
elementtree = 1.2.6.post20050316 elementtree = 1.2.6.post20050316
erp5diff = 0.8.1.7 erp5diff = 0.8.1.7
eventlet = 0.17.4 eventlet = 0.17.4
five.formlib = 1.0.4 five.formlib = 1.0.4
five.localsitemanager = 2.0.5 five.localsitemanager = 2.0.5
gitdb = 0.6.4 greenlet = 0.4.9
greenlet = 0.4.7
http-parser = 0.8.3 http-parser = 0.8.3
httplib2 = 0.9.1 httplib2 = 0.9.2
huBarcode = 1.0.0 huBarcode = 1.0.0
interval = 1.0.0 interval = 1.0.0
ipdb = 0.8.1 ipdb = 0.8.1
ipython = 3.2.0 ipython = 4.0.0
logilab-common = 1.0.2 logilab-common = 1.1.0
neoppod = 1.4.0 numpy = 1.10.1
numpy = 1.9.2
objgraph = 2.0.1 objgraph = 2.0.1
plone.recipe.command = 1.1 ply = 3.8
ply = 3.7
polib = 1.0.7 polib = 1.0.7
pprofile = 1.7.3 pprofile = 1.7.3
pycountry = 1.14 ptyprocess = 0.5
pycrypto = 2.6.1 pycountry = 1.17
pyflakes = 0.9.2 pyflakes = 1.0.0
pylint = 1.4.4 pylint = 1.4.4
python-magic = 0.4.6 python-magic = 0.4.6
python-memcached = 1.57 python-memcached = 1.57
pytracemalloc = 1.2
qrcode = 5.1 qrcode = 5.1
restkit = 4.2.2 restkit = 4.2.2
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
slapos.recipe.template = 2.8 simplegeneric = 0.8.1
slapos.toolbox = 0.52
smmap = 0.9.0
socketpool = 0.5.3 socketpool = 0.5.3
spyne = 2.11.0 spyne = 2.12.10
suds = 0.4 suds = 0.4
threadframe = 0.2 threadframe = 0.2
timerserver = 2.0.2 timerserver = 2.0.2
urlnorm = 1.1.2 urlnorm = 1.1.2
uuid = 1.30 uuid = 1.30
validictory = 1.0.0 validictory = 1.0.1
xfw = 0.10 xfw = 0.10
xupdate-processor = 0.4 xupdate-processor = 0.4
# Required by: # Required by:
# slapos.toolbox==0.52 # Products.CMFCore==2.2.9
GitPython = 1.0.1
# Required by:
# Products.CMFCore==2.2.8
Products.ZSQLMethods = 2.13.4 Products.ZSQLMethods = 2.13.4
# Required by: # Required by:
# slapos.toolbox==0.52 # SOAPpy===0.12.0nxd001
atomize = 0.2.0 fpconst = 0.7.2
# Required by: # Required by:
# slapos.toolbox==0.52 # traitlets==4.0.0
feedparser = 5.2.1 ipython-genutils = 0.1.0
# Required by: # Required by:
# SOAPpy===0.12.0nxd001 # pickleshare==0.5
fpconst = 0.7.2 path.py = 8.1.2
# Required by: # Required by:
# slapos.toolbox==0.52 # ipython==4.0.0
lockfile = 0.10.2 pexpect = 4.0.1
# Required by: # Required by:
# slapos.toolbox==0.52 # ipython==4.0.0
paramiko = 1.15.2 pickleshare = 0.5
# Required by: # Required by:
# slapos.toolbox==0.52 # ipython==4.0.0
rpdb = 0.1.5 traitlets = 4.0.0
# Required by: # Required by:
# zope.app.testing==3.8.1 # zope.app.testing==3.8.1
...@@ -745,3 +739,8 @@ zope.app.dependable = 3.5.1 ...@@ -745,3 +739,8 @@ zope.app.dependable = 3.5.1
# Products.CMFCalendar==2.2.3 # Products.CMFCalendar==2.2.3
# five.formlib==1.0.4 # five.formlib==1.0.4
zope.app.form = 4.0.2 zope.app.form = 4.0.2
# Required by:
# Products.ZCatalog==2.13.27
# zope.container==3.11.2
zope.dottedname = 4.1.0
...@@ -206,8 +206,15 @@ certs = ${:ca-dir}/certs ...@@ -206,8 +206,15 @@ certs = ${:ca-dir}/certs
newcerts = ${:ca-dir}/newcerts newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl crl = ${:ca-dir}/crl
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port }}
monitor-title = Balancer monitor
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends =
{{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
publish publish
logrotate-apache logrotate-apache
......
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%} {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
parts = extends =
publish-cloudooo-connection-information {{ parameter_dict['template-monitor'] }}
parts +=
publish
cloudooo-instance cloudooo-instance
resiliency-exclude-file resiliency-exclude-file
promise promise
promise-openoffice promise-openoffice
{% if use_ipv6 %}promise-tunnel{% endif %} {% if use_ipv6 %}promise-tunnel{% endif %}
[publish-cloudooo-connection-information] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% if use_ipv6 -%} {% if use_ipv6 -%}
url = cloudooo://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/ url = cloudooo://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
...@@ -99,3 +101,8 @@ service = ${:etc}/run ...@@ -99,3 +101,8 @@ service = ${:etc}/run
promise = ${:etc}/promise promise = ${:etc}/promise
cloudooo-data = ${:srv}/cloudooo cloudooo-data = ${:srv}/cloudooo
font = ${:srv}/font font = ${:srv}/font
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 2 }}
monitor-title = Cloudooo monitor
...@@ -62,8 +62,12 @@ connection-url = smtp://127.0.0.2:0/ ...@@ -62,8 +62,12 @@ connection-url = smtp://127.0.0.2:0/
{% if server_type == 'neo' -%} {% if server_type == 'neo' -%}
{% set ((name, server_dict),) = server_dict.items() -%} {% set ((name, server_dict),) = server_dict.items() -%}
{% do neo.append(server_dict.get('cluster')) -%} {% do neo.append(server_dict.get('cluster')) -%}
{% do server_dict.__setitem__('cluster', '${publish-early:neo-cluster}') -%} {% do server_dict.update(cluster='${publish-early:neo-cluster}') -%}
{{ root_common.request_neo(server_dict, 'zodb-neo', 'neo-') }} {{ root_common.request_neo(server_dict, 'zodb-neo', 'neo-') }}
{% set client_dict = zodb_dict[name].setdefault('storage-dict', {}) -%}
{% for k in 'ssl', '_ca', '_cert', '_key' -%}
{% do k in server_dict and client_dict.setdefault(k, server_dict[k]) -%}
{% endfor -%}
{% else -%} {% else -%}
{{ assert(server_type == 'zeo', server_type) -}} {{ assert(server_type == 'zeo', server_type) -}}
{# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#} {# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#}
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends =
{{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
publish-kumofs-connection-information publish
kumofs-instance kumofs-instance
logrotate-entry-kumofs logrotate-entry-kumofs
resiliency-exclude-file resiliency-exclude-file
...@@ -11,7 +13,7 @@ parts += ...@@ -11,7 +13,7 @@ parts +=
promise-kumofs-gateway promise-kumofs-gateway
promise-kumofs-manager promise-kumofs-manager
[publish-kumofs-connection-information] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% if use_ipv6 -%} {% if use_ipv6 -%}
url = memcached://[${kumofs-instance:ip}]:${kumofs-instance:gateway-port}/ url = memcached://[${kumofs-instance:ip}]:${kumofs-instance:gateway-port}/
...@@ -106,3 +108,8 @@ port = ${kumofs-instance:gateway-port} ...@@ -106,3 +108,8 @@ port = ${kumofs-instance:gateway-port}
<= promise-template <= promise-template
path = ${directory:promise}/kumofs-manager path = ${directory:promise}/kumofs-manager
port = ${kumofs-instance:manager-port} port = ${kumofs-instance:manager-port}
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 4 }}
monitor-title = Kumofs monitor
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
{% set ip = (ipv4_set | list)[0] -%} {% set ip = (ipv4_set | list)[0] -%}
{% endif -%} {% endif -%}
[publish-mariadb-url] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% macro render_database_list(database_list) -%} {% macro render_database_list(database_list) -%}
{% set publish_database_list = [] -%} {% set publish_database_list = [] -%}
...@@ -232,10 +232,17 @@ command-line = "{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened" ...@@ -232,10 +232,17 @@ command-line = "{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened"
wrapper-path = ${directory:promise}/mariadb wrapper-path = ${directory:promise}/mariadb
parameters-extra = true parameters-extra = true
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ port + 1 }}
monitor-title = Mariadb monitor
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends =
{{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
publish-mariadb-url publish
logrotate-entry-mariadb logrotate-entry-mariadb
binary-link binary-link
update-mysql update-mysql
......
...@@ -185,8 +185,16 @@ backup-zodb = {{ default_backup_path }} ...@@ -185,8 +185,16 @@ backup-zodb = {{ default_backup_path }}
zodb = {{ default_zodb_path }} zodb = {{ default_zodb_path }}
tidstorage = {{ tidstorage_repozo_path }} tidstorage = {{ tidstorage_repozo_path }}
{% set next_port = next_port + 1 -%}
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port }}
monitor-title = ZODB monitor
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends =
{{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
publish publish
...@@ -175,6 +175,27 @@ context = section parameter_dict preload-userhosts-runzope-parameter ...@@ -175,6 +175,27 @@ context = section parameter_dict preload-userhosts-runzope-parameter
template = {{ parameter_dict['runzope-userhosts-preloaded-template'] }} template = {{ parameter_dict['runzope-userhosts-preloaded-template'] }}
mode = 755 mode = 755
{# Hack to deploy SSL certs via instance parameters -#}
{% for zodb in zodb_dict.itervalues() -%}
{% set storage_dict = zodb.setdefault('storage-dict', {}) -%}
{% if zodb['type'] == 'neo' and storage_dict.get('ssl', 1) -%}
{% for k, v in (('_ca', 'ca.crt'),
('_cert', 'neo.crt'),
('_key', 'neo.key')) -%}
{% if k in storage_dict -%}
[{{ section('neo-ssl-' + k[1:]) }}]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/{{v}}
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = {{dumps(storage_dict.pop(k))}}
{% endif -%}
{% endfor -%}
{% endif -%}
{% endfor -%}
{# endhack -#}
[zope-base] [zope-base]
recipe = slapos.cookbook:generic.zope.zeo.client recipe = slapos.cookbook:generic.zope.zeo.client
inituser = ${directory:instance}/inituser inituser = ${directory:instance}/inituser
...@@ -192,9 +213,23 @@ bt5-repository = ...@@ -192,9 +213,23 @@ bt5-repository =
[zope-conf-parameter-base] [zope-conf-parameter-base]
ip = {{ ipv4 }} ip = {{ ipv4 }}
site-id = {{ site_id }} site-id = {{ site_id }}
{% set storage_dict = {'neo': {}, 'zeo': slapparameter_dict.get('zodb-zeo', {})} -%} {% set zeo_dict = slapparameter_dict.get('zodb-zeo', {}) -%}
{% for name, zodb in zodb_dict.iteritems() -%} {% for name, zodb in zodb_dict.iteritems() -%}
{% do zodb.setdefault('storage-dict', {}).update(storage_dict[zodb['type']].get(name, {})) -%} {% set storage_dict = zodb.setdefault('storage-dict', {}) -%}
{% if zodb['type'] == 'zeo' -%}
{% do storage_dict.update(zeo_dict.get(name, ())) -%}
{% else -%}
{% if name == slapparameter_dict.get('neo-name') -%}
{% do storage_dict.update(master_nodes=slapparameter_dict['neo-masters'],
name=slapparameter_dict['neo-cluster']) -%}
{% endif -%}
{{ assert(storage_dict['master_nodes'], name) }}
{% if storage_dict.pop('ssl', 1) -%}
{% do storage_dict.update(ca='~/etc/ca.crt',
cert='~/etc/neo.crt',
key='~/etc/neo.key') -%}
{% endif -%}
{% endif -%}
{% endfor -%} {% endfor -%}
developer-list = {{ dumps(slapparameter_dict['developer-list']) }} developer-list = {{ dumps(slapparameter_dict['developer-list']) }}
instance = ${directory:instance} instance = ${directory:instance}
...@@ -250,14 +285,9 @@ node-id = {{ dumps(node_id_base ~ '-' ~ index) }} ...@@ -250,14 +285,9 @@ node-id = {{ dumps(node_id_base ~ '-' ~ index) }}
{% for db_name, zodb in zodb_dict.iteritems() -%} {% for db_name, zodb in zodb_dict.iteritems() -%}
{% if zodb['type'] == 'neo' -%} {% if zodb['type'] == 'neo' -%}
{% do import_set.add('neo.client') -%} {% do import_set.add('neo.client') -%}
{% set log = buildout_directory ~ '/var/log/' ~ name ~ '-neo-' ~ db_name ~ '.log' -%} {% set log = name ~ '-neo-' ~ db_name ~ '.log' -%}
{% do log_list.append(log) -%} {% do log_list.append('${directory:log}/' + log) -%}
{% do zodb['storage-dict'].__setitem__('logfile', log) -%} {% do zodb['storage-dict'].update(logfile='~/var/log/'+log) -%}
{% if db_name == slapparameter_dict.get('neo-name') -%}
{% do zodb['storage-dict'].__setitem__('name', slapparameter_dict['neo-cluster']) -%}
{% do zodb['storage-dict'].__setitem__('master_nodes', slapparameter_dict['neo-masters']) -%}
{% endif -%}
{{ assert(zodb['storage-dict']['master_nodes'], db_name) }}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
import-list = {{ dumps(list(import_set)) }} import-list = {{ dumps(list(import_set)) }}
...@@ -323,7 +353,7 @@ post = {{ bin_directory }}/slapos-kill --pidfile {{ '${' ~ conf_parameter_name ~ ...@@ -323,7 +353,7 @@ post = {{ bin_directory }}/slapos-kill --pidfile {{ '${' ~ conf_parameter_name ~
{% set next_port = next_port + 1 -%} {% set next_port = next_port + 1 -%}
{% endfor -%} {% endfor -%}
[publish-zope] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
zope-address-list = {{ dumps(publish_list) }} zope-address-list = {{ dumps(publish_list) }}
{# {#
...@@ -345,12 +375,19 @@ smtp-url = {{ dumps(slapparameter_dict['smtp-url']) }} ...@@ -345,12 +375,19 @@ smtp-url = {{ dumps(slapparameter_dict['smtp-url']) }}
bt5 = {{ dumps(slapparameter_dict['bt5']) }} bt5 = {{ dumps(slapparameter_dict['bt5']) }}
bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }} bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }}
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port }}
monitor-title = Zope monitor
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends =
{{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
erp5-promise erp5-promise
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
publish-zope publish
versions = versions versions = versions
[versions] [versions]
......
...@@ -36,6 +36,7 @@ fonts = {{ fonts_location }} ...@@ -36,6 +36,7 @@ fonts = {{ fonts_location }}
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-cloudooo] [dynamic-template-cloudooo]
<= jinja2-template-base <= jinja2-template-base
...@@ -84,6 +85,7 @@ bin-directory = {{ bin_directory }} ...@@ -84,6 +85,7 @@ bin-directory = {{ bin_directory }}
dash = {{ dash_location }} dash = {{ dash_location }}
template-haproxy-cfg = {{ template_haproxy_cfg }} template-haproxy-cfg = {{ template_haproxy_cfg }}
template-apache-conf = {{ template_apache_conf }} template-apache-conf = {{ template_apache_conf }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-balancer] [dynamic-template-balancer]
<= jinja2-template-base <= jinja2-template-base
...@@ -94,6 +96,7 @@ extra-context = ...@@ -94,6 +96,7 @@ extra-context =
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-zeo] [dynamic-template-zeo]
<= jinja2-template-base <= jinja2-template-base
...@@ -115,6 +118,7 @@ jsl = {{ jsl_location }} ...@@ -115,6 +118,7 @@ jsl = {{ jsl_location }}
link-binary = {{ dumps(zope_link_binary) }} link-binary = {{ dumps(zope_link_binary) }}
userhosts = {{ userhosts_location }} userhosts = {{ userhosts_location }}
runzope-userhosts-preloaded-template = {{ template_runzope_userhosts_preloaded }} runzope-userhosts-preloaded-template = {{ template_runzope_userhosts_preloaded }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-zope] [dynamic-template-zope]
<= jinja2-template-base <= jinja2-template-base
...@@ -131,6 +135,7 @@ dcron-location = {{ dcron_location }} ...@@ -131,6 +135,7 @@ dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }} gzip-location = {{ gzip_location }}
kumo-location = {{ kumo_location }} kumo-location = {{ kumo_location }}
logrotate-location = {{ logrotate_location }} logrotate-location = {{ logrotate_location }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-kumofs] [dynamic-template-kumofs]
<= jinja2-template-base <= jinja2-template-base
...@@ -150,6 +155,7 @@ template-mariadb-initial-setup = {{ template_mariadb_initial_setup }} ...@@ -150,6 +155,7 @@ template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }} link-binary = {{ dumps(mariadb_link_binary) }}
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }} mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
template-monitor = {{ template_monitor }}
[dynamic-template-mariadb] [dynamic-template-mariadb]
<= jinja2-template-base <= jinja2-template-base
......
...@@ -6,10 +6,10 @@ DROP FUNCTION IF EXISTS sphinx_snippets; ...@@ -6,10 +6,10 @@ DROP FUNCTION IF EXISTS sphinx_snippets;
#CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'ha_sphinx.so'; #CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'ha_sphinx.so';
{% macro database(name, user, password) -%} {% macro database(name, user, password) -%}
CREATE DATABASE IF NOT EXISTS {{ name }}; CREATE DATABASE IF NOT EXISTS `{{ name }}`;
{% if user -%} {% if user -%}
GRANT ALL PRIVILEGES ON {{ name }}.* TO {{ user }}@'%' IDENTIFIED BY '{{ password }}'; GRANT ALL PRIVILEGES ON `{{ name }}`.* TO `{{ user }}`@`%` IDENTIFIED BY '{{ password }}';
GRANT ALL PRIVILEGES ON {{ name }}.* TO {{ user }}@'localhost' IDENTIFIED BY '{{ password }}'; GRANT ALL PRIVILEGES ON `{{ name }}`.* TO `{{ user }}`@localhost IDENTIFIED BY '{{ password }}';
{%- endif %} {%- endif %}
{% endmacro -%} {% endmacro -%}
......
...@@ -44,7 +44,6 @@ apache-libcloud = 0.9.1 ...@@ -44,7 +44,6 @@ apache-libcloud = 0.9.1
async = 0.6.1 async = 0.6.1
gitdb = 0.5.4 gitdb = 0.5.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.3 slapos.recipe.template = 2.3
slapos.toolbox = 0.40.4 slapos.toolbox = 0.40.4
smmap = 0.8.2 smmap = 0.8.2
...@@ -63,4 +62,4 @@ feedparser = 5.1.1 ...@@ -63,4 +62,4 @@ feedparser = 5.1.1
# Required by: # Required by:
# slapos.toolbox==0.40.2 # slapos.toolbox==0.40.2
paramiko = 1.15.2 paramiko = 1.15.3
...@@ -25,7 +25,7 @@ parts += ...@@ -25,7 +25,7 @@ parts +=
promise promise
frontend-promise frontend-promise
content-promise content-promise
publish-connection-informations publish-connection-information
{{ replicated.replicate("mariadb", "3", "mariadb-export", "mariadb-import") }} {{ replicated.replicate("mariadb", "3", "mariadb-export", "mariadb-import") }}
...@@ -45,7 +45,7 @@ wrapper = /bin/true ...@@ -45,7 +45,7 @@ wrapper = /bin/true
path = ${directory:www} path = ${directory:www}
# Add "exporter" parameters to list of published connection parameters # Add "exporter" parameters to list of published connection parameters
[publish-connection-informations] [publish-connection-information]
# XXX-Cedric: Long term goal: could be a recipe that requests an instance and # XXX-Cedric: Long term goal: could be a recipe that requests an instance and
# bubbles ALL # bubbles ALL
# parameters of the requested instance. Requirement: aggregated publish. # parameters of the requested instance. Requirement: aggregated publish.
......
...@@ -13,7 +13,7 @@ parts = ...@@ -13,7 +13,7 @@ parts =
frontend-promise frontend-promise
content-promise content-promise
publish-connection-informations publish-connection-information
${custom-application-deployment:part-list} ${custom-application-deployment:part-list}
...@@ -276,7 +276,7 @@ config-custom_domain = $${slap-parameter:domain} ...@@ -276,7 +276,7 @@ config-custom_domain = $${slap-parameter:domain}
#-- #--
#-- Publish instance parameters. #-- Publish instance parameters.
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend_url = $${apache-php:url} backend_url = $${apache-php:url}
url = $${request-frontend:connection-site_url} url = $${request-frontend:connection-site_url}
......
...@@ -74,7 +74,7 @@ mode = 0644 ...@@ -74,7 +74,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in
output = ${buildout:directory}/instance-apache-php.cfg output = ${buildout:directory}/instance-apache-php.cfg
md5sum = b2564a719fdde097f402ef80e0991903 md5sum = 963ec2e460b281405b9e0e2748a27e62
mode = 0644 mode = 0644
[instance-apache-import] [instance-apache-import]
...@@ -96,7 +96,7 @@ context = key templateapache instance-apache-php:output ...@@ -96,7 +96,7 @@ context = key templateapache instance-apache-php:output
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = 24c5d0db063e5343a3cb0db9d5fbc738 md5sum = 00068d0f68a9e1eb5a6e89e73a3dc399
mode = 0644 mode = 0644
[instance-resilient] [instance-resilient]
...@@ -112,7 +112,7 @@ context = key buildout buildout:bin-directory ...@@ -112,7 +112,7 @@ context = key buildout buildout:bin-directory
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = 5e2f917b032e43af6a736532966ae1f0 md5sum = f171782b98c1143d44ec2a35d8259254
mode = 0644 mode = 0644
[instance-mariadb] [instance-mariadb]
...@@ -187,7 +187,6 @@ async = 0.6.1 ...@@ -187,7 +187,6 @@ async = 0.6.1
gitdb = 0.5.4 gitdb = 0.5.4
pycrypto = 2.6 pycrypto = 2.6
rdiff-backup = 1.0.5 rdiff-backup = 1.0.5
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.40.4 slapos.toolbox = 0.40.4
smmap = 0.8.2 smmap = 0.8.2
...@@ -206,4 +205,4 @@ feedparser = 5.1.3 ...@@ -206,4 +205,4 @@ feedparser = 5.1.3
# Required by: # Required by:
# slapos.toolbox==0.40.2 # slapos.toolbox==0.40.2
paramiko = 1.15.2 paramiko = 1.15.3
...@@ -11,7 +11,7 @@ offline = true ...@@ -11,7 +11,7 @@ offline = true
# += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended # += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended
parts += parts +=
{{ parts.replicate("apache", "3") }} {{ parts.replicate("apache", "3") }}
publish-connection-informations publish-connection-information
{{ replicated.replicate("apache", "3", "apache-export", "apache-import") }} {{ replicated.replicate("apache", "3", "apache-export", "apache-import") }}
...@@ -27,7 +27,7 @@ config-mariadb3-computer-guid = ${slap-parameter:mariadb3-computer-guid} ...@@ -27,7 +27,7 @@ config-mariadb3-computer-guid = ${slap-parameter:mariadb3-computer-guid}
config-pbs-mariadb3-computer-guid = ${slap-parameter:pbs-mariadb3-computer-guid} config-pbs-mariadb3-computer-guid = ${slap-parameter:pbs-mariadb3-computer-guid}
config-domain = ${slap-parameter:domain} config-domain = ${slap-parameter:domain}
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend_url = ${request-apache:connection-backend_url} backend_url = ${request-apache:connection-backend_url}
url = ${request-apache:connection-url} url = ${request-apache:connection-url}
......
...@@ -25,7 +25,7 @@ parts += ...@@ -25,7 +25,7 @@ parts +=
promise promise
frontend-promise frontend-promise
content-promise content-promise
publish-connection-informations publish-connection-information
{{ replicated.replicate("postgres", "3", "postgres-export", "postgres-import") }} {{ replicated.replicate("postgres", "3", "postgres-export", "postgres-import") }}
...@@ -45,7 +45,7 @@ wrapper = /bin/true ...@@ -45,7 +45,7 @@ wrapper = /bin/true
path = ${directory:www} path = ${directory:www}
# Add "exporter" parameters to list of published connection parameters # Add "exporter" parameters to list of published connection parameters
[publish-connection-informations] [publish-connection-information]
# XXX-Cedric: Long term goal: could be a recipe that requests an instance and # XXX-Cedric: Long term goal: could be a recipe that requests an instance and
# bubbles ALL # bubbles ALL
# parameters of the requested instance. Requirement: aggregated publish. # parameters of the requested instance. Requirement: aggregated publish.
......
...@@ -15,7 +15,7 @@ parts = ...@@ -15,7 +15,7 @@ parts =
frontend-promise frontend-promise
content-promise content-promise
publish-connection-informations publish-connection-information
${custom-application-deployment:part-list} ${custom-application-deployment:part-list}
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
...@@ -261,7 +261,7 @@ path = $${directory:report}/slapmonitor-xml ...@@ -261,7 +261,7 @@ path = $${directory:report}/slapmonitor-xml
#-- #--
#-- Publish instance parameters. #-- Publish instance parameters.
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend_url = $${apache-php:url} backend_url = $${apache-php:url}
url = $${request-frontend:connection-site_url} url = $${request-frontend:connection-site_url}
......
...@@ -62,7 +62,7 @@ mode = 0644 ...@@ -62,7 +62,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in
output = ${buildout:directory}/instance-apache-php.cfg output = ${buildout:directory}/instance-apache-php.cfg
md5sum = 7a0670c747f2f21a79c240bfbfbf9f6e md5sum = 8b9e7ac376cad5235e88a45ece817e6b
mode = 0644 mode = 0644
[instance-apache-import] [instance-apache-import]
...@@ -84,7 +84,7 @@ context = key templateapache instance-apache-php:output ...@@ -84,7 +84,7 @@ context = key templateapache instance-apache-php:output
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = bdc7e126567ece6bf93a9bb493e29fac md5sum = dca811871e293cf3ce1bfc52dd8dab64
mode = 0644 mode = 0644
[instance-resilient] [instance-resilient]
...@@ -100,7 +100,7 @@ context = key buildout buildout:bin-directory ...@@ -100,7 +100,7 @@ context = key buildout buildout:bin-directory
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = 35bbf8cb40fe7185664641d82b406334 md5sum = e8fd20a32c87853ecba2846f50cd0898
mode = 0644 mode = 0644
[instance-postgres] [instance-postgres]
...@@ -184,7 +184,6 @@ cp.recipe.cmd = 0.4 ...@@ -184,7 +184,6 @@ cp.recipe.cmd = 0.4
gitdb = 0.5.4 gitdb = 0.5.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pycrypto = 2.6 pycrypto = 2.6
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.40.4 slapos.toolbox = 0.40.4
smmap = 0.8.2 smmap = 0.8.2
...@@ -203,7 +202,7 @@ feedparser = 5.1.3 ...@@ -203,7 +202,7 @@ feedparser = 5.1.3
# Required by: # Required by:
# slapos.toolbox==0.40.2 # slapos.toolbox==0.40.2
paramiko = 1.15.2 paramiko = 1.15.3
# Required by: # Required by:
# slapos.recipe.maarch==0.4 # slapos.recipe.maarch==0.4
......
...@@ -11,7 +11,7 @@ offline = true ...@@ -11,7 +11,7 @@ offline = true
# += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended # += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended
parts += parts +=
{{ parts.replicate("apache", "3") }} {{ parts.replicate("apache", "3") }}
publish-connection-informations publish-connection-information
{{ replicated.replicate("apache", "3", "apache-export", "apache-import") }} {{ replicated.replicate("apache", "3", "apache-export", "apache-import") }}
...@@ -28,7 +28,7 @@ config-pbs-postgres3-computer-guid = ${slap-parameter:pbs-postgres3-computer-gui ...@@ -28,7 +28,7 @@ config-pbs-postgres3-computer-guid = ${slap-parameter:pbs-postgres3-computer-gui
config-domain = ${slap-parameter:domain} config-domain = ${slap-parameter:domain}
config-maarch-sql-data-file = ${slap-parameter:maarch-sql-data-file} config-maarch-sql-data-file = ${slap-parameter:maarch-sql-data-file}
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend_url = ${request-apache:connection-backend_url} backend_url = ${request-apache:connection-backend_url}
url = ${request-apache:connection-url} url = ${request-apache:connection-url}
......
...@@ -41,7 +41,7 @@ recipe = slapos.recipe.template ...@@ -41,7 +41,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/monitor.cfg.in url = ${:_profile_base_location_}/monitor.cfg.in
output = ${buildout:directory}/monitor.cfg output = ${buildout:directory}/monitor.cfg
filename = monitor.cfg filename = monitor.cfg
md5sum = 51284c0aeb62eccd37f8a4e1621ee28c md5sum = 9b31959560d3cde094199e267bbb013b
mode = 0644 mode = 0644
[monitor-bin] [monitor-bin]
......
...@@ -288,3 +288,6 @@ curl_path = ${curl:location}/bin/curl ...@@ -288,3 +288,6 @@ curl_path = ${curl:location}/bin/curl
[publish-connection-informations] [publish-connection-informations]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
monitor_url = $${monitor-parameters:url} monitor_url = $${monitor-parameters:url}
[publish-connection-information]
<= publish-connection-informations
Monitor
=======
This stack has for purpose to know if all promises went/are ok.
It provides a web interface, to see which promises failed. It also provide a rss
feed to easily know the actual state of your instance, and to know when it
started to went bad.
THIS STACK IS A KIND OF FORK OF THE `stack/monitor`. THIS ONE WAS CREATED AS A
REDESIGNED ONE TO REMOVE UNWANTED FEATURES AND TO GO FURTHER TO THE GOOD DESIGN
DIRECTION. PLEASE, DO NOT USE THE OLD MONITORING INTERFACE OR ONLY FOR BACKWARD
COMPATIBILITY REASON.
Summary:
- Activate monitoring for you software
- Add a monitor promise
- Information about URL access
- Monitor promise configuration example
- Promise requirements
- monitor.haljson example
- monitor.conf example
Activate monitoring for your software
-------------------------------------
You just have to extend the monitor stack from your software.cfg.
You can also create a new buildout which extends your software, and the
monitoring stack:
[buildout]
extends =
monitor_url
my_software_url
In your instance.cfg, your publish section should be named `[publish]` in order
to extends the one of the monitoring stack.
Then, in the same file you can configure the monitor by adding this section:
[monitor-instance-parameter]
monitor-httpd-ipv6 = ...
monitor-httpd-port = ...
monitor-title = ...
Add a monitor promise
---------------------
For instance, we want to create a promise for KVM log parsing. Add these
sections in its instance.cfg:
[directory]
monitor-promise = ${:etc}/monitor-promise
[kvm-log-parser-promise]
recipe = ....
filename = kvm-log-parser
rendered = ${directory:monitor-promise}/${:filename}
mode = 0755
[buildout]
parts += kvm-log-parser-promise
We can optionaly add promise title:
[kvm-log-parser-promise-parameter]
# fill with -> see "Service config example" below
title = Kvm log parse
[kvm-log-parser-promise-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:monitor-promise}/${kvm-log-parser-promise:filename}.cfg
template = service.cfg
context = section parameter_dict kvm-log-parser-promise-parameter
[buildout]
parts += kvm-log-parser-promise-cfg
... and optionaly a specific frequency:
[kvm-log-parser-promise-parameter]
frequency = */5 * * * *
Optionaly, we also want a custom interface:
[directory]
kvm-log-parser-promise-interface-dir = ....../interface
[kvm-log-parser-promise-parameter]
private-path-list += ${directory:kvm-log-parser-promise-interface-dir}
[kvm-log-parser-promise-interface]
recipe = ....
rendered = ${directory:kvm-log-parser-interface-dir}/index.html
[buildout]
parts += kvm-log-parser-promise-interface
service.cfg:
[service]
{% for key, value in parameter_dict.items() -%}
{{ key }} = {{ value.strip().replace("\n", "\n ") }}
{% endfor -%}
Information about URL access
----------------------------
Open HTTP GET on static files, open HTTP POST on cgi
GET <root_monitor>/ // classical monitoring interface
GET <root_monitor>/monitor.haljson // monitor conf
GET <root_monitor>/public/<service>.status.json // service status json
Example for KVM log parsing promise
GET <kvm_monitor>/monitor.haljson
GET <kvm_monitor>/public/kvm-log-parser.status.json
GET <kvm_monitor>/public/kvm-log-parser/index.html
POST <kvm_monitor>/cgi-bin/monitor-run-promise.cgi?service=kvm-log-parse // rerun the promise
Information about internal file tree
------------------------------------
Tree for monitor runtime:
etc/monitor.conf // generated by slapos
etc/cron.d/monitor // generated by slapos
bin/monitor.py // generated by slapos
srv/monitor/web/index.html // static
srv/monitor/web/monitor.css // static
srv/monitor/web/monitor.js // static
srv/monitor/web/monitor.haljson // generated by monitor.py
srv/monitor/public/.... // generated by monitor.py
srv/monitor/private/.... // generated by monitor.py
srv/monitor/cgi-bin/.... // generated by monitor.py
Example for KVM log parsing promise
etc/monitor-promise/kvm-log-parse.cfg // generated by slapos (kvm-log-parser-promise)
etc/monitor-promise/kvm-log-parse // generated by slapos (kvm-log-parser-promise)
var/kvm-log-parser-promise/interface/index.html // generated by slapos (kvm-log-parser-promise)
var/log/kvm.log // generated by kvm
var/log/kvm-log-parse-last-report.csv // generated by kvm-log-parse
srv/monitor/public/kvm-log-parse.status.json // generated by kvm-log-parse (indirectly by the monitor promise executor)
srv/monitor/public/kvm-log-parse/kvm.log -> var/log/kvm.log // generated by monitor.py
srv/monitor/public/kvm-log-parse/kvm-log-parse-last-report.csv -> var/log/kvm-log-parse-last-report.csv // genareted by monitor.py
srv/monitor/private/kvm-log-parse/interface -> var/kvm-log-parser-promise/interface // generated by monitor.py
srv/monitor/cgi-bin/kvm-log-parse/action.cgi -> var/kvm-log-parser-promise/action.cgi // generated by monitor.py
Monitor promise config example
------------------------------
Example for KVM log parsing promise
# etc/monitor-promise/kvm-log-parse.cfg
[service]
title = Kvm log parse
frequency = <Cron Syntax>
cgi-path-list = # automatically symlink to srv/monitor/cgi-bin/$service/
$instance/var/kvm-log-parser-promise/action.cgi
public-path-list = # automatically symlink to srv/monitor/public/$service/
$instance/var/log/kvm.log
private-path-list = # automatically symlink to srv/monitor/private/$service/
$instance/var/log
$instance/var/kvm-log-parser-promise/interface
On cron, the command will be something like:
${service:frequency} ${monitor:promise-executor-path} '${monitor:service-pid-folder}/${service:name}.pid' '${service:status-path}' '${promise_path}'
and "monitor:promise-executor-path" is a script that would run a promise if not
already on going (see `run-promise.py`).
TODO cron accepts 999 characters maximum for a command, so we should reduce the
size of the cron command
TODO put `run-promise.py` in the software
Promise requirements
--------------------
A promise should check something (like web page is well cached, there's not too
much slow queries, ...):
- MUST output the status.json in stdout
- SHOULD output on stdout
- MUST return 0 if status is good else != 0
- the status.json MUST contain "message" (string) which explains why the status is OK or bad
monitor.haljson example
-----------------------
{
"_links": {
"related_monitor": [
{ "href": "<url>/static" },
{ "href": "http://my.other.monitor" }
]
},
"_embedded": {
"service": [
{
"_links": {
"status": { "href": "<url>/kvm-log-parse/status.json" },
"interface": { "href": "<url>/kvm-log-parse/index.html" }
},
"title": "KVM log parse",
"id": "kvm-log-parse"
},
{
"_links": {
"status": { "href": "<url>/<service>/status.json" },
"interface": { "href": "<url>/<service>/index.html" }
},
"title": "Service name",
"id": "<service>"
}
]
},
"title": "KVM Monitoring interface"
}
monitor.conf example
--------------------
[monitor]
title = KVM Monitoring interface
monitor-hal-json = $instance/srv/monitor/web/monitor.haljson
public-folder = $instance/srv/monitor/public
private-folder = $instance/srv/monitor/private
web-folder = $instance/srv/monitor/web
cgi-folder = $instance/srv/monitor/cgi-bin
service-pid-folder = $instance/var/monitor/service-pid
public-path-list =
$instance/var/log
private-path-list =
$instance/srv/backup/log_rotate
monitor-url-list =
https://[...]/
https://[...]/
[buildout]
# XXX THIS STACK IS A KIND OF FORK OF `stack/monitor`. THIS ONE WAS
# CREATED AS A REDESIGNED ONE TO REMOVE UNWANTED FEATURES AND
# TO GO FURTHER TO THE GOOD DESIGN DIRECTION. SEE THE README FOR
# MORE INFORMATION.
extends =
../../component/apache/buildout.cfg
../../component/curl/buildout.cfg
../../component/dash/buildout.cfg
../../component/dcron/buildout.cfg
../../component/openssl/buildout.cfg
parts +=
slapos-cookbook
dcron
monitor-eggs
extra-eggs
monitor-conf
monitor-bin
monitor-web-index-html
monitor-web-monitor-css
monitor-web-monitor-js
monitor-web-monitor-logout-cgi
monitor-web-monitor-logout-page
monitor-template
rss-bin
[monitor-download-base]
recipe = hexagonit.recipe.download
download-only = true
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[monitor-eggs]
recipe = zc.recipe.egg
eggs =
collective.recipe.template
cns.recipe.symlink
[extra-eggs]
recipe = zc.recipe.egg
interpreter = pythonwitheggs
eggs =
PyRSS2Gen
Jinja2
[make-rss-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/make-rss.sh.in
md5sum = 98c8f6fd81e405b0ad10db07c3776321
output = ${buildout:directory}/template-make-rss.sh.in
mode = 0644
[monitor-conf]
<= monitor-download-base
filename = monitor.conf.in
md5sum = 2db5c08c7e8658981b4b1e3f27fd5967
[monitor-bin]
<= monitor-download-base
filename = monitor.py.in
md5sum = 2484cb185c391890a05db26c2163af8e
[monitor-web-default-promise-interface]
<= monitor-download-base
filename = default-promise-interface.html
md5sum = eaedae330cd155f8b693b418286d0d98
[monitor-web-index-html]
<= monitor-download-base
filename = index.html
md5sum = 262db07691c145301252a49b6b51d11d
[monitor-web-monitor-css]
<= monitor-download-base
filename = monitor.css
md5sum = a18ab932e5e2e656995f47c7d4a7853a
[monitor-web-monitor-js]
<= monitor-download-base
filename = monitor.js.in
md5sum = 3451788c49d3664cd9b72551fab34a9b
[monitor-web-monitor-logout-cgi]
recipe = slapos.recipe.template:jinja2
filename = monitor-logout.py.cgi
md5sum = 5b3c0aa559722a3bae5a692ea9a0a441
mode = 0755
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/monitor-logout.cgi
context = key python_executable buildout:executable
[monitor-web-monitor-logout-page]
<= monitor-download-base
filename = monitor-logout.html
md5sum = b210c6842df541305d299081bc1bf81e
[monitor-web-monitor-promise-runner-cgi]
<= monitor-download-base
filename = monitor-run-promise.py.cgi
md5sum = 15625e5bf6c1b57b9199250951ffc16e
[monitor-template]
recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
md5sum = 6d5f1ceff198262319566ee25093c350
context =
key apache_location apache:location
key gzip_location gzip:location
raw monitor_bin ${monitor-bin:location}/${monitor-bin:filename}
raw monitor_conf_template ${monitor-conf:location}/${monitor-conf:filename}
raw monitor_password_promise_template ${monitor-password-promise:location}/${monitor-password-promise:filename}
raw monitor_password_cgi_template ${monitor-password-cgi:location}/${monitor-password-cgi:filename}
raw monitor_password_promise_interface_template ${monitor-password-promise-interface:location}/${monitor-password-promise-interface:filename}
raw monitor_web_default_promise_interface ${monitor-web-default-promise-interface:location}/${monitor-web-default-promise-interface:filename}
raw monitor_web_index_html ${monitor-web-index-html:location}/${monitor-web-index-html:filename}
raw monitor_web_monitor_css ${monitor-web-monitor-css:location}/${monitor-web-monitor-css:filename}
key monitor_web_monitor_logout_cgi monitor-web-monitor-logout-cgi:rendered
raw monitor_web_monitor_logout_page ${monitor-web-monitor-logout-page:location}/${monitor-web-monitor-logout-page:filename}
raw monitor_web_monitor_promise_runner_cgi ${monitor-web-monitor-promise-runner-cgi:location}/${monitor-web-monitor-promise-runner-cgi:filename}
raw monitor_web_monitor_js ${monitor-web-monitor-js:location}/${monitor-web-monitor-js:filename}
raw curl_executable_location ${curl:location}/bin/curl
raw dash_executable_location ${dash:location}/bin/dash
raw dcron_executable_location ${dcron:location}/sbin/crond
raw logrotate_executable_location ${logrotate:location}/usr/sbin/logrotate
raw monitor_httpd_template ${monitor-httpd-conf:location}/${monitor-httpd-conf:filename}
raw monitor_service_conf_template ${monitor-service-conf-template:location}/${monitor-service-conf-template:filename}
raw monitor_service_run ${monitor-service-template-run:location}/${monitor-service-template-run:filename}
raw openssl_executable_location ${openssl:location}/bin/openssl
raw python_executable ${buildout:executable}
raw promise_executor_py ${run-promise-py:location}/${run-promise-py:filename}
raw template_wrapper ${template-wrapper:output}
raw status2rss_executable_path ${status2rss-executable:location}/${status2rss-executable:filename}
[monitor-httpd-conf]
<= monitor-download-base
md5sum = 625d3d948c0af7b4848d7fad92bfb844
filename = monitor-httpd.conf.in
[monitor-service-conf-template]
<= monitor-download-base
filename = monitor-service.cfg.in
md5sum = 5913d2a0096b50537f394a49b762b3e5
[monitor-service-template-run]
<= monitor-download-base
md5sum = d5f29fa859a45696e1ff1bb174ab1111
filename = monitor-service-run.in
[run-promise-py]
<= monitor-download-base
filename = run-promise.py
md5sum = 6db26ce13becf8a190e34c14cb8b6f9f
[monitor-httpd-template]
<= monitor-download-base
md5sum = 93e1dda50cb71bfe29966b2946c02dd1
filename = cgi-httpd.conf.in
[index]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
md5sum = e759977b21c70213daa4c2701f2c2078
destination = ${buildout:parts-directory}/monitor-index
filename = index.cgi.in
mode = 0644
[index-template]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
destination = ${buildout:parts-directory}/monitor-template-index
md5sum = 7400c8cfa16a15a0d41f512b8bbb1581
filename = index.html.jinja2
mode = 0644
[status-cgi]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
md5sum = e43d79bec8824265e22df7960744113a
destination = ${buildout:parts-directory}/monitor-template-status-cgi
filename = status.cgi.in
mode = 0644
[status-history-cgi]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
#md5sum = 4fb26753ee669b8ac90ffe33dbd12e8f
destination = ${buildout:parts-directory}/monitor-template-status-history-cgi
filename = status-history.cgi.in
mode = 0644
[settings-cgi]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
md5sum = b4cef123a3273e848e8fe496e22b20a8
destination = ${buildout:parts-directory}/monitor-template-settings-cgi
filename = settings.cgi.in
mode = 0644
[monitor-password-promise]
<= monitor-download-base
filename = monitor-password-promise.py.in
md5sum = 0a9a42551ed6bdb973fd1f0dd1d4ec86
[monitor-password-cgi]
<= monitor-download-base
md5sum = 04fc7e6d892d29a601cfd43d1700eeda
filename = monitor-password.py.cgi
[monitor-password-promise-interface]
<= monitor-download-base
filename = monitor-password-interface.html
md5sum = 04b664dfb47bfd3d01502768311aa239
[status2rss-executable]
<= monitor-download-base
filename = status2rss.py
md5sum = 65315ded80cd72f54f6e12d06ce813c4
[dcron-service]
recipe = slapos.recipe.template
url = ${template-dcron-service:output}
output = $${directory:services}/crond
mode = 0700
logfile = $${directory:log}/crond.log
[template-wrapper]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/wrapper.in
output = ${buildout:directory}/template-wrapper.cfg
mode = 0644
md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
PidFile "{{ httpd_configuration.get('pid-file') }}"
StartServers 1
ServerLimit 1
ThreadLimit 4
ThreadsPerChild 4
ServerName example.com
ServerAdmin someone@email
<IfDefine !MonitorPort>
Listen [{{ httpd_configuration.get('listening-ip') }}]:{{ monitor_parameters.get('port') }}
Define MonitorPort
</IfDefine>
DocumentRoot "{{ directory.get('www') }}"
ErrorLog "{{ httpd_configuration.get('error-log') }}"
LoadModule unixd_module modules/mod_unixd.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule mime_module modules/mod_mime.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule dir_module modules/mod_dir.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule alias_module modules/mod_alias.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
# SSL Configuration
<IfDefine !SSLConfigured>
Define SSLConfigured
SSLCertificateFile {{ httpd_configuration.get('certificate') }}
SSLCertificateKeyFile {{ httpd_configuration.get('key') }}
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLRandomSeed startup /dev/urandom 256
SSLRandomSeed connect builtin
SSLProtocol -ALL +SSLv3 +TLSv1
SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH
</IfDefine>
SSLEngine On
ScriptSock {{ httpd_configuration.get('cgid-pid-file') }}
<Directory {{ directory.get('www') }}>
SSLVerifyDepth 1
SSLRequireSSL
SSLOptions +StrictRequire
# XXX: security????
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex {{ monitor_parameters.get('index-filename') }}
</Directory>
Alias /private/ {{ directory.get('private-directory') }}/
<Directory {{ directory.get('private-directory') }}>
Order Deny,Allow
Deny from env=AUTHREQUIRED
<Files ".??*">
Order Allow,Deny
Deny from all
</Files>
AuthType Basic
AuthName "Private access"
AuthUserFile "{{ monitor_parameters.get('htaccess-file') }}"
Require valid-user
Options Indexes FollowSymLinks
Satisfy all
</Directory>
<Location /rewrite>
AuthType Basic
AuthName "Private access"
AuthUserFile "{{ monitor_parameters.get('htaccess-file') }}"
Require valid-user
</Location>
ProxyVia On
RewriteEngine On
{% for key, value in monitor_rewrite_rule.iteritems() %}
RewriteRule ^/rewrite/{{ key }}($|/.*) {{ value }}/$1 [P,L]
{% endfor %}
<!DOCTYPE html>
<html>
<head>
<title>Promise status</title>
<style>
input, button {
min-height: 10mm;
min-width: 10mm;
}
</style>
<script>
function getServiceName() {
var match = /(?:&|\?)service_name=([^&]*)/.exec(location.search);
if (match) {
return match[1];
}
throw new Error("no service name found");
}
var service_name = getServiceName(),
monitor_json_url = "/monitor.haljson",
status_json_url = "/public/" + service_name + ".status.json",
rerun_cgi_url = "/cgi-bin/monitor-run-promise.cgi?service=" + service_name;
function newDeferred() {
var d = {
"promise": undefined,
"resolve": undefined,
"reject": undefined
};
d.promise = new Promise(function (resolve, reject) {
d.resolve = resolve;
d.reject = reject;
});
return d;
}
function xhr(param) {
/*global XMLHttpRequest */
var d = newDeferred(), xhr = new XMLHttpRequest(), k, i, l, a;
d.promise.cancel = function () { xhr.abort(); };
xhr.open((param.method || "GET").toUpperCase(), param.url, true);
xhr.responseType = param.responseType || "";
if (param.withCredentials !== undefined) {
xhr.withCredentials = param.withCredentials;
}
if (param.headers) {
a = Object.keys(param.headers);
l = a.length;
for (i = 0; i < l; i += 1) {
k = a[i];
xhr.setRequestHeader(k, param.headers[k]);
}
}
xhr.addEventListener("load", function (e) {
var r, t = e.target, callback;
if (param.noStatusCheck) {
d.resolve(t);
} else if (t.status < 400) {
d.resolve(t);
} else {
d.reject(new Error("HTTP: " + (t.status ? t.status + " " : "") + (t.statusText || "Unknown")));
}
}, false);
xhr.addEventListener("error", function (e) {
return d.reject(new Error("HTTP: Error"));
}, false);
xhr.addEventListener("abort", function (e) {
return d.reject(new Error("HTTP: Aborted"));
}, false);
xhr.send(param.data);
return d.promise;
}
function unexpectedError(reason) {
console.error(reason);
alert(reason);
}
function PromiseStatusInterface(config) {
var it = this,
statusP = document.createElement("p"),
descriptionH2 = document.createElement("h2"),
descriptionP = document.createElement("p"),
errorH2 = document.createElement("h2"),
errorPre = document.createElement("pre"),
header = document.createElement("header"),
h1 = document.createElement("h1"),
h2 = document.createElement("h2"),
a = document.createElement("a"),
button = document.createElement("button");
this.element = config.rootElement || document.createElement("div");
this.statusP = statusP;
this.descriptionP = descriptionP;
this.errorH2 = errorH2;
this.errorPre = errorPre;
this.element.appendChild(header);
header.appendChild(a);
a.setAttribute("tabindex", "-1");
a.setAttribute("href", "/");
a.appendChild(button);
button.textContent = "Home";
a = document.createElement("a");
button = document.createElement("button");
header.appendChild(a);
a.setAttribute("tabindex", "-1");
a.setAttribute("href", "");
a.appendChild(button);
button.textContent = "Refresh";
button = document.createElement("button");
header.appendChild(button);
button.textContent = "Run promise now";
button.onclick = function () {
this.runPromiseNow();
}.bind(this);
this.runPromiseNowButton = button;
this.element.appendChild(h1);
h1.textContent = "Promise status";
this.element.appendChild(statusP);
this.element.appendChild(descriptionH2);
descriptionH2.textContent = "Description";
this.element.appendChild(descriptionP);
this.element.appendChild(errorH2);
errorH2.textContent = "Error output";
errorH2.style.display = "none";
this.element.appendChild(errorPre);
errorPre.style.display = "none";
this.loadStatusUi();
this.loadDescriptionUi();
this.loadErrorUi();
}
PromiseStatusInterface.prototype.loadStatusJson = function () {
if (this.status_json_promise) { return; }
this.status_json_promise = Promise.resolve().then(function () {
return xhr({url: status_json_url, withCredentials: true, responseType: "json"});
}).then(function (xhr) {
return xhr.response;
});
this.status_json_promise.catch(function () { return; }).then(function () {
setTimeout(function () {
delete this.status_json_promise;
}.bind(this), 1000);
}.bind(this));
return this.status_json_promise;
};
PromiseStatusInterface.prototype.loadStatusUi = function () {
this.loadStatusJson();
this.statusP.textContent = "Loading status...";
return this.status_json_promise.then(function (status_json) {
if (status_json.status === "OK") {
this.statusP.textContent = "Status: OK.";
} else {
this.statusP.textContent = "Status: BAD (" + status_json.status + ").";
}
if (status_json.message) {
this.statusP.appendChild(document.createTextNode(" " + status_json.message));
}
}.bind(this), function (reason) {
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.statusP.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this)).catch(unexpectedError);
};
PromiseStatusInterface.prototype.loadDescriptionUi = function () {
this.loadStatusJson();
this.descriptionP.textContent = "Loading description...";
return this.status_json_promise.then(function (status_json) {
if (status_json.description) {
this.descriptionP.textContent = status_json.description;
} else {
this.descriptionP.textContent = "No description";
}
}.bind(this), function (reason) {
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.descriptionP.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this)).catch(unexpectedError);
};
PromiseStatusInterface.prototype.loadErrorUi = function () {
this.loadStatusJson();
this.errorPre.textContent = "Loading error output...";
return this.status_json_promise.then(function (status_json) {
if (status_json.error) {
this.errorH2.style.display = "";
this.errorPre.style.display = "";
this.errorPre.textContent = status_json.error;
} else {
this.errorH2.style.display = "none";
this.errorPre.style.display = "none";
this.errorPre.textContent = "";
}
}.bind(this), function (reason) {
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.errorPre.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this)).catch(unexpectedError);
};
PromiseStatusInterface.prototype.runPromiseNow = function () {
this.runPromiseNowButton.disabled = true;
var original_text = this.runPromiseNowButton.textContent;
this.runPromiseNowButton.textContent = "Sending message...";
return Promise.resolve().then(function () {
return xhr({url: rerun_cgi_url, method: "POST", withCredentials: true});
}).catch(unexpectedError).then(function () {
this.runPromiseNowButton.textContent = original_text;
}.bind(this));
};
/*global setTimeout */
setTimeout(function () {
/*global document */
document.body.innerHTML = "";
return new PromiseStatusInterface({rootElement: document.body});
});
</script>
</head>
<body>
<h1>Promise status</h1>
<noscript>Javascript should be enabled</noscript>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="monitor.css" />
<script src="monitor.js"></script>
</head>
<body>
<noscript>Please enable javascript on your browser to make this application to work.</noscript>
</body>
</html>
[cron]
recipe = slapos.cookbook:cron
cron-entries = ${logrotate-directory:cron-entries}
dcrond-binary = {{ dcron_executable_location }}
crontabs = ${logrotate-directory:crontabs}
cronstamps = ${logrotate-directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
binary = ${logrotate-directory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = ${logrotate-directory:bin}/cron_simplelogger
log = ${logrotate-directory:log}/cron.log
[logrotate]
recipe = slapos.cookbook:logrotate
logrotate-entries = ${logrotate-directory:logrotate-entries}
backup = ${logrotate-directory:logrotate-backup}
logrotate-binary = {{ logrotate_executable_location }}
gzip-binary = {{ gzip_location }}/bin/gzip
gunzip-binary = {{ gzip_location }}/bin/gunzip
wrapper = ${logrotate-directory:bin}/logrotate
conf = ${logrotate-directory:etc}/logrotate.conf
state-file = ${logrotate-directory:srv}/logrotate.status
[cron-entry-logrotate]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = logrotate
frequency = 0 0 * * *
command = ${logrotate:wrapper}
# Add log to cron
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = ${monitor-directory:bin}/cron_simplelogger
log = ${monitor-directory:log}/cron.log
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
var = ${buildout:directory}/var
run = ${:var}/run
log = ${:var}/log
scripts = ${:etc}/run
services = ${:etc}/service
promises = ${:etc}/promise
monitor = ${:srv}/monitor
monitor-promise = ${:etc}/monitor-promise
[monitor-directory]
recipe = slapos.cookbook:mkdirectory
bin = ${directory:bin}
etc = ${directory:etc}
run = ${directory:monitor}/run
#run = ${directory:scripts}
pids = ${directory:run}/monitor
cgi-bin = ${directory:monitor}/cgi-bin
public = ${directory:monitor}/public
private = ${directory:monitor}/private
services = ${directory:services}
services-conf = ${directory:etc}/monitor.conf.d
www = ${directory:monitor}/web
web-dir = ${directory:monitor}/web
log = ${directory:log}/monitor
promise-wrapper = ${directory:var}/monitor-promise-wrapper
monitor-var = ${directory:var}/monitor
monitor-password-var = ${monitor-directory:monitor-var}/password
monitor-password-interface = ${monitor-directory:monitor-password-var}/password/interface
monitor-status2rss-var = ${monitor-directory:monitor-var}/status2rss
[logrotate-directory]
recipe = slapos.cookbook:mkdirectory
cron-entries = ${:etc}/cron.d
cronstamps = ${:etc}/cronstamps
crontabs = ${:etc}/crontabs
logrotate-backup = ${:backup}/logrotate
logrotate-entries = ${:etc}/logrotate.d
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
backup = ${:srv}/backup
etc = ${buildout:directory}/etc
services = ${:etc}/service
log = ${buildout:directory}/var/log
[ca-directory]
recipe = slapos.cookbook:mkdirectory
root = ${directory:srv}/ssl
requests = ${:root}/requests
private = ${:root}/private
certs = ${:root}/certs
newcerts = ${:root}/newcerts
crl = ${:root}/crl
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ openssl_executable_location }}
ca-dir = ${ca-directory:root}
requests-directory = ${ca-directory:requests}
wrapper = ${monitor-directory:services}/certificate_authority
ca-private = ${ca-directory:private}
ca-certs = ${ca-directory:certs}
ca-newcerts = ${ca-directory:newcerts}
ca-crl = ${ca-directory:crl}
[ca-httpd]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = ${monitor-httpd-conf-parameter:key-file}
cert-file = ${monitor-httpd-conf-parameter:cert-file}
executable = ${httpd-wrapper:wrapper-path}
wrapper = ${directory:services}/monitor-httpd
[monitor-conf-parameters]
title = ${monitor-instance-parameter:monitor-title}
service-executable-dir = ${monitor-directory:run}
template-service-run = {{ monitor_service_run }}
public-folder = ${monitor-directory:public}
private-folder = ${monitor-directory:private}
web-folder = ${monitor-directory:web-dir}
monitor-hal-json = ${monitor-directory:web-dir}/monitor.haljson
service-pid-folder = ${monitor-directory:pids}
crond-folder = ${logrotate-directory:cron-entries}
public-path-list =
${directory:log}
private-path-list =
monitor-url-list =
[monitor-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_conf_template }}
rendered = ${directory:etc}/${:filename}
filename = monitor.conf
context = section parameter_dict monitor-conf-parameters
[httpd-monitor-htpasswd]
recipe = plone.recipe.command
stop-on-error = true
htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd
command = {{ apache_location }}/bin/htpasswd -cb ${:htpasswd-path} ${:user} ${:password}
user = admin
password = admin
[monitor-httpd-conf-parameter]
listening-ip = ${monitor-instance-parameter:monitor-httpd-ipv6}
port = ${monitor-instance-parameter:monitor-httpd-port}
pid-file = ${directory:run}/httpd.pid
cgid-pid-file = ${directory:run}/cgid.pid
access-log = ${monitor-directory:log}/httpd-access.log
error-log = ${monitor-directory:log}/httpd-error.log
cert-file = ${ca-directory:certs}/httpd.crt
key-file = ${ca-directory:certs}/httpd.key
htpasswd-file = ${httpd-monitor-htpasswd:htpasswd-path}
url = https://[${monitor-instance-parameter:monitor-httpd-ipv6}]:${:port}/
[monitor-httpd-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_httpd_template }}
rendered = ${monitor-directory:etc}/monitor-httpd.conf
mode = 0744
context =
section directory monitor-directory
section parameter_dict monitor-httpd-conf-parameter
[httpd-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ apache_location }}/bin/httpd -f ${monitor-httpd-conf:rendered} -DFOREGROUND
wrapper-path = ${directory:bin}/monitor-httpd
wait-for-files =
${ca-directory:certs}/httpd.key
${ca-directory:certs}/httpd.crt
${cgi-httpd-graceful-wrapper:rendered}
[cgi-httpd-graceful-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ template_wrapper }}
rendered = ${directory:run}/monitor-httpd-graceful
mode = 0700
context =
key content :command
command = kill -USR1 $(cat ${monitor-httpd-conf-parameter:pid-file})
[monitor-status2rss-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ python_executable }} {{ status2rss_executable_path }} '${monitor-instance-parameter:monitor-title}' '${monitor-httpd-conf-parameter:url}' ${monitor-directory:public} ${monitor-directory:monitor-status2rss-var}/previous_status ${monitor-directory:web-dir}/feed
wrapper-path = ${directory:bin}/monitor-status2rss.py
[monitor-status2rss-cron-entry]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = monitor-status2rss
frequency = * * * * *
command = ${monitor-status2rss-wrapper:wrapper-path}
[monitor-web-default-promise-interface]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_default_promise_interface }}
rendered = ${monitor-directory:web-dir}/default-promise-interface.html
context =
[monitor-web-index-html]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_index_html }}
rendered = ${monitor-directory:web-dir}/index.html
context =
[monitor-web-monitor-css]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_monitor_css }}
rendered = ${monitor-directory:web-dir}/monitor.css
context =
[monitor-web-monitor-js]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_monitor_js }}
rendered = ${monitor-directory:web-dir}/monitor.js
context =
key monitor_title monitor-instance-parameter:monitor-title
[monitor-web-monitor-logout-cgi]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_monitor_logout_cgi }}
rendered = ${monitor-directory:cgi-bin}/monitor-logout.cgi
mode = 0755
context =
[monitor-web-monitor-logout-page]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_monitor_logout_page }}
rendered = ${monitor-directory:web-dir}/logout
context =
[monitor-web-monitor-promise-runner-cgi]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_web_monitor_promise_runner_cgi }}
rendered = ${monitor-directory:cgi-bin}/monitor-run-promise.cgi
mode = 0755
context =
raw python_executable {{ python_executable }}
key promise_wrapper_folder monitor-directory:promise-wrapper
[start-monitor]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_bin }}
rendered = ${directory:scripts}/bootstrap-monitor
context =
raw python_executable {{ python_executable }}
key public_folder monitor-directory:public
key private_folder monitor-directory:private
key monitor_configuration_path monitor-conf:rendered
key promise_runner_path monitor-run-promise:rendered
key promise_folder directory:promises
key monitor_promise_folder directory:monitor-promise
key promise_wrapper_folder monitor-directory:promise-wrapper
[monitor-run-promise]
recipe = slapos.recipe.template:jinja2
template = {{ promise_executor_py }}
rendered = ${directory:bin}/monitor-run-promise
mode = 700
context =
raw python_executable {{ python_executable }}
[monitor-httpd-promise]
recipe = slapos.cookbook:check_url_available
path = ${directory:promises}/${:filename}
filename = monitor-httpd-listening-on-tcp
url = ${monitor-httpd-conf-parameter:url}
check-secure = 1
dash_path = {{ dash_executable_location }}
curl_path = {{ curl_executable_location }}
[monitor-httpd-promise-conf]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:monitor-promise}/${monitor-httpd-promise:filename}.cfg
template = {{ monitor_service_conf_template }}
mode = 0644
context = section parameter_dict monitor-httpd-promise-conf-parameter
[monitor-httpd-promise-conf-parameter]
title = Monitor httpd listening
# frequency minute hour day mounth weekday
frequency = * * * * *
public-path-list = ${monitor-httpd-conf-parameter:access-log} ${monitor-httpd-conf-parameter:error-log}
#private-path-list =
[monitor-password-parameter]
password-changed-once-path = ${directory:var}/monitor-password-changed-once
[monitor-password-promise]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_password_promise_template }}
rendered = ${directory:monitor-promise}/${:filename}
filename = monitor-password
mode = 0755
context =
raw python_executable {{ python_executable }}
key password_changed_once_path monitor-password-parameter:password-changed-once-path
[monitor-password-promise-conf-parameter]
title = Monitor password
frequency = */5 * * * *
private-path-list = ${monitor-directory:monitor-password-interface}
[monitor-password-promise-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_service_conf_template }}
rendered = ${directory:monitor-promise}/${monitor-password-promise:filename}.cfg
mode = 0644
context = section parameter_dict monitor-password-promise-conf-parameter
[monitor-password-cgi]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_password_cgi_template }}
rendered = ${monitor-directory:cgi-bin}/monitor-password.cgi
context =
raw python_executable {{ python_executable }}
key password_changed_once_path monitor-password-parameter:password-changed-once-path
raw htpasswd_executable {{ apache_location }}/bin/htpasswd
key htpasswd_path httpd-monitor-htpasswd:htpasswd-path
[monitor-password-promise-interface]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_password_promise_interface_template }}
rendered = ${monitor-directory:monitor-password-interface}/index.html
context =
[publish]
recipe = slapos.cookbook:publish
monitor-url = ${monitor-httpd-conf-parameter:url}
[monitor-instance-parameter]
monitor-title = Monitoring interface
[buildout]
parts =
monitor-web-default-promise-interface
monitor-web-index-html
monitor-web-monitor-css
monitor-web-monitor-js
monitor-web-monitor-logout-cgi
monitor-web-monitor-logout-page
monitor-web-monitor-promise-runner-cgi
cron-entry-logrotate
certificate-authority
monitor-conf
start-monitor
ca-httpd
monitor-httpd-promise
monitor-httpd-promise-conf
monitor-password-promise
monitor-password-promise-conf
monitor-password-cgi
monitor-password-promise-interface
monitor-status2rss-cron-entry
publish
#!${dash-output:dash}
STATUS_DB={{ monitor_parameters['db-path'] }}
RSS_FILE={{ monitor_parameters['rss-path'] }}
PYTHON=${buildout:directory}/bin/${extra-eggs:interpreter}
STATUS2RSS=${rss-bin:location}/${rss-bin:filename}
$PYTHON $STATUS2RSS "Monitoring RSS feed" "{{ monitor_parameters['url'] }}/{{ monitor_parameters['index-filename'] }}" $STATUS_DB > $RSS_FILE
PidFile "{{ parameter_dict.get('pid-file') }}"
StartServers 1
ServerLimit 1
ThreadLimit 4
ThreadsPerChild 4
ServerName example.com
ServerAdmin someone@email
<IfDefine !MonitorPort>
Listen [{{ parameter_dict.get('listening-ip') }}]:{{ parameter_dict.get('port') }}
Define MonitorPort
</IfDefine>
DocumentRoot "{{ directory.get('www') }}"
ErrorLog "{{ parameter_dict.get('error-log') }}"
LoadModule unixd_module modules/mod_unixd.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule mime_module modules/mod_mime.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule dir_module modules/mod_dir.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule alias_module modules/mod_alias.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
# SSL Configuration
<IfDefine !SSLConfigured>
Define SSLConfigured
SSLCertificateFile {{ parameter_dict.get('cert-file') }}
SSLCertificateKeyFile {{ parameter_dict.get('key-file') }}
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLRandomSeed startup /dev/urandom 256
SSLRandomSeed connect builtin
SSLProtocol -ALL +SSLv3 +TLSv1
SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH
</IfDefine>
AddType application/hal+json .haljson
SSLEngine On
ScriptSock {{ parameter_dict.get('cgid-pid-file') }}
<Directory {{ directory.get('www') }}>
SSLVerifyDepth 1
SSLRequireSSL
SSLOptions +StrictRequire
# XXX: security????
DirectoryIndex index.html
Options FollowSymLinks
Order Deny,Allow
AuthType Basic
AuthName "Private access"
AuthUserFile "{{ parameter_dict.get('htpasswd-file') }}"
Require valid-user
</Directory>
Alias /private {{ directory.get('private') }}/
<Directory {{ directory.get('private') }}>
Order Deny,Allow
Deny from env=AUTHREQUIRED
<Files ".??*">
Order Allow,Deny
Deny from all
</Files>
AuthType Basic
AuthName "Private access"
AuthUserFile "{{ parameter_dict.get('htpasswd-file') }}"
Require valid-user
Options Indexes FollowSymLinks
Satisfy all
</Directory>
Alias /public {{ directory.get('public') }}/
<Directory {{ directory.get('public') }}>
Options Indexes FollowSymLinks
Order Allow,Deny
Allow from all
</Directory>
Alias /cgi-bin {{ directory.get('cgi-bin') }}
<Directory {{ directory.get('cgi-bin') }}>
# XXX security ???
Order Deny,Allow
Deny from all
<Files "*.cgi">
Order Deny,Allow
Deny from env=AUTHREQUIRED
AuthType Basic
AuthName "Private access"
AuthUserFile "{{ parameter_dict.get('htpasswd-file') }}"
Require valid-user
</Files>
Options +ExecCGI
AddHandler cgi-script .cgi
Options Indexes FollowSymLinks
Satisfy all
</Directory>
<!DOCTYPE html>
<html>
<head><title>Monitor logout</title></head>
<body>
<noscript>Cannot logout without javascript</noscript>
<script>
var logoutURL = "/cgi-bin/monitor-logout.cgi",
xhr = new XMLHttpRequest();
xhr.onload = function () {
if (xhr.status === 401) {
document.body.innerHTML = "<p>You are now logged out. You can go back to the monitor interface <a href=\"/\">here</a>.</p>";
} else {
console.error("Cannot logout (" + xhr.status + ")");
document.body.innerHTML = "<p>Cannot logout, retrying in 5 seconds.</p>";
setTimeout(location.reload.bind(location), 5000);
}
};
xhr.onerror = function () {
document.body.innerHTML = "<p>Cannot logout, please try again later.</p>";
};
xhr.open("POST", logoutURL, true, " logout", " password");
xhr.send();
document.body.innerHTML = "<p>Logging out...</p>";
</script>
</body>
</html>
#!{{ python_executable }}
print("Status: 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"Private access\"\r\n\r")
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Monitor password</title>
<style>
input, button {
min-height: 10mm;
min-width: 10mm;
}
</style>
<script>
var service_name = "monitor-password", // XXX hardcoded
monitor_json_url = "/monitor.haljson",
status_json_url = "/public/" + service_name + ".status.json",
rerun_cgi_url = "/cgi-bin/monitor-run-promise.cgi?service=" + service_name,
password_cgi_url_part = "/cgi-bin/monitor-password.cgi?password=";
function newDeferred() {
var d = {
"promise": undefined,
"resolve": undefined,
"reject": undefined
};
d.promise = new Promise(function (resolve, reject) {
d.resolve = resolve;
d.reject = reject;
});
return d;
}
function xhr(param) {
/*global XMLHttpRequest */
var d = newDeferred(), xhr = new XMLHttpRequest(), k, i, l, a;
d.promise.cancel = function () { xhr.abort(); };
if (param.username) {
xhr.open((param.method || "GET").toUpperCase(), param.url, true, param.username, param.password);
} else {
xhr.open((param.method || "GET").toUpperCase(), param.url, true);
}
xhr.responseType = param.responseType || "";
if (param.withCredentials !== undefined) {
xhr.withCredentials = param.withCredentials;
}
if (param.headers) {
a = Object.keys(param.headers);
l = a.length;
for (i = 0; i < l; i += 1) {
k = a[i];
xhr.setRequestHeader(k, param.headers[k]);
}
}
xhr.addEventListener("load", function (e) {
var r, t = e.target, callback;
if (param.noStatusCheck) {
d.resolve(t);
} else if (t.status < 400) {
d.resolve(t);
} else {
r = new Error("HTTP: " + (t.status ? t.status + " " : "") + (t.statusText || "Unknown"));
r.target = t;
d.reject(r);
}
}, false);
xhr.addEventListener("error", function (e) {
return d.reject(new Error("HTTP: Error"));
}, false);
xhr.addEventListener("abort", function (e) {
return d.reject(new Error("HTTP: Aborted"));
}, false);
xhr.send(param.data);
return d.promise;
}
function unexpectedError(reason) {
console.error(reason);
alert(reason);
}
function MonitorPasswordInterface(config) {
var it = this,
statusP = document.createElement("p"),
descriptionP = document.createElement("p"),
form = document.createElement("form"),
formPassword1Input = document.createElement("input"),
formPassword2Input = document.createElement("input"),
formChangePasswordButton = document.createElement("button"),
errorH2 = document.createElement("h2"),
errorPre = document.createElement("pre"),
header = document.createElement("header"),
h1 = document.createElement("h1"),
h2 = document.createElement("h2"),
a = document.createElement("a"),
button = document.createElement("button");
this.element = config.rootElement || document.createElement("div");
this.statusP = statusP;
this.descriptionP = descriptionP;
this.formPassword1Input = formPassword1Input;
this.formPassword2Input = formPassword2Input;
this.formChangePasswordButton = formChangePasswordButton;
this.errorH2 = errorH2;
this.errorPre = errorPre;
this.element.appendChild(header);
header.appendChild(a);
a.setAttribute("tabindex", "-1");
a.setAttribute("href", "/");
a.appendChild(button);
button.textContent = "Home";
a = document.createElement("a");
button = document.createElement("button");
header.appendChild(a);
a.setAttribute("tabindex", "-1");
a.setAttribute("href", "");
a.appendChild(button);
button.textContent = "Refresh";
this.element.appendChild(h1);
h1.textContent = "Monitor password";
this.element.appendChild(statusP);
this.element.appendChild(descriptionP);
this.element.appendChild(form);
form.appendChild(formPassword1Input);
formPassword1Input.setAttribute("type", "password");
form.onsubmit = this.onFormSubmit.bind(this);
form.appendChild(document.createElement("br"));
form.appendChild(formPassword2Input);
formPassword2Input.setAttribute("type", "password");
form.appendChild(document.createElement("br"));
form.appendChild(formChangePasswordButton);
formChangePasswordButton.setAttribute("type", "submit");
formChangePasswordButton.textContent = "Change password";
this.element.appendChild(errorH2);
errorH2.textContent = "Operational error";
errorH2.style.display = "none";
this.element.appendChild(errorPre);
errorPre.style.display = "none";
this.loadStatusUi();
this.loadDescriptionUi();
this.loadErrorUi();
}
MonitorPasswordInterface.prototype.loadStatusJson = function () {
if (this.status_json_promise) { return; }
this.status_json_promise = Promise.resolve().then(function () {
return xhr({url: status_json_url, withCredentials: true, responseType: "json"});
}).then(function (xhr) {
return xhr.response;
});
this.status_json_promise.catch(function () { return; }).then(function () {
setTimeout(function () {
delete this.status_json_promise;
}.bind(this), 1000);
}.bind(this));
return this.status_json_promise;
};
MonitorPasswordInterface.prototype.loadStatusUi = function () {
this.loadStatusJson();
this.statusP.textContent = "Loading status...";
return this.status_json_promise.then(function (status_json) {
if (status_json.status === "OK") {
this.statusP.innerHTML = "&nbsp;";
} else {
this.statusP.textContent = "/!\\ The password needs to be changed at least once! /!\\";
}
}.bind(this), function (reason) {
if (reason && reason.target && reason.target.status === 404) {
this.statusP.textContent = "/!\\ The password needs to be changed at least once! /!\\";
return;
}
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.statusP.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this)).catch(unexpectedError);
};
MonitorPasswordInterface.prototype.loadDescriptionUi = function () {
this.descriptionP.textContent = [
"The monitor password is the password used to connect to this interface.",
"Here you can change the monitor password by filling the formular just below."
].join("\n");
};
MonitorPasswordInterface.prototype.loadErrorUi = function () {
this.loadStatusJson();
this.errorPre.textContent = "Loading error output...";
return this.status_json_promise.then(function (status_json) {
if (status_json.error) {
this.errorH2.style.display = "";
this.errorPre.style.display = "";
this.errorPre.textContent = status_json.error;
} else {
this.errorH2.style.display = "none";
this.errorPre.style.display = "none";
this.errorPre.textContent = "";
}
}.bind(this), function (reason) {
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.errorPre.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this)).catch(unexpectedError);
};
MonitorPasswordInterface.prototype.onFormSubmit = function (event) {
event.preventDefault();
event.stopPropagation();
this.execForm();
};
MonitorPasswordInterface.prototype.execForm = function () {
if (this.formPassword1Input.value !== this.formPassword2Input.value) {
this.statusP.textContent = "The two typed passwords should match!";
return;
}
this.statusP.textContent = "Changing password...";
var password = this.formPassword1Input.value;
return Promise.resolve().then(function () {
return xhr({url: password_cgi_url_part + password, method: "POST", withCredentials: true});
}).then(function () {
this.statusP.textContent = "Password changed succesfully!";
this.formPassword1Input.value = this.formPassword2Input.value = "";
// rerun promise with new login (also does the relogin)
xhr({url: rerun_cgi_url, method: "POST", withCredentials: true, username: "admin", password: password});
}.bind(this), function (reason) {
var message = reason && (reason.target && (reason.target.statusText || "Unknown") || reason.message);
this.statusP.textContent = "Status Json Error: " + (message || "Unknown error");
}.bind(this));
};
MonitorPasswordInterface.prototype.runPromiseNow = function () {
this.runPromiseNowButton.disabled = true;
var original_text = this.runPromiseNowButton.textContent;
this.runPromiseNowButton.textContent = "Sending message...";
return Promise.resolve().then(function () {
return xhr({url: rerun_cgi_url, method: "POST", withCredentials: true});
}).catch(unexpectedError).then(function () {
this.runPromiseNowButton.textContent = original_text;
}.bind(this));
};
/*global setTimeout */
setTimeout(function () {
/*global document */
document.body.innerHTML = "";
return new MonitorPasswordInterface({rootElement: document.body});
});
</script>
</head>
<body>
<h1>Monitor password</h1>
<noscript>Javascript should be enabled</noscript>
</body>
</html>
#!{{ python_executable }}
password_changed_once_path = "{{ password_changed_once_path }}"
import os
def main():
if os.path.exists(password_changed_once_path):
print('{"status":"OK"}')
return 0
print('{"status":"BAD","message":"Password never changed"}')
return 1
if __name__ == "__main__":
exit(main())
#!{{ python_executable }}
htpasswd_executable = "{{ htpasswd_executable }}"
htpasswd_path = "{{ htpasswd_path }}"
password_changed_once_path = "{{ password_changed_once_path }}"
import cgi
import cgitb
import os
import sys
cgitb.enable(display=0)
def sh(args):
os.system(" ".join(["'" + arg.replace("'", "'\\''") + "'" for arg in args]))
def touch(path):
open(path, "w").close()
def main():
form = cgi.FieldStorage()
password = form["password"].value
if sh([htpasswd_executable, "-b", htpasswd_path, "admin", password]):
sys.stdout.write("Status: 500 Internal Server Error\r\n\r\n")
return 1
touch(password_changed_once_path)
sys.stdout.write("Status: 204 No Content\r\n\r\n")
return 0
if __name__ == "__main__":
exit(main())
#!{{ python_executable }}
# Put this file in the software release
promise_wrapper_folder = "{{ promise_wrapper_folder }}"
import cgi
import cgitb
import os
cgitb.enable(display=0)
def main():
form = cgi.FieldStorage()
promise_name = form["service"].value
if "/" not in promise_name:
promise_path = os.path.join(promise_wrapper_folder, promise_name)
os.spawnl(os.P_NOWAIT, promise_path, promise_path)
print("Status: 204 No Content\r\n\r")
if __name__ == "__main__":
exit(main())
#!/usr/bin/env python
configuration_location = "%(configuration_location)s"
process_pid_file = "%(process_pid_file)s"
import sys
import os
import ConfigParser
import json
import subprocess
def loadConfig(config_file):
config = ConfigParser.ConfigParser()
config.read(config_file)
return config
def main():
config = loadConfig(configuration_location)
script_path = config.get("service", "script-path")
executable_folder = os.path.dirname(script_path)
executable = os.path.basename(script_path)
parameter_json = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'parameters_%%s.json' %% executable)
with open(parameter_json, 'w') as fjson:
fjson.write(json.dumps(dict(config.items("parameter"))))
process = subprocess.Popen(
[script_path, parameter_json],
stdin=None,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
with open(process_pid_file, "w") as pidfile:
pidfile.write(str(process.pid))
if __name__ == "__main__":
sys.exit(main())
\ No newline at end of file
[service]
{% for key, value in parameter_dict.items() -%}
{{ key }} = {{ value.strip().replace("\n", "\n ") }}
{% endfor -%}
[slap-parameters]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[monitor-parameters]
json-filename = monitor.json
json-path = $${monitor-directory:monitor-result}/$${:json-filename}
rss-filename = rssfeed.html
rss-path = $${monitor-directory:public-cgi}/$${:rss-filename}
executable = $${monitor-directory:bin}/monitor.py
port = 9685
htaccess-file = $${monitor-directory:etc}/.htaccess-monitor
url = https://[$${slap-parameters:ipv6-random}]:$${:port}
index-filename = index.cgi
index-path = $${monitor-directory:www}/$${:index-filename}
db-path = $${monitor-directory:etc}/monitor.db
monitor-password-path = $${monitor-directory:etc}/.monitor.shadow
[monitor-directory]
recipe = slapos.cookbook:mkdirectory
# Standard directory needed by monitoring stack
home = $${buildout:directory}
etc = $${:home}/etc
bin = $${:home}/bin
srv = $${:home}/srv
var = $${:home}/var
log = $${:var}/log
run = $${:var}/run
service = $${:etc}/service/
etc-run = $${:etc}/run/
tmp = $${:home}/tmp
promise = $${:etc}/promise
cron-entries = $${:etc}/cron.d
crontabs = $${:etc}/crontabs
cronstamps = $${:etc}/cronstamps
ca-dir = $${:srv}/ssl
www = $${:var}/www
cgi-bin = $${:var}/cgi-bin
monitoring-cgi = $${:cgi-bin}/monitoring
knowledge0-cgi = $${:cgi-bin}/zero-knowledge
public-cgi = $${:cgi-bin}/monitor-public
monitor-custom-scripts = $${:etc}/monitor
monitor-result = $${:var}/monitor
private-directory = $${:srv}/monitor-private
[public-symlink]
recipe = cns.recipe.symlink
symlink = $${monitor-directory:public-cgi} = $${monitor-directory:www}/monitor-public
autocreate = true
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${monitor-directory:cron-entries}
crontabs = $${monitor-directory:crontabs}
cronstamps = $${monitor-directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${monitor-directory:service}/crond
# Add log to cron
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${monitor-directory:bin}/cron_simplelogger
log = $${monitor-directory:log}/cron.log
[cron-entry-monitor]
<= cron
recipe = slapos.cookbook:cron.d
name = launch-monitor
frequency = */5 * * * *
command = $${deploy-monitor-script:rendered} -a
[cron-entry-rss]
<= cron
recipe = slapos.cookbook:cron.d
name = build-rss
frequency = */5 * * * *
command = $${make-rss:rendered}
[setup-static-files]
recipe = plone.recipe.command
command = ln -s ${download-monitor-jquery:destination} $${monitor-directory:www}/static
update-command = $${:command}
[deploy-index]
recipe = slapos.recipe.template:jinja2
template = ${index:location}/${index:filename}
rendered = $${monitor-parameters:index-path}
update-apache-access = ${apache:location}/bin/htpasswd -cb $${monitor-parameters:htaccess-file} admin
mode = 0744
context =
key cgi_directory monitor-directory:cgi-bin
raw index_template $${deploy-index-template:location}/$${deploy-index-template:filename}
key monitor_password_path monitor-parameters:monitor-password-path
key monitor_password_script_path deploy-monitor-password-cgi:rendered
key apache_update_command :update-apache-access
raw extra_eggs_interpreter ${buildout:directory}/bin/${extra-eggs:interpreter}
raw default_page /static/welcome.html
section rewrite_element monitor-rewrite-rule
[deploy-index-template]
recipe = hexagonit.recipe.download
url = ${index-template:location}/$${:filename}
destination = $${monitor-directory:www}
filename = ${index-template:filename}
download-only = true
mode = 0644
[deploy-status-cgi]
recipe = slapos.recipe.template:jinja2
template = ${status-cgi:location}/${status-cgi:filename}
rendered = $${monitor-directory:monitoring-cgi}/$${:filename}
filename = status.cgi
mode = 0744
context =
key json_file monitor-parameters:json-path
key monitor_bin monitor-parameters:executable
key pwd monitor-directory:monitoring-cgi
key this_file :filename
raw python_executable ${buildout:executable}
[deploy-status-history-cgi]
recipe = slapos.recipe.template:jinja2
template = ${status-history-cgi:location}/${status-history-cgi:filename}
rendered = $${monitor-directory:monitoring-cgi}/$${:filename}
filename = status-history.cgi
mode = 0744
context =
key monitor_db_path monitor-parameters:db-path
key status_history_length zero-parameters:status-history-length
raw python_executable ${buildout:executable}
[deploy-settings-cgi]
recipe = slapos.recipe.template:jinja2
template = ${settings-cgi:location}/${settings-cgi:filename}
rendered = $${monitor-directory:knowledge0-cgi}/$${:filename}
filename = settings.cgi
mode = 0744
context =
raw config_cfg $${buildout:directory}/knowledge0.cfg
raw timestamp $${buildout:directory}/.timestamp
raw python_executable ${buildout:executable}
key pwd monitor-directory:knowledge0-cgi
key this_file :filename
[deploy-monitor-password-cgi]
recipe = slapos.recipe.template:jinja2
template = ${monitor-password-cgi:location}/${monitor-password-cgi:filename}
rendered = $${monitor-directory:knowledge0-cgi}/$${:filename}
filename = monitor-password.cgi
mode = 0744
context =
raw python_executable ${buildout:executable}
key pwd monitor-directory:knowledge0-cgi
key this_file :filename
[deploy-monitor-script]
recipe = slapos.recipe.template:jinja2
template = ${monitor-bin:location}/${monitor-bin:filename}
rendered = $${monitor-parameters:executable}
mode = 0744
context =
section directory monitor-directory
section monitor_parameter monitor-parameters
key monitoring_file_json monitor-parameters:json-path
raw python_executable ${buildout:executable}
[make-rss]
recipe = slapos.recipe.template:jinja2
template = ${make-rss-script:output}
rendered = $${monitor-directory:bin}/make-rss.sh
mode = 0744
context =
section directory monitor-directory
section monitor_parameters monitor-parameters
[monitor-directory-access]
recipe = plone.recipe.command
command = ln -s $${:source} $${monitor-directory:private-directory}
source =
[monitor-instance-log-access]
recipe = plone.recipe.command
command = if [ -d $${:source} ]; then ln -s $${:source} $${monitor-directory:private-directory}/instance-logs; fi
update-command = if [ -d $${:source} ]; then ln -s $${:source} $${monitor-directory:private-directory}/instance-logs; fi
source = $${monitor-directory:home}/.slapgrid/log/
location = $${:source}
[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${monitor-directory:ca-dir}/requests/
private = $${monitor-directory:ca-dir}/private/
certs = $${monitor-directory:ca-dir}/certs/
newcerts = $${monitor-directory:ca-dir}/newcerts/
crl = $${monitor-directory:ca-dir}/crl/
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${monitor-directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${monitor-directory:service}/certificate_authority
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}
[ca-httpd]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = $${cadirectory:certs}/httpd.key
cert-file = $${cadirectory:certs}/httpd.crt
executable = $${monitor-directory:bin}/cgi-httpd
wrapper = $${monitor-directory:service}/cgi-httpd
# Put domain name
name = example.com
###########
# Deploy a webserver running cgi scripts for monitoring
###########
[public]
recipe = slapos.cookbook:zero-knowledge.write
filename = knowledge0.cfg
status-history-length = 5
[zero-parameters]
recipe = slapos.cookbook:zero-knowledge.read
filename = $${public:filename}
[monitor-rewrite-rule]
# XXX could it be something lighter?
[monitor-httpd-configuration]
pid-file = $${monitor-directory:run}/cgi-httpd.pid
cgid-pid-file = $${monitor-directory:run}/cgi-httpd-cgid.pid
error-log = $${monitor-directory:log}/cgi-httpd-error-log
listening-ip = $${slap-parameters:ipv6-random}
certificate = $${ca-httpd:cert-file}
key = $${ca-httpd:key-file}
[monitor-httpd-configuration-file]
recipe = slapos.recipe.template:jinja2
template = ${monitor-httpd-template:destination}/${monitor-httpd-template:filename}
rendered = $${monitor-directory:etc}/cgi-httpd.conf
mode = 0744
context =
section directory monitor-directory
section monitor_parameters monitor-parameters
section httpd_configuration monitor-httpd-configuration
section monitor_rewrite_rule monitor-rewrite-rule
[cgi-httpd-wrapper]
recipe = slapos.cookbook:wrapper
apache-executable = ${apache:location}/bin/httpd
command-line = $${:apache-executable} -f $${monitor-httpd-configuration-file:rendered} -DFOREGROUND
wrapper-path = $${ca-httpd:executable}
wait-for-files =
$${cadirectory:certs}/httpd.key
$${cadirectory:certs}/httpd.crt
[cgi-httpd-graceful-wrapper]
recipe = slapos.recipe.template:jinja2
template = ${template-wrapper:output}
rendered = $${monitor-directory:etc-run}/cgi-httpd-graceful
mode = 0700
context =
key content :command
command = kill -USR1 $(cat $${monitor-httpd-configuration:pid-file})
[monitor-promise]
recipe = slapos.cookbook:check_url_available
path = $${monitor-directory:promise}/monitor
url = $${monitor-parameters:url}/$${monitor-parameters:index-filename}
check-secure = 1
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[publish-connection-informations]
recipe = slapos.cookbook:publish
monitor_url = $${monitor-parameters:url}
[monitor]
{% for key, value in parameter_dict.items() -%}
{{ key }} = {{ value.strip().replace("\n", "\n ") }}
{% endfor -%}
body { width: 80vw; margin: auto; padding-top: 1%; }
/* h1 { align-text: center; margin: auto; } */
/*td { padding: 0 2%; }/**/
td { padding: 0 1em; }/**/
table { border: 1px solid black; }
table > table { margin-top: 1em; }
input {
box-sizing: border-box;
min-height: 10mm;
min-width: 10mm;
}
button {
box-sizing: border-box;
min-height: 10mm;
min-width: 10mm;
background-color: lightgray;
background: linear-gradient(180deg, #F6F6F6 0%, #DDDDDD 100%);
border-radius: 2px;
border-style: solid;
border-width: 1px;
border-color: #A4A4A4;
}
a.as-button {
display: inline-block;
box-sizing: border-box;
min-height: 10mm;
min-width: 10mm;
padding: 0.5em 0.5em;
text-align: center;
text-decoration: initial;
}
a.as-button {
color: black;
background-color: lightgray;
background: linear-gradient(180deg, #F6F6F6 0%, #DDDDDD 100%);
border-radius: 2px;
border-style: solid;
border-width: 1px;
border-color: #A4A4A4;
}
a.as-button:active, button:active {
background-color: white;
background: linear-gradient(0deg, #F6F6F6 0%, #DDDDDD 100%);
}
a.as-button:hover, button:hover {
border-color: #777777;
}
/*jslint indent: 2 */
(function () {
"use strict";
var monitor_title = '{{ dumps(monitor_title)[5:-1] }}',
RSS_ICON_DATA_URI = [
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+CjwhRE9DVFlQR",
"SBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cu",
"dzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM",
"9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPS",
"IxMjhweCIgaGVpZ2h0PSIxMjhweCIgdmlld0JveD0iMCAwIDI1NiAyNTYiPgo8cmVjd",
"CB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgeD0iMCIgIHk9IjAiICBmaWxsPSIjRjQ5",
"QzUyIi8+CjxjaXJjbGUgY3g9IjY4IiBjeT0iMTg5IiByPSIyNCIgZmlsbD0iI0ZGRiI",
"vPgo8cGF0aCBkPSJNMTYwIDIxM2gtMzRhODIgODIgMCAwIDAgLTgyIC04MnYtMzRhMT",
"E2IDExNiAwIDAgMSAxMTYgMTE2eiIgZmlsbD0iI0ZGRiIvPgo8cGF0aCBkPSJNMTg0I",
"DIxM0ExNDAgMTQwIDAgMCAwIDQ0IDczIFYgMzhhMTc1IDE3NSAwIDAgMSAxNzUgMTc1",
"eiIgZmlsbD0iI0ZGRiIvPgo8L3N2Zz4K"
].join("");
function loadJson(url) {
/*global XMLHttpRequest */
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.onload = function (event) {
var response = event.target;
if (response.status < 400) {
try {
resolve(JSON.parse(response.responseText));
} catch (e) {
reject(e);
}
} else {
reject(new Error("XHR: " + response.status + ": " + response.statusText));
}
};
xhr.onerror = function () {
reject(new Error("XHR: Error"));
};
xhr.open("GET", url, true);
xhr.send();
});
}
///////////////////
// tools for HAL //
function getProperty(object, path) {
if (Array.isArray(path)) {
while (path.length) {
object = object[path.shift()];
}
} else {
return object[path];
}
return object;
}
function softGetProperty(object, path) {
try {
return getProperty(object, path);
} catch (ignored) {
return undefined;
}
}
function forceList(value) {
if (Array.isArray(value)) {
return value;
}
return [value];
}
function softGetPropertyAsList(object, path) {
try {
return forceList(getProperty(object, path));
} catch (ignored) {
return [];
}
}
///////////////////
function htmlToElementList(html) {
/*global document */
var div = document.createElement("div");
div.innerHTML = html;
return div.querySelectorAll("*");
}
function resolveUrl(firstUrl) {
/*jslint plusplus: true */
/*global URL, location */
var l = arguments.length, i = 1, url = new URL(firstUrl, location.href);
while (i < l) { url = new URL(arguments[i++], url); }
return url.href;
}
function escapeHtml(html) {
return html.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
}
function loadAndRenderMonitorSection(root, monitor_dict, monitor_url) {
var table, service_list = softGetPropertyAsList(monitor_dict, ["_embedded", "service"]);
if (!service_list) {
root.textContent = "";
return;
}
table = document.createElement("table");
root.appendChild(table);
return Promise.all(service_list.map(function (service_dict) {
var interface_url = softGetProperty(service_dict, ["_links", "interface", "href"]),
status_url = softGetProperty(service_dict, ["_links", "status", "href"]),
href_html_part = (interface_url ? " href=\"" + escapeHtml(interface_url) + "\"" : ""),
title_html_part = (service_dict.title ? escapeHtml(service_dict.title) : (service_dict.id ||"Untitled")),
row = htmlToElementList("<table><tbody><tr><td><a" + href_html_part + ">" + title_html_part + "</a></td><td>Loading status...</td><td><a" + href_html_part + "><div style=\"height: 10mm; width: 10mm; background-color: gray;\"></div></a></td></tr></tbody></table>");
table.appendChild(row[2]);
if (!status_url) {
row[5].textContent = "No status";
return;
}
return loadJson(resolveUrl(monitor_url, status_url)).then(function (status_dict) {
if (status_dict.description) {
row[2].title = status_dict.description;
}
row[5].textContent = status_dict.message || "";
row[8].style.backgroundColor = status_dict.status === "OK" ? "green" : "red";
}).catch(function (reason) {
row[5].textContent = (reason && (reason.name + ": " + reason.message));
row[8].style.backgroundColor = "red";
});
}));
}
function loadAndRenderMonitorJson(root) {
root.textContent = "Loading monitor section...";
return loadJson("monitor.haljson").then(function (monitor_dict) {
//monitor_json_list.push(monitor_dict);
root.innerHTML = "";
var loading = loadAndRenderMonitorSection(root, monitor_dict), related_monitor_list = softGetPropertyAsList(monitor_dict, ["_links", "related_monitor"]);
if (!related_monitor_list.length) { return loading; }
return Promise.all([loading, Promise.all(related_monitor_list.map(function (link) {
var div = htmlToElementList("<div>Loading monitor section...</div>")[0];
root.appendChild(div);
if (link.href[link.href.length - 1] !== "/") {
link.href += "/";
}
link.href = resolveUrl(link.href, "monitor.haljson");
return loadJson(link.href).catch(function (reason) {
div.textContent = (reason && (reason.name + ": " + reason.message));
}).then(function (monitor_dict) {
//monitor_json_list.push(monitor_dict);
div.remove();
return loadAndRenderMonitorSection(root, monitor_dict, link.href);
});
}))]);
});
}
function bootstrap(root) {
var element_list = htmlToElementList([
"<header>",
" <a href=\"\" class=\"as-button\">Refresh</a>",
" <a href=\"/logout\" class=\"as-button\">Logout</a>",
" <a href=\"/feed\"><img src=\"" + RSS_ICON_DATA_URI + "\" style=\"width: 10mm; height: 10mm; vertical-align: middle;\" alt=\"[RSS Feed]\" /></a>",
"</header>",
"<h1>" + monitor_title + "</h1>",
"<h2>System health status</h2>",
"<p>This interface allow to see the status of several features, it may show problems and sometimes provides a way to fix them.</p>",
"<p>Red square means the feature has a problem, green square means it is ok.</p>",
"<p>You can click on a feature below to get more precise information.</p>"
].join("\n")), div = document.createElement("div"), tmp;
[].reduce.call(element_list, function (array, element) {
if (element.parentNode.parentNode) { return array; }
array.push(element);
return array;
}, []).forEach(function (element) {
root.appendChild(element);
});
document.title = monitor_title;
root.appendChild(div);
/*global alert */
tmp = loadAndRenderMonitorJson(div);
tmp.catch(alert);
/*global console */
tmp.catch(console.error.bind(console));
}
/*global setTimeout */
setTimeout(function () {
/*global document */
bootstrap(document.body);
});
}());
#!{{ python_executable }}
# Put this file in the software release
promise_runner_path = "{{ promise_runner_path }}"
public_folder = "{{ public_folder }}"
private_folder = "{{ private_folder }}"
monitor_configuration_path = "{{ monitor_configuration_path }}"
promise_folder = "{{ promise_folder }}"
monitor_promise_folder = "{{ monitor_promise_folder }}"
promise_wrapper_folder = "{{ promise_wrapper_folder }}"
import sys
import os
import stat
import subprocess
import threading
import json
import ConfigParser
import traceback
def main():
# initialisation
config = loadConfig([monitor_configuration_path])
# get promises in monitor_promise_folder
promise_dict = {}
fillPromiseDictFromFolder(promise_dict, monitor_promise_folder)
# get promises in promise_folder
fillPromiseDictFromFolder(promise_dict, promise_folder)
# get promises configurations
for filename in os.listdir(monitor_promise_folder):
path = os.path.join(monitor_promise_folder, filename)
if os.path.isfile(path) and filename[-4:] == ".cfg":
promise_name = filename[:-4]
if promise_name in promise_dict:
loadConfig([path], promise_dict[promise_name]["configuration"])
promise_items = promise_dict.items()
# create symlinks from service configurations
for service_name, promise in promise_items:
service_config = promise["configuration"]
createSymlinksFromConfig((config, "monitor", "public-folder"), (service_config, "service", "public-path-list"), service_name)
createSymlinksFromConfig((config, "monitor", "private-folder"), (service_config, "service", "private-path-list"), service_name)
# create symlinks from monitor.conf
createSymlinksFromConfig((config, "monitor", "public-folder"), (config, "monitor", "public-path-list"))
createSymlinksFromConfig((config, "monitor", "private-folder"), (config, "monitor", "private-path-list"))
# generate monitor.json
monitor_dict = {}
tmp = softConfigGet(config, "monitor", "title")
if tmp:
monitor_dict["title"] = tmp
tmp = softConfigGet(config, "monitor", "monitor-url-list")
if tmp:
monitor_dict["_links"] = {"related_monitor": [{"href": url} for url in tmp.split()]}
if promise_items:
service_list = []
monitor_dict["_embedded"] = {"service": service_list}
for service_name, promise in promise_items:
service_config = promise["configuration"]
service_dict = {}
service_list.append(service_dict)
service_dict["id"] = service_name
service_dict["_links"] = {"status": {"href": "/public/%s.status.json" % service_name}} # hardcoded
tmp = softConfigGet(service_config, "service", "title")
if tmp:
service_dict["title"] = tmp
interface_path = os.path.join(private_folder, service_name, "interface/index.html") # hardcoded
if os.path.isfile(interface_path):
service_dict["_links"]["interface"] = {"href": "/private/%s/interface/" % service_name} # hardcoded
else:
service_dict["_links"]["interface"] = {"href": "/default-promise-interface.html?service_name=%s" % service_name} # XXX hardcoded
with open(config.get("monitor", "monitor-hal-json"), "w") as fp:
json.dump(monitor_dict, fp)
# put promises to a cron file
# XXX only if at least one configuration file is modified, then write in the cron
service_pid_folder = config.get("monitor", "service-pid-folder")
crond_folder = config.get("monitor", "crond-folder")
cron_line_list = []
for service_name, promise in promise_items:
service_status_path = "%s/%s.status.json" % (public_folder, service_name) # hardcoded
mkdirAll(os.path.dirname(service_status_path))
command = ("%s %s %s " % (
promise_runner_path,
os.path.join(service_pid_folder, "%s.pid" % service_name),
service_status_path,
)) + promise["path"]
cron_line_list.append("%s %s" % (
softConfigGet(service_config, "service", "frequency") or "* * * * *",
command.replace("%", "\\%"),
))
wrapper_path = os.path.join(promise_wrapper_folder, service_name)
with open(wrapper_path, "w") as fp:
fp.write("#!/bin/sh\n%s" % command) # XXX hardcoded, use dash, sh or bash binary!
os.chmod(wrapper_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH )
with open(crond_folder + "/monitor-promises", "w") as fp:
fp.write("\n".join(cron_line_list))
return 0
def loadConfig(pathes, config=None):
if config is None:
config = ConfigParser.ConfigParser()
try:
config.read(pathes)
except ConfigParser.MissingSectionHeaderError:
traceback.print_exc()
return config
def fillPromiseDictFromFolder(promise_dict, folder):
for filename in os.listdir(folder):
path = os.path.join(folder, filename)
if os.path.isfile(path) and os.access(path, os.X_OK):
promise_dict[filename] = {"path": path, "configuration": ConfigParser.ConfigParser()}
def softConfigGet(config, *args, **kwargs):
try:
return config.get(*args, **kwargs)
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
return None
def createSymlinksFromConfig(destination_folder_config_tuple, source_list_config_tuple, service_name=""):
destination_folder = softConfigGet(*destination_folder_config_tuple)
if destination_folder:
source_path_str = softConfigGet(*source_list_config_tuple)
if source_path_str:
for path in source_path_str.split():
dirname = os.path.join(destination_folder, service_name)
try:
mkdirAll(dirname) # could also raise OSError
os.symlink(path, os.path.join(dirname, os.path.basename(path)))
except OSError, e:
if e.errno != os.errno.EEXIST:
raise
def mkdirAll(path):
try:
os.makedirs(path)
except OSError, e:
if e.errno == os.errno.EEXIST and os.path.isdir(path):
pass
else: raise
if __name__ == "__main__":
sys.exit(main())
#!{{ python_executable }}
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import json
from cStringIO import StringIO
def main():
if len(sys.argv) < 4:
print("Usage: %s <pid_path> <output_path> <command...>" % sys.argv[0])
return 2
pid_path=sys.argv[1]
output_path=sys.argv[2]
if os.path.exists(pid_path):
with open(pid_path, "r") as pidfile:
try:
pid = int(pidfile.read(6))
except ValueError:
pid = None
if pid and os.path.exists("/proc/" + str(pid)):
print("A process is already running with pid " + str(pid))
return 1
with open(pid_path, "w") as pidfile:
process = executeCommand(sys.argv[3:])
pidfile.write(str(process.pid))
status_json = generateStatusJsonFromProcess(process)
with open(output_path, "w") as outputfile:
json.dump(status_json, outputfile)
os.remove(pid_path)
def generateStatusJsonFromProcess(process):
stdout, stderr = process.communicate()
try:
status_json = json.loads(stdout)
except ValueError:
status_json = {}
if process.returncode != 0:
status_json["status"] = "error"
elif not status_json.get("status"):
status_json["status"] = "OK"
if stderr:
status_json["error"] = stderr
return status_json
def executeCommand(args):
return subprocess.Popen(
args,
#cwd=instance_path,
#env=None if sys.platform == 'cygwin' else {},
stdin=None,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
if __name__ == "__main__":
sys.exit(main())
import sys
import os
import json
import datetime
import base64
import hashlib
def main():
_, title, link, public_folder, previous_status_path, output_path = sys.argv
final_status = "OK";
# getting status
for filename in os.listdir(public_folder):
if filename.endswith(".status.json"):
filepath = os.path.join(public_folder, filename)
status = None
try:
status = json.load(open(filepath, "r"))
except ValueError:
continue
try:
if status["status"] != "OK":
final_status = "BAD"
break
except KeyError:
final_status = "BAD"
break
# checking previous status
try:
status = open(previous_status_path, "r").readline(4)
if status == final_status:
return 0
except IOError:
pass
# update status
open(previous_status_path, "w").write(final_status)
# generating RSS
utcnow = datetime.datetime.utcnow()
open(output_path, "w").write(
newRssString(
title,
title,
link,
utcnow,
utcnow,
"60",
[
newRssItemString(
"Status is %s" % final_status,
"Status is %s" % final_status,
link,
newGuid("%s, %s" % (utcnow, final_status)),
utcnow,
)
],
)
)
def escapeHtml(string):
return string.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
def newGuid(string):
sha256 = hashlib.sha256()
sha256.update(string)
return sha256.hexdigest()
def newRssItemString(title, description, link, guid, pub_date, guid_is_perma_link=True):
return """<item>
<title>%(title)s</title>
<description>%(description)s</description>
<link>%(link)s</link>
<guid isPermaLink="%(guid_is_perma_link)s">%(guid)s</guid>
<pubDate>%(pub_date)s</pubDate>
</item>""" % {
"title": escapeHtml(title),
"description": escapeHtml(description),
"link": escapeHtml(link),
"guid": escapeHtml(guid),
"pub_date": escapeHtml(pub_date.strftime("%a, %d %b %Y %H:%M:%S +0000")),
"guid_is_perma_link": escapeHtml(repr(guid_is_perma_link).lower()),
}
def newRssString(title, description, link, last_build_date, pub_date, ttl, rss_item_string_list):
return """<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>%(title)s</title>
<description>%(description)s</description>
<link>%(link)s</link>
<lastBuildDate>%(last_build_date)s</lastBuildDate>
<pubDate>%(pub_date)s</pubDate>
<ttl>%(ttl)s</ttl>
%(items)s
</channel>
</rss>
""" % {
"title": escapeHtml(title),
"description": escapeHtml(description),
"link": escapeHtml(link),
"last_build_date": escapeHtml(last_build_date.strftime("%a, %d %b %Y %H:%M:%S +0000")),
"pub_date": escapeHtml(pub_date.strftime("%a, %d %b %Y %H:%M:%S +0000")),
"ttl": escapeHtml(str(ttl)),
"items": "\n\n".join([" " + item.replace("\n", "\n ") for item in rss_item_string_list]),
}
if __name__ == "__main__":
exit(main())
#!{{ extra_eggs_interpreter }}
import cgi
import cgitb
import Cookie
import base64
import hashlib
import hmac
import jinja2
import os
import subprocess
import urllib
cgitb.enable(display=0, logdir="/tmp/cgi.log")
form = cgi.FieldStorage()
cookie = Cookie.SimpleCookie()
cgi_path = "{{ cgi_directory }}"
monitor_password_path = "{{ monitor_password_path }}"
monitor_password_script_path = "{{ monitor_password_script_path }}"
monitor_apache_password_command = "{{ apache_update_command }}"
monitor_rewrite = "{{ ' '.join(rewrite_element.keys()) }}"
########
# Password functions
#######
def crypt(word, salt="$$"):
salt = salt.split("$")
algo = salt[0] or 'sha1'
if algo in hashlib.algorithms:
H = getattr(hashlib, algo)
elif algo == "plain":
return "%s$%s" % (algo, word)
else:
raise ValueError
rounds = min(max(0, int(salt[1])), 30) if salt[1] else 9
salt = salt[2] or base64.b64encode(os.urandom(12), "./")
h = hmac.new(salt, word, H).digest()
for x in xrange(1, 1 << rounds):
h = H(h).digest()
return "%s$%s$%s$%s" % (algo, rounds, salt,
base64.b64encode(h, "./").rstrip("="))
def is_password_set():
if not os.path.exists(monitor_password_path):
return False
hashed_password = open(monitor_password_path, 'r').read()
try:
void, algo, salt, hsh = hashed_password.split('$')
except ValueError:
return False
return True
def set_password(raw_password):
hashed_password = crypt(raw_password)
subprocess.check_call(monitor_apache_password_command + " %s" % raw_password,
shell=True)
open(monitor_password_path, 'w').write(hashed_password)
def check_password(raw_password):
"""
Returns a boolean of whether the raw_password was correct. Handles
encryption formats behind the scenes.
"""
if not os.path.exists(monitor_password_path) or not raw_password:
return False
hashed_password = open(monitor_password_path, 'r').read()
return hashed_password == crypt(raw_password, hashed_password)
### End of password functions
def forward_form():
command = os.path.join(cgi_path, form['posting-script'].value)
params_dict = {}
for f in form:
params_dict[f] = form[f].value
del params_dict['posting-script']
os.environ['QUERY_STRING'] = urllib.urlencode(params_dict)
try:
if os.access(command, os.X_OK):
print '\n', subprocess.check_output([command])
except subprocess.CalledProcessError:
print "There is a problem with sub-process"
pass
def return_document(command=None):
if not command:
script = form['script'].value
command = os.path.join(cgi_path, script)
#XXX this functions should be called only for display,
#so a priori it doesn't need form data
os.environ['QUERY_STRING'] = ''
try:
if os.access(command, os.X_OK):
print '\n', subprocess.check_output([command])
elif os.access(command, os.R_OK):
print open(command).read()
else:
raise OSError
except (subprocess.CalledProcessError, OSError) as e:
print "<p>Error :</p><pre>%s</pre>" % e
def make_menu():
# Transform deep-2 tree in json
folder_list = {}
for folder in os.listdir(cgi_path):
if os.path.isdir(os.path.join(cgi_path, folder)):
folder_list[folder] = []
for folder in folder_list:
for file in os.listdir(os.path.join(cgi_path, folder)):
if os.path.isfile(os.path.join(cgi_path, folder, file)):
folder_list[folder].append(file)
return folder_list
def get_cookie_password():
cookie_string = os.environ.get('HTTP_COOKIE')
if cookie_string:
cookie.load(cookie_string)
try:
return cookie['password'].value
except KeyError:
pass
return None
def set_cookie_password(password):
cookie['password'] = password
print cookie, "; Path=/; HttpOnly"
# Beginning of response
print "Content-Type: text/html"
password = None
# Check if user is logged
if "password_2" in form and "password" in form:
password_2 = form['password_2'].value
password_1 = form['password'].value
password = get_cookie_password()
if not is_password_set() or check_password(password):
if password_2 == password_1:
password = password_1
set_password(password)
set_cookie_password(password)
elif "password" in form:
password = form['password'].value
if is_password_set() and check_password(password):
set_cookie_password(password)
else:
password = get_cookie_password()
print '\n'
if not is_password_set():
return_document(monitor_password_script_path)
elif not check_password(password):
print "<html><head>"
print """
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">"""
print "</head><body>"
if password is None:
print "<h1>This is the monitoring interface</h1>"
else:
print "<h1>Error</h1><p>Wrong password</p>"
print """
<p>Please enter the monitor_password in the next field to access the data</p>
<form action="/index.cgi" method="post" class="pure-form-aligned">
Password : <input type="password" name="password">
<button type="submit" class="pure-button pure-button-primary">Access</button>
</form>
</body></html>"""
# redirection to the required script/page
else:
print
if "posting-script" in form:
forward_form()
elif "script" in form:
return_document()
else:
html_base = jinja2.Template(open('{{ index_template }}').read())
print
print html_base.render(tree=make_menu(), default_page="{{ default_page }}", monitor_rewrite=monitor_rewrite)
<html>
<head>
<title>Monitoring Interface</title>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
<script src="static/jquery-1.10.2.min.js"></script>
<script src="static/script.js"></script>
</head>
<body>
<div id="div-menu">
<h1>Monitoring</h1>
<div id="script-categories" class="pure-menu pure-menu-open">
<ul>
{% for category in tree %}
<li class="pure-menu-heading category">{{ category }}</li>
{% for script in tree[category] %}
<li><a href="{{ category }}/{{ script }}" class="script">{{ script }}</a></li>
{% endfor %}
{% endfor %}
<li class="pure-menu-heading category">Files</li>
<li><a href="./private/" class="link"> User: admin</br> Password is yours</a></li>
<li class="pure-menu-heading category">Local Service</li>
{% set rewrite_list = monitor_rewrite.split() %}
{% for path in rewrite_list %}
<li><a href="./rewrite/{{path}}/" class="link">{{path}}</a></li>
{% endfor %}
</ul>
</div>
</div>
<div id="content">
<iframe src="{{ default_page }}">
</iframe>
</div>
</body>
</html>
#!{{ python_executable }}
import cgitb
cgitb.enable()
print "<html><head>"
print """
<script type="text/javascript" src="static/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">"""
print "</head><body>"
print "<h1>This is the monitoring interface</h1>"
print "<h2>Please set your password for later access</h2>"
print """
<form action="/index.cgi" method="post" class="pure-form-aligned">
<div class="pure-control-group">
<label for="password">Password*:</label>
<input placeholder="Set your password" type="password" name="password" id="password"></br>
</div><div class="pure-control-group">
<label for="password">Verify Password*:</label>
<input placeholder="Verify password" type="password" name="password_2" id="password_2"></br>
</div><p id="validate-status" style="color:red"></p>
<div class="pure-controls">
<button id="register-button" type="submit" class="pure-button pure-button-primary" disabled>Access</button></div>
</form>
<script type="text/javascript" src="static/monitor-register.js"></script>
</body></html>
"""
#!{{ python_executable }}
import cgi
import cgitb
import ConfigParser
import os
cgitb.enable()
form = cgi.FieldStorage()
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"static/pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"static/style.css\">"
print "</head><body>"
config_file = "{{ config_cfg }}"
if not os.path.exists(config_file):
print "Your software does <b>not</b> embed 0-knowledge. \
This interface is useless in this case</body></html>"
exit(0)
parser = ConfigParser.ConfigParser()
parser.read(config_file)
if not parser.has_section('public'):
print "<p>Your software does not use 0-knowledge settings.</p></body></html>"
exit(0)
for name in form:
if parser.has_option('public', name):
parser.set('public', name, form[name].value)
with open(config_file, 'w') as file:
parser.write(file)
if len(form) > 0:
try:
os.remove("{{ timestamp }}")
except OSError:
pass
print "<h1>Values that can be defined :</h1>"
print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
print "<input type=\"hidden\" name=\"posting-script\" value=\"{{ pwd }}/{{ this_file }}\">"
for option in parser.options("public"):
print "<div class=\"pure-control-group\">"
print "<label for=\"%s\">%s</label>" % (cgi.escape(option, quote=True), cgi.escape(option))
print "<input type=\"text\" name=\"%s\" value=\"%s\">" % (cgi.escape(option, quote=True), cgi.escape(parser.get('public', option), quote=True))
print "</div>"
print "<div class=\"pure-controls\"><button type=\"submit\" class=\"pure-button \
pure-button-primary\">Save</button></div></form>"
print "<br><h1>Other values :</h1>"
print "<form class=\"pure-form-aligned\">"
for section in parser.sections():
if section != 'public':
for option in parser.options(section):
print "<div class=\"pure-control-group\">"
print "<label for=\"%s\">%s</label>" % (cgi.escape(option, quote=True), cgi.escape(option))
print "<input type=\"text\" name=\"%s\" value=\"%s\" readonly>" %(cgi.escape(option, quote=True), cgi.escape(parser.get(section, option), quote=True))
print "</div>"
print "</form>"
print "</body></html>"
$(window).load(function(){
$(document).ready(function() {
$("#password_2").keyup(validate);
});
function validate() {
var password1 = $("#password").val();
var password2 = $("#password_2").val();
if(password1 == password2) {
$("#register-button").removeAttr("disabled");
$("#validate-status").attr("style", "display:none");
}
else {
$("#register-button").attr("disabled", "disabled");
$("#validate-status").attr("style", "").text("Passwords do not match");
}
}
});
\ No newline at end of file
/*!
Pure v0.3.0
Copyright 2013 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
https://github.com/yui/pure/blob/master/LICENSE.md
*/
/*!
normalize.css v1.1.2 | MIT License | git.io/normalize
Copyright (c) Nicolas Gallagher and Jonathan Neal
*/
/*! normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}.pure-button{display:inline-block;*display:inline;zoom:1;line-height:normal;white-space:nowrap;vertical-align:baseline;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button{font-size:100%;*font-size:90%;*overflow:visible;padding:.5em 1.5em;color:#444;color:rgba(0,0,0,.8);*color:#444;border:1px solid #999;border:0 rgba(0,0,0,0);background-color:#E6E6E6;text-decoration:none;border-radius:2px;-webkit-transition:.1s linear -webkit-box-shadow;-moz-transition:.1s linear -moz-box-shadow;-ms-transition:.1s linear box-shadow;-o-transition:.1s linear box-shadow;transition:.1s linear box-shadow}.pure-button-hover,.pure-button:hover,.pure-button:focus{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:-webkit-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.05) 0,rgba(0,0,0,.1));background-image:-ms-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-o-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset}.pure-button[disabled],.pure-button-disabled,.pure-button-disabled:hover,.pure-button-disabled:focus,.pure-button-disabled:active{border:0;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);filter:alpha(opacity=40);-khtml-opacity:.4;-moz-opacity:.4;opacity:.4;cursor:not-allowed;box-shadow:none}.pure-button-hidden{display:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form select,.pure-form textarea{padding:.5em .6em;display:inline-block;border:1px solid #ccc;font-size:.8em;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;-webkit-transition:.3s linear border;-moz-transition:.3s linear border;-ms-transition:.3s linear border;-o-transition:.3s linear border;transition:.3s linear border;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-form input[type=text]:focus,.pure-form input[type=password]:focus,.pure-form input[type=email]:focus,.pure-form input[type=url]:focus,.pure-form input[type=date]:focus,.pure-form input[type=month]:focus,.pure-form input[type=time]:focus,.pure-form input[type=datetime]:focus,.pure-form input[type=datetime-local]:focus,.pure-form input[type=week]:focus,.pure-form input[type=number]:focus,.pure-form input[type=search]:focus,.pure-form input[type=tel]:focus,.pure-form input[type=color]:focus,.pure-form select:focus,.pure-form textarea:focus{outline:0;outline:thin dotted \9;border-color:#129FEA}.pure-form input[type=file]:focus,.pure-form input[type=radio]:focus,.pure-form input[type=checkbox]:focus{outline:thin dotted #333;outline:1px auto #129FEA}.pure-form .pure-checkbox,.pure-form .pure-radio{margin:.5em 0;display:block}.pure-form input[type=text][disabled],.pure-form input[type=password][disabled],.pure-form input[type=email][disabled],.pure-form input[type=url][disabled],.pure-form input[type=date][disabled],.pure-form input[type=month][disabled],.pure-form input[type=time][disabled],.pure-form input[type=datetime][disabled],.pure-form input[type=datetime-local][disabled],.pure-form input[type=week][disabled],.pure-form input[type=number][disabled],.pure-form input[type=search][disabled],.pure-form input[type=tel][disabled],.pure-form input[type=color][disabled],.pure-form select[disabled],.pure-form textarea[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input[readonly],.pure-form select[readonly],.pure-form textarea[readonly]{background:#eee;color:#777;border-color:#ccc}.pure-form input:focus:invalid,.pure-form textarea:focus:invalid,.pure-form select:focus:invalid{color:#b94a48;border:1px solid #ee5f5b}.pure-form input:focus:invalid:focus,.pure-form textarea:focus:invalid:focus,.pure-form select:focus:invalid:focus{border-color:#e9322d}.pure-form input[type=file]:focus:invalid:focus,.pure-form input[type=radio]:focus:invalid:focus,.pure-form input[type=checkbox]:focus:invalid:focus{outline-color:#e9322d}.pure-form select{border:1px solid #ccc;background-color:#fff}.pure-form select[multiple]{height:auto}.pure-form label{margin:.5em 0 .2em;font-size:90%}.pure-form fieldset{margin:0;padding:.35em 0 .75em;border:0}.pure-form legend{display:block;width:100%;padding:.3em 0;margin-bottom:.3em;font-size:125%;color:#333;border-bottom:1px solid #e5e5e5}.pure-form-stacked input[type=text],.pure-form-stacked input[type=password],.pure-form-stacked input[type=email],.pure-form-stacked input[type=url],.pure-form-stacked input[type=date],.pure-form-stacked input[type=month],.pure-form-stacked input[type=time],.pure-form-stacked input[type=datetime],.pure-form-stacked input[type=datetime-local],.pure-form-stacked input[type=week],.pure-form-stacked input[type=number],.pure-form-stacked input[type=search],.pure-form-stacked input[type=tel],.pure-form-stacked input[type=color],.pure-form-stacked select,.pure-form-stacked label,.pure-form-stacked textarea{display:block;margin:.25em 0}.pure-form-aligned input,.pure-form-aligned textarea,.pure-form-aligned select,.pure-form-aligned .pure-help-inline,.pure-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.pure-form-aligned .pure-control-group{margin-bottom:.5em}.pure-form-aligned .pure-control-group label{text-align:right;display:inline-block;vertical-align:middle;width:10em;margin:0 1em 0 0}.pure-form-aligned .pure-controls{margin:1.5em 0 0 10em}.pure-form input.pure-input-rounded,.pure-form .pure-input-rounded{border-radius:2em;padding:.5em 1em}.pure-form .pure-group fieldset{margin-bottom:10px}.pure-form .pure-group input{display:block;padding:10px;margin:0;border-radius:0;position:relative;top:-1px}.pure-form .pure-group input:focus{z-index:2}.pure-form .pure-group input:first-child{top:1px;border-radius:4px 4px 0 0}.pure-form .pure-group input:last-child{top:-2px;border-radius:0 0 4px 4px}.pure-form .pure-group button{margin:.35em 0}.pure-form .pure-input-1{width:100%}.pure-form .pure-input-2-3{width:66%}.pure-form .pure-input-1-2{width:50%}.pure-form .pure-input-1-3{width:33%}.pure-form .pure-input-1-4{width:25%}.pure-form .pure-help-inline,.pure-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:90%}.pure-form-message{display:block;color:#666;font-size:90%}@media only screen and (max-width :480px){.pure-form button[type=submit]{margin:.7em 0 0}.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form label{margin-bottom:.3em;display:block}.pure-group input[type=text],.pure-group input[type=password],.pure-group input[type=email],.pure-group input[type=url],.pure-group input[type=date],.pure-group input[type=month],.pure-group input[type=time],.pure-group input[type=datetime],.pure-group input[type=datetime-local],.pure-group input[type=week],.pure-group input[type=number],.pure-group input[type=search],.pure-group input[type=tel],.pure-group input[type=color]{margin-bottom:0}.pure-form-aligned .pure-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.pure-form-aligned .pure-controls{margin:1.5em 0 0}.pure-form .pure-help-inline,.pure-form-message-inline,.pure-form-message{display:block;font-size:80%;padding:.2em 0 .8em}}.pure-g{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-flex;-webkit-flex-flow:row wrap;display:-ms-flexbox;-ms-flex-flow:row wrap}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class *="pure-u"]{font-family:sans-serif}.pure-u-1,.pure-u-1-2,.pure-u-1-3,.pure-u-2-3,.pure-u-1-4,.pure-u-3-4,.pure-u-1-5,.pure-u-2-5,.pure-u-3-5,.pure-u-4-5,.pure-u-1-6,.pure-u-5-6,.pure-u-1-8,.pure-u-3-8,.pure-u-5-8,.pure-u-7-8,.pure-u-1-12,.pure-u-5-12,.pure-u-7-12,.pure-u-11-12,.pure-u-1-24,.pure-u-5-24,.pure-u-7-24,.pure-u-11-24,.pure-u-13-24,.pure-u-17-24,.pure-u-19-24,.pure-u-23-24{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1{width:100%}.pure-u-1-2{width:50%;*width:49.969%}.pure-u-1-3{width:33.3333%;*width:33.3023%}.pure-u-2-3{width:66.6667%;*width:66.6357%}.pure-u-1-4{width:25%;*width:24.969%}.pure-u-3-4{width:75%;*width:74.969%}.pure-u-1-5{width:20%;*width:19.969%}.pure-u-2-5{width:40%;*width:39.969%}.pure-u-3-5{width:60%;*width:59.969%}.pure-u-4-5{width:80%;*width:79.969%}.pure-u-1-6{width:16.6667%;*width:16.6357%}.pure-u-5-6{width:83.3333%;*width:83.3023%}.pure-u-1-8{width:12.5%;*width:12.469%}.pure-u-3-8{width:37.5%;*width:37.469%}.pure-u-5-8{width:62.5%;*width:62.469%}.pure-u-7-8{width:87.5%;*width:87.469%}.pure-u-1-12{width:8.3333%;*width:8.3023%}.pure-u-5-12{width:41.6667%;*width:41.6357%}.pure-u-7-12{width:58.3333%;*width:58.3023%}.pure-u-11-12{width:91.6667%;*width:91.6357%}.pure-u-1-24{width:4.1667%;*width:4.1357%}.pure-u-5-24{width:20.8333%;*width:20.8023%}.pure-u-7-24{width:29.1667%;*width:29.1357%}.pure-u-11-24{width:45.8333%;*width:45.8023%}.pure-u-13-24{width:54.1667%;*width:54.1357%}.pure-u-17-24{width:70.8333%;*width:70.8023%}.pure-u-19-24{width:79.1667%;*width:79.1357%}.pure-u-23-24{width:95.8333%;*width:95.8023%}.pure-g-r{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-flex;-webkit-flex-flow:row wrap;display:-ms-flexbox;-ms-flex-flow:row wrap}.opera-only :-o-prefocus,.pure-g-r{word-spacing:-.43em}.pure-g-r [class *="pure-u"]{font-family:sans-serif}.pure-g-r img{max-width:100%;height:auto}@media (min-width:980px){.pure-visible-phone{display:none}.pure-visible-tablet{display:none}.pure-hidden-desktop{display:none}}@media (max-width:480px){.pure-g-r>.pure-u,.pure-g-r>[class *="pure-u-"]{width:100%}}@media (max-width:767px){.pure-g-r>.pure-u,.pure-g-r>[class *="pure-u-"]{width:100%}.pure-hidden-phone{display:none}.pure-visible-desktop{display:none}}@media (min-width:768px) and (max-width:979px){.pure-hidden-tablet{display:none}.pure-visible-desktop{display:none}}.pure-menu ul{position:absolute;visibility:hidden}.pure-menu.pure-menu-open{visibility:visible;z-index:2;width:100%}.pure-menu ul{left:-10000px;list-style:none;margin:0;padding:0;top:-10000px;z-index:1}.pure-menu>ul{position:relative}.pure-menu-open>ul{left:0;top:0;visibility:visible}.pure-menu-open>ul:focus{outline:0}.pure-menu li{position:relative}.pure-menu a,.pure-menu .pure-menu-heading{display:block;color:inherit;line-height:1.5em;padding:5px 20px;text-decoration:none;white-space:nowrap}.pure-menu.pure-menu-horizontal>.pure-menu-heading{display:inline-block;*display:inline;zoom:1;margin:0;vertical-align:middle}.pure-menu.pure-menu-horizontal>ul{display:inline-block;*display:inline;zoom:1;vertical-align:middle;height:2.4em}.pure-menu li a{padding:5px 20px}.pure-menu-can-have-children>.pure-menu-label:after{content:'\25B8';float:right;font-family:'Lucida Grande','Lucida Sans Unicode','DejaVu Sans',sans-serif;margin-right:-20px;margin-top:-1px}.pure-menu-can-have-children>.pure-menu-label{padding-right:30px}.pure-menu-separator{background-color:#dfdfdf;display:block;height:1px;font-size:0;margin:7px 2px;overflow:hidden}.pure-menu-hidden{display:none}.pure-menu-fixed{position:fixed;top:0;left:0;width:100%}.pure-menu-horizontal li{display:inline-block;*display:inline;zoom:1;vertical-align:middle}.pure-menu-horizontal li li{display:block}.pure-menu-horizontal>.pure-menu-children>.pure-menu-can-have-children>.pure-menu-label:after{content:"\25BE"}.pure-menu-horizontal>.pure-menu-children>.pure-menu-can-have-children>.pure-menu-label{padding-right:30px}.pure-menu-horizontal li.pure-menu-separator{height:50%;width:1px;margin:0 7px}.pure-menu-horizontal li li.pure-menu-separator{height:1px;width:auto;margin:7px 2px}.pure-menu.pure-menu-open,.pure-menu.pure-menu-horizontal li .pure-menu-children{background:#fff;border:1px solid #b7b7b7}.pure-menu.pure-menu-horizontal,.pure-menu.pure-menu-horizontal .pure-menu-heading{border:0}.pure-menu a{border:1px solid transparent;border-left:0;border-right:0}.pure-menu a,.pure-menu .pure-menu-can-have-children>li:after{color:#777}.pure-menu .pure-menu-can-have-children>li:hover:after{color:#fff}.pure-menu .pure-menu-open{background:#dedede}.pure-menu li a:hover,.pure-menu li a:focus{background:#eee}.pure-menu li.pure-menu-disabled a:hover,.pure-menu li.pure-menu-disabled a:focus{background:#fff;color:#bfbfbf}.pure-menu .pure-menu-disabled>a{background-image:none;border-color:transparent;cursor:default}.pure-menu .pure-menu-disabled>a,.pure-menu .pure-menu-can-have-children.pure-menu-disabled>a:after{color:#bfbfbf}.pure-menu .pure-menu-heading{color:#565d64;text-transform:uppercase;font-size:90%;margin-top:.5em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#dfdfdf}.pure-menu .pure-menu-selected a{color:#000}.pure-menu.pure-menu-open.pure-menu-fixed{border:0;border-bottom:1px solid #b7b7b7}.pure-paginator{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;text-rendering:optimizespeed;list-style:none;margin:0;padding:0}.opera-only :-o-prefocus,.pure-paginator{word-spacing:-.43em}.pure-paginator li{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-paginator .pure-button{border-radius:0;padding:.8em 1.4em;vertical-align:top;height:1.1em}.pure-paginator .pure-button:focus,.pure-paginator .pure-button:active{outline-style:none}.pure-paginator .prev,.pure-paginator .next{color:#C0C1C3;text-shadow:0 -1px 0 rgba(0,0,0,.45)}.pure-paginator .prev{border-radius:2px 0 0 2px}.pure-paginator .next{border-radius:0 2px 2px 0}@media (max-width:480px){.pure-menu-horizontal{width:100%}.pure-menu-children li{display:block;border-bottom:1px solid #000}}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:6px 12px}.pure-table td:first-child,.pure-table th:first-child{border-left-width:0}.pure-table thead{background:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child td,.pure-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child td{border-bottom-width:0}
\ No newline at end of file
$(document).ready(function() {
function doDataUrl (data) {
var frame_content = document.getElementsByTagName("iframe")[0].contentWindow;
var b64 = btoa(data);
dataurl = 'data:text/html;base64,' + b64;
$("iframe").attr('src', dataurl);
}
if ( window.self === window.top ) {
//not in an iframe
$(".script").click(function(e) {
e.preventDefault();
var message = $(this).attr('href');
var slash_pos = message.search('/');
//let's differenciate kind of script called
if ( slash_pos === -1 || slash_pos === 0) {
url = message;
}
else {
url = '/index.cgi';
}
$("iframe").attr('src', url + '?script=' + encodeURIComponent(message));
});
$(".link").click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
$("iframe").attr('src', url);
});
}
else {
//in an iframe
$("body").empty();
}
});
body {
padding: 15px;
}
.pure-menu .pure-menu-heading {
font-size: 120%;
}
#content {
display: inline-block;
min-width: 72%;
height: 97%;
margin-left: 30px;
}
#div-menu {
display: inline-block;
vertical-align: top;
}
#div-menu h1 {
text-align: center;
}
iframe {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
border-style: none;
}
<html>
<head>
<title>Welcome to the Monitoring Interface</title>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Welcome to your monitoring interface</h1>
<p>From this interface you can monitor, configure your instance</p>
</body>
</html>
#!{{ python_executable }}
import cgi
import datetime
import os
import sqlite3
db_path = '{{ monitor_db_path }}'
status_history_length = '{{ status_history_length }}'
db = sqlite3.connect(db_path)
print """<html><head>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
</head><body>
<h1>Monitor Status History :</h1>"""
def get_date_from_timestamp(timestamp):
return datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S')
def print_individual_status(timestamp):
print "<div><h3>Failure on %s</h3><ul>" % get_date_from_timestamp(timestamp)
rows = db.execute("select status, element, output from individual_status where timestamp=?", (timestamp,))
for row in rows:
status, element, output = row
print "<li>%s , %s :</br><pre>%s</pre></li>" % (status, cgi.escape(element), cgi.escape(output))
print "</ul></div>"
if not os.path.exists(db_path):
print """No status history found</p></body></html>"""
exit(0)
failure_row_list = db.execute("select timestamp from status where status='FAILURE' order by timestamp desc limit ?", status_history_length )
for failure_row in failure_row_list:
timestamp, = failure_row
print_individual_status(timestamp)
print "</body></html>"
#!{{ python_executable }}
import cgi
import cgitb
import json
import os
import subprocess
def refresh():
command = ["{{ monitor_bin }}", "-a"]
subprocess.call(command)
cgitb.enable(display=0, logdir="/tmp/cgi.log")
form = cgi.FieldStorage()
json_file = "{{ json_file }}"
if not os.path.exists(json_file) or "refresh" in form:
refresh()
if not os.path.exists(json_file):
print """<html><head>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
</head><body>
<h1>Monitoring :</h1>
No status file found</p></body></html>"""
exit(0)
result = json.load(open(json_file))
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"static/pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"static/style.css\">"
print "</head><body>"
print "<h1>Monitoring :</h1>"
print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
print "<input type=\"hidden\" name=\"posting-script\" value=\"{{ pwd }}/{{ this_file }}\">"
print "<p><em>Last time of monitoring process : %s</em></p>" % (result['datetime'])
del result['datetime']
print "<div class=\"pure-controls\"><button type=\"submit\" class=\"pure-button \
pure-button-primary\" name=\"refresh\" value=\"refresh\">Refresh</button></div></form>"
print "<br/>"
print "<h2>These scripts and promises have failed :</h2>"
for r in result:
if result[r] != '':
print "<h3>%s</h3><pre style=\"padding-left:30px;\">%s</pre>" % (cgi.escape(r), cgi.escape(result[r]))
print "<br/>"
print "<h2>These scripts and promises were successful :</h2>"
print "<ul>"
for r in result:
if result[r] == '':
print "<li>%s</li>" % (r)
print "</ul>"
print "</body></html>"
#!${dash-output:dash}
{{ content }}
\ No newline at end of file
...@@ -38,7 +38,7 @@ eggs = collective.recipe.template ...@@ -38,7 +38,7 @@ eggs = collective.recipe.template
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready.cfg.in url = ${:_profile_base_location_}/pbsready.cfg.in
output = ${buildout:directory}/pbsready.cfg output = ${buildout:directory}/pbsready.cfg
md5sum = 7d7cb70cb76a41f853e74cc34a9ef428 md5sum = 4962204261e38c782c80ab9ca71410e9
mode = 0644 mode = 0644
[pbsready-import] [pbsready-import]
...@@ -63,18 +63,18 @@ mode = 0644 ...@@ -63,18 +63,18 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
output = ${buildout:directory}/instance-pull-backup.cfg output = ${buildout:directory}/instance-pull-backup.cfg
md5sum = 0e6a95e7a9b38d402f94c11b7d10397e md5sum = 932acec2718e3daef839886b71e667cd
mode = 0644 mode = 0644
[template-replicated] [template-replicated]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template-replicated.cfg.in url = ${:_profile_base_location_}/template-replicated.cfg.in
md5sum = 0641a65142fe0f624bf7c112081c2527 md5sum = 738f21e9fbfaee0d150d49da0afd7435
mode = 0644 mode = 0644
destination = ${buildout:directory}/template-replicated.cfg.in destination = ${buildout:directory}/template-replicated.cfg.in
[template-parts] [template-parts]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template-parts.cfg.in url = ${:_profile_base_location_}/template-parts.cfg.in
md5sum = 071b1034ee8f5cc14f79b16fdeba2813 md5sum = 071b1034ee8f5cc14f79b16fdeba2813
mode = 0644 mode = 0644
...@@ -90,7 +90,7 @@ md5sum = d21472f0e58f928fb827f2cbf22c4d4a ...@@ -90,7 +90,7 @@ md5sum = d21472f0e58f928fb827f2cbf22c4d4a
output = ${buildout:directory}/instance-frozen.cfg output = ${buildout:directory}/instance-frozen.cfg
[resilient-web-takeover-cgi-script-download] [resilient-web-takeover-cgi-script-download]
recipe = slapos.recipe.download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/resilient-web-takeover-cgi-script.py.in url = ${:_profile_base_location_}/resilient-web-takeover-cgi-script.py.in
md5sum = 3aa7624af1196062d7d01946d4de9f0e md5sum = 3aa7624af1196062d7d01946d4de9f0e
mode = 0644 mode = 0644
......
[buildout] [buildout]
parts = parts =
publish-connection-informations publish-connection-information
pbs pbs
logrotate logrotate
cron cron
...@@ -245,7 +245,7 @@ ignore-known-hosts-file = false ...@@ -245,7 +245,7 @@ ignore-known-hosts-file = false
#-- #--
#-- Publish instance parameters. #-- Publish instance parameters.
[publish-connection-informations] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
ssh-key = $${sshkeys-dropbear:public-key-value} ssh-key = $${sshkeys-dropbear:public-key-value}
notification-url = http://[$${notifier:host}]:$${notifier:port}/notify notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
...@@ -272,5 +272,5 @@ mode = 700 ...@@ -272,5 +272,5 @@ mode = 700
context = context =
key input_feed_directory directory:notifier-feeds key input_feed_directory directory:notifier-feeds
key monitor_feed_directory monitor-directory:public-cgi key monitor_feed_directory monitor-directory:public-cgi
key base_url publish-connection-informations:feeds-url key base_url publish-connection-information:feeds-url
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
...@@ -120,7 +120,7 @@ create = true ...@@ -120,7 +120,7 @@ create = true
<= logrotate <= logrotate
recipe = slapos.cookbook:logrotate.d recipe = slapos.cookbook:logrotate.d
name = equeue name = equeue
log = $${equeue:log} log = $${equeue:log} $${dropbear-sshd:log}
frequency = daily frequency = daily
rotate-num = 30 rotate-num = 30
...@@ -188,6 +188,14 @@ dropbear-binary = ${dropbear:location}/sbin/dropbear ...@@ -188,6 +188,14 @@ dropbear-binary = ${dropbear:location}/sbin/dropbear
recipe = slapos.cookbook:dropbear.add_authorized_key recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key} key = $${slap-parameter:authorized-key}
[dropbear-sshd]
recipe = collective.recipe.template
log = $${basedirectory:log}/sshd.log
input = inline:#!/bin/sh
exec $${dropbear-server:wrapper} >> $${:log}/sshd.log 2>&1
output = $${rootdirectory:bin}/raw_sshd_log
mode = 700
#---------------- #----------------
#-- #--
...@@ -210,7 +218,7 @@ keygen-binary = ${dropbear:location}/bin/dropbearkey ...@@ -210,7 +218,7 @@ keygen-binary = ${dropbear:location}/bin/dropbearkey
recipe = slapos.cookbook:sshkeys_authority.request recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear name = dropbear
type = rsa type = rsa
executable = $${dropbear-server:wrapper} executable = $${dropbear-sshd:output}
public-key = $${dropbear-server:rsa-keyfile}.pub public-key = $${dropbear-server:rsa-keyfile}.pub
private-key = $${dropbear-server:rsa-keyfile} private-key = $${dropbear-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd wrapper = $${basedirectory:services}/sshd
......
...@@ -97,7 +97,7 @@ sla-{{ key }} = {{ value }} ...@@ -97,7 +97,7 @@ sla-{{ key }} = {{ value }}
{% endfor -%} {% endfor -%}
{% endif %} {% endif %}
[publish-connection-informations] [publish-connection-information]
feed-url-{{namebase}}-{{id}}-push = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${request-{{namebase}}-pseudo-replicating-{{id}}:pbs-notification-id} feed-url-{{namebase}}-{{id}}-push = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${request-{{namebase}}-pseudo-replicating-{{id}}:pbs-notification-id}
takeover-{{namebase}}-{{id}}-url = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-takeover-url} takeover-{{namebase}}-{{id}}-url = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-takeover-url}
takeover-{{namebase}}-{{id}}-password = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-takeover-password} takeover-{{namebase}}-{{id}}-password = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-takeover-password}
...@@ -208,7 +208,7 @@ config-remove-backup-older-than = {{ slapparameter_dict.get('remove-backup-older ...@@ -208,7 +208,7 @@ config-remove-backup-older-than = {{ slapparameter_dict.get('remove-backup-older
slave = true slave = true
sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid} sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid}
[publish-connection-informations] [publish-connection-information]
feed-url-{{namebase}}-{{id}}-pull = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${request-pull-backup-server-{{namebase}}-{{id}}:config-notification-id} feed-url-{{namebase}}-{{id}}-pull = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${request-pull-backup-server-{{namebase}}-{{id}}:config-notification-id}
......
...@@ -9,13 +9,9 @@ python = python2.7 ...@@ -9,13 +9,9 @@ python = python2.7
# Note that if you want a develop version of slapos-cookbook from a git # Note that if you want a develop version of slapos-cookbook from a git
# checkout, you must add both slapos-cookbook-develop and slapos-cookbook in parts # checkout, you must add both slapos-cookbook-develop and slapos-cookbook in parts
# Explicitly disable download-cache
download-cache =
# Generate list of automatically chosen eggs version # Generate list of automatically chosen eggs version
extensions += extensions +=
buildout-versions buildout-versions
mr.developer
slapos.extension.strip slapos.extension.strip
# Use shacache and lxml # Use shacache and lxml
...@@ -26,6 +22,7 @@ extends = ...@@ -26,6 +22,7 @@ extends =
../component/python-cffi/buildout.cfg ../component/python-cffi/buildout.cfg
../component/python-cliff/buildout.cfg ../component/python-cliff/buildout.cfg
../component/python-cryptography/buildout.cfg ../component/python-cryptography/buildout.cfg
../component/python-PyYAML/buildout.cfg
# Separate from site eggs # Separate from site eggs
allowed-eggs-from-site-packages = allowed-eggs-from-site-packages =
...@@ -86,6 +83,7 @@ recipe = zc.recipe.egg ...@@ -86,6 +83,7 @@ recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${python-cffi:egg} ${python-cffi:egg}
${python-PyYAML:egg}
${python-cliff:egg} ${python-cliff:egg}
${python-cryptography:egg} ${python-cryptography:egg}
pyOpenSSL pyOpenSSL
...@@ -103,50 +101,52 @@ eggs = ...@@ -103,50 +101,52 @@ eggs =
[versions] [versions]
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.7.1.post11 zc.buildout = 1.7.1.post13
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2) # Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 1.3.2.post4 zc.recipe.egg = 1.3.2.post5
# Use own version of h.r.download to be able to open .xz and .lz archives # Use own version of h.r.download to be able to open .xz and .lz archives
hexagonit.recipe.download = 1.7.post4 hexagonit.recipe.download = 1.7.post4
Jinja2 = 2.8 Jinja2 = 2.8
PyYAML = 3.11
Werkzeug = 0.10.4 Werkzeug = 0.10.4
buildout-versions = 1.7 buildout-versions = 1.7
cffi = 1.2.1 cffi = 1.2.1
cliff = 1.15.0
cmd2 = 0.6.8 cmd2 = 0.6.8
collective.recipe.template = 1.11 collective.recipe.template = 1.11
cryptography = 1.0 cryptography = 1.0.2
decorator = 4.0.4
idna = 2.0 idna = 2.0
inotifyx = 0.2.2 inotifyx = 0.2.2
itsdangerous = 0.24 itsdangerous = 0.24
lxml = 3.4.4 lxml = 3.4.4
meld3 = 1.0.2 meld3 = 1.0.2
mr.developer = 1.33
netaddr = 0.7.18 netaddr = 0.7.18
pbr = 1.6.0 pbr = 1.8.1
plone.recipe.command = 1.1
prettytable = 0.7.2 prettytable = 0.7.2
psutil = 3.2.1 psutil = 3.2.2
pyOpenSSL = 0.15.1 pyOpenSSL = 0.15.1
pyasn1 = 0.1.8 pyasn1 = 0.1.9
pyparsing = 2.0.3 pyparsing = 2.0.3
pytz = 2015.4 pytz = 2015.6
requests = 2.7.0 requests = 2.8.1
setuptools = 18.1 setuptools = 18.1
simplejson = 3.8.0 simplejson = 3.8.0
six = 1.9.0 six = 1.10.0
slapos.cookbook = 1.0.9 slapos.cookbook = 1.0.9
slapos.core = 1.3.10 slapos.core = 1.3.12
slapos.extension.strip = 0.1 slapos.extension.strip = 0.1
slapos.libnetworkcache = 0.14.3 slapos.libnetworkcache = 0.14.5
slapos.recipe.build = 0.21 slapos.recipe.build = 0.23
slapos.recipe.cmmi = 0.2 slapos.recipe.cmmi = 0.2
stevedore = 1.7.0 stevedore = 1.9.0
unicodecsv = 0.13.0 unicodecsv = 0.14.1
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1
# Required by: # Required by:
# slapos.core==1.3.10 # slapos.core==1.3.12
Flask = 0.10.1 Flask = 0.10.1
# Required by: # Required by:
...@@ -154,16 +154,12 @@ Flask = 0.10.1 ...@@ -154,16 +154,12 @@ Flask = 0.10.1
MarkupSafe = 0.23 MarkupSafe = 0.23
# Required by: # Required by:
# cliff==1.14.0 # cliff==1.15.0
# stevedore==1.7.0 # stevedore==1.9.0
argparse = 1.3.0 argparse = 1.4.0
# Required by:
# slapos.core==1.3.10
cliff = 1.14.0
# Required by: # Required by:
# cryptography==1.0 # cryptography==1.0.2
enum34 = 1.0.4 enum34 = 1.0.4
# Required by: # Required by:
...@@ -171,7 +167,7 @@ enum34 = 1.0.4 ...@@ -171,7 +167,7 @@ enum34 = 1.0.4
functools32 = 3.2.3.post2 functools32 = 3.2.3.post2
# Required by: # Required by:
# cryptography==1.0 # cryptography==1.0.2
ipaddress = 1.0.14 ipaddress = 1.0.14
# Required by: # Required by:
...@@ -183,7 +179,7 @@ jsonschema = 2.5.1 ...@@ -183,7 +179,7 @@ jsonschema = 2.5.1
lock-file = 2.0 lock-file = 2.0
# Required by: # Required by:
# slapos.core==1.3.10 # slapos.core==1.3.12
netifaces = 0.10.4 netifaces = 0.10.4
# Required by: # Required by:
...@@ -191,16 +187,16 @@ netifaces = 0.10.4 ...@@ -191,16 +187,16 @@ netifaces = 0.10.4
pycparser = 2.14 pycparser = 2.14
# Required by: # Required by:
# slapos.core==1.3.10 # slapos.core==1.3.12
supervisor = 3.1.3 supervisor = 3.1.3
# Required by: # Required by:
# slapos.core==1.3.10 # slapos.core==1.3.12
uritemplate = 0.6 uritemplate = 0.6
# Required by: # Required by:
# slapos.core==1.3.10 # slapos.core==1.3.12
zope.interface = 4.1.2 zope.interface = 4.1.3
[networkcache] [networkcache]
download-cache-url = http://www.shacache.org/shacache download-cache-url = http://www.shacache.org/shacache
......
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