Commit d34f2af0 authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master+ZODB4-wc2' into y/wc2-next

* master+ZODB4-wc2: (106 commits)
  component/perl-Image-ExifTool: version up 12.30
  fixup! stack/erp5: use %Ta for timing of haproxy requests
  stack/erp5: use %Ta for timing of haproxy requests
  Revert "kvm: Bang immediately in case of vnc_promise problem"
  kvm: Bang immediately in case of vnc_promise problem
  kvm: Switch mouse to tablet mode
  software/slapos-sr-testing: update doc
  software/slapos-sr-testing: run ERP5 SR test with a python3 slapos.core
  component/depot_tools: check out a fixed revision
  software/erp5/test: add python3 support
  software/galene: use python3
  stack/caucase: Version up caucase 0.9.12
  galene: version up 0.4
  kvm: Increase default VM parameters to match nowadays requirement
  hugo: create tempfiles in a dedicated temporary directory
  component/java-jdk: add missing rpaths
  component/alsa: enable slapos.recipe.cmmi's shared
  kvm: Upgrade default ISO for vm to debian bullseye
  componant/slapos/obs.cfg: update OBS build
  caddy-frontend: Pick up recent kedifa from the distribution
  ...
parents fce2105c b2640909
......@@ -5,6 +5,7 @@ parts =
[alsa]
# Contains libasound
recipe = slapos.recipe.cmmi
shared = true
url = ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.3.tar.bz2
md5sum = eefe5992567ba00d6110a540657aaf5c
configure-options =
......
......@@ -39,9 +39,9 @@ configure-options =
[apache]
recipe = slapos.recipe.cmmi
shared = true
version = 2.4.46
version = 2.4.49
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 7d661ea5e736dac5e2761d9f49fe8361
md5sum = f294efbeabcf6027fccc7983a6daa55f
configure-options = --disable-static
--enable-authn-alias
--enable-bucketeer
......
......@@ -10,7 +10,9 @@ parts =
[cclient]
recipe = slapos.recipe.cmmi
url = ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
#url = ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
url = https://src.fedoraproject.org/lookaside/pkgs/uw-imap/${:filename}/${:md5sum}/${:filename}
filename = imap-2007f.tar.gz
md5sum = 2126fd125ea26b73b20f01fcd5940369
configure-command = true
# cclient does not support parallel compilation
......@@ -23,11 +25,11 @@ make-options =
SSLLIB=${openssl:location}/lib
EXTRACFLAGS=-fPIC
EXTRALDFLAGS="-Wl,-rpath -Wl,${openssl:location}/lib"
CCLIENT=${buildout:parts-directory}
PREFIX=%(location)s
-j1
patches =
${:_profile_base_location_}/imap-2007f.patch#42c77fdd5d7a976fc302b93aadb3da98
${:_profile_base_location_}/imap-2007f.patch#5d1f2f95472f6be465ef7e152a011100
${:_profile_base_location_}/imap-2007f-openssl-1.1.patch#c726354e888f2f3b3954e334903cef80
patch-options = -p1
--- old/Makefile 2011-09-22 13:19:53.000000000 +0100
+++ new/Makefile 2011-11-09 15:02:54.038306922 +0100
@@ -280,7 +280,11 @@
diff -u old/Makefile new/Makefile
--- old/Makefile
+++ new/Makefile
@@ -280,6 +280,7 @@
SYSTEM=unix
TOOLS=tools
TOUCH=touch
-
+IMAPDIR=$(CCLIENT)/cclient
+COMPILEDIR = $(CCLIENT)/cclient__compile__/imap-2007f
+CP=cp -r
+INSTALL=install
+FOR=for
# Primary build command
@@ -580,7 +584,6 @@
# Primary build command
@@ -580,7 +581,6 @@
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo
@echo Do you want to continue this build anyway? Type y or n please:
......@@ -21,36 +17,26 @@
nounenc:
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -639,7 +642,7 @@
@@ -639,7 +639,6 @@
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo
@echo Do you want to build with IPv6 anyway? Type y or n please:
- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
+ #@$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
@echo OK, I will remember that you really want to build with IPv6.
@echo You will not see this message again.
@$(TOUCH) ip6
@@ -731,6 +734,24 @@
@@ -731,6 +730,15 @@
$(SH) -c '$(RM) an ua OSTYPE SPECIALS c-client mtest imapd ipopd mailutil mlock dmail tmail || true'
$(CD) tools;$(MAKE) clean
+install:
+ $(INSTALL) -v -d $(IMAPDIR)/include
+ $(INSTALL) -v -d $(IMAPDIR)/lib
+ $(INSTALL) -v -m 644 $(COMPILEDIR)/c-client/*.h $(IMAPDIR)/include
+ $(INSTALL) -v -m 644 $(COMPILEDIR)/c-client/c-client.a $(IMAPDIR)/lib
+ $(CP) $(COMPILEDIR)/ipopd $(COMPILEDIR)/mailutil $(COMPILEDIR)/imapd \
+ $(COMPILEDIR)/dmail $(COMPILEDIR)/mlock $(COMPILEDIR)/mtest $(COMPILEDIR)/tmail $(IMAPDIR)
+ $(RM) $(IMAPDIR)/ipopd/*.h $(IMAPDIR)/ipopd/*.c $(IMAPDIR)/ipopd/Makefile;
+ $(RM) $(IMAPDIR)/mailutil/*.h $(IMAPDIR)/mailutil/*.c $(IMAPDIR)/mailutil/Makefile;
+ $(RM) $(IMAPDIR)/imapd/*.h $(IMAPDIR)/imapd/*.c $(IMAPDIR)/imapd/Makefile;
+ $(RM) $(IMAPDIR)/tmail/*.h $(IMAPDIR)/tmail/*.c $(IMAPDIR)/tmail/Makefile;
+ $(RM) $(IMAPDIR)/mlock/*.h $(IMAPDIR)/mlock/*.c $(IMAPDIR)/mlock/Makefile;
+ $(RM) $(IMAPDIR)/mtest/*.h $(IMAPDIR)/mtest/*.c $(IMAPDIR)/mtest/Makefile;
+ $(RM) $(IMAPDIR)/dmail/*.h $(IMAPDIR)/dmail/*.c $(IMAPDIR)/dmail/Makefile;
+ $(INSTALL) -v -m 644 $(COMPILEDIR)/ip6 $(IMAPDIR)
+ $(INSTALL) -v -m 644 $(COMPILEDIR)/OSTYPE $(IMAPDIR)
+ $(INSTALL) -v -m 644 $(COMPILEDIR)/SPECIALS $(IMAPDIR)
+install:
+ $(INSTALL) -v -d $(PREFIX)/bin $(PREFIX)/include $(PREFIX)/lib
+ $(INSTALL) -v c-client/*.h $(PREFIX)/include
+ $(INSTALL) -v c-client/c-client.a $(PREFIX)/lib
+ for x in ipopd mailutil imapd dmail mlock mtest tmail; \
+ do for x in $$x/*; do [ ! -x $$x ] || echo $$x; done; \
+ done |xargs $(INSTALL) -v -t $(PREFIX)/bin
+ $(INSTALL) -v -t $(PREFIX) ip6 OSTYPE SPECIALS
+
# A monument to a hack of long ago and far away...
......
[buildout]
extends =
../git/buildout.cfg
parts =
depot_tools
[depot_tools]
recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
branch = master
revsion = e023d4482012d89690f6a483e877eceb47c4501e
git-executable = ${git:location}/bin/git
......@@ -73,7 +73,7 @@ environment =
PATH=${pkgconfig:location}/bin:${gettext:location}/bin:${glib:location}/bin:${xz-utils:location}/bin:${flex:location}/bin:${bison:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${pcre: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
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi -L${zlib:location}/lib/ -Wl,-rpath=${zlib: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 -lglib-2.0 -lintl -lgobject-2.0
FFI_CFLAGS=-I${libffi:location}/include
......
......@@ -11,20 +11,21 @@ url = https://rubygems.org/rubygems/rubygems-2.4.8.zip
ruby-executable = ${ruby:location}/bin/ruby
gems =
msgpack==1.3.3
cool.io==1.4.6
concurrent-ruby==1.1.9
cool.io==1.7.1
dig_rb==1.0.1
http_parser.rb==0.6.0
sigdump==0.2.4
serverengine==2.2.3
strptime==0.1.9
serverengine==2.2.4
strptime==0.2.5
thread_safe==0.3.6
tzinfo==1.2.9
tzinfo==2.0.4
tzinfo-data==1.2021.1
yajl-ruby==1.4.1
fluentd==0.14.14
fluentd==1.8.1
httpclient==2.8.3
json==2.5.1
td-client==0.8.85
fluent-plugin-td==0.10.29
td-client==1.0.8
fluent-plugin-td==1.1.0
gem-options =
--with-icu-lib=${icu:location}/lib/
--with-icu-dir=${icu:location}/
......
......@@ -10,19 +10,13 @@ parts =
ipaex-fonts
liberation-fonts
ocrb-fonts
source-code-pro-fonts
jetbrains-mono-fonts
[fonts-base]
# XXX download and unpack, with shared parts support
# we could make slapos.recipe.build:download-unpacked really support shared
# parts and use it here. Current version of slapos.recipe.build ( 0.44 ) looks
# for buildout:shared-parts , but this is not what shared parts are using.
recipe = slapos.recipe.cmmi
recipe = slapos.recipe.build:download-unpacked
shared = true
configure-command = :
make-binary = :
post-install = cp -ra . ${:location}
location = @@LOCATION@@
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
......@@ -77,27 +71,19 @@ md5sum = 62f02985bfef43a27dbdd17641fec210
# Microsoft's TrueType core fonts
# non-free so not enabled by default
[msttcore-fonts]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
recipe = slapos.recipe.build
shared = true
p7z = ${p7zip:location}/bin/7z
install =
import os, subprocess
from zc.buildout.download import Download
d = location
fonts = []
download = lambda x, dl=Download(self.buildout['buildout']): (
dl("http://downloads.sf.net/corefonts/%s32.exe" % name, md5sum=md5sum)
for md5sum, name in (x.split() for x in x.splitlines() if x))
extract = lambda x, d=d, p7z="${p7zip:location}/bin/7z": any(
subprocess.check_call((p7z, "x", "-ssc-", path, "*.ttf"), cwd=d)
for path, is_temp in x)
try:
fonts += download(options['fonts'])
os.makedirs(d)
extract(fonts)
finally:
for path, is_temp in fonts:
if is_temp:
os.remove(path)
os.makedirs(location)
cmd = [options['p7z'], "x", "-ssc-", None, "*.ttf"]
for x in options['fonts'].splitlines():
md5sum, name = x.split()
cmd[3] = self.download(
"http://downloads.sf.net/corefonts/%s32.exe" % name,
md5sum)
subprocess.check_call(cmd, cwd=location)
slapos_promise =
slapos_update_promise = ${:slapos_promise}
fonts =
......
......@@ -16,6 +16,7 @@ rpath = ${:library-dirs}
[geolite2-country]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz#${:md5sum}
md5sum = dc6224c648350d90f344a0c5c3ca5474
strip-top-level-dir = true
......
......@@ -14,8 +14,8 @@ parts = ghostscript
[ghostscript]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9540/ghostscript-9.54.0.tar.gz
md5sum = 5d571792a8eb826c9f618fb69918d9fc
url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9550/ghostscript-9.55.0.tar.xz
md5sum = 92aa46e75c4f32eb11d9c975053d876c
pkg_config_depends = ${libtiff:location}/lib/pkgconfig:${libjpeg:location}/lib/pkgconfig:${fontconfig:location}/lib/pkgconfig:${fontconfig:pkg_config_depends}
# XXX --with-tessdata work arounds a slaprunner bug of having softwares installed in a path containing //
configure-options =
......
......@@ -18,8 +18,8 @@ parts =
[git]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.kernel.org/pub/software/scm/git/git-2.25.1.tar.xz
md5sum = 92bf65673b4fc08b64108d807f36f4d9
url = https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.33.0.tar.xz
md5sum = 0990ff97af1511be0d9f0d3223dd4359
configure-options =
--with-curl=${curl:location}
--with-openssl=${openssl:location}
......
[buildout]
extends =
../patchelf/buildout.cfg
../zlib/buildout.cfg
../alsa/buildout.cfg
../libpng/buildout.cfg
../freetype/buildout.cfg
../xorg/buildout.cfg
parts =
java-jdk
[java-jdk]
recipe = plone.recipe.command
command = echo "Error: unsupported platform" && false
stop-on-error = true
location =
recipe = slapos.recipe.build
update =
from zc.buildout import UserError
raise UserError("unsupported platform")
[java-jdk:linux and bits64]
[java-jdk:linux and platform.machine() == 'x86_64']
recipe = slapos.recipe.cmmi
shared = true
url = https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
md5sum = f5da6f4dec81bdd2a096184ec1d69216
configure-command = :
make-binary = :
pre-install =
mkdir -p @@LOCATION@@
cp -r * @@LOCATION@@
post-install =
for file in @@LOCATION@@/bin/* ; do
mv * %(location)s
for file in %(location)s/bin/* %(location)s/lib/*.so ; do
echo appending rpath to $file
${patchelf:location}/bin/patchelf --set-rpath ${:rpath} $file
${patchelf:location}/bin/patchelf --set-rpath %(rpath)s $file
done
rpath = ${zlib:location}/lib:@@LOCATION@@/lib
location = @@LOCATION@@
rpath = ${zlib:location}/lib:${alsa:location}/lib:${freetype:location}/lib:${libpng:location}/lib:${libXrender:location}/lib:${libXtst:location}/lib:${libX11:location}/lib:${libXau:location}/lib:${libXext:location}/lib:${libXdmcp:location}/lib:${libXi:location}/lib:${libxcb:location}/lib:@@LOCATION@@/lib:@@LOCATION@@/lib/server
......@@ -9,42 +9,34 @@ parts =
[java-re]
<= java-re-7
[java-common]
recipe = slapos.recipe.build:download-unpacked
url = http://javadl.sun.com/webapps/download/AutoDL?BundleId=${:bundle-id}
[java-re-7]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:plugin
file:lib/rt.jar
file:bin/java
<= java-common
# http://java.com/en/download/manual_java7.jsp
x86 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=97798 90a6b9e2a32d06c18a3f16b485f0d1ea
x86-64 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=97800 7605134662f6c87131eca5745895fe84
install =
url, md5sum = options[guessPlatform()].split()
extract_dir = self.extract(self.download(url, md5sum))
workdir = guessworkdir(extract_dir)
self.copyTree(workdir, location)
[java-re-7:linux and platform.machine() == 'i686']
bundle-id = 97798
md5sum = 90a6b9e2a32d06c18a3f16b485f0d1ea
[java-re-7:linux and platform.machine() == 'x86_64']
bundle-id = 97800
md5sum = 7605134662f6c87131eca5745895fe84
[java-re-8]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:plugin
file:lib/rt.jar
file:bin/java
<= java-common
# https://www.java.com/en/download/manual.jsp
# Update 161
x86 = http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230530_2f38c3b165be4555a1fa6e98c45e0808 32db95dd417fd7949922206b2a61aa19
x86-64 = http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230532_2f38c3b165be4555a1fa6e98c45e0808 4385bc121b085862be623f4a31e7e0b4
install =
url, md5sum = options[guessPlatform()].split()
extract_dir = self.extract(self.download(url, md5sum))
workdir = guessworkdir(extract_dir)
self.copyTree(workdir, location)
[java-re-8:linux and platform.machine() == 'i686']
bundle-id = 230530_2f38c3b165be4555a1fa6e98c45e0808
md5sum = 90a6b9e2a32d06c18a3f16b485f0d1ea
[java-re-8:linux and platform.machine() == 'x86_64']
bundle-id = 230532_2f38c3b165be4555a1fa6e98c45e0808
md5sum = 4385bc121b085862be623f4a31e7e0b4
[java-re-8-output]
# Shared binary location to ease migration
......
--- jdk-6u27-linux-x64.bin.orig 2011-09-27 11:02:14.000000000 +0200
+++ jdk-6u27-linux-x64.bin 2011-09-27 10:38:01.000000000 +0200
@@ -81,7 +81,7 @@
trap 'rm -f $outname; exit 1' HUP INT QUIT TERM
echo "Unpacking..."
tail ${tail_args} +189 "$0" > $outname
-if [ -x /usr/bin/sum ]; then
+if [ -x /usr/bin/null ]; then
echo "Checksumming..."
sum=`/usr/bin/sum $outname`
@@ -169,7 +169,7 @@
fi
# Service Tag support and JDK product registration
- register_JDK "$javahome" "${BINARY_NAME}" "$1"
+ # register_JDK "$javahome" "${BINARY_NAME}" "$1"
else
if [ "$1" = "-x" ]; then
......@@ -8,12 +8,23 @@ parts =
[lua]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.lua.org/ftp/lua-5.3.1.tar.gz
md5sum = 797adacada8d85761c079390ff1d9961
url = http://www.lua.org/ftp/lua-5.4.3.tar.gz
md5sum = ef63ed2ecfb713646a7fcc583cf5f352
configure-command = true
make-options =
"$(uname -sr 2>/dev/null|grep -Eq '^Linux' && echo linux || echo posix)"
MYCFLAGS="-I${readline:location}/include"
MYCFLAGS="-I${readline:location}/include -fPIC"
MYLDFLAGS="-L${readline:location}/lib -Wl,-rpath=${readline:location}/lib"
make-targets =
install INSTALL_TOP=@@LOCATION@@
INSTALL_TOP=@@LOCATION@@
post-install =
mkdir -p %(location)s/lib/pkgconfig
{
make pc INSTALL_TOP=%(location)s
echo '%(pc)s'
} > %(location)s/lib/pkgconfig/lua.pc
pc =
Name: Lua
Description: Lua language engine
Version: $${version}
Libs: -L$${libdir} -llua
Cflags: -I$${includedir}
From: Santiago Vila <sanvila@debian.org>
Subject: Fix FTBFS with glibc 2.28
Bug-Debian: https://bugs.debian.org/915152
X-Debian-version: 1.4.18-2
Based on this gnulib commit by Paul Eggert:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00002.html
--- a/lib/fflush.c
+++ b/lib/fflush.c
@@ -33,7 +33,7 @@
#undef fflush
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
static void
@@ -72,7 +72,7 @@
#endif
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
@@ -148,7 +148,7 @@
if (stream == NULL || ! freading (stream))
return fflush (stream);
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
clear_ungetc_buffer_preserving_position (stream);
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -32,7 +32,7 @@
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -62,7 +62,7 @@
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
/* Avoid memory leak when there is an active ungetc buffer. */
--- a/lib/freadahead.c
+++ b/lib/freadahead.c
@@ -25,7 +25,7 @@
size_t
freadahead (FILE *fp)
{
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
--- a/lib/freading.c
+++ b/lib/freading.c
@@ -31,7 +31,7 @@
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return ((fp->_flags & _IO_NO_WRITES) != 0
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
&& fp->_IO_read_base != NULL));
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -47,7 +47,7 @@
#endif
/* These tests are based on fpurge.c. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
@@ -123,7 +123,7 @@
return -1;
}
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */
......@@ -11,7 +11,8 @@ shared = true
url = http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz
md5sum = 730bb15d96fffe47e148d1e09235af82
environment =
PATH=${xz-utils:location}/bin:${patch:location}/bin:%(PATH)s
PATH=${xz-utils:location}/bin:%(PATH)s
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${:_profile_base_location_}/01-fix-ftbfs-with-glibc-2.28.patch#058a786425e507f911649205b61ffcac
https://sources.debian.org/data/main/m/m4/1.4.18-5/debian/patches/01-fix-ftbfs-with-glibc-2.28.patch#058a786425e507f911649205b61ffcac
[buildout]
extends =
../coreutils/buildout.cfg
../git/buildout.cfg
../libexpat/buildout.cfg
../openssl/buildout.cfg
../patch/buildout.cfg
../pcre/buildout.cfg
../zlib/buildout.cfg
......@@ -12,13 +10,12 @@ parts = nginx-output
[nginx-common]
recipe = slapos.recipe.cmmi
shared = false
shared = true
url = https://nginx.org/download/nginx-1.19.2.tar.gz
md5sum = 3dc55f6451ed6f819f1c796f4e5e9617
[nginx]
<= nginx-common
shared = true
configure-options=
--with-http_ssl_module
--with-http_v2_module
......@@ -32,10 +29,10 @@ configure-options=
[nginx-dav-ext-module]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/arut/nginx-dav-ext-module/archive/v0.0.3.tar.gz
strip-top-level-dir = true
md5sum = 2cb502dbda335be4ebd5fed0b3182bae
mode = 0644
[nginx-webdav]
<= nginx-common
......@@ -61,29 +58,11 @@ command = ${coreutils-output:test} -x ${:nginx} -a -f ${:mime}
nginx = ${nginx:location}/sbin/nginx
mime = ${nginx:location}/conf/mime.types
[hexaglobe-nginx-module]
recipe = hexagonit.recipe.download
ignore-existing = true
url = http://easicloud-p.cdn.hexaglobe.net/nginx-easicloud.tar.gz
md5sum = 57fe2ceb09740f22b5b1023f29889e0e
strip-top-level-dir = true
[nginx-enable-sub]
# Used by Hexaglobe for watermarking
<= nginx
configure-options=
--with-ipv6
--with-http_ssl_module
--with-ld-opt="-L ${zlib:location}/lib -L ${openssl:location}/lib -L ${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib"
--with-cc-opt="-I ${pcre:location}/include -I ${openssl:location}/include -I ${zlib:location}/include"
--add-module=${hexaglobe-nginx-module:location}/sub_module
# --add-module=${hexaglobe-nginx-module:location}/nginx-upstream-fair
[nginx-push-stream-module]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/wandenberg/nginx-push-stream-module.git
revision = 3d3a204177d3a7ab8a2858e04e792a6d11bf133f
git-executable = ${git:location}/bin/git
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/wandenberg/nginx-push-stream-module/archive/0.4.0.tar.gz
md5sum = d9cba621b8739e13bdb5e02b9425f205
[nginx-push-stream]
<= nginx-common
......
......@@ -4,6 +4,7 @@ parts =
[noVNC]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/novnc/noVNC/archive/refs/tags/v1.2.0.tar.gz
md5sum = 290dfabc4ecdd58d62ccb8c34a922962
strip-top-level-dir = true
......@@ -11,8 +11,8 @@ extends =
parts =
nodejs
[nodejs]
<= nodejs-8.9.4
#[nodejs]
#<= nodejs-X.Y.Z
[nodejs-14.16.0]
<= nodejs-base
......@@ -25,33 +25,25 @@ md5sum = 7dc3666f407bf4e12a01ce1be2883d31
openssl_location = ${openssl:location}
version = v12.18.3
md5sum = 28bf6a4d98b238403fa58a0805f4a979
[nodejs-10.19.0]
<= nodejs-base
openssl_location = ${openssl:location}
version = v10.19.0
md5sum = 9e433c753d839d2d2a6341861501674f
[nodejs-10.6.0]
<= nodejs-base
openssl_location = ${openssl:location}
version = v10.6.0
md5sum = 9df233b86244ebda1ded1f91694fbe86
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-8.9.4]
<= nodejs-base
version = v8.9.4
md5sum = 4ddc1daff327d7e6f63da57fdfc24f55
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-8.6.0]
<= nodejs-base
version = v8.6.0
md5sum = 0c95e08220667d8a18b97ecec8218ac6
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-8.12.0]
<= nodejs-base
version = v8.12.0
md5sum = 5690333b77964edf81945fc724f6ea85
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-base]
# Server-side Javascript.
......@@ -66,85 +58,15 @@ configure-options =
--shared-openssl
--shared-openssl-includes=${:openssl_location}/include
--shared-openssl-libpath=${:openssl_location}/lib
PATH = ${pkgconfig:location}/bin:%(PATH)s
environment =
HOME=@@LOCATION@@
PATH=${pkgconfig:location}/bin:%(PATH)s
PATH=${:PATH}
PKG_CONFIG_PATH=${:openssl_location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${:openssl_location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
LD_LIBRARY_PATH=${:openssl_location}/lib
[nodejs-8.6.0-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:node} -a -x ${:npm}
node = ${nodejs-8.6.0:location}/bin/node
npm = ${nodejs-8.6.0:location}/bin/npm
[nodejs-5]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
version = v5.9.1
url = http://nodejs.org/dist/${:version}/node-${:version}.tar.gz
md5sum = 346c9325912271dc7614fe955c75c3a6
configure-options =
--shared-openssl
--shared-openssl-includes=${openssl:location}/include
--shared-openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-4]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
version = v4.4.1
url = http://nodejs.org/dist/${:version}/node-${:version}.tar.gz
md5sum = ef756c3e773f08bccada08eb37ee699c
configure-options =
--shared-openssl
--shared-openssl-includes=${openssl:location}/include
--shared-openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-0.6]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
url = http://nodejs.org/dist/v0.6.21/node-v0.6.21.tar.gz
md5sum = 0da985a0bf820400af92363b9f453fe4
configure-options =
--openssl-includes=${openssl:location}/include
--openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-0.4]
recipe = slapos.recipe.cmmi
url = http://nodejs.org/dist/node-v0.4.12.tar.gz
md5sum = a6375eaa43db5356bf443e25b828ae16
configure-options =
--openssl-includes=${openssl:location}/include
--openssl-libpath=${openssl:location}/lib
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[npm]
# Node.js Package Manager
# Deprecated. Included in node >= 0.6.3.
......
# Implementation of OPC UA (OPC Unified Architecture). https://open62541.org/
[buildout]
parts = open62541
extends =
../cmake/buildout.cfg
[open62541]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/open62541/open62541/archive/refs/tags/v1.2.2.tar.gz
md5sum = 2883bde165bc9bc3d459ccbb47acf7f4
configure-command = ${cmake:location}/bin/cmake
configure-options =
-Bbuild
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
make-options = -C build
......@@ -16,13 +16,13 @@ parts =
[openssh]
recipe = slapos.recipe.cmmi
shared = true
md5sum = 68ba883aff6958297432e5877e9a0fe2
md5sum = 8ce5f390958baeeab635aafd0ef41453
location = @@LOCATION@@
url = https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
url = https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${:_profile_base_location_}/no_create_privsep_path.patch#f341dc11d73df6f43c7ae1fa47b8c003
${:_profile_base_location_}/no_create_privsep_path.patch#6ab983d16c9b4caf111c737dcad6ec9b
environment =
CPPFLAGS=-I${zlib:location}/include -I${openssl-1.0:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl-1.0:location}/lib -Wl,-rpath=${openssl-1.0:location}/lib
......
......@@ -14,7 +14,7 @@ diff --git a/Makefile.in b/Makefile.in
index 04e1c8e5..9bd5d01b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -329,7 +329,6 @@ install-files:
@@ -391,7 +391,6 @@ install-files:
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
$(MKDIR_P) $(DESTDIR)$(libexecdir)
......
[buildout]
extends =
../mysql-tritonn-5.0/buildout.cfg
../mariadb/buildout.cfg
../patch/buildout.cfg
../perl-Devel-CheckLib/buildout.cfg
parts =
perl-DBD-MySQL
perl-DBD-mariadb
[perl-DBD-MySQL-common]
<= perl-CPAN-package
......@@ -23,12 +22,6 @@ patches =
patch-options = -p1
extra-configure-args=--libs "-L${zlib:location}/lib -L${openssl:location}/lib $(mysql_config --libs)"
[perl-DBD-MySQL]
<= perl-DBD-MySQL-common
environment =
OTHERLDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mysql-tritonn-5.0:location}/lib/mysql -Wl,-rpath=${openssl:location}/lib
PATH=${mysql-tritonn-5.0:location}/bin:${patch:location}/bin:%(PATH)s
[perl-DBD-mariadb]
<= perl-DBD-MySQL-common
environment =
......
......@@ -7,5 +7,5 @@ parts =
[perl-Image-ExifTool]
<= perl-CPAN-package
module = Image/Image-ExifTool
version = 12.00
md5sum = 8c3f99a9a8d110ba340ee3f7063c940e
version = 12.30
md5sum = 1f5d66d62418c8b29eb0c0b7fd272b28
......@@ -4,6 +4,7 @@ extends =
../automake/buildout.cfg
../boost-lib/buildout.cfg
../libtool/buildout.cfg
../lua/buildout.cfg
../make/buildout.cfg
../openssl/buildout.cfg
../pkgconfig/buildout.cfg
......@@ -19,17 +20,16 @@ parts =
[powerdns]
recipe = slapos.recipe.cmmi
url = http://downloads.powerdns.com/releases/pdns-4.2.1.tar.bz2
md5sum = b5f3998a3bc438b905c72c0473408839
url = https://downloads.powerdns.com/releases/pdns-4.5.1.tar.bz2
md5sum = 5f0ba98ca59bc3d84cfd09097c8b9953
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-boost=${boost-lib:location}
--with-libcrypto=${openssl:location}
--with-modules="geoip"
--with-dynmodules=""
--without-lua
--disable-lua-records
pkg_config_depends = ${yaml-cpp:location}/lib/pkgconfig
pkg_config_depends = ${yaml-cpp:location}/lib/pkgconfig:${lua:location}/lib/pkgconfig
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${libmaxminddb:location}/bin:${libtool:location}/bin:${make:location}/bin:${pkgconfig:location}/bin:%(PATH)s
LDFLAGS=-L${boost-lib:location}/lib -Wl,-rpath=${boost-lib:location}/lib -L${libmaxminddb:location}/lib -Wl,-rpath=${libmaxminddb:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${yaml-cpp:location}/lib -Wl,-rpath=${yaml-cpp:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
......@@ -39,5 +39,3 @@ environment =
YAML_LIBS = -lyaml-cpp
make-options =
LIBTOOL=libtool
make-target =
install
......@@ -11,10 +11,9 @@ parts =
recipe = zc.recipe.egg:custom
egg =
pysvn
find-links = http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.10.tar.gz
find-links = https://sourceforge.net/projects/pysvn/files/pysvn/V1.9.15/pysvn-1.9.15.tar.gz/download
patches =
${:_profile_base_location_}/pysvn-1.7.10-inc_lib_dir.patch#08371129e0d0a215fb7f7811a860a89c
${:_profile_base_location_}/pysvn-issue-179.patch#bd3f9629f95f0f749c5a5e93c797ee2b
${:_profile_base_location_}/pysvn-1.9.15-inc_lib_dir.patch#c16eb88a862d4676c0ea2827f51b991a
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
include-dirs =
......
diff -ur pysvn-1.7.10.orig/setup.py pysvn-1.7.10/setup.py
--- pysvn-1.7.10.orig/setup.py 2010-12-30 13:26:51.000000000 +0100
+++ pysvn-1.7.10/setup.py 2015-08-14 10:29:25.562686564 +0200
@@ -19,6 +19,10 @@
diff --git a/setup.py b/setup.py
index e5ce838..e2b95f8 100644
--- a/setup.py
+++ b/setup.py
@@ -40,9 +40,16 @@ import distutils.sysconfig
import platform
import shutil
import sys
+import subprocess
import os
import os.path
import setuptools.command.bdist_egg
+import setuptools.command.bdist_egg
from setuptools.command.build_ext import build_ext
+try:
+ from ConfigParser import ConfigParser
+except ImportError:
+ from configparser import ConfigParser
+
pysvn_version_info = {}
f = open( 'Builder/version.info', 'r' )
@@ -27,13 +28,26 @@
pysvn_version_info[ key ] = value
@@ -77,6 +84,13 @@ class BuildExtensions(build_ext):
super( BuildExtensions, self ).build_extension( ext )
def run(self):
+ cfg = ConfigParser()
+ cfg.read('setup.cfg')
+ kw = {}
+ for key in ('include-dirs', 'library-dirs'):
+ if cfg.has_option('build_ext', key):
+ kw[key] = cfg.get('build_ext', key)
def _build_pysvn( self, ext ):
+ cfg = ConfigParser()
+ cfg.read('setup.cfg')
+ kw = {}
+ for key in ('include-dirs', 'library-dirs'):
+ if cfg.has_option('build_ext', key):
+ kw[key] = cfg.get('build_ext', key)
+
# Generate metadata first
self.run_command("egg_info")
os.chdir('Source')
- os.system(sys.executable + ' setup.py configure')
+ os.system(sys.executable + ' setup.py configure --include-dirs=%(include-dirs)s --library-dirs=%(library-dirs)s' % kw)
os.system('make clean')
os.system('make')
- os.system('make egg DISTDIR="%s"' % os.path.abspath(os.path.join('..', self.dist_dir)))
+ os.system('rm -rf dist; mkdir -p dist/EGG-INFO')
+ os.system('cp -rvf pysvn dist')
+ os.system('cp -rvf ../pysvn.egg-info/* dist/EGG-INFO')
+ os.system('find dist/pysvn -type f | sed s:dist/:: > dist/EGG-INFO/SOURCES.txt')
+ setuptools.command.bdist_egg.make_zipfile(
+ self.egg_output, 'dist', verbose=self.verbose,
+ dry_run=self.dry_run, mode=self.gen_header())
os.chdir('..') # Go back in parent directory
# Add to 'Distribution.dist_files' so that the "upload" command works
getattr( self.distribution, 'dist_files', [] ).append(
diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_configure.py
--- pysvn-1.7.10.orig/Source/setup_configure.py 2014-11-09 11:55:47.000000000 +0100
+++ pysvn-1.7.10/Source/setup_configure.py 2015-08-17 10:41:05.781767086 +0200
@@ -54,6 +54,8 @@
class Options:
dest_dir = os.path.join( os.path.abspath( self.build_lib ), 'pysvn' )
# Generate metadata first
@@ -91,9 +105,13 @@ class BuildExtensions(build_ext):
# Invoke the build system. This will generate the __init__.py and
# .so that we'll package.
os.chdir( 'Source' )
- os.system( sys.executable + ' setup.py configure' )
- os.system( 'make clean' )
- os.system( 'make' )
+ subprocess.check_call(sys.executable + ' setup.py configure --include-dirs=%(include-dirs)s --library-dirs=%(library-dirs)s' % kw, shell=True)
+ subprocess.check_call('make clean', shell=True)
+ subprocess.check_call('make', shell=True)
+ subprocess.check_call('rm -rf dist; mkdir -p dist/EGG-INFO', shell=True)
+ subprocess.check_call('cp -rvf pysvn dist', shell=True)
+ subprocess.check_call('cp -rvf ../pysvn.egg-info/* dist/EGG-INFO', shell=True)
+ subprocess.check_call('find dist/pysvn -type f | sed s:dist/:: > dist/EGG-INFO/SOURCES.txt', shell=True)
# Copy the built files to the destination pysvn/ directory.
self.mkpath( dest_dir )
diff --git a/Source/setup_configure.py b/Source/setup_configure.py
index 2bf8ca1..7037f8f 100644
--- a/Source/setup_configure.py
+++ b/Source/setup_configure.py
@@ -55,6 +55,8 @@ class Options:
all_options_info = {
'--arch': (2, '<arch>'),
'--distro-dir': (2, '<dir>'),
+ '--library-dirs': (1, '<dir>:<dir>:...'),
+ '--include-dirs': (1, '<dir>:<dir>:...'),
'--apr-inc-dir': (1, '<dir>'),
'--apu-inc-dir': (1, '<dir>'),
'--apr-lib-dir': (1, '<dir>'),
@@ -511,12 +513,16 @@
@@ -542,12 +544,16 @@ class Compiler:
raise last_exception
def find_svn_bin( self ):
......@@ -70,28 +80,28 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
+ return ''
def find_svn_lib( self ):
folder = self.find_dir(
@@ -589,8 +595,8 @@
last_exception = None
@@ -633,8 +639,8 @@ class Compiler:
# override the base_dir_list from the command line kw
svn_root_dir = None
- if self.options.hasOption( kw ):
- base_dir_list = [self.options.getOption( kw )]
+ if kw and self.options.hasOption( kw ):
+ base_dir_list = self.options.getOption( kw ) + base_dir_list
+ base_dir_list = [self.options.getOption( kw )] + base_dir_list
debug( '__find_dir base_dir_list=%r' % (base_dir_list,) )
elif( self.options.hasOption( '--svn-root-dir' )
and svn_root_suffix is not None ):
@@ -604,7 +610,7 @@
@@ -644,7 +650,7 @@ class Compiler:
if self.verbose:
print( 'Info: Checking for %s in %s' % (name, full_check_file) )
if os.path.exists( full_check_file ):
- return os.path.abspath( dirname )
+ return dirname
raise SetupError( 'cannot find %s %s - use %s' % (name, check_file, kw) )
raise SetupError( 'Cannot find %s %s - use %s' % (name, check_file, kw) )
@@ -629,6 +635,17 @@
@@ -669,6 +675,17 @@ class Compiler:
def getSvnVersion( self ):
return self.__svn_version_tuple
......@@ -109,33 +119,42 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
class Win32CompilerMSVC90(Compiler):
def __init__( self, setup ):
@@ -1093,7 +1110,7 @@
'%(PYCXX)s/Src',
'/usr/share/python%s/CXX' % distutils.sysconfig.get_python_version() # typical Linux
@@ -1185,6 +1202,7 @@ class UnixCompilerGCC(CompilerGCC):
CompilerGCC.__init__( self, setup )
self._find_paths_pycxx_dir = [
+ '../Import/pycxx-7.1.5',
distutils.sysconfig.get_python_inc(), # typical Linux
'/usr/include'
]
@@ -1194,7 +1212,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/src/CXX'
]
- self._find_paths_svn_inc = [
+ self._find_paths_svn_inc = self._include_dirs() + [
'/usr/include/subversion-1', # typical Linux
'/usr/local/include/subversion-1', # typical *BSD
'/usr/pkg/include/subversion-1', # netbsd
@@ -1103,14 +1120,14 @@
'/usr/local/bin', # typical *BSD
'/usr/pkg/bin', # netbsd
@@ -1204,7 +1222,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/local/bin', # typical *BSD
'/usr/pkg/bin', # netbsd
]
- self._find_paths_svn_lib = [
+ self._find_paths_svn_lib = self._library_dirs() + [
'/usr/lib64', # typical 64bit Linux
'/usr/lib', # typical Linux
'/usr/local/lib64', # typical 64bit Linux
'/usr/local/lib', # typical *BSD
@@ -1212,7 +1230,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/pkg/lib', # netbsd
'/usr/lib/x86_64-linux-gnu', # debian/unbuntu
]
- self._find_paths_apr_inc = [
+ self._find_paths_apr_inc = self._include_dirs() + [
'/usr/include/apr-1', # typical Linux
'/usr/include/apr-1.0', # typical Linux
'/usr/local/apr/include/apr-1', # Mac OS X www.metissian.com
'/usr/pkg/include/apr-1', # netbsd
@@ -1120,7 +1137,7 @@
@@ -1223,7 +1241,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/local/include/apache2', # alternate *BSD
]
self._find_paths_apr_util_inc = self._find_paths_apr_inc
......@@ -144,7 +163,7 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
'/usr/lib64', # typical 64bit Linux
'/usr/lib', # typical Linux
'/usr/local/lib64', # typical 64bit Linux
@@ -1186,6 +1203,8 @@
@@ -1310,6 +1328,8 @@ class LinuxCompilerGCC(UnixCompilerGCC):
if not self.setup.options.hasOption( '--norpath' ):
py_ld_libs.extend( [
'-Wl,--rpath',
......
http://pysvn.tigris.org/ds/viewMessage.do?dsForumId=1334&dsMessageId=3094617
diff -ur pysvn-1.7.10.orig/Source/pysvn_svnenv.cpp pysvn-1.7.10/Source/pysvn_svnenv.cpp
--- pysvn-1.7.10.orig/Source/pysvn_svnenv.cpp 2010-11-20 13:02:37.000000000 +0100
+++ pysvn-1.7.10/Source/pysvn_svnenv.cpp 2015-08-17 17:39:50.491209720 +0200
@@ -292,8 +292,8 @@
if( accept_permanently )
{
new_cred->may_save = 1;
- new_cred->accepted_failures = accepted_failures;
}
+ new_cred->accepted_failures = accepted_failures;
*cred = new_cred;
......@@ -33,17 +33,14 @@ package_version = 2.7.18
package_version_suffix =
md5sum = fd6cc8ec0a78c44036f825e739f36e5a
# This is actually the default setting for prefix, but we can't use it in
# other settings in this part if we don't set it explicitly here.
prefix = @@LOCATION@@
version = 2.7
executable = ${:prefix}/bin/python${:version}
executable = @@LOCATION@@/bin/python${:version}
patch-options = -p1
patches =
${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7
${:_profile_base_location_}/pytracemalloc_pep445.patch#9f3145817afa2b7fad801fde8447e396
${:_profile_base_location_}/disabled_module_list.patch#71ad30d32bcdbc50c19cf48675b1246e
${:_profile_base_location_}/disabled_module_list.patch#e038a8016475574c810cbaaf0e42f4ac
${:_profile_base_location_}/asyncore_poll_insteadof_select.patch#ab6991c0ee6e25aeb8951e71f280a2f1
url =
http://www.python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz
......@@ -61,11 +58,11 @@ make-targets = make profile-opt && make install
# recent RedHat would otherwise mangle them, either failing ('python' is
# ambiguous and 'python2' is not supported anymore) or replacing with
# something that's really wrong (/usr/bin/python...).
post-install = cd '${:prefix}' &&
post-install = cd '%(prefix)s' &&
find -executable -type f -print0 |
xargs -0 grep -I -m 1 '' |
sed -n 's,:#! */usr/bin/env \+python2\?$,,p' |
xargs -d '\n' sed -i '1s,.*,#!${:executable},'
xargs -d '\n' sed -i '1s,.*,#!%(executable)s,'
# the entry "-Wl,-rpath=${file:location}/lib" below is needed by python-magic,
# which would otherwise load the system libmagic.so with ctypes
......
......@@ -5,7 +5,7 @@
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ['_bsddb', '_tkinter', 'bsddb185']
+disabled_module_list = ['_bsddb', '_tkinter', 'bsddb185', 'nis']
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
......@@ -42,6 +42,7 @@ configure-options =
--with-openssl=${openssl:location}
# Profiled build:
--enable-optimizations
pre-build = printf '*disabled*\nnis\n' >> Modules/Setup.local
pre-install = mkdir profile-opt
# the entry "-Wl,-rpath=${file:location}/lib" below is needed by python-magic,
......
......@@ -63,9 +63,10 @@ environment +=
[debian-netinst-base]
recipe = slapos.recipe.build:download
filename = ${:_buildout_section_name_}
url = https://cdimage.debian.org/cdimage/${:release}/${:arch}/iso-cd/debian-${:version}-${:arch}-netinst.iso
release = archive/${:version}
shared = true
filename = debian-${:version}-${:arch}-netinst.iso
url = https://cdimage.debian.org/cdimage/archive/${:archive}/${:arch}/iso-cd/${:filename}
archive = ${:version}
[debian-amd64-netinst-base]
<= debian-netinst-base
......@@ -86,16 +87,23 @@ md5sum = df0ce86d0b1d81e232ad08eef58754ed
version = 9.13.0
md5sum = 6097fdb9cbab47c96471274b9044e983
[debian-amd64-netinst.iso]
# Download the installer of Debian 10 (Buster)
# XXX: This is not the latest version because
# Debian does not provide a stable URL for it.
[debian-amd64-buster-netinst.iso]
<= debian-amd64-netinst-base
version = 10.11.0
md5sum = 9d7b9cc850464d60ac174787c53e8f3f
[debian-amd64-bullseye-netinst.iso]
<= debian-amd64-netinst-base
version = 10.10.0
md5sum = c7d0e562e589e853b5d00563b4311720
version = 11.1.0
md5sum = b710c178eb434d79ce40ce703d30a5f0
alternate-url = https://cdimage.debian.org/cdimage/release/current/${:arch}/iso-cd/${:filename}
[debian-amd64-netinst.iso]
<= debian-amd64-bullseye-netinst.iso
[debian-amd64-testing-netinst.iso]
<= debian-amd64-netinst-base
release = bullseye_di_rc3
alternate-url = https://cdimage.debian.org/cdimage/${archive}/${:arch}/iso-cd/${:filename}
archive = bullseye_di_rc3
version = bullseye-DI-rc3
md5sum = 405917de7062c58357a3673c9901f0c4
......@@ -5,5 +5,6 @@ parts =
[rpm2cpio]
# https://github.com/ruda/rpm2cpio
recipe = slapos.recipe.build:download
shared = true
url = ${:_profile_base_location_}/${:_buildout_section_name_}
md5sum = aa3a5920a1d8963592be0c2666ee05e2
......@@ -10,12 +10,22 @@ extends =
[serf]
recipe = slapos.recipe.cmmi
shared = true
url = https://archive.apache.org/dist/serf/serf-1.2.1.tar.bz2
md5sum = 4f8e76c9c6567aee1d66aba49f76a58b
configure-options =
--with-apr=${apr:location}
--with-apr-util=${apr-util:location}
--with-openssl=${openssl-1.0:location}
environment =
CFLAGS=-I${zlib:location}/include -I${libuuid:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
url = https://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2
md5sum = 370a6340ff20366ab088012cd13f2b57
scons-command =
python ${scons:location}/scons.py \
APR="${apr:location}" \
APU="${apr-util:location}" \
OPENSSL="${openssl:location}" \
PREFIX=@@LOCATION@@ \
CFLAGS="-I${zlib:location}/include -I${libuuid:location}/include" \
LINKFLAGS="-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib"
configure-command = :
make-binary = ${:scons-command}
[scons]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
md5sum = d262e6c6da620488d2226fabc8aabf09
strip-top-level-dir = false
......@@ -76,8 +76,6 @@ post-install =
[dbus-glib]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
environment +=
CPPFLAGS=-I${libexpat:location}/include -I${dbus:location}/include/dbus-1.0 -I${dbus:location}/lib/dbus-1.0/include
LDFLAGS=-L${libexpat:location}/lib -L${gettext:location}/lib -Wl,-rpath=${zlib:location}/lib -L${dbus:location}/lib -Wl,-rpath=${dbus:location}/lib
LD_LIBRARY_PATH=${dbus:location}/lib
DBUS_CFLAGS=-I${dbus:location}/include/dbus-1.0 -I${dbus:location}/lib/dbus-1.0/include
......@@ -86,9 +84,7 @@ environment +=
pre-configure =
sed -i 's#/opt/slapos/parts/dbus/lib/libdbus-1.la#${dbus:location}/lib/libdbus-1.la#' ${dbus-glib:location}/lib/libdbus-glib-1.la
environment +=
PATH=${pkgconfig:location}/bin:${python:location}/bin:%(PATH)s
LD_LIBRARY_PATH=${dbus:location}/lib
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${dbus:location}/lib -Wl,-rpath=${dbus:location}/lib
PYTHON=${python:location}/bin/python${python:version}
PYTHON_INCLUDES=-I${python:location}/include/python${python:version}
PYTHON_LIBS=-L${python:location}/lib -lpython${python:version} -lpthread -ldl -lutil -lm
......@@ -114,34 +110,21 @@ make-options =
[gobject-introspection]
pre-configure =
ln -s ${python:location}/bin/python${python:version} ${python:location}/bin/python2.
sed -i 's#!/opt/slapos/parts/python2.7/bin/python2.7#!${python2.7:location}/bin/python2.7#' ${python2.7:location}/bin/python-config
libtoolize -c -f
aclocal -I${pkgconfig:location}/share/aclocal -I${gettext:location}/share/aclocal -I${libtool:location}/share/aclocal -I${glib:location}/share/aclocal
./autogen.sh
sed -i 's#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#!${python:location}/bin/python${python:version}#' ${python:location}/bin/python${python:version}-config
configure-options +=
--enable-shared
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-go:location}/bin:%(PATH)s
GIR_DIR=${buildout:parts-directory}/${:_buildout_section_name_}/share/gir-1.0
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include -I${python:location}/include/python${python:version}
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi -L${python:location}/lib
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${gettext:location}/share/aclocal:${libtool:location}/share/aclocal:${glib:location}/share/aclocal:${intltool:location}/share/aclocal
M4=${m4:location}/bin/m4
PERL5LIB=${perl:location}/lib/5.28.1/
post-install =
sed -i 's#!${python:location}/bin/python${python:version}#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#' ${python:location}/bin/python-config
sed -i 's#!${python:location}/bin/python${python:version}#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#' ${python:location}/bin/python${python:version}-config
rm -rf ${bison-go:location}
[pygobject3]
pre-configure +=
sed -i 's#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#!${python:location}/bin/python${python:version}#' ${python:location}/bin/python-config
environment +=
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include -I${gettext:location}/include -I${libffi:location}/include -I${python:location}/include/python${python:version}
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${python:location}/lib
sed -i 's#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#!${python:location}/bin/python${python:version}#' ${python:location}/bin/python${python:version}-config
post-install =
sed -i 's#!${python:location}/bin/python${python:version}#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#' ${python:location}/bin/python-config
sed -i 's#!${python:location}/bin/python${python:version}#!/opt/slapos/parts/python${python:version}/bin/python${python:version}#' ${python:location}/bin/python${python:version}-config
[ncurses]
configure-options =
......@@ -189,3 +172,9 @@ configure-options +=
--prefix=${buildout:rootdir}/parts/${:_buildout_section_name_}
environment +=
DESTDIR=${buildout:destdir}
[swig]
configure-options +=
--prefix=${buildout:rootdir}/parts/${:_buildout_section_name_}
environment +=
DESTDIR=${buildout:destdir}
......@@ -15,26 +15,25 @@ extends =
../sqlite3/buildout.cfg
../zlib/buildout.cfg
../swig/buildout.cfg
../lz4/buildout.cfg
parts =
subversion
[subversion]
recipe = slapos.recipe.cmmi
shared = true
url = http://apache.mirrors.tds.net/subversion/subversion-1.8.14.tar.bz2
md5sum = fe476ba26d6835eba4393780ea907361
# Patch available thanks to gentoo developpers
# https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-vcs/subversion/files/subversion-fix-parallel-build-support-for-perl-bindings.patch
patches =
${:_profile_base_location_}/subversion-fix-parallel-build-support-for-perl-bindings.patch#fd69f4c932b4882ed98c59eb102be64a
url = https://downloads.apache.org/subversion/subversion-1.14.1.tar.bz2
md5sum = 2eccc2c7451397e01a13682600af9563
configure-options =
--disable-static
--with-apr=${apr:location}
--with-apr-util=${apr-util:location}
--with-serf=yes
--without-apxs
--with-utf8proc=internal
--with-zlib=${zlib:location}
--with-sqlite=${sqlite3:location}
--with-lz4=${lz4:location}
--without-berkeley-db
--without-sasl
--without-apr_memcache
......@@ -53,9 +52,9 @@ configure-options =
make-targets = install -j1
environment =
PATH=${patch:location}/bin:${perl:location}/bin:${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl-1.0:location}/lib/pkgconfig:${serf:location}/lib/pkgconfig
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${serf:location}/lib/pkgconfig
CPPFLAGS=-I${libexpat:location}/include -I${libuuid:location}/include
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${openssl-1.0:location}/lib
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${serf:location}/lib -Wl,-rpath=${lz4:location}/lib
[subversion-1.9]
recipe = hexagonit.recipe.cmmi
......
--- Makefile.in 2011-07-16 13:50:53.000000000 +0200
+++ Makefile.in.new 2012-03-11 12:13:57.000000000 +0100
@@ -732,7 +732,7 @@
extraclean-swig-headers: clean-swig-headers
$(EXTRACLEAN_SWIG_HEADERS)
-$(SWIG_PL_DIR)/native/Makefile.PL: $(SWIG_SRC_DIR)/perl/native/Makefile.PL.in
+$(SWIG_PL_DIR)/native/Makefile.PL: $(SWIG_SRC_DIR)/perl/native/Makefile.PL.in libsvn_swig_perl
./config.status subversion/bindings/swig/perl/native/Makefile.PL
$(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
......@@ -11,7 +11,7 @@ parts =
[tomcat7]
recipe = slapos.recipe.build:download-unpacked
ignore-existing = true
shared = true
strip-top-level-dir = true
url = https://archive.apache.org/dist/tomcat/tomcat-7/v${:version}/bin/apache-tomcat-${:version}.tar.gz
version = 7.0.100
......@@ -19,7 +19,7 @@ md5sum = 79be4ba5a6e770730a4be3d5cb3c7862
[tomcat9]
recipe = slapos.recipe.build:download-unpacked
ignore-existing = true
shared = true
strip-top-level-dir = true
url = https://archive.apache.org/dist/tomcat/tomcat-9/v${:version}/bin/apache-tomcat-${:version}.tar.gz
version = 9.0.12
......
......@@ -23,7 +23,7 @@ wait-ssh = 100
[vm-debian]
recipe = slapos.recipe.build:vm.install-debian
environment = vm-install-environment
dists = debian-stable
dists = debian-buster
size = 2Gi
preseed.partman/early_command =
set -e /usr/lib/apt-setup/generators/99 AllowUnauthenticated; if [ "`debconf-get mirror/http/hostname`" = archive.debian.org ]; then echo "echo 'APT::Get::$2 \"true\";' >/target/etc/apt/apt.conf.d/01$2" >$1$2; chmod +x $1$2; fi
......@@ -75,6 +75,8 @@ x86_64.iso = debian-amd64-stretch-netinst.iso
[debian-buster]
<= debian-stable
x86_64.iso = debian-amd64-buster-netinst.iso
[debian-bullseye]
<= debian-testing
<= debian-stable
x86_64.iso = debian-amd64-bullseye-netinst.iso
......@@ -35,6 +35,7 @@ bin-yarn = ${:rendered}
[yarn-download]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/yarnpkg/yarn/releases/download/v${:version}/yarn-v${:version}.tar.gz
[yarn-download-1.22.10]
......
......@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import glob
import os
version = '1.0.197'
version = '1.0.213'
name = 'slapos.cookbook'
long_description = open("README.rst").read()
......@@ -110,7 +110,6 @@ setup(name=name,
'generic.kumofs = slapos.recipe.generic_kumofs:Recipe',
'generic.memcached = slapos.recipe.generic_memcached:Recipe',
'generic.mysql.wrap_update_mysql = slapos.recipe.generic_mysql:WrapUpdateMySQL',
'generic.varnish = slapos.recipe.generic_varnish:Recipe',
'gitinit = slapos.recipe.gitinit:Recipe',
'haproxy = slapos.recipe.haproxy:Recipe',
'ipv4toipv6 = slapos.recipe.6tunnel:FourToSix',
......@@ -162,12 +161,10 @@ setup(name=name,
'slapconfiguration.serialised = slapos.recipe.slapconfiguration:Serialised',
'slapconfiguration.jsondump = slapos.recipe.slapconfiguration:JsonDump',
'slapcontainer = slapos.recipe.container:Recipe',
'softwaretype = slapos.recipe.softwaretype:Recipe', # BBB
'sphinx= slapos.recipe.sphinx:Recipe',
'squid = slapos.recipe.squid:Recipe',
'sshkeys_authority = slapos.recipe.sshkeys_authority:Recipe',
'sshkeys_authority.request = slapos.recipe.sshkeys_authority:Request',
'stunnel = slapos.recipe.stunnel:Recipe',
'switch-softwaretype = slapos.recipe.switch_softwaretype:Recipe',
'symbolic.link = slapos.recipe.symbolic_link:Recipe',
'tidstorage = slapos.recipe.tidstorage:Recipe',
......
generic_varnish
===============
This recipe creates a varnish instance dedicated for ERP5 with a web checker[1]
set up.
How to Use generic_varnish ?
============================
On slap console, you can instantiate varnish like this::
instance = request(
software_type='varnish',
partition_parameter_kw={
'backend-url':'https://[your_backend_address]:your_backend_port',
'web-checker-frontend-url':'http://www.example.com',
'web-checker-mail-address':'web-checker-result@example.com',
'web-checker-smtp-host':'mail.example.com',
}
)
backend-url is the backend url that varnish will cache.
web-checker-frontend-url is the entry-point-url that web checker will check
the HTTP headers of all the pages in the web site.
web-checker-mail-address is the email address where web checker will send
the HTTP Cache cheking result.
web-checker-smtp-host is the smtp server to be used to send the web checker
result.
[Note]
When web-checker-* parameters are not given, web_checker will be disabled.
References
==========
[1] web_checker (it is a part of erp5.util)
http://pypi.python.org/pypi/erp5.util
web_checker: Web site HTTP Cache header checking tool
##############################################################################
#
# Copyright (c) 2012 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
import re
from slapos.recipe.librecipe import GenericSlapRecipe
class Recipe(GenericSlapRecipe):
"""
Instantiate varnish daemon
TODO:
- use varnish3.x and replace .vcl for it
"""
def _install(self):
ip = self.options['ip']
backend_url = self.options.get('backend-url',
# BBB: Peeking in partition parameters directly. Eew.
self.parameter_dict.get('backend-url',
self.parameter_dict.get('tidstorage-url') # BBB
)
)
backend_server, backend_port = self._getBackendServer(backend_url)
path_list = []
if backend_url.startswith('https://'):
config = dict(
stunnel_binary=self.options['stunnel-binary'],
stunnel_server=ip,
stunnel_port=int(self.options['stunnel-port']),
stunnel_pid_file=self.options['stunnel-pid-file'],
stunnel_conf_file=self.options['stunnel-conf-file'],
shell_path=self.options['shell-path'],
backend_server=backend_server.replace('[', '').replace(']', ''),
backend_port=backend_port,
)
path_list.append(self.createExecutable(self.options['stunnel-wrapper'],
self.substituteTemplate(self.getTemplateFilename('stunnel.in'),
config)))
path_list.append(self.createFile(self.options['stunnel-conf-file'],
self.substituteTemplate(self.getTemplateFilename('stunnel.conf.in'),
config)))
backend_server = ip
backend_port = int(self.options['stunnel-port'])
varnishd_manager_port = int(self.options['manager-port'])
varnishd_server_port = int(self.options['server-port'])
config = dict(
varnishd_binary=self.options['varnishd-binary'],
varnish_ip=ip,
varnishlog_binary=self.options['varnishlog-binary'],
varnishd_manager_port=varnishd_manager_port,
varnishd_server_port=varnishd_server_port,
varnishd_pid_file=self.options['pid-file'],
varnish_instance_name=self.options['varnish-instance-name'],
varnish_data=self.options['varnish-data'],
gcc_location=self.options['gcc-location'],
shell_path=self.options['shell-path'],
vcl_file=self.options['vcl-file'],
backend_port=backend_port,
backend_server=backend_server,
)
path_list.append(self.createExecutable(self.options['varnishd-wrapper'],
self.substituteTemplate(self.getTemplateFilename('varnishd.in'),
config)))
path_list.append(self.createExecutable(self.options['varnishlog-wrapper'],
self.substituteTemplate(self.getTemplateFilename('varnishlog.in'),
config)))
path_list.append(self.createFile(self.options['vcl-file'],
self.substituteTemplate(self.getTemplateFilename('default.vcl.in'),
config)))
return path_list
def _getBackendServer(self, url):
r = re.compile('\/\/(\[.+\]|[\d.]+):(\d*)')
result = r.search(url)
ip = result.groups()[0]
port = result.groups()[1]
return (ip, port)
#This is a basic VCL configuration file for varnish. See the vcl(7)
#man page for details on VCL syntax and semantics.
#
#Default backend definition. Set this to point to your content
#server.
#
backend default {
.host = "%(backend_server)s";
.port = "%(backend_port)s";
.probe = {
.timeout = 30s;
.interval = 5s;
.window = 4;
.threshold = 3;
.request =
"OPTIONS /erp5/getId HTTP/1.1"
"Host: %(backend_server)s:%(backend_port)s"
"Accept-Encoding: identity"
"Connection: close"
"User-Agent: Varnish";
}
}
# Called at the beginning of a request, after the complete request has been received and parsed
sub vcl_recv {
# Pass any requests that Varnish does not understand straight to the backend.
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "PURGE" &&
req.request != "DELETE") {
/* Non-RFC2616 or CONNECT which is weird. */
return (pipe);
}
# Pass anything other than GET and HEAD directly.
if (req.request != "GET" && req.request != "HEAD") {
return (pass);
}
if (req.http.Authorization) {
/* Not cacheable by default */
return (pass);
}
# No need to have cookies for static resources
if (req.url ~ "\.(css|gif|ico|jpg|js|png)$") {
unset req.http.Cookie;
}
# Remove bogus cookies
if (req.http.Cookie) {
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__utm.=[^;]+;? *", "\1");
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__ac_name=\x22\x22;? *", "\1");
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__ac=\x22Og.3D.3D\x22;? *", "\1");
}
if (req.http.Cookie == "") {
unset req.http.Cookie;
}
if (req.http.Cookie && req.http.Cookie ~ "(^|; ) *__ac=") {
return (pass);
}
# We do not care about Accept-Encoding, because we don't use varnish as the front most HTTP server.
unset req.http.Accept-Encoding;
if (req.backend.healthy) {
set req.grace = 1h;
} else {
set req.grace = 1w;
}
return (lookup);
}
# Run after a pass in vcl_recv OR after a lookup that returned a hitpass
sub vcl_pass {
# unset If-Modified-Since to avoid reusing anonymous's browser cache
# after login.
unset req.http.If-Modified-Since;
return (pass);
}
# Creates the varnish cache key by the url
sub vcl_hash {
# We use url only for hash.
hash_data(req.url);
return (hash);
}
# Called after a cache lookup if the requested document was found in the cache
sub vcl_hit {
return (deliver);
}
# Called after a cache lookup if the requested document was not found in the cache
sub vcl_miss {
return (fetch);
}
# Called after a document has been successfully retrieved from the backend
sub vcl_fetch {
# Unset Expires that is always overridden by Cache-Control.
unset beresp.http.Expires;
# Unset Pragma that is obsolete.
unset beresp.http.Pragma;
# We only cache 200 (OK) and 304 (Not Modified) responses.
if (beresp.status != 200 && beresp.status != 304) {
set beresp.ttl = 0s;
}
# If max-age is 0 or not set, we want no browser cache.
if (beresp.ttl <= 0s) {
set beresp.http.Cache-Control = "no-store";
# Mark as hit_for_pass for the next 2 minutes.
set beresp.ttl = 120s;
return (hit_for_pass);
}
# We don't care haproxy's cookie.
if (beresp.http.Set-Cookie && beresp.http.Set-Cookie !~ "^SERVERID=[^;]+; path=/$") {
return (hit_for_pass);
} else {
unset beresp.http.Set-Cookie;
}
# We set long enough grace for cachable objects.
set beresp.grace = 1w;
return (deliver);
}
# Called before a cached object is delivered to the client
sub vcl_deliver {
if (obj.hits > 0) {
set resp.http.X-Cache = obj.hits;
} else {
set resp.http.X-Cache = "MISS";
}
return (deliver);
}
foreground = yes
pid = %(stunnel_pid_file)s
debug = 4
[remote]
accept = %(stunnel_server)s:%(stunnel_port)s
client = yes
connect = %(backend_server)s:%(backend_port)s
sni = %(stunnel_server)s
#!%(shell_path)s
DAEMON_OPTS="%(stunnel_conf_file)s"
exec %(stunnel_binary)s ${DAEMON_OPTS} 2>&1
#!%(shell_path)s
DAEMON_OPTS="-F \
-a %(varnish_ip)s:%(varnishd_server_port)s \
-T %(varnish_ip)s:%(varnishd_manager_port)s \
-t 0 \
-p nuke_limit=500 \
-n %(varnish_instance_name)s \
-f %(vcl_file)s \
-s file,%(varnish_data)s/varnish_storage.bin,1G"
PIDFILE=%(varnishd_pid_file)s
# exporting PATH here so that we will pass the PATH variable to the subprocess
export PATH="%(gcc_location)s:$PATH"
exec %(varnishd_binary)s -P ${PIDFILE} ${DAEMON_OPTS} 2>&1
#!%(shell_path)s
DAEMON_OPTS="-a -n %(varnish_instance_name)s"
exec %(varnishlog_binary)s ${DAEMON_OPTS} "$@"
#!%(shell_path)s
DAEMON_OPTS="-F \
-a %(varnish_ip)s:%(varnishd_server_port)s \
-T %(varnish_ip)s:%(varnishd_manager_port)s \
-n %(varnish_instance_name)s \
-f %(vcl_file)s \
-s file,%(varnish_data)s/varnish_storage.bin,1G"
PIDFILE=%(varnishd_pid_file)s
# exporting PATH here so that it will pass the PATH variable to the subprocess
export PATH
# If unset, or set to "0" or "no", exit
if [ -z "${VARNISHLOG_ENABLED}" ] || \
[ "${VARNISHLOG_ENABLED}" = "0" ] || \
[ "${VARNISHLOG_ENABLED}" = "no" ]; then
exit 0;
fi
exec %(varnishlog_binary)s ${DAEMON_OPTS} 2>&1
......@@ -24,15 +24,17 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import ast
import re
import logging, os
import zc.buildout.easy_install
from pprint import pformat
from slapos.recipe.librecipe import GenericBaseRecipe
from zc.buildout import UserError
script_template = '''# This script is auto generated by slapgrid, do not edit!
import sys
sys.path[0:0] = %(path)s
sys.path[0:0] = %(paths)s
extra_config_dict = %(config)s
......@@ -54,6 +56,24 @@ for module in list(sys.modules):
%(content)s
'''
execfile_template = """\
def _(path):
global _
del _
with open(path) as f:
return compile(f.read(), path, 'exec')
exec(_(%r))"""
def isPythonName(name):
try:
x, = ast.parse(name).body
if type(x) is ast.Expr:
x = x.value
return type(x) is ast.Name and x.id == name
except Exception:
pass
class Recipe(GenericBaseRecipe):
_WORKING_SET_CACHE_NAME = "slapos.cookbook_pplugin_ws_cache"
......@@ -64,6 +84,35 @@ class Recipe(GenericBaseRecipe):
options['develop-eggs-directory'] = buildout_section['develop-eggs-directory']
super(Recipe, self).__init__(buildout, name, options)
filepath = options.get('file')
module = options.get('module')
klass = options.get('class')
if klass == 'RunPromise':
klass = None
elif klass and not isPythonName(klass):
raise UserError("%r is not a valid class name" % klass)
if bool(module) == bool(filepath):
raise UserError("Either 'module' or 'file' is required but not both")
if module:
if not all(map(isPythonName, module.split('.'))):
raise UserError("%r is not a valid module name" % module)
if klass:
content = 'from %s import %s as RunPromise' % (module, klass)
else:
content = 'from %s import RunPromise' % module
else:
content = execfile_template % filepath
if klass:
content += '\n\nRunPromise = ' + klass
self.content = content
self.config_dict = {key[7:]: options[key]
for key in options
if key.startswith('config-')}
def _get_cache_storage(self):
"""Return a mapping where to store generated working sets.
from https://github.com/buildout/buildout/blob/master/zc.recipe.egg_/src/zc/recipe/egg/egg.py#L170
......@@ -111,26 +160,10 @@ class Recipe(GenericBaseRecipe):
else:
working_set = set()
regex = r"^[\w_\-\.\s]+$"
import_path = self.options.get('import', '').strip()
if import_path:
if not re.search(regex, import_path):
raise ValueError("Import path %r is not a valid" % import_path)
content_string = "from %s import RunPromise" % import_path
else:
# old parameter for compatibility
content_string = self.options['content'].strip()
if not re.search(regex, content_string):
raise ValueError("Promise content %r is not valid" % content_string)
config_dict = {key[7:]: self.options[key]
for key in self.options
if key.startswith('config-')}
return self.createFile(self.options['output'], script_template % {
'path': pformat([dist.location for dist in working_set], indent=2),
'content': content_string,
'config': pformat(config_dict, indent=2),
'paths': pformat(tuple(dist.location for dist in working_set), indent=2),
'config': pformat(self.config_dict, indent=2),
'content': self.content,
}, int(self.options.get('mode', '0644'), 8)),
update = install
......@@ -43,13 +43,14 @@ class Recipe(object):
def __init__(self, buildout, name, options):
storage_path = options['storage-path']
when_absent = options.get('when-absent', None)
try:
with open(storage_path) as f:
readline = f.readline()
except IOError, e:
except IOError as e:
if e.errno != errno.ENOENT:
raise
readline = None
readline = when_absent
self.readline = readline
options['readline'] = readline
......
This diff is collapsed.
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
import signal
import errno
from slapos.recipe.librecipe import GenericBaseRecipe
def kill(pid_file, sig=signal.SIGUSR1):
if os.path.exists(pid_file):
with open(pid_file) as f:
pid = int(f.read().strip())
try:
os.kill(pid, sig)
except OSError as e:
if e.errno != errno.ESRCH: # No such process
raise e
os.unlink(pid_file)
class Recipe(GenericBaseRecipe):
def install(self):
path_list = []
self.isClient = self.optionIsTrue('client', default=False)
if self.isClient:
self.logger.info("Client mode")
else:
self.logger.info("Server mode")
conf = {}
for type_ in ['remote', 'local']:
for data in ['host', 'port']:
confkey, opt = ['%s%s%s' % (type_, i, data) for i in ['_', '-']]
conf[confkey] = self.options[opt]
pid_file = self.options['pid-file']
conf.update(pid_file=pid_file)
log_file = self.options['log-file']
conf.update(log=log_file)
if self.isClient:
template = self.getTemplateFilename('client.conf.in')
else:
template = self.getTemplateFilename('server.conf.in')
key = self.options['key-file']
cert = self.options['cert-file']
conf.update(key=key, cert=cert)
conf_file = self.createFile(
self.options['config-file'],
self.substituteTemplate(template, conf))
path_list.append(conf_file)
wrapper = self.createWrapper(
self.options['wrapper'],
(self.options['stunnel-binary'], conf_file),
)
path_list.append(wrapper)
# Reload configuration
kill(pid_file, signal.SIGHUP)
if 'post-rotate-script' in self.options:
path_list.append(self.createPythonScript(
self.options['post-rotate-script'],
__name__ + '.kill', (pid_file,)))
return path_list
foreground = yes
output = %(log)s
pid = %(pid_file)s
syslog = no
[service]
client = yes
accept = %(local_host)s:%(local_port)s
connect = %(remote_host)s:%(remote_port)s
foreground = yes
output = %(log)s
pid = %(pid_file)s
syslog = no
key = %(key)s
cert = %(cert)s
[service]
accept = %(remote_host)s:%(remote_port)s
connect = %(local_host)s:%(local_port)s
import os, shutil, tempfile, unittest
from slapos.recipe import promise_plugin
from slapos.test.utils import makeRecipe
from zc.buildout import UserError
from pprint import pformat
import stat, json
import six
......@@ -10,7 +11,7 @@ class TestPromisePlugin(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.mkdtemp()
self.output = os.path.join(self.tmp, 'output.py')
self.options = options = {
self.options = {
'output': self.output,
'eggs': 'slapos.cookbook'
}
......@@ -18,9 +19,16 @@ class TestPromisePlugin(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmp)
def test_parameters(self):
self.options['mode'] = '0644'
self.options['import'] = 'slapos.promise.plugin.check_site_available'
def makeRecipe(self):
return makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
def installRecipe(self):
self.makeRecipe().install()
def setConfig(self):
self.options['config-param1'] = "YY^@12"
self.options['config-param2'] = "23'91'"
self.options['config-param3'] = None
......@@ -28,88 +36,102 @@ class TestPromisePlugin(unittest.TestCase):
in multi line
123444
"""
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
recipe.install()
def assertOutput(self, *expect):
self.assertTrue(os.path.exists(self.output))
with open(self.output, 'r') as f:
content = f.read()
self.assertIn("from slapos.promise.plugin.check_site_available import RunPromise", content)
self.assertEqual(stat.S_IMODE(os.stat(self.output).st_mode), int('644', 8))
expected_dict = dict(
param1=self.options['config-param1'],
param2=self.options['config-param2'],
param3=self.options['config-param3'],
param4=self.options['config-param4'],
)
self.assertIn('extra_config_dict = %s' % pformat(expected_dict, indent=2), content)
def test_no_module_set(self):
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
with self.assertRaises(KeyError):
recipe.install()
def test_default(self):
self.options['import'] = 'slapos.promise.plugin.check_site_available'
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
recipe.install()
self.assertTrue(os.path.exists(self.output))
for s in expect:
self.assertIn(s, content)
def assertConfig(self):
items = self.options.items()
expect = {k[7:] : v for k, v in items if k.startswith('config-')}
self.assertOutput("extra_config_dict = %s" % pformat(expect, indent=2))
def assertEmptyConfig(self):
self.assertOutput("extra_config_dict = %s" % ('{}' if six.PY3 else '{ }'))
def test_module(self):
self.options['module'] = 'slapos.promise.plugin.check_site_available'
self.installRecipe()
self.assertOutput("from %s import RunPromise" % self.options['module'])
self.assertEmptyConfig()
def test_file(self):
self.options['file'] = __file__
self.installRecipe()
self.assertOutput("exec(_(%r))" % self.options['file'])
self.assertEmptyConfig()
def test_module_and_parameters(self):
self.options['module'] = 'slapos.promise.plugin.check_site_available'
self.setConfig()
self.installRecipe()
self.assertOutput("from %s import RunPromise" % self.options['module'])
self.assertConfig()
def test_file_and_parameters(self):
self.options['file'] = __file__
self.setConfig()
self.installRecipe()
self.assertOutput("exec(_(%r))" % self.options['file'])
self.assertConfig()
def test_mode(self):
self.options['mode'] = '0644'
self.options['module'] = 'slapos.promise.plugin.check_site_available'
self.installRecipe()
self.assertEqual(stat.S_IMODE(os.stat(self.output).st_mode), int('644', 8))
with open(self.output) as f:
content = f.read()
self.assertIn("from slapos.promise.plugin.check_site_available import RunPromise", content)
self.assertIn('extra_config_dict = %s' % ('{}' if six.PY3 else '{ }'), content)
def test_module_and_class(self):
self.options['module'] = m = 'slapos.promise.plugin.check_site_available'
self.options['class'] = 'MyPromise'
self.installRecipe()
self.assertOutput("from %s import MyPromise as RunPromise" % m)
def test_file_and_class(self):
self.options['file'] = __file__
self.options['class'] = 'MyPromise'
self.installRecipe()
self.assertOutput("exec(_(%r))\n\nRunPromise = MyPromise" % __file__)
def test_no_module_or_file(self):
with self.assertRaises(UserError) as p:
self.makeRecipe()
msg = str(p.exception)
self.assertEqual(msg, "Either 'module' or 'file' is required but not both")
def test_module_and_file(self):
self.options['module'] = 'slapos.promise.plugin.check_site_available'
self.options['file'] = __file__
self.test_no_module_or_file()
def test_bad_parameters(self):
self.options['import'] = 'slapos.promise.plugin.check_site_available'
self.options['config-param1; print "toto"'] = """#xxxx"\nimport os; os.stat(f)"""
self.options['config-param2\n@domething'] = '"#$$*PPP\n\n p = 2*5; print "result is %s" % p'
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
recipe.install()
self.assertTrue(os.path.exists(self.output))
with open(self.output) as f:
content = f.read()
expected_param1 = r"""'param1; print "toto"': '#xxxx"\nimport os; os.stat(f)',"""
expected_param2 = r"""'param2\n@domething': '"#$$*PPP\n\n p = 2*5; print "result is %s" % p'"""
self.assertIn(expected_param1, content)
self.assertIn(expected_param2, content)
def test_bad_module_path(self):
self.options['import'] = 'slapos.promise.plugin.check_site_available; print "toto"'
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
with self.assertRaises(ValueError) as p:
recipe.install()
self.assertEqual(str(p.exception), "Import path %r is not a valid" % self.options['import'])
def test_bad_content(self):
self.options['content'] = 'from slapos.plugin.check_site_available import toto; print "toto"'
recipe = makeRecipe(
promise_plugin.Recipe,
options=self.options,
name='plugin')
with self.assertRaises(ValueError) as p:
recipe.install()
self.assertEqual(str(p.exception), "Promise content %r is not valid" % self.options['content'])
self.options['module'] = 'slapos.promise.plugin.check_site_available'
self.options.update((
('config-param1; print "toto"', '#xxxx"\nimport os; os.stat(f)'),
('config-param2\n@domething', '"#$$*PPP\np = 2*5; print "result=%s" % p')
))
self.installRecipe()
self.assertOutput(
r"""'param1; print "toto"': '#xxxx"\nimport os; os.stat(f)',""",
r"""'param2\n@domething': '"#$$*PPP\np = 2*5; print "result=%s" % p'"""
)
def test_bad_module(self):
self.options['module'] = 'slapos.promise.plugin.check_site_available; print "toto"'
with self.assertRaises(UserError) as p:
self.makeRecipe()
self.assertEqual(str(p.exception), "%r is not a valid module name" % self.options['module'])
def test_bad_file(self):
self.options['file'] = 'print "toto"'
self.installRecipe()
self.assertOutput(r"""exec(_('print "toto"'))""")
def test_bad_class(self):
self.options['class'] = 'MyPromise; print "toto"'
with self.assertRaises(UserError) as p:
self.makeRecipe()
self.assertEqual(str(p.exception), "%r is not a valid class name" % self.options['class'])
......@@ -46,7 +46,7 @@ md5sum = ae4a0043414336a521b524d9c95f1c68
[template-pullrdiffbackup]
filename = instance-pullrdiffbackup.cfg.in
md5sum = f2e6f30a0e8228cbfb93eaaae10fe884
md5sum = 45a4faa217ea5b83ecf271791e1632dd
[template]
filename = instance.cfg.in
......
......@@ -107,8 +107,7 @@ recipe = slapos.cookbook:promise.plugin
eggs =
slapos.toolbox
output = $${directory:plugin}/{{ slave_reference }}_check_backup.py
content =
from slapos.promise.plugin.backupserver_check_backup import RunPromise
module = slapos.promise.plugin.backupserver_check_backup
config-status_dirbasename = $${variables:status_dirbasename}
config-status_name = {{ '$${' ~ slave_reference }}-backup-script:status_name}
config-status_fullpath = {{ '$${' ~ slave_reference }}-backup-script:status_log}
......@@ -117,7 +116,6 @@ config-cron_frequency = {{ frequency }}
config-monitor_url = $${monitor-publish:monitor-base-url}
config-statistic_dirbasename = $${variables:statistic_dirbasename}
config-statistic_name = {{ '$${' ~ slave_reference }}-backup-script:statistic_name}
mode = 600
{% do part_list.append("%s-promise-check-backup" % slave_reference) -%}
[{{ slave_reference }}-backup-script]
......@@ -194,7 +192,7 @@ virtual-depends =
[nginx-listen-promise]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = nginx_listen.py
config-host = $${nginx-configuration:ip}
config-port = $${nginx-configuration:port}
......
......@@ -22,15 +22,15 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in
md5sum = 51087ac7615bd7cc01e60eb23701f625
md5sum = 0950e09ad1f03f0789308f5f7a7eb1b8
[profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in
md5sum = b6fc5a004a1235ffad3af0b4cb0e661f
md5sum = 7c2e52b76c42bed95702763c344e41dd
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = 9bb51f663f69d66b5b3708bf892dd3e6
md5sum = 313671d343ceccfca5af1baa642132c5
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
......@@ -46,7 +46,7 @@ md5sum = 88af61e7abbf30dc99a1a2526161128d
[template-default-slave-virtualhost]
_update_hash_filename_ = templates/default-virtualhost.conf.in
md5sum = 13cd08d630cc51666a9f7e469fb6ea52
md5sum = 37475d79f28c5f126bc1947fdb938fdb
[template-backend-haproxy-configuration]
_update_hash_filename_ = templates/backend-haproxy.cfg.in
......@@ -102,7 +102,7 @@ md5sum = 38792c2dceae38ab411592ec36fff6a8
[profile-kedifa]
filename = instance-kedifa.cfg.in
md5sum = eab5ae579471ca86b40bd2da3b53fefa
md5sum = dfb4dabd1e4094de1276d171f998ef47
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
......
......@@ -58,6 +58,7 @@ parts =
promise-slave-introspection-https
promise-slave-introspection-configuration
logrotate-entry-slave-introspection
backend-haproxy-statistic-frontend-promise
[caddyprofiledeps]
recipe = caddyprofiledeps
......@@ -538,7 +539,7 @@ context =
[trafficserver-promise-listen-port]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = trafficserver-port-listening.py
config-host = ${trafficserver-variable:local-ip}
config-port = ${trafficserver-variable:input-port}
......@@ -551,7 +552,7 @@ environment = TS_ROOT=${buildout:directory}
[trafficserver-promise-cache-availability]
<= monitor-promise-base
module = trafficserver_cache_availability
promise = trafficserver_cache_availability
name = trafficserver-cache-availability.py
config-wrapper-path = ${trafficserver-ctl:wrapper-path}
......@@ -652,48 +653,48 @@ context =
[promise-frontend-caddy-configuration]
<= monitor-promise-base
module = validate_frontend_configuration
promise = validate_frontend_configuration
name = frontend-caddy-configuration-promise.py
config-verification-script = ${promise-helper-last-configuration-state:rendered}
[promise-caddy-frontend-v4-https]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = caddy_frontend_ipv4_https.py
config-host = {{ instance_parameter_dict['ipv4-random'] }}
config-port = ${configuration:port}
[promise-caddy-frontend-v4-http]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = caddy_frontend_ipv4_http.py
config-host = {{ instance_parameter_dict['ipv4-random'] }}
config-port = ${configuration:plain_http_port}
[promise-caddy-frontend-v6-https]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = caddy_frontend_ipv6_https.py
config-host = {{ instance_parameter_dict['ipv6-random'] }}
config-port = ${configuration:port}
[promise-caddy-frontend-v6-http]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = caddy_frontend_ipv6_http.py
config-host = {{ instance_parameter_dict['ipv6-random'] }}
config-port = ${configuration:plain_http_port}
[promise-backend-haproxy-http]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = backend_haproxy_http.py
config-host = {{ instance_parameter_dict['ipv4-random'] }}
config-port = ${backend-haproxy-configuration:http-port}
[promise-backend-haproxy-https]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = backend_haproxy_https.py
config-host = {{ instance_parameter_dict['ipv4-random'] }}
config-port = ${backend-haproxy-configuration:https-port}
......@@ -797,7 +798,7 @@ extra-context =
[promise-backend-haproxy-configuration]
<= monitor-promise-base
module = validate_frontend_configuration
promise = validate_frontend_configuration
name = backend-haproxy-configuration.py
config-verification-script = ${promise-backend-haproxy-configuration-helper:rendered}
......@@ -887,7 +888,7 @@ context =
[monitor-verify-re6st-connectivity]
<= monitor-promise-base
module = check_url_available
promise = check_url_available
name = re6st-connectivity.py
config-url = ${configuration:re6st-verification-url}
......@@ -921,6 +922,14 @@ config-url = https://[${slap-configuration:ipv6-random}]:{{ instance_parameter_d
config-https-only = true
return = domain secure_access
[backend-haproxy-statistic-frontend-promise]
<= monitor-promise-base
promise = check_url_available
name = backend-haproxy-statistic-frontend.py
config-http-code = 401
config-url =
${backend-haproxy-statistic-frontend:connection-secure_access}
[slave-introspection-configuration-state]
<= jinja2-template-base
template = {{ software_parameter_dict['template_configuration_state_script'] }}
......@@ -967,7 +976,7 @@ extra-context =
[promise-slave-introspection-configuration]
<= monitor-promise-base
module = validate_frontend_configuration
promise = validate_frontend_configuration
name = slave-introspection-configuration.py
config-verification-script = ${promise-slave-introspection-configuration-helper:rendered}
......@@ -984,7 +993,7 @@ context =
[promise-slave-introspection-https]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = slave_introspection_https.py
config-host = {{ instance_parameter_dict['ipv6-random'] }}
config-port = ${frontend-configuration:slave-introspection-https-port}
......@@ -999,7 +1008,7 @@ delaycompress =
[promise-logrotate-setup]
<= monitor-promise-base
module = check_command_execute
promise = check_command_execute
name = ${:_buildout_section_name_}.py
config-command =
${logrotate:wrapper-path} -d
......
......@@ -103,10 +103,12 @@ context =
{% set authorized_slave_string_list = [] %}
{% set authorized_slave_list = [] %}
{% set rejected_slave_dict = {} %}
{% set critical_rejected_slave_dict = {} %}
{% set warning_slave_dict = {} %}
{% set used_host_list = [] %}
{% for slave in sorted(instance_parameter_dict['slave-instance-list']) %}
{% set slave_error_list = [] %}
{% set slave_critical_error_list = [] %}
{% set slave_warning_list = [] %}
{% set slave_server_alias_unclashed = [] %}
{% set slave_type = slave.get('type') %}
......@@ -165,7 +167,9 @@ context =
{% endif %}
{% set custom_domain = slave.get('custom_domain') %}
{% if custom_domain and custom_domain in used_host_list %}
{% do slave_error_list.append('custom_domain %r clashes' % (custom_domain,)) %}
{% set message = 'custom_domain %r clashes' % (custom_domain,) %}
{% do slave_error_list.append(message) %}
{% do slave_critical_error_list.append(message) %}
{% else %}
{% do used_host_list.append(custom_domain) %}
{% endif %}
......@@ -182,7 +186,9 @@ context =
{% if slave_alias in slave_server_alias_unclashed or slave_alias == custom_domain %}
{# optionally do something about reporting back that server-alias has been unclashed #}
{% elif slave_alias in used_host_list %}
{% do slave_error_list.append('server-alias \'%s\' clashes' % (slave_alias,)) %}
{% set message = 'server-alias \'%s\' clashes' % (slave_alias,) %}
{% do slave_error_list.append(message) %}
{% do slave_critical_error_list.append(message) %}
{% else %}
{% do slave_server_alias_unclashed.append(slave_alias) %}
{% do used_host_list.append(slave_alias) %}
......@@ -251,6 +257,9 @@ context =
{% else %}
{% do rejected_slave_dict.__setitem__(slave.get('slave_reference'), sorted(slave_error_list)) %}
{% endif %}
{% if len(slave_critical_error_list) > 0 %}
{% do critical_rejected_slave_dict.__setitem__(slave.get('slave_reference'), sorted(slave_critical_error_list)) %}
{% endif %}
{% if len(slave_warning_list) > 0 %}
{% do warning_slave_dict.__setitem__(slave.get('slave_reference'), sorted(slave_warning_list)) %}
{% endif %}
......@@ -373,7 +382,7 @@ kedifa-csr_id-certificate = ${request-kedifa:connection-csr_id-certificate}
{% set section_part = '${request-' + frontend %}
[{{ part_name }}]
<= monitor-promise-base
module = check_url_available
promise = check_url_available
name = check-backend-haproxy-statistic-url-{{ frontend }}.py
config-url =
{{ section_part }}:connection-backend-haproxy-statistic-url}
......@@ -752,9 +761,9 @@ filename = rejected-slave.json
directory = ${directory:promise-output}
rendered = ${:directory}/${:filename}
template = {{ software_parameter_dict['template_empty'] }}
{% if rejected_slave_dict %}
{% if critical_rejected_slave_dict %}
{# sort_keys are important in order to avoid shuffling parameters on each run #}
content = {{ dumps(json_module.dumps(rejected_slave_dict, indent=2, sort_keys=True)) }}
content = {{ dumps(json_module.dumps(critical_rejected_slave_dict, indent=2, sort_keys=True)) }}
{% else %}
content =
{% endif %}
......@@ -856,15 +865,15 @@ rendered = ${directory:etc}/nginx-rejected-slave.conf
[promise-rejected-slave-publish-ip-port]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = rejected-slave-publish-ip-port-listening.py
config-host = ${rejected-slave-publish-configuration:ip}
config-port = ${rejected-slave-publish-configuration:port}
[rejected-slave-promise]
<= monitor-promise-base
module = check_socket_listening
module = check_file_state
promise = check_socket_listening
promise = check_file_state
name = rejected-slave.py
config-filename = ${rejected-slave-json:rendered}
config-state = empty
......
......@@ -193,7 +193,7 @@ template = inline:
[promise-expose-csr_id-ip-port]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = expose-csr_id-ip-port-listening.py
config-host = ${expose-csr_id-configuration:ip}
config-port = ${expose-csr_id-configuration:port}
......@@ -250,7 +250,7 @@ extra-context =
[promise-kedifa-http-reply]
<= monitor-promise-base
module = check_url_available
promise = check_url_available
name = kedifa-http-reply.py
# Kedifa replies 400 on /, so use it to be sure that Kedifa replied
config-http-code = 400
......@@ -331,7 +331,7 @@ monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
[promise-logrotate-setup]
<= monitor-promise-base
module = check_command_execute
promise = check_command_execute
name = ${:_buildout_section_name_}.py
config-command =
${logrotate:wrapper-path} -d
......
......@@ -20,19 +20,8 @@ parts +=
caucase-eggs
template
caddyprofiledeps
kedifa-develop
kedifa
[kedifa-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/kedifa.git
git-executable = ${git:location}/bin/git
revision = 3fccc2ec945c59b644a12fa40225795abd61e0b0
[kedifa-develop]
recipe = zc.recipe.egg:develop
setup = ${kedifa-repository:location}
[kedifa]
recipe = zc.recipe.egg
eggs =
......@@ -222,6 +211,7 @@ mode = 0644
<=download-template
[versions]
kedifa = 0.0.6
# Modern KeDiFa requires zc.lockfile
zc.lockfile = 1.4
......
......@@ -353,7 +353,7 @@ filename = {{ '%s.conf' % slave_reference }}
{%- do part_list.append(monitor_ipv6_section_title) %}
[{{ monitor_ipv6_section_title }}]
<= monitor-promise-base
module = check_icmp_packet_lost
promise = check_icmp_packet_lost
name = {{ monitor_ipv6_section_title }}.py
config-address = {{ dumps(monitor_ipv6_test) }}
# promise frequency in minutes (2 times/day)
......@@ -365,7 +365,7 @@ config-frequency = 720
{%- do part_list.append(monitor_ipv4_section_title) %}
[{{ monitor_ipv4_section_title }}]
<= monitor-promise-base
module = check_icmp_packet_lost
promise = check_icmp_packet_lost
name = {{ monitor_ipv4_section_title }}.py
config-address = {{ dumps(monitor_ipv4_test) }}
config-ipv4 = true
......@@ -632,7 +632,7 @@ template = inline:
[promise-expose-csr_id-ip-port]
<= monitor-promise-base
module = check_socket_listening
promise = check_socket_listening
name = expose-csr_id-ip-port-listening.py
config-host = ${expose-csr_id-configuration:ip}
config-port = ${expose-csr_id-configuration:port}
......@@ -655,7 +655,7 @@ commands =
[promise-logrotate-setup]
<= monitor-promise-base
module = check_command_execute
promise = check_command_execute
name = ${:_buildout_section_name_}.py
config-command =
${logrotate:wrapper-path} -d
\ No newline at end of file
......@@ -2,6 +2,11 @@
{%- if slave_parameter['prefer-gzip-encoding-to-backend'] %}
{%- do proxy_append_list.append(('prefer-gzip', 'Proxy which always overrides Accept-Encoding to gzip if such is found')) %}
{%- endif %} {#- if slave_parameter['prefer-gzip-encoding-to-backend'] #}
{%- if slave_parameter['path'].strip().strip('/') %}
{%- set zope_path = slave_parameter['path'].strip().strip('/') ~ '/' %}
{%- else %}
{%- set zope_path = '' %}
{%- endif %}
{%- set http_host_list = [] %}
{%- set https_host_list = [] %}
{%- for host in slave_parameter['host_list'] %}
......@@ -129,27 +134,27 @@
regexp (.*)
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
{%- if tls %}
to /prefer-gzip/VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /prefer-gzip/VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- else %}
to /prefer-gzip/VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /prefer-gzip/VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- endif %}
}
rewrite {
regexp (.*)
if {>Accept-Encoding} not_match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
{%- if tls %}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- else %}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- endif %}
}
{%- else %}
rewrite {
regexp (.*)
{%- if tls %}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-https-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- else %}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ slave_parameter['path'] }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F{hostonly}:{{ slave_parameter['virtualhostroot-http-port'] }}%2F{{ zope_path }}VirtualHostRoot/{1}
{%- endif %}
} {# rewrite #}
{%- endif %} {#- if slave_parameter['prefer-gzip-encoding-to-backend'] #}
......
......@@ -795,7 +795,7 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
with cls.slap.instance_supervisor_rpc as instance_supervisor:
return getattr(instance_supervisor, method)(*args, **kwargs)
def assertRejectedSlavePromiseWithPop(self, parameter_dict):
def assertRejectedSlavePromiseEmptyWithPop(self, parameter_dict):
rejected_slave_promise_url = parameter_dict.pop(
'rejected-slave-promise-url')
......@@ -806,7 +806,7 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
else:
result_json = result.json()
self.assertEqual(
parameter_dict['rejected-slave-dict'],
{},
result_json
)
except AssertionError:
......@@ -971,12 +971,11 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
return parsed_parameter_dict
def getMasterPartitionPath(self):
# partition w/o etc/trafficserver, but with buildout.cfg
# partition with etc/nginx-rejected-slave.conf
return [
q for q in glob.glob(os.path.join(self.instance_path, '*',))
if not os.path.exists(
os.path.join(q, 'etc', 'trafficserver')) and os.path.exists(
os.path.join(q, 'buildout.cfg'))][0]
if os.path.exists(
os.path.join(q, 'etc', 'nginx-rejected-slave.conf'))][0]
def parseConnectionParameterDict(self):
return self.parseParameterDict(
......@@ -1238,7 +1237,7 @@ class TestMasterRequestDomain(HttpFrontendTestCase, TestDataMixin):
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
self.assertEqual(
{
......@@ -1269,7 +1268,7 @@ class TestMasterRequest(HttpFrontendTestCase, TestDataMixin):
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
self.assertEqual(
{
'monitor-base-url': 'https://[%s]:8401' % self._ipv6_address,
......@@ -1707,7 +1706,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
expected_parameter_dict = {
'monitor-base-url': 'https://[%s]:8401' % self._ipv6_address,
......@@ -2231,7 +2230,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
result,
'Path',
'/VirtualHostBase/'
'https//typezopepath.example.com:443/path/to/some/resource'
'https/typezopepath.example.com:443/path/to/some/resource'
'/VirtualHostRoot/'
'test-path/deeper'
)
......@@ -2793,7 +2792,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//typezope.example.com:443/'
'/VirtualHostBase/https/typezope.example.com:443'
'/VirtualHostRoot/test-path/deeper'
)
......@@ -2833,8 +2832,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:443/'
'/VirtualHostBase/https/'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:443'
'/VirtualHostRoot/test-path/deeper'
)
......@@ -2845,8 +2844,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/http//'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:80/'
'/VirtualHostBase/http/'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:80'
'/VirtualHostRoot/test-path/deeper'
)
......@@ -2868,8 +2867,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:443/'
'/VirtualHostBase/https/'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:443'
'/VirtualHostRoot/test-path/deeper'
)
self.assertEqual(
......@@ -2883,8 +2882,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/http//'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:80/'
'/VirtualHostBase/http/'
'typezopeprefergzipencodingtobackendhttpsonly.example.com:80'
'/VirtualHostRoot/test-path/deeper'
)
self.assertEqual(
......@@ -2911,8 +2910,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//'
'typezopeprefergzipencodingtobackend.example.com:443/'
'/VirtualHostBase/https/'
'typezopeprefergzipencodingtobackend.example.com:443'
'/VirtualHostRoot/test-path/deeper'
)
......@@ -2949,8 +2948,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//'
'typezopeprefergzipencodingtobackend.example.com:443/'
'/VirtualHostBase/https/'
'typezopeprefergzipencodingtobackend.example.com:443'
'/VirtualHostRoot/test-path/deeper'
)
self.assertEqual(
......@@ -2982,8 +2981,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/http//typezopevirtualhostroothttpport'
'.example.com:12345//VirtualHostRoot/test-path'
'/VirtualHostBase/http/typezopevirtualhostroothttpport'
'.example.com:12345/VirtualHostRoot/test-path'
)
def test_type_zope_virtualhostroot_https_port(self):
......@@ -3000,8 +2999,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(
result,
'Path',
'/VirtualHostBase/https//typezopevirtualhostroothttpsport'
'.example.com:12345//VirtualHostRoot/test-path'
'/VirtualHostBase/https/typezopevirtualhostroothttpsport'
'.example.com:12345/VirtualHostRoot/test-path'
)
def test_type_notebook(self):
......@@ -5286,7 +5285,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
expected_parameter_dict = {
'monitor-base-url': 'https://[%s]:8401' % self._ipv6_address,
......@@ -5296,10 +5295,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'rejected-slave-amount': '0',
'slave-amount': '12',
'rejected-slave-dict': {
# u"_ssl_ca_crt_only":
# [u"ssl_ca_crt is present, so ssl_crt and ssl_key are required"],
# u"_ssl_key-ssl_crt-unsafe":
# [u"slave ssl_key and ssl_crt does not match"]
},
'warning-list': [
u'apache-certificate is obsolete, please use master-key-upload-url',
......@@ -5948,7 +5943,7 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate(
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
expected_parameter_dict = {
'monitor-base-url': 'https://[%s]:8401' % self._ipv6_address,
......@@ -6053,7 +6048,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
self.assertBackendHaproxyStatisticUrl(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict, 'master-')
self.assertRejectedSlavePromiseWithPop(parameter_dict)
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
expected_parameter_dict = {
'monitor-base-url': 'https://[%s]:8401' % self._ipv6_address,
......@@ -6293,6 +6288,29 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
}
}
def assertRejectedSlavePromiseWithPop(self, parameter_dict):
rejected_slave_promise_url = parameter_dict.pop(
'rejected-slave-promise-url')
try:
result = requests.get(rejected_slave_promise_url, verify=False)
if result.text == '':
result_json = {}
else:
result_json = result.json()
self.assertEqual(
{
u'_SITE_4': [u"custom_domain 'duplicate.example.com' clashes"],
u'_SITE_2': [u"custom_domain 'duplicate.example.com' clashes"],
u'_SITE_3': [u"server-alias 'duplicate.example.com' clashes"]
},
result_json
)
except AssertionError:
raise
except Exception as e:
self.fail(e)
def test_master_partition_state(self):
parameter_dict = self.parseConnectionParameterDict()
self.assertKeyWithPop('monitor-setup-url', parameter_dict)
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -24,6 +24,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......@@ -47,6 +48,7 @@ T-2/etc/plugin/trafficserver-port-listening.py
T-3/etc/plugin/__init__.py
T-3/etc/plugin/backend-client-caucase-updater.py
T-3/etc/plugin/backend-haproxy-configuration.py
T-3/etc/plugin/backend-haproxy-statistic-frontend.py
T-3/etc/plugin/backend_haproxy_http.py
T-3/etc/plugin/backend_haproxy_https.py
T-3/etc/plugin/buildout-T-3-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -23,6 +23,7 @@ T-1/etc/plugin/promise-logrotate-setup.py
T-2/etc/plugin/__init__.py
T-2/etc/plugin/backend-client-caucase-updater.py
T-2/etc/plugin/backend-haproxy-configuration.py
T-2/etc/plugin/backend-haproxy-statistic-frontend.py
T-2/etc/plugin/backend_haproxy_http.py
T-2/etc/plugin/backend_haproxy_https.py
T-2/etc/plugin/buildout-T-2-status.py
......
......@@ -18,4 +18,4 @@ md5sum = e986de01a57161b32425f1cd3ccac924
[template-cloudooo-instance]
filename = instance-cloudooo.cfg.in
md5sum = 6e4bdb1df02aed5c96ccf7b9c3c71b89
md5sum = 3e6830c21c206b3ae1140375e5e63b46
......@@ -105,7 +105,7 @@ ssl-session-cache = ${directory:log}/apache-ssl-session-cache
[apache-promise]
# Check any apache port in ipv4, expect other ports and ipv6 to behave consistently
<= monitor-promise-base
module = check_url_available
promise = check_url_available
name = apache.py
config-url = https://{{ ipv4 }}:{{ apache_dict.values()[0][0] }}
# XXX cloudooo replies "400 Bad Request" for GET on / but what we want to check
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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