Commit 2adefe1b authored by Antoine Catton's avatar Antoine Catton

Merge my work from generic-lamp in order to provide a base for generic

recipes.

Squashed commit of the following:

commit 47c90b0c79dc758a581e5401a83683ae4d7b0d17
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 17:26:27 2011 +0200

    Huge underscore to dashe refactoring

commit 609422d8bc8a500435692de6686411c01c036e8f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 17:04:52 2011 +0200

    Reset lamp recipe as it is in master branch

commit 37ae2ed0b0630a802b46aae361f538eeb7130952
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 16:51:22 2011 +0200

    Make slapgrid-sr works

commit f35677b711e834239f8c8508ea44ca1432f98091
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 16:16:45 2011 +0200

    Add lamp.cfg from master.

commit 75956ad31f8d012502a305f396865505f46672d2
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 16:19:42 2011 +0200

    Typo.

commit 4fe7611cbf688043b9c0462a3b5a17ae3e785e07
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 16:12:51 2011 +0200

    Fix part name.

commit c3bbb38de449eea7e6329974b4ecf04342c19551
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 16:11:02 2011 +0200

    Checkpoint: it starts to compile.

commit 7355ace45ba4d4e14c89faaf74903e0bbd16a851
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 16:08:03 2011 +0200

    Remove unwanted part recipe

commit 5852112db15c33cc24d16fb62f78bc349bfea1df
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 16:09:15 2011 +0200

    Updating MD5 Checksums

commit 010789fd9f0cc9c1286c0ed64b790e4575de1096
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 16:05:32 2011 +0200

    Substitute underscores by dashes in buildout.cfg

    Let's break everything !

commit d651715ca31d169930e640f72c1c93408e423435
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 15:57:48 2011 +0200

    Revert "Instances have to be offline"

    This reverts commit d55a6ba29d37a1cad27df93635ba332fb30f5d3a.

    It is not needed to put offline = true in profiles which extends correctly
    defined offline profiles.

commit d55a6ba29d37a1cad27df93635ba332fb30f5d3a
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:54:33 2011 +0200

    Instances have to be offline

commit 5f2fa0f37bcdd57c9144b42152e61fb78ba9557d
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 15:52:25 2011 +0200

    Stabilise instance profiles.

    Reuse eggs and develop eggs from software.

    Force offline.

commit dfb5af615413a89479220f41f79095382de6ebe0
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 15:44:48 2011 +0200

    Typo.

commit 729fe366ec026a1879c4c705b7cf6b35852aea5c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 15:29:19 2011 +0200

    Use internal python code instead of system binary to rename file.

commit 8b045d7ff788aa4e230f8a75a2118696bc262b8a
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 15:31:17 2011 +0200

    Continue renaming.

commit 220eb561e5bae9a067f58d9713ba83e0eec8d596
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:26:01 2011 +0200

    Update md5sums

commit 014500fe75b0880a1f32c3b0db441136d256b546
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 15:20:49 2011 +0200

    Fix md5sum.

commit 855bc9dce7e169d8b9a70c6f4dd091e402da6402
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:22:28 2011 +0200

    NEVER use system binary!

commit 55a4c1fca21838c0f477cc6cad3f275cd06aba5c
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:19:18 2011 +0200

    Use lowercase parameter

commit 1626815637f2f7fe371fc28fb6d5f2140072ed19
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:13:43 2011 +0200

    Wordpress will not provide davstorage functionnality.

    It has to be provided as a parameter for now.

commit ff22c8a6479e72d479d0442e3ef32e1d00a40216
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:04:19 2011 +0200

    Typo

commit 488fc6253b35482b36b2ebfcf01a63e10d1d0426
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 15:03:41 2011 +0200

    Drop SlapBaseRecipe depedency

commit b303d9da6343030d120f7f3f3e4e49c579da39a9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 15:03:12 2011 +0200

    Bugfix : os.path.exists return false for links

commit aa9ff10d5900f1c3751d278fac7a856ab12246e4
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 15:02:57 2011 +0200

    Use explicit naming

commit 2966f091c8674840150c0acac8b18aa5e666f310
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:59:17 2011 +0200

    Use explicit naming

commit 567e235cecca4730e22d0632f61f376b2933b036
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:55:51 2011 +0200

    md5sum are mandatory to force download of template in case of modification

commit d0b28013f8fe4f3bc67f61ad0b4462f7dab4404a
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:53:15 2011 +0200

    software release have to be self contained.

    Provide all possible software type if needed.
    Give explicit name to what the default instance does.

commit 8bf92485c816f1a131a0b1a5922db0408f3f17dc
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 14:45:34 2011 +0200

    Fix md5sum again

commit bf58585787d5f605404785684ebe6de13045db3d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 14:39:03 2011 +0200

    Fix MD5 checksum because romain didn't

commit 68f3441aaaa5ce534e6c379e198e3741a556c604
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 14:37:36 2011 +0200

    Avoid plurals.

commit 4c78779fb885a824688731b149b6a909a89668cd
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 14:35:22 2011 +0200

    Make buildout happy.

commit d69c492dde87e0b66ab9e3adaf5be31528d15826
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 14:35:03 2011 +0200

    Drop not needed parameter.

commit 72a2aa22937355bed4403be7b540dfc6402c93fe
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:32:11 2011 +0200

    Use explicit naming

commit d6408a14df9a863415b228aa8c57e5877a9ccc30
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 14:25:13 2011 +0200

    Switch to more "generic" locations.

commit 6a31279f3087dd8f3b323161c42c7968ba513b1f
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:08:40 2011 +0200

    Explicit naming

commit b31f888e79d797b94c4f322aad9c11a63b391c3a
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:02:23 2011 +0200

    Rename documentation file to match the recipe.

commit 0b262685b61c3570364f9ca7488d7d67c2876512
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 14:01:01 2011 +0200

    Fix wrong plural refactoring

commit 4146e7ce6e63090b19d7ce0747945f7ea8beb5fd
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:56:35 2011 +0200

    Simplify.

    Buildout will provide informative message about missing key in section.

commit bee94f6a4bab87a12f748ca7153cdf7e4be62a8f
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:53:09 2011 +0200

    Make buildout happy.

    Define update (same as install) and return list.

commit daa02181d263fb8eaa57d97239ae88242a6d2e6f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 13:47:19 2011 +0200

    Refactor getRandomPassword in generatePassword

commit ddd7c895a96a04402e881eaffce2d7532c4c24f6
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:46:49 2011 +0200

    "Fix" paths, mark dirtyness.

commit 04d4615fc6d1304d9c5814e0e36df11bfa8b83a1
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:38:08 2011 +0200

    Post refactoring fix.

commit 6faa83979c70e9b123b11437f65e14f5aaee5bde
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 13:30:08 2011 +0200

    Bugfix: remove certificates links

commit 545978599b39290adadda9d4c2a00ecf74f6510e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 13:24:17 2011 +0200

    Drop usage of getAbsFilepath method and use absolute path in buildout.

commit 0e88681608f9cda95fa4c06c141d2df77a3a9bef
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:31:35 2011 +0200

    Sorry.

commit 278c35b41c54becff0fd6b4a89d928866920a532
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:22:24 2011 +0200

    Update md5sums.

commit bac89dacfeb216d766b82c01c2125133d4cd9453
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 13:21:05 2011 +0200

    Avoid plurals.

commit dca1966dc6c27dcfe2859eab5b96e82f83206c5c
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 12:02:06 2011 +0200

    Absolute paths shall be used.

    This is more explicit.

    Currently there is POSIX requirement in slapos, so / is safe.

    If non POSIX system shall be support, the profile shall be the same (always
    use /) and recipes shall give portability layer (like setuptools does).

commit 230f4e4df736c71c896cc4292e7575eb118279e7
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 11:59:51 2011 +0200

    Typo fix on “update”

commit 97fcad6e56fbe5ed1b29e5f927be636a83726fa0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 11:56:35 2011 +0200

    Make logrotate recipe compatible with
    4dd8819f8b882c6fda6c1dca8a29660209fe73b3

commit 4f381ab22ed9f1bee8b49acc9c176de2fe15eed9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 11:51:42 2011 +0200

    Add the possibility to provide a complete url.

commit 02f1fb833e4d290d68a7d0527e0d98959b1a49c2
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:53:45 2011 +0200

    Drop dollar.

commit 586d380d4425bef58e30bded6b3a5dc7d3e15d12
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:51:23 2011 +0200

    Just split on empty spaces.

    Supporting spaces can be done by adding '\ ' and supporting it later.

commit 4dd8819f8b882c6fda6c1dca8a29660209fe73b3
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:50:43 2011 +0200

    User shall not be forced to provide parameters in lines.

commit 520421ed444bebab641f8fd91a5fff7eccdfb60b
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:45:01 2011 +0200

    Put IPv6 in [].

    Update instance md5sum.

commit 37f2c51e5a7319f865346e7e686b2d5e9454d101
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:36:15 2011 +0200

    Just passing correct url shall be enough too.

commit 063f9471fe99831897daeb82069b66b172c6fcf5
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 11:33:41 2011 +0200

    Add update method to GenericBaseRecipe

commit 44ef0c65aaadbca76d9d0b290f187dfa8f1b3af5
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 11:30:22 2011 +0200

    Returning symlink of key and cert file to buildout in stunnel

commit f5a9cb7dd267634ac53802514983e1ed86e5223a
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:20:28 2011 +0200

    Update md5sum.

commit c65b0a6eeb9e1af96aa6cd90f0da9e3acc707768
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:15:28 2011 +0200

    Instance shall be self contained.

    Options like egg location or offline shall be defined loduly.

commit dbf05dd37288207ecb72fc6381babf9de50b7a02
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:11:52 2011 +0200

    md5sum is required.

    using local cache will not force files to be redownloaded, and hexagonit.*
    requires local cache.

commit 5b43dd700964c89bbdf13e9f4cba1bfce7ba5d3c
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:07:50 2011 +0200

    Expose default eggs and develop eggs locations.

commit 1427b5022596f01bed6aa94462bb4246be81e0f6
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 11:04:38 2011 +0200

    Drop librecipe dependency.

commit 082f037370ecbf80030767e09424b11d59010829
Author: Romain Courteaud <romain@nexedi.com>
Date:   Fri Oct 14 10:45:42 2011 +0200

    Fix software type recipe.

    Do not use mapping but buildout parameter.
    New buildout section created have to be prefixed by slap_ for a better
    understanding.
    Do not extend default instance.cfg but propagate parameters instead. This will
    prevent unexpected side effect.

commit d32fd6583abe9564280c35564b8b4f83d1374cd4
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 10:43:56 2011 +0200

    Support flatten software type selection.

commit 7e283f8447cc9a88175db1619adb54b1f4b8cabd
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Fri Oct 14 10:43:26 2011 +0200

    Drop artificial mapping.

    Flatten the configuration.

    More: bootstrap is softwaretype.

commit 641d12b2ba24741f2cd4a52b5a6e44056230242c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:38:35 2011 +0200

    [WORKING] Modifiy mariadb instance-default to make it work

commit 1fd721f59d05279959d3283ad44d31ad56a9f59d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:37:47 2011 +0200

    Bugfix: stunnel weren't using the right package

commit 3027b2b920f8249bd616998aa3aea6f7940a28a8
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:37:29 2011 +0200

    Add ca.request entrypoint

commit 2a88fc9fc99e2cd4af3bf5a89ce87b67ebf117eb
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:08:32 2011 +0200

    runCertificateAuthoricity receive directly a dict now.

commit dcb14d898bc0a62b29515cd65e51c64e61dd461b
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:08:04 2011 +0200

    runMysql receive the dict directly now.

commit 493e7747b3e8fd739689289568291f79413b5407
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Oct 14 10:07:37 2011 +0200

    Remove useless getAbsFilepath in order to make mysql software release
    work

commit 5b0bb4154570bb49bd55aa788511b1170c1471ce
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:47:39 2011 +0200

    Make instance.cfg work

commit e9d119645654fbd6aadc2150bccc5ceedc143bdf
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:47:23 2011 +0200

    [DOES NOT WORK] Make mysql instanciate

commit c3abf66133b7fdd7345d50c6e1b46976fc896c81
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:46:49 2011 +0200

    [DOES NOT WORK] Make stunnel instanciate

commit 4fdb14b7866f2a3892b392ef5d5440dda81d72db
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:46:30 2011 +0200

    Bugfix on publish url

commit c080bc9c516421d7114ed1e1eff157dab27e8519
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:46:08 2011 +0200

    Clean out mkdirectories recipe

commit fa0c4471efbe9506d4897659e62870c1dd62ecce
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:45:34 2011 +0200

    [NOT TESTED] Make logrotate instanciate

commit 19f31b898db3807779a219747dc59456c839c6f4
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:45:18 2011 +0200

    Add comment to not remote unused import

commit 099efc5c452af22fc3ddcdcc9d693578ecc27963
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:44:44 2011 +0200

    [DOES NOT WORK] Make Certificate Authoritiy running

commit 7d07a104d54ff4303328280c058a7600740d0929
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:44:04 2011 +0200

    Make duplicity recipe work

commit 58dd07ce2a5176c2860cc4b961709521e7d37c4a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 19:43:34 2011 +0200

    Use the right python package

commit 15de834518cfef5c3d70c7b867b8e7d2e7d43c03
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 18:43:36 2011 +0200

    Get the name of the caller package

commit 7438a9fbfae9cb77175a54036c391d61003c7b52
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 18:34:15 2011 +0200

    Bugfix on generic base recipe

commit a01309cf3fe1af1d90bae38ffdb35f1308616b4a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 18:31:16 2011 +0200

    Bugfix: bug fix on generic base recipe

    Passing options to the egg was polluting the options dictionnary

commit 2483ee2604c5e74efc367517668b310b1b8c596c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 16:32:36 2011 +0200

    Fix logrotate.d entrypoint module

commit 600b587be960883069c2e0348813499b999efe7c
Merge: e755f81 af93196e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 16:30:51 2011 +0200

    Merge branch 'master' into generic-lamp

    Conflicts:
    	slapos/recipe/lamp/__init__.py
    	software/mariadb/software.cfg
    	software/wordpress/instance.cfg
    	software/wordpress/software.cfg

commit e755f811b82fc11c7abec4bf7415449e9e5b1244
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 16:25:11 2011 +0200

    Use internal generic recipe getAbsFilepath in mkdirectories

commit 06b62174349dd8c64fc90e449584f9c19f1aa6ad
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 16:02:01 2011 +0200

    [NOT TESTED] Rename logrotate part of mariadb

commit 98366d54306a537284f0cd00dd33e230bd89281f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 16:01:02 2011 +0200

    [NOT TESTED] Change recipe to the right entry points

commit 808f25ed026010af7fffa2d655f17afef096ef56
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:59:06 2011 +0200

    Add right entry points

commit 16f2a9c6af83b2d04a15f12c85a561adfd28c1a5
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:57:50 2011 +0200

    [NOT TESTED] Adapt instance.cfg of mariadb for the latest modifications
    of recipes

commit d82425428d8e197cd635f447e42f59d2eca65534
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:57:17 2011 +0200

    Merge logrotate into one python file.

commit 38b7037871ee0f65ffb6fc6fb0f01978bd0a66ff
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:34:25 2011 +0200

    Simplify dcron recipe

commit 6a24f9df5e820a97b486679bdee8f11f0a5273c9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:22:20 2011 +0200

    [NOT WORKING] Commit changes to instances.cfg

commit 29768659cd767741fd9a5187083eeaac0d34e0dc
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:22:04 2011 +0200

    Add entry points to new recipes

commit 9db8d1b47d0cce62dba74565fe7962a1ad839da1
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:21:40 2011 +0200

    Minimalize mysql recipe

commit 07d8b6eafc6c5b36f68cae0e01a23945127bf694
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:20:48 2011 +0200

    Move certificate authority from mysql ca module

commit 65df096d8282e2c0c1c86a7b542c0d72ff4f70f7
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:20:29 2011 +0200

    Remove duplicate certificate_authority.py

commit 7c9b0f5ed798c4ccbb614f058cd423b5a823372e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:16:44 2011 +0200

    Create the certificate authority recipe

commit 208a10386de8b78c7595b8338d9a2ea91e2e38b6
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:15:26 2011 +0200

    Add simplelogger recipe.

    This recipe create a simple logger which read stdin and put in in
    a file.
    It's use as catchcron.

commit 629ce0db9e61f3c1240c3eb77f164b1113ce05b8
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:15:10 2011 +0200

    Add logrotate recipe

commit 1eeddce195cdb9420bce730c370a9ec4c7b9a498
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:14:32 2011 +0200

    Add XXX on execute

commit e9648b1e3776883bb5d40d08eb3f6f9c1034e3d2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:13:50 2011 +0200

    Add request recipe

commit def16439634bffe90e8c4b2168095fbe2afbfa9d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:13:31 2011 +0200

    Modify softwaretype recipe to add offline informations

commit 607948cbebf858cb28d9bbbe4891d6f9a48e29f7
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:12:10 2011 +0200

    Add mkdirectories recipe

commit b1d4232b7c1dd96d67f28b77f413174cbdb9aabd
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:10:26 2011 +0200

    Factorisizing stunnel in one recipe

commit beb4b87366f243a0d07a00584d928aa0c3cda630
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:08:46 2011 +0200

    Merging dcron module in one python file.

commit 73756ff28af42ec4865ce8819e4a86c88028e370
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:06:32 2011 +0200

    Add part recipe (running a function and using JSON on stdin/stdout to
    pass and return parameters)

commit 61c7571d2da6621b38894562f10d4f5fd5a17fcf
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:05:50 2011 +0200

    Add publishurl recipe

commit de204966fc041e1767517d3857fc0819f28a6946
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:05:14 2011 +0200

    Move out from slapbaserecipe some common things with generic base recipe

commit 2c8ad13beac44a1f8d77db82616f449db7e59db3
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 13 15:05:04 2011 +0200

    Add generic base recipe

commit ba33cd765febf411655cbb5eaa1452dba4d52cbe
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 14:45:27 2011 +0200

    Remove unused logrotate_entry template file in mysql recipe

commit 2046c5f567d7628e2dcdf1f70f7e263261d9741a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 14:10:35 2011 +0200

    WordPress software release using generic recipes

commit 912d1223487768d872baeeeaf1aa79bee1aa5fcd
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 14:00:32 2011 +0200

    MariaDB software release using generic recipes

    Due to hexagonit.recipe, you gotta create softwarerelease/path/downloads
    directory manually.

commit fcea59e328c04623c2fa27369a98fea03a59b556
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:58:05 2011 +0200

    Improve softwaretype to use different .installed.cfg file

commit c8c17f4036242ecfccac5a92b9e283cf7146408f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:57:40 2011 +0200

    Clean up softwaretype recipe to use meanful filename

commit c2cd04bc62cf87696d6d9304ae0eca668168298a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:56:26 2011 +0200

    Remove the usage of software type

commit a4dabc0f1e27771508d7a118e72410fcd07ff49a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:55:33 2011 +0200

    Give the remote backup mechanism to another recipe and/or part

commit 2401e6b801d3b1fcb76c4af1b2dcb2773e6d4d8a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:53:13 2011 +0200

    Remove unused registerLogRotation method from mysql recipe

commit 35b3dfbb48d12335ee7cb1fc1a6be822aae0e6f8
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:51:03 2011 +0200

    Remove request from lamp recipe

commit 364dc8cc1e4777c03e5d3a9e0765955b47d3e716
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:48:09 2011 +0200

    Add optionIsTrue method in SlapBaseRecipe

commit 4f127d2b5f14bc348986f06ced4075e56450f6cc
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:43:56 2011 +0200

    split setConnectionUrl in two method in order to factorize the code.

    This way, _unparseUrl can be reuse for another purpose.

commit 834dadeb7eefcf8d0476b555712acd9a5f4a11a7
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:41:43 2011 +0200

    Add duplicity recipe

commit 59ff39c5876b7ef74e51c698a16684b65ad149da
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:41:16 2011 +0200

    Minor: add request recipe to setup.py

commit b8cdd4470297070467d5d332511726376143dd9d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Oct 6 13:40:02 2011 +0200

    Add request recipe.

    The request is done in the __init__ method to be able to pass some
    parameter to another part in the buildout.cfg.

commit 7b6adaecb080a84a9bb0f20ca2264864dac6bf7e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Oct 4 11:06:13 2011 +0200

    Splitting MySQL recipe in order to be generic.

commit 39a106c2f4ec49d9d6a0de979edce049cfa6a663
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Oct 4 11:02:02 2011 +0200

    Adding vim swapfile to gitignore.

commit 7fc8bb42bb708a3d640cf0f90484d59bd8985f31
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Oct 4 10:58:32 2011 +0200

    Add more generic recipes.

    Generic recipes added :
     - dcron : recipe to run a cron deamon and add parts (cron, and cron.d
       entry points)
     - logrotate : recipe to install a logrotate and add logrotate parts
       (logrotate and logrotate.d entry points)
     - softwaretype : recipe to switch instance.cfg depending on the
       software type.

    Some modification of the librecipe were necessary to factorize
    some code.

commit e20a8d17ac1cf1c351376a692b97b7dec92f7a0a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 28 10:32:32 2011 +0200

    Fix: mariadb would recover again next restart

    This is a working version of 41f95a7407a2767cc141726b76904d1b679f468f

commit c63c89c16c8d110f35acb57f6a88fd8d9923bc58
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 28 10:30:46 2011 +0200

    Bad bugfix

    This reverts commit 41f95a7407a2767cc141726b76904d1b679f468f.

commit 41f95a7407a2767cc141726b76904d1b679f468f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 28 10:16:05 2011 +0200

    Bux fix: mariadb would import the dump again next restart

commit 296da01db0d2019c34134ed426cd1e8a3b1bb886
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 17:37:54 2011 +0200

    My bad, remove the develop= on apache-php.cfg

commit dce3ce7fdea133f01f83d379287c6047533e6757
Merge: 8a573c8 0a43d8aa
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 17:32:02 2011 +0200

    Merge branch 'master' into lamp-failover

commit 8a573c8dd8a3bc094b95a46a117e5f5deb7ca9f2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 17:19:46 2011 +0200

    Modify lamp request to request another software release

    Example of usage with wordpress software.cfg

commit df8c7449f5646e1a95580c4797b88e3eec201b29
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 17:02:11 2011 +0200

    Pin newer cookbook.

commit 7daea6f475669461095c9cfcd3ceb468663108b0
Merge: 23ec754 16e97301
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:30:40 2011 +0200

    Merge branch 'master' into lamp-failover

    Conflicts:
    	slapos/recipe/mysql/__init__.py
    	software/mariadb/instance.cfg
    	software/mariadb/software.cfg

commit 23ec754142936b2ba6ebfc41e7d6be4169f115a2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:28:41 2011 +0200

    Remove inexistant import script from mariadb instance.cfg

commit 29c03b04f0c220258e834bafc9d8174340abc948
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:24:57 2011 +0200

    Remove useless generic recipes

commit f6fa78b55f787f530bb335b91936a20470510877
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:23:40 2011 +0200

    Add mariadb backup and recovering.

commit d32847c692b6e081b804e57af8810c18fdf41c07
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:13:16 2011 +0200

    MySQL fix: mysql wasn't accepting remote connections

commit 4b4a3c39a9f9715b0a4878cd6d582ba435638853
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:08:19 2011 +0200

    Mysql Recipe: return a meanful URI instead of several parameters

commit a2366cd5cb5c34677725227be3505096a26ebb98
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 16:06:16 2011 +0200

    Removing lamp.failover entry point

commit 1ff0f94d1d70f36381582096c352756228fffd0c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 15:52:03 2011 +0200

    Pin on newer versions.

commit 65fbe3191060f2bb73449025736fda432cff86c9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 14:20:57 2011 +0200

    Return a webdavs:// url instead of https:// using
    setConnectionUrl method.

commit 0229a2ee60490f7bd19df788b6a9fe2add50776a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 14:18:55 2011 +0200

    Adding setConnectionUrl in librecipe to return url in parameter xml.

commit 6656c27d783035f0f74098a1c4a1c6b5a000e877
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 14:01:15 2011 +0200

    Adding right dependency to apache-php component

commit cc7cafea095693d47326c497b81ab74f86a2ac53
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 27 13:57:45 2011 +0200

    Remove "lampfailover" software release and recipe

commit 7692283be83a2b9efd9b956b88b0d1418ce9fd3f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 26 10:34:10 2011 +0200

    Fix mariadb backup.

    The file moving was not working if the dump.sql.gz was already
    here.

commit f859e455c6da2ebbcecf82556207f3c6d42a0108
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 22 16:15:28 2011 +0200

    Fix: adding duplicity to mariadb software.cfg

commit 98a1bfd57cac4b2de94001b0ccb4a0dede2c1b4a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 22 16:13:23 2011 +0200

    Updating lampfailover to stunnel client requesting a mariadb

commit 695dc79eb77198cda44191bf05db30f44eb3b8b7
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 18:07:21 2011 +0200

    Put the right md5sums, my mistake

commit 3a360e48105835602cf791d0a61cc7908aa0bb5d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 17:33:10 2011 +0200

    Use the right entry point for this software release

commit 6aebcb0f95199ab229cbf4fc3539903305e65018
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 17:32:59 2011 +0200

    lampfailover recipe cleanup

commit 9ecc25566dc76385f9654daecdcd964c6002fa4a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 17:13:58 2011 +0200

    Remove useless SSL Certificate backup from lampfailover
    as well

commit 8dac32843ce8d85e9ed5f55bdc7ba95f4b35bf79
Merge: 74418d0 e3e07fc
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 17:12:52 2011 +0200

    Merge branch 'mariadb-failover' into lamp-failover

commit e3e07fccc4d274511968cad2b247f6c19cec68b3
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 17:11:20 2011 +0200

    Remove useless SSL certificates backup

commit 74418d061035fa971a85ba1ccf07100033c57672
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 16:47:21 2011 +0200

    Recover format, runner and conditionalrunner recipes
    used in former mariadb failover, now named lampfailover.

    Data recover from 94d490bf17859901d8d744b8690af264f4f011eb

commit f8231a3a889bf609ebe63356937b6d5ac21a2475
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 16:30:49 2011 +0200

    Add entry point for lamp.failover

commit 210d1153a989f3edec0eaab2efe05a024780702d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 16:29:51 2011 +0200

    Adding lampfailover recipe and software release

    Just a copy of mariadb recipe and software release from
    94d490bf17859901d8d744b8690af264f4f011eb commit.

commit f96fc3f64ae973a115d4d0111734c9a21845ee3c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 15:28:04 2011 +0200

    Back to the original mariadb software release and mysql recipe
    with mariadb-failover improvements kepts except the failover.

commit 94d490bf17859901d8d744b8690af264f4f011eb
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 10:20:53 2011 +0200

    Revert to commmit 027183d9890c2b9d85363333a6362fd2ff8b9181

commit 2fae9cf4cb7ba255f5342d34a8ccf7a1daf695df
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 09:56:18 2011 +0200

    Revert MySQL recipe to de0f3a95

commit 84ba123757ccd0fc1ed89395dc77d395018fdd07
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 09:53:56 2011 +0200

    Rename mysql recipe in lamp-failover

commit 2b1aa06c47a7b012c564ab507c93a334cc49d27b
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 09:51:17 2011 +0200

    Revert mariadb software release to
    399a0d40

commit a6475d6e991c58e77ca59f9f88c88a158b5be76f
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Sep 21 09:50:45 2011 +0200

    Rename mariadb software release to lamp-failover.

commit 027183d9890c2b9d85363333a6362fd2ff8b9181
Merge: bb5b78c de7cb090
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Tue Sep 20 18:04:28 2011 +0200

    Merge branch 'master' into mariadb-failover

commit bb5b78c3c8bdab99c98938d9735696d60bbe8209
Merge: ca2b0f7 7cc1f011
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 17:13:13 2011 +0200

    Merge branches 'master' and 'mariadb-failover' into mariadb-failover

commit ca2b0f77ae858d9151a18ea9f9f53bf4cd033695
Merge: ccd0c38 1e59da9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 16:45:06 2011 +0200

    Merge branch 'mariadb-backup' into mariadb-failover

    Conflicts:
    	setup.py
    	slapos/recipe/mysql/__init__.py
    	software/mariadb/instance.cfg
    	software/mariadb/software.cfg

commit 1e59da9dd0b08a1dd764cc11f831ff860ff46a87
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 16:40:43 2011 +0200

    Fix md5sum of instance.cfg

commit 19515a4598f25b1643aaf41b310d061469db77f4
Merge: e754c1a 9000b20
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 16:39:40 2011 +0200

    Merge branch 'webdav' into mariadb-backup

commit e754c1a051ea5c93bc9dba05d700c95b721d2808
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 14:55:36 2011 +0200

    Minor: fix the url

commit 8ff5bcada5c6939972190af22ef57f9ed15d485a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 14:50:12 2011 +0200

    Fix the url of instance.cfg of davstorage

commit 9000b20d35ab12b59233b1736de5416e915c6ff1
Merge: 576e95e0 a0ed7bea
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 20 14:46:38 2011 +0200

    Merge commit 'slapos-0.44' into webdav

    Conflicts:
    	slapos/recipe/davstorage/__init__.py
    	software/davstorage/software.cfg

commit b98a73dd15c0853f80792cc183b30282724b3503
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 17:57:58 2011 +0200

    Minor: mistake in the parameter order

commit c6d6e6a19cb252f196987d053bece2edbabe60f6
Merge: afdfa59 facf9df5
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Tue Sep 20 10:34:27 2011 +0200

    Merge branch 'master' into mariadb-backup

commit afdfa59bcfa2d7fcf179fbbc7c64aed9373e8a17
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Mon Sep 19 19:10:24 2011 +0200

    Pin versions.

commit 8338f226b3e7de16e990d34ea2c5cb0037089bdc
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 18:54:04 2011 +0200

    Linking python with made in slapos libxml

commit 492add6218d90427ad16f47064cd7de9f3a441ce
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 18:47:55 2011 +0200

    Add software.cfg url of davstorage

commit fc897da0ec2c18212e3838fa6775e43a1133088b
Merge: e55a243 9be05e37
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 18:27:00 2011 +0200

    Merge branch 'master' into mariadb-backup

    Conflicts:
    	slapos/recipe/mysql/__init__.py
    	software/davstorage/software.cfg

commit e55a243673fdd5bccb281b070f0e97832bba696d
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 14:41:57 2011 +0200

    Minor: removed unused variable "returncode"

commit 5a863d2e034782e2f58bbab01a0eb57d581a0b30
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 14:40:00 2011 +0200

    Use subprocess.check_call instead of checking return code of
    subprocess.call()

commit 91fc5e8d4893eec41cc651ef2510c4feaab85eee
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 14:33:24 2011 +0200

    Minor: removing useless commented code in davstorage software.cfg

commit 753fc3084429aefe9381f2e0f438c4303cadf6e4
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 14:27:48 2011 +0200

    Minor: removing rebootstrap of the software release

    Another new python for mariadb is useless.

commit 62b3d3959834921005e7b23f1588644448e6d4d5
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 14:23:52 2011 +0200

    Partially revert 3728936e6a1b2728bcdefc70298bb4adb69a777e in order to
    clean the git history.

commit 05a458a71311298b2620cebb3122e6a8fe54c622
Merge: 87f61f7 a33be315
Author: Łukasz Nowak <luke@nexedi.com>
Date:   Mon Sep 19 13:35:17 2011 +0200

    Merge branch 'master' into mariadb-backup

commit 87f61f793058b9a2e5584b31691c47bc720bcca8
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 13:28:33 2011 +0200

    Minor: removing trailing spaces

commit 7bf410ecb9e3f1966c579a327ed4d5df80193046
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 13:08:53 2011 +0200

    Minor: Adding import-script.sh I forgot to commit

commit 7435626070c300c4e4e579c632ccf4700dc7aab8
Merge: 0510486 13d6e1d3
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 19 11:55:33 2011 +0200

    Merge branch 'master' into mariadb-backup

    Conflicts:
    	slapos/recipe/mysql/__init__.py

commit ccd0c3813c74806c55329f8387e955bbaf51005c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 12 16:32:03 2011 +0200

    Adding backup restoration to mariadb software release

commit 24740e670cc4e7ab4ec43c4a029b064ec49dcb2c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 17:57:58 2011 +0200

    Minor: mistake in the parameter order

commit 05104863cd426d4977ceaed6d2509764dd46b4bd
Merge: 1b43ef4 4299234e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 17:24:44 2011 +0200

    Merge branch 'master' into mariadb-backup

commit fdbe06fd2dbe910932a3ee533b9f18572d7e25fb
Merge: 9f61de0 4299234e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 17:16:59 2011 +0200

    Merge branch 'master' into mariadb-failover

commit 1b43ef420bc23be6cec791b690ad38b1468cbcc2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 15:56:35 2011 +0200

    Trim the branch to just add davstorage backup

commit 9f61de06d0da2c42281703409b55e94005125d3c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 15:37:43 2011 +0200

    Switch MySQL Backup to duplicity with webdav remote server

commit 2fa9ae925a4629424bd728ec059ea59e9c2a63be
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 15:34:40 2011 +0200

    Minor: fix the buildout of duplicity to work

commit 51e512e5ecfc9e23823e8ba02f168eb34ac7fca4
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 8 14:11:07 2011 +0200

    Adding duplicity software release

commit 576e95e0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Sep 6 09:32:05 2011 +0200

    Add versions line to davstorage software release

commit 094abfd41ba87f340c52dfd540f09b8f5b2fbb2c
Merge: f59c5c5 150c49e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 5 14:04:03 2011 +0200

    Merge branch 'webdav' into mariadb-failover

commit 150c49e3cd12e3b8f935c864ccc292c082049289
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 5 13:15:40 2011 +0200

    Working webdav storage

commit 159054aec04f13ed0e5687a8466bd4803a8c1350
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Sep 2 17:25:08 2011 +0200

    Link with the right dbm

commit 7bd8c5ad00c53a7830dd45093656907978d26c21
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 1 09:35:31 2011 +0200

    Enable dav-fs module on apache compilation

commit e1a4051a
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Sep 5 13:15:40 2011 +0200

    Working webdav storage

commit 20769516
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Sep 2 17:25:08 2011 +0200

    Link with the right dbm

commit 7d959f9b
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Sep 1 09:35:31 2011 +0200

    Enable dav-fs module on apache compilation

commit 0c699697
Author: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date:   Wed Aug 31 08:04:24 2011 +0200

    version up : apache httpd 2.2.20 including a fix for CVE-2011-3192.

commit cedcfb49
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Aug 31 17:40:35 2011 +0200

    Adding webdav option on apache compilation

commit f59c5c549360ac8d5e16b3c510305502a41880f6
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Aug 31 15:13:11 2011 +0200

    Adding pull_backup_server on mariadb

commit 3728936e6a1b2728bcdefc70298bb4adb69a777e
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Aug 31 15:12:35 2011 +0200

    Switch mariadb to dropbear

commit dbe4efeda490d8f201d39ba1d1f2cac2e69c38f3
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Aug 31 15:03:09 2011 +0200

    Linking dropbear with slapos zlib

commit f6c9b477a9ba4fd67ccc0b19e2a1a8adfa767b11
Merge: bb80ae9 1a85f89
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 30 14:05:24 2011 +0200

    Merging from pull-backup-server branch

commit bb80ae9bd341cfdf2663f7cff85b2a2cffc2cb32
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 30 13:58:41 2011 +0200

    Switch from OpenSSH client to Dropbear client

commit d0cf9dfc9f34f7ab3bc747018bcb47f10afa8170
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 30 13:57:21 2011 +0200

    Minor: Dropbear buildout fine tuning

commit 5f50ae5c79cce438ee0eabbede9590c797156dad
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 30 09:08:41 2011 +0200

    Add ipv6 patch for dropbear

    Took here :
    <https://lists.openwrt.org/pipermail/openwrt-devel/2009-May/004299.html>

commit 80a2e24a8c6c54bd04d22b1b96710faa1c354bc2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Aug 29 17:54:36 2011 +0200

    Updating the pull_backup_server buildout

commit 8736902307cde71ae6f95e257b3e89fef7d721db
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Aug 29 17:51:19 2011 +0200

    Replacing openssh buildout by dropbear one.

    Adding my own dropbear patch which was submitted to
    dropbear developpers.

commit 1a85f89df53a6c770371935f24448d5c12c1f75c
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Aug 25 11:54:11 2011 +0200

    Minor: use internal writeFile function instead open(..., 'w')

commit cc1be9293072f9b95772dcc666cbbc2bf77b6bf2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Thu Aug 25 09:40:57 2011 +0200

    Adding rdiff_backup installation and configuration

commit 38882163cb12d965ba0f1e3c87de9775ffe11ed0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Wed Aug 24 09:48:07 2011 +0200

    Minor: adding ssh compression

commit eb5bff2affcc6a4b6e5d332a2c59c9663839c6a0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 17:35:57 2011 +0200

    Minor: fix adding ssh_config template

commit 07fcca2381cb9167779aa18434b0d8e1514d6403
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 17:32:24 2011 +0200

    Minor: fix of error due to ssh_conf to self.ssh_conf renaming

commit c3f7c4944e960b463166e000422888bec13556a0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 16:47:32 2011 +0200

    Adding ssh_config file generation

commit 4c6ebe52eab924eca18df4950a2bce6f10513971
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 16:43:52 2011 +0200

    Minor: adding consistency to known_hosts file creation

commit c814412504d1b9682c180e40507a861ec125ebb9
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 16:40:50 2011 +0200

    Minor: put the parameter dict reading at the begining

commit 956db5d669d25bfbb0f0675a1d06d1c05a4056ad
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 16:39:09 2011 +0200

    Minor: save sshd_conf options

commit 2535efd9dc003474b31480b529a1ecf2b057e2c0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 15:11:15 2011 +0200

    Minor: adding template for known_hosts file

commit 02f865391d3a95cbe87f7461696dec339ffe32e2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 12:58:55 2011 +0200

    Add known_hosts file generation

commit 411052f4452c273674a6e3d5497807e6f6041948
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 12:57:40 2011 +0200

    Minor: strip the ssh key value.

commit 669996d528a3177a601b60ad0767b8e5c6791455
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 12:56:35 2011 +0200

    Minor: dirty fix to avoid "unused option" message

commit 8dda614bcb389ae57398c020eafcdabf77354281
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 12:55:08 2011 +0200

    Minor: save cron.d path

commit ca95838a0512a9065fa08f51152791ca918fadb0
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 11:18:55 2011 +0200

    Minor: code condensation

commit 1e251053ab1a3eb7acd2bf5af42c075f56a1fbdb
Author: Antoine Catton <acatton@tiolive.com>
Date:   Tue Aug 23 10:38:46 2011 +0200

    Pull Backup Server recipe first draft

commit 9bf0841e55078e5f5d4ea822f05cbb0b2840f6d2
Author: Antoine Catton <acatton@tiolive.com>
Date:   Mon Aug 22 13:18:08 2011 +0200

    Minor: code cleaning on mysql recipe

commit 91a5ec43e7835acc283a88733b0edcc146013b5b
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Aug 19 15:47:01 2011 +0200

    Minor: adding sshd_binary option to mariadb

commit ba53f1ed65021273f0c5797830ec164963391249
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Aug 19 15:12:44 2011 +0200

    Adding openssh part to mariadb software release

commit 4fa4540c300e62322ff0eddd0609a02ad5d20f26
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Aug 19 15:11:47 2011 +0200

    Adding openssh part

commit 15c4b3203aabefde58dcfcf43fafb3174290a671
Author: Antoine Catton <acatton@tiolive.com>
Date:   Fri Aug 19 13:25:42 2011 +0200

    Minor: clean up white spaces in mysql recipe
parent af93196e
...@@ -8,3 +8,4 @@ downloads/ ...@@ -8,3 +8,4 @@ downloads/
eggs/ eggs/
parts/ parts/
slapos.cookbook.egg-info slapos.cookbook.egg-info
.*.swp
...@@ -39,8 +39,13 @@ setup(name=name, ...@@ -39,8 +39,13 @@ setup(name=name,
zip_safe=True, zip_safe=True,
entry_points={ entry_points={
'zc.buildout': [ 'zc.buildout': [
'certificate_authority = slapos.recipe.certificate_authority:Recipe',
'certificate_authority.request = slapos.recipe.certificate_authority:Request',
'cron = slapos.recipe.dcron:Recipe',
'cron.d = slapos.recipe.dcron:Part',
'download = slapos.recipe.download:Recipe', 'download = slapos.recipe.download:Recipe',
'davstorage = slapos.recipe.davstorage:Recipe', 'davstorage = slapos.recipe.davstorage:Recipe',
'duplicity = slapos.recipe.duplicity:Recipe',
'erp5 = slapos.recipe.erp5:Recipe', 'erp5 = slapos.recipe.erp5:Recipe',
'erp5testnode = slapos.recipe.erp5testnode:Recipe', 'erp5testnode = slapos.recipe.erp5testnode:Recipe',
'helloworld = slapos.recipe.helloworld:Recipe', 'helloworld = slapos.recipe.helloworld:Recipe',
...@@ -51,16 +56,24 @@ setup(name=name, ...@@ -51,16 +56,24 @@ setup(name=name,
'libcloudrequest = slapos.recipe.libcloudrequest:Recipe', 'libcloudrequest = slapos.recipe.libcloudrequest:Recipe',
'memcached = slapos.recipe.memcached:Recipe', 'memcached = slapos.recipe.memcached:Recipe',
'mysql = slapos.recipe.mysql:Recipe', 'mysql = slapos.recipe.mysql:Recipe',
'mkdirectory = slapos.recipe.mkdirectory:Recipe',
'nbdserver = slapos.recipe.nbdserver:Recipe', 'nbdserver = slapos.recipe.nbdserver:Recipe',
'nosqltestbed = slapos.recipe.nosqltestbed:NoSQLTestBed', 'nosqltestbed = slapos.recipe.nosqltestbed:NoSQLTestBed',
'lamp = slapos.recipe.lamp:Request', 'lamp = slapos.recipe.lamp:Request',
'lamp.request = slapos.recipe.lamp:Request', 'lamp.request = slapos.recipe.lamp:Request',
'lamp.static = slapos.recipe.lamp:Static', 'lamp.static = slapos.recipe.lamp:Static',
'lamp.simple = slapos.recipe.lamp:Simple', 'lamp.simple = slapos.recipe.lamp:Simple',
'logrotate = slapos.recipe.logrotate:Recipe',
'logrotate.d = slapos.recipe.logrotate:Part',
'publishurl = slapos.recipe.publishurl:Recipe',
'proactive = slapos.recipe.proactive:Recipe', 'proactive = slapos.recipe.proactive:Recipe',
'request = slapos.recipe.request:Recipe',
'sheepdogtestbed = slapos.recipe.sheepdogtestbed:SheepDogTestBed', 'sheepdogtestbed = slapos.recipe.sheepdogtestbed:SheepDogTestBed',
'softwaretype = slapos.recipe.softwaretype:Recipe',
'siptester = slapos.recipe.siptester:SipTesterRecipe', 'siptester = slapos.recipe.siptester:SipTesterRecipe',
'simplelogger = slapos.recipe.simplelogger:Recipe',
'slaprunner = slapos.recipe.slaprunner:Recipe', 'slaprunner = slapos.recipe.slaprunner:Recipe',
'stunnel = slapos.recipe.stunnel:Recipe',
'testnode = slapos.recipe.testnode:Recipe', 'testnode = slapos.recipe.testnode:Recipe',
'vifib = slapos.recipe.vifib:Recipe', 'vifib = slapos.recipe.vifib:Recipe',
'xwiki = slapos.recipe.xwiki:Recipe', 'xwiki = slapos.recipe.xwiki:Recipe',
......
mkdirectory
===========
mkdirectory loops on its options and create the directory joined
.. Note::
Use a slash ``/`` as directory separator. Don't use system dependent separator.
The slash will be parsed and replace by the operating system right separator.
Only use relative directory to the buildout root directory.
The created directory won't be added to path list.
##############################################################################
#
# 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 hashlib
import ConfigParser
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def setPath(self):
self.ca_dir = self.options['ca-dir']
self.request_directory = self.options['requests-directory']
self.ca_private = self.options['ca-private']
self.ca_certs = self.options['ca-certs']
self.ca_newcerts = self.options['ca-newcerts']
self.ca_crl = self.options['ca-crl']
self.ca_key_ext = '.key'
self.ca_crt_ext = '.crt'
def install(self):
path_list = []
# XXX: We gotta find better a way to get these options
ca_country_code = 'XX'
ca_email = 'xx@example.com'
ca_state = 'State',
ca_city = 'City'
ca_company = 'Company'
# XXX: end
self.setPath()
config = dict(ca_dir=self.ca_dir, request_dir=self.request_directory)
for f in ['crlnumber', 'serial']:
if not os.path.exists(os.path.join(self.ca_dir, f)):
open(os.path.join(self.ca_dir, f), 'w').write('01')
if not os.path.exists(os.path.join(self.ca_dir, 'index.txt')):
open(os.path.join(self.ca_dir, 'index.txt'), 'w').write('')
openssl_configuration = os.path.join(self.ca_dir, 'openssl.cnf')
config.update(
working_directory=self.ca_dir,
country_code=ca_country_code,
state=ca_state,
city=ca_city,
company=ca_company,
email_address=ca_email,
)
self.createFile(openssl_configuration, self.substituteTemplate(
self.getTemplateFilename('openssl.cnf.ca.in'), config))
ca_wrapper = self.createPythonScript(
self.options['wrapper'],
'%s.certificate_authority.runCertificateAuthority' % __name__,
dict(
openssl_configuration=openssl_configuration,
openssl_binary=self.options['openssl-binary'],
certificate=os.path.join(self.ca_dir, 'cacert.pem'),
key=os.path.join(self.ca_private, 'cakey.pem'),
crl=self.ca_crl,
request_dir=self.request_directory
)
)
path_list.append(ca_wrapper)
return path_list
class Request(Recipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
self.setPath()
key_file = self.options['key-file']
cert_file = self.options['cert-file']
name = self.options['name']
hash_ = hashlib.sha512(name).hexdigest()
key = os.path.join(self.ca_private, hash_ + self.ca_key_ext)
certificate = os.path.join(self.ca_certs, hash_ + self.ca_crt_ext)
parser = ConfigParser.RawConfigParser()
parser.add_section('certificate')
parser.set('certificate', 'name', name)
parser.set('certificate', 'key_file', key)
parser.set('certificate', 'certificate_file', certificate)
parser.write(open(os.path.join(self.request_directory, hash_), 'w'))
for link in [key_file, cert_file]:
if os.path.islink(link):
os.unlink(link)
elif os.path.exists(link):
raise OSError("%r file should be a symbolic link.")
os.symlink(key, key_file)
os.symlink(certificate, cert_file)
wrapper = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute_wait',
[ [self.options['executable']],
[certificate, key] ],
)
return [key_file, cert_file, wrapper]
...@@ -101,12 +101,17 @@ class CertificateAuthority: ...@@ -101,12 +101,17 @@ class CertificateAuthority:
'certificate_file')): 'certificate_file')):
print 'Created certificate %r' % parser.get('certificate', 'name') print 'Created certificate %r' % parser.get('certificate', 'name')
def runCertificateAuthority(args): def runCertificateAuthority(ca_conf):
ca_conf = args[0]
ca = CertificateAuthority(ca_conf['key'], ca_conf['certificate'], ca = CertificateAuthority(ca_conf['key'], ca_conf['certificate'],
ca_conf['openssl_binary'], ca_conf['openssl_configuration'], ca_conf['openssl_binary'], ca_conf['openssl_configuration'],
ca_conf['request_dir']) ca_conf['request_dir'])
while True: while True:
ca.checkAuthority() ca.checkAuthority()
ca.checkRequestDir() ca.checkRequestDir()
# XXX
# Antoine: I really don't like that at all. It wastes useful CPU time.
# I think it would be a greater idea to use pyinotify
# <http://pyinotify.sourceforge.net/>
# Or we could use select() with socket as well.
time.sleep(60) time.sleep(60)
# end XXX
##############################################################################
#
# 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
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
self.logger.info("Installing dcron...")
path_list = []
cronstamps = self.options['cronstamps']
cron_d = self.options['cron-entries']
crontabs = self.options['crontabs']
catcher = self.options['catcher']
binary = self.options['binary']
script = self.createPythonScript(binary,
'slapos.recipe.librecipe.execute.execute',
[self.options['dcrond-binary'].strip(), '-s', cron_d, '-c', crontabs,
'-t', cronstamps, '-f', '-l', '5', '-M', catcher]
)
path_list.append(script)
self.logger.debug('Main cron executable created at : %r', script)
self.logger.info("dcron successfully installed.")
return path_list
class Part(GenericBaseRecipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
cron_d = self.options['cron-entries']
filename = os.path.join(cron_d, 'name')
with open(filename, 'w') as part:
part.write('%(frequency)s %(command)s\n' % {
'frequency': self.options['frequency'],
'command': self.options['command'],
})
return [filename]
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
remote_url = self.options['remote_backup']
backup_directory = self.options['directory']
wrapper = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute',
[self.options['duplicity_binary'], '--no-encryption',
backup_directory, remote_url]
)
return [wrapper]
...@@ -36,8 +36,13 @@ import time ...@@ -36,8 +36,13 @@ import time
import re import re
import urlparse import urlparse
# Use to do from slapos.recipe.librecipe import GenericBaseRecipe
from generic import GenericBaseRecipe
from genericslap import GenericSlapRecipe
class BaseSlapRecipe: class BaseSlapRecipe:
"""Base class for all slap.recipe.*""" """Base class for all slap.recipe.*"""
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
"""Default initialisation""" """Default initialisation"""
self.name = name self.name = name
...@@ -95,6 +100,9 @@ class BaseSlapRecipe: ...@@ -95,6 +100,9 @@ class BaseSlapRecipe:
# setup egg to give possibility to generate scripts # setup egg to give possibility to generate scripts
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options) self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
# Hook options
self._options(options)
# setup auto uninstall/install # setup auto uninstall/install
self._setupAutoInstallUninstall() self._setupAutoInstallUninstall()
...@@ -248,6 +256,10 @@ class BaseSlapRecipe: ...@@ -248,6 +256,10 @@ class BaseSlapRecipe:
"""Hook which shall be implemented in children class""" """Hook which shall be implemented in children class"""
raise NotImplementedError('Shall be implemented by subclass') raise NotImplementedError('Shall be implemented by subclass')
def _options(self, options):
"""Hook which can be implemented in children class"""
pass
def createPromiseWrapper(self, promise_name, file_content): def createPromiseWrapper(self, promise_name, file_content):
"""Create a promise wrapper. """Create a promise wrapper.
...@@ -259,12 +271,16 @@ class BaseSlapRecipe: ...@@ -259,12 +271,16 @@ class BaseSlapRecipe:
self._writeExecutable(promise_path, file_content) self._writeExecutable(promise_path, file_content)
return promise_path return promise_path
def setConnectionUrl(self, scheme, host, path='', params='', query='', def setConnectionUrl(self, *args, **kwargs):
fragment='', port=None, auth=None): url = self._unparseUrl(*args, **kwargs)
"""Set the ConnectionDict to a dict with only one Universal Resource self.setConnectionDict(dict(url=url))
Locator.
auth can be either a login string or a tuple (login, password). def _unparseUrl(self, scheme, host, path='', params='', query='',
fragment='', port=None, auth=None):
"""Join a url with auth, host, and port.
* auth can be either a login string or a tuple (login, password).
* if the host is an ipv6 address, brackets will be added to surround it.
""" """
# XXX-Antoine: I didn't find any standard module to join an url with # XXX-Antoine: I didn't find any standard module to join an url with
...@@ -288,4 +304,6 @@ class BaseSlapRecipe: ...@@ -288,4 +304,6 @@ class BaseSlapRecipe:
netloc += ':%s' % port netloc += ':%s' % port
url = urlparse.urlunparse((scheme, netloc, path, params, query, fragment)) url = urlparse.urlunparse((scheme, netloc, path, params, query, fragment))
self.setConnectionDict(dict(url=url))
return url
...@@ -23,6 +23,8 @@ def execute_wait(args): ...@@ -23,6 +23,8 @@ def execute_wait(args):
ready = False ready = False
if ready: if ready:
break break
# XXX: It's the same as ../ca/certificate_authoritiy.py
# We should use pyinotify as well. Or select() on socket.
time.sleep(sleep) time.sleep(sleep)
os.execv(exec_list[0], exec_list + sys.argv[1:]) os.execv(exec_list[0], exec_list + sys.argv[1:])
......
##############################################################################
#
# 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 logging
import os
import sys
import inspect
import pkg_resources
import zc.buildout
class GenericBaseRecipe(object):
TRUE_VALUES = ['y', 'yes', '1', 'true']
def __init__(self, buildout, name, options):
"""Recipe initialisation"""
self.name = name
self.options = options
self.buildout = buildout
self.logger = logging.getLogger(name)
self._options(options) # Options Hook
self._ws = self.getWorkingSet()
def update(self):
"""By default update method does the same thing than install"""
return self.install()
def install(self):
"""Install method of the recipe. This must be overriden in child
classes """
raise NotImplementedError("install method is not implemented.")
def getWorkingSet(self):
"""If you want do override the default working set"""
egg = zc.recipe.egg.Egg(self.buildout, 'slapos.cookbook',
self.options.copy())
requirements, ws = egg.working_set()
return ws
def _options(self, options):
"""Options Hook method. This method can be overriden in child classes"""
return
def createFile(self, name, content, mode=0600):
"""Create a file with content
The parent directory should exists, else it would raise IOError"""
with open(name, 'w') as fileobject:
fileobject.write(content)
os.chmod(fileobject.name, mode)
return os.path.abspath(name)
def createExecutable(self, name, content, mode=0700):
return self.createFile(name, content, mode)
def createPythonScript(self, name, absolute_function, arguments=''):
"""Create a python script using zc.buildout.easy_install.scripts
* function should look like 'module.function', or only 'function'
if it is a builtin function."""
absolute_function = tuple(absolute_function.rsplit('.', 1))
if len(absolute_function) == 1:
absolute_function = ('__builtin__',) + absolute_function
if len(absolute_function) != 2:
raise ValueError("A non valid function was given")
module, function = absolute_function
path, filename = os.path.split(os.path.abspath(name))
script = zc.buildout.easy_install.scripts(
[(filename, module, function)], self._ws, sys.executable,
path, arguments=arguments)[0]
return script
def substituteTemplate(self, template_location, mapping_dict):
"""Read from file template_location an substitute content with
mapping_dict douing a dummy python format."""
with open(template_location, 'r') as template:
return template.read() % mapping_dict
def getTemplateFilename(self, template_name):
caller = inspect.stack()[1]
caller_frame = caller[0]
name = caller_frame.f_globals['__name__']
return pkg_resources.resource_filename(name,
'template/%s' % template_name)
def generatePassword(self, len_=32):
# TODO: implement a real password generator which remember the last
# call.
return "insecure"
def isTrueValue(self, value):
return str(value).lower() in GenericBaseRecipe.TRUE_VALUES
def optionIsTrue(self, optionname, default=None):
return self.isTrueValue(self.options[optionname])
##############################################################################
#
# 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 logging
from slapos import slap
import zc.buildout
import zc.recipe.egg
import time
import re
import urlparse
class GenericSlapRecipe(object):
"""Base class for all slap.recipe.*"""
def __init__(self, buildout, name, options):
"""Default initialisation"""
self.name = name
options['eggs'] = 'slapos.cookbook'
self.options = options
self.logger = logging.getLogger(self.name)
self.slap = slap.slap()
# SLAP related information
slap_connection = buildout['slap-connection']
self.computer_id = slap_connection['computer-id']
self.computer_partition_id = slap_connection['partition-id']
self.server_url = slap_connection['server-url']
self.software_release_url = slap_connection['software-release-url']
self.key_file = slap_connection.get('key-file')
self.cert_file = slap_connection.get('cert-file')
# setup egg to give possibility to generate scripts
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
# Hook options
self._options(options)
# setup auto uninstall/install
self._setupAutoInstallUninstall()
def _setupAutoInstallUninstall(self):
"""By default SlapOS recipes are reinstalled each time"""
# Note: It is possible to create in future subclass which will do no-op in
# this method
self.options['slapos-timestamp'] = str(time.time())
def install(self):
self.slap.initializeConnection(self.server_url, self.key_file,
self.cert_file)
self.computer_partition = self.slap.registerComputerPartition(
self.computer_id,
self.computer_partition_id)
self.request = self.computer_partition.request
self.setConnectionDict = self.computer_partition.setConnectionDict
self.parameter_dict = self.computer_partition.getInstanceParameterDict()
# call children part of install
path_list = self._install()
return path_list
update = install
def _install(self):
"""Hook which shall be implemented in children class"""
raise NotImplementedError('Shall be implemented by subclass')
def _options(self, options):
"""Hook which can be implemented in children class"""
pass
def setConnectionUrl(self, *args, **kwargs):
url = self._unparseUrl(*args, **kwargs)
self.setConnectionDict(dict(url=url))
def _unparseUrl(self, scheme, host, path='', params='', query='',
fragment='', port=None, auth=None):
"""Join a url with auth, host, and port.
* auth can be either a login string or a tuple (login, password).
* if the host is an ipv6 address, brackets will be added to surround it.
"""
# XXX-Antoine: I didn't find any standard module to join an url with
# login, password, ipv6 host and port.
# So instead of copy and past in every recipe I factorized it right here.
netloc = ''
if auth is not None:
auth = tuple(auth)
netloc = str(auth[0]) # Login
if len(auth) > 1:
netloc += ':%s' % auth[1] # Password
netloc += '@'
# host is an ipv6 address whithout brackets
if ':' in host and not re.match(r'^\[.*\]$', host):
netloc += '[%s]' % host
else:
netloc += str(host)
if port is not None:
netloc += ':%s' % port
url = urlparse.urlunparse((scheme, netloc, path, params, query, fragment))
return url
##############################################################################
#
# 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
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
path_list = []
logrotate_backup = self.options['backup']
logrotate_d = self.options['logrotate-entries']
logrotate_conf_file = self.options['conf']
logrotate_conf = []
logrotate_conf.append("include %s" % logrotate_d)
logrotate_conf.append("olddir %s" % logrotate_backup)
logrotate_conf.append("dateext")
frequency = 'daily'
if 'frequency' in self.options:
frequency = self.options['frequency']
logrotate_conf.append(frequency)
num_rotate = 30
if 'num-rotate' in self.options:
num_rotate = self.options['num-rotate']
logrotate_conf.append("rotate %s" % num_rotate)
logrotate_conf.append("compress")
logrotate_conf.append("compresscmd %s" % self.options['gzip-binary'])
logrotate_conf.append("compressoptions -9")
logrotate_conf.append("uncompresscmd %s" % self.options['gunzip-binary'])
logrotate_conf_file = self.createFile(logrotate_conf_file, '\n'.join(logrotate_conf))
logrotate_conf.append(logrotate_conf_file)
state_file = self.options['state-file']
logrotate = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.exceute.execute',
[self.options['logrotate-binary'], '-s', state_file, logrotate_conf_file, ]
)
path_list.append(logrotate)
return path_list
class Part(GenericBaseRecipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
logrotate_d = self.options['logrotate-entries']
part_path = os.path.join(logrotate_d, self.options['name'])
conf = []
if 'frequency' in self.options:
conf.append(self.options['frequency'])
if 'num-rotate' in self.options:
conf.append('rotate %s' % self.options['num-rotate'])
if 'post' in self.options:
conf.append("postrotate\n%s\nendscript" % self.options['post'])
if 'pre' in self.options:
conf.append("prerotate\n%s\nendscript" % self.options['pre'])
if self.optionIsTrue('sharedscripts', False):
conf.append("sharedscripts")
if self.optionIsTrue('notifempty', False):
conf.append('notifempty')
if self.optionIsTrue('create', True):
conf.append('create')
log = self.options['log']
self.createFile(os.path.join(logrotate_d, self.options['name']),
"%(logfiles)s {\n%(conf)s\n}" % {
'logfiles': log,
'conf': '\n'.join(conf),
}
)
return [part_path]
##############################################################################
#
# 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
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def _options(self, options):
self.directory = options.copy()
del self.directory['recipe']
str_mode = '0700'
if 'mode' in self.directory:
str_mode = self.directory['mode']
del self.directory['mode']
self.mode = int(str_mode, 8)
def install(self):
for directory in self.directory.values():
path = directory
if not os.path.exists(path):
os.mkdir(path, self.mode)
elif not os.path.isdir(path):
raise OSError("%s path exits, but it's not a directory.")
return []
...@@ -24,330 +24,135 @@ ...@@ -24,330 +24,135 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import BaseSlapRecipe from slapos.recipe.librecipe import GenericBaseRecipe
import hashlib
import os import os
import pkg_resources
import sys
import zc.buildout
import ConfigParser
import re
class Recipe(BaseSlapRecipe): class Recipe(GenericBaseRecipe):
def getTemplateFilename(self, template_name):
return pkg_resources.resource_filename(__name__,
'template/%s' % template_name)
def parseCmdArgument(self, arg): def _options(self, options):
if any([(i in arg) for i in ["'", ' ', "\\"]]): options['password'] = self.generatePassword()
return "'%s'" % re.sub(r"(\\|\')", r'\\\1', arg)
return arg
def _install(self): def install(self):
self.software_type = self.parameter_dict['slap_software_type'] path_list = []
self.path_list = []
self.requirements, self.ws = self.egg.working_set() template_filename = self.getTemplateFilename('my.cnf.in')
# self.cron_d is a directory, where cron jobs can be registered
self.cron_d = self.installCrond()
self.logrotate_d, self.logrotate_backup = self.installLogrotate()
mysql_conf = self.installMysqlServer(self.getLocalIPv4Address(), 45678) mysql_conf = dict(
self.mysql_backup_directory = mysql_conf['backup_directory'] ip=self.options['ip'],
data_directory=self.options['data-directory'],
ca_conf = self.installCertificateAuthority() tcp_port=self.options['port'],
key, certificate = self.requestCertificate('MySQL') pid_file=self.options['pid-file'],
socket=self.options['socket'],
stunnel_conf = self.installStunnel(self.getGlobalIPv6Address(), error_log=self.options['error-log'],
self.getLocalIPv4Address(), 12345, mysql_conf['tcp_port'], slow_query_log=self.options['slow-query-log'],
certificate, key, ca_conf['ca_crl'], mysql_database=self.options['database'],
ca_conf['certificate_authority_path']) mysql_user=self.options['user'],
mysql_password=self.options['password'],
self.linkBinary()
self.setConnectionUrl(scheme='mysqls',
host=stunnel_conf['public_ip'],
port=stunnel_conf['public_port'],
auth=(mysql_conf['mysql_user'],
mysql_conf['mysql_password']),
path=mysql_conf['mysql_database'])
return self.path_list
def linkBinary(self):
"""Links binaries to instance's bin directory for easier exposal"""
for linkline in self.options.get('link_binary_list', '').splitlines():
if not linkline:
continue
target = linkline.split()
if len(target) == 1:
target = target[0]
path, linkname = os.path.split(target)
else:
linkname = target[1]
target = target[0]
link = os.path.join(self.bin_directory, linkname)
if os.path.lexists(link):
if not os.path.islink(link):
raise zc.buildout.UserError(
'Target link already %r exists but it is not link' % link)
os.unlink(link)
os.symlink(target, link)
self.logger.debug('Created link %r -> %r' % (link, target))
self.path_list.append(link)
def installCrond(self):
timestamps = self.createDataDirectory('cronstamps')
cron_output = os.path.join(self.log_directory, 'cron-output')
self._createDirectory(cron_output)
catcher = zc.buildout.easy_install.scripts([('catchcron',
__name__ + '.catdatefile', 'catdatefile')], self.ws, sys.executable,
self.bin_directory, arguments=[cron_output])[0]
self.path_list.append(catcher)
cron_d = os.path.join(self.etc_directory, 'cron.d')
crontabs = os.path.join(self.etc_directory, 'crontabs')
self._createDirectory(cron_d)
self._createDirectory(crontabs)
wrapper = zc.buildout.easy_install.scripts([('crond',
'slapos.recipe.librecipe.execute', 'execute')], self.ws, sys.executable,
self.wrapper_directory, arguments=[
self.options['dcrond_binary'].strip(), '-s', cron_d, '-c', crontabs,
'-t', timestamps, '-f', '-l', '5', '-M', catcher]
)[0]
self.path_list.append(wrapper)
return cron_d
def installLogrotate(self):
"""Installs logortate main configuration file and registers its to cron"""
logrotate_d = os.path.abspath(os.path.join(self.etc_directory,
'logrotate.d'))
self._createDirectory(logrotate_d)
logrotate_backup = self.createBackupDirectory('logrotate')
logrotate_conf = self.createConfigurationFile("logrotate.conf",
"include %s" % logrotate_d)
logrotate_cron = os.path.join(self.cron_d, 'logrotate')
state_file = os.path.join(self.data_root_directory, 'logrotate.status')
open(logrotate_cron, 'w').write('0 0 * * * %s -s %s %s' %
(self.options['logrotate_binary'], state_file, logrotate_conf))
self.path_list.extend([logrotate_d, logrotate_conf, logrotate_cron])
return logrotate_d, logrotate_backup
def registerLogRotation(self, name, log_file_list, postrotate_script):
"""Register new log rotation requirement"""
open(os.path.join(self.logrotate_d, name), 'w').write(
self.substituteTemplate(self.getTemplateFilename(
'logrotate_entry.in'),
dict(file_list=' '.join(['"'+q+'"' for q in log_file_list]),
postrotate=postrotate_script, olddir=self.logrotate_backup)))
def installCertificateAuthority(self, ca_country_code='XX',
ca_email='xx@example.com', ca_state='State', ca_city='City',
ca_company='Company'):
self.ca_dir = os.path.join(self.data_root_directory, 'ca')
self._createDirectory(self.ca_dir)
self.ca_request_dir = os.path.join(self.ca_dir, 'requests')
self._createDirectory(self.ca_request_dir)
config = dict(ca_dir=self.ca_dir, request_dir=self.ca_request_dir)
self.ca_private = os.path.join(self.ca_dir, 'private')
self.ca_certs = os.path.join(self.ca_dir, 'certs')
self.ca_crl = os.path.join(self.ca_dir, 'crl')
self.ca_newcerts = os.path.join(self.ca_dir, 'newcerts')
self.ca_key_ext = '.key'
self.ca_crt_ext = '.crt'
for d in [self.ca_private, self.ca_crl, self.ca_newcerts, self.ca_certs]:
self._createDirectory(d)
for f in ['crlnumber', 'serial']:
if not os.path.exists(os.path.join(self.ca_dir, f)):
open(os.path.join(self.ca_dir, f), 'w').write('01')
if not os.path.exists(os.path.join(self.ca_dir, 'index.txt')):
open(os.path.join(self.ca_dir, 'index.txt'), 'w').write('')
openssl_configuration = os.path.join(self.ca_dir, 'openssl.cnf')
config.update(
working_directory=self.ca_dir,
country_code=ca_country_code,
state=ca_state,
city=ca_city,
company=ca_company,
email_address=ca_email,
)
self._writeFile(openssl_configuration, pkg_resources.resource_string(
__name__, 'template/openssl.cnf.ca.in') % config)
self.path_list.extend(zc.buildout.easy_install.scripts([
('certificate_authority',
__name__ + '.certificate_authority', 'runCertificateAuthority')],
self.ws, sys.executable, self.wrapper_directory, arguments=[dict(
openssl_configuration=openssl_configuration,
openssl_binary=self.options['openssl_binary'],
certificate=os.path.join(self.ca_dir, 'cacert.pem'),
key=os.path.join(self.ca_private, 'cakey.pem'),
crl=os.path.join(self.ca_crl),
request_dir=self.ca_request_dir
)]))
return dict(
ca_certificate=os.path.join(config['ca_dir'], 'cacert.pem'),
ca_crl=os.path.join(config['ca_dir'], 'crl'),
certificate_authority_path=config['ca_dir']
) )
def requestCertificate(self, name): mysql_binary = self.options['mysql-binary']
hash = hashlib.sha512(name).hexdigest() socket = self.options['socket'],
key = os.path.join(self.ca_private, hash + self.ca_key_ext) post_rotate = self.createPythonScript(
certificate = os.path.join(self.ca_certs, hash + self.ca_crt_ext) self.options['logrotate-post'],
parser = ConfigParser.RawConfigParser() 'slapos.recipe.librecipe.execute.execute',
parser.add_section('certificate') [mysql_binary, '--no-defaults', '-B', '--socket=%s' % socket, '-e',
parser.set('certificate', 'name', name) 'FLUSH LOGS']
parser.set('certificate', 'key_file', key)
parser.set('certificate', 'certificate_file', certificate)
parser.write(open(os.path.join(self.ca_request_dir, hash), 'w'))
return key, certificate
def installStunnel(self, public_ip, private_ip, public_port, private_port,
ca_certificate, key, ca_crl, ca_path):
"""Installs stunnel"""
template_filename = self.getTemplateFilename('stunnel.conf.in')
log = os.path.join(self.log_directory, 'stunnel.log')
pid_file = os.path.join(self.run_directory, 'stunnel.pid')
stunnel_conf = dict(
public_ip=public_ip,
private_ip=private_ip,
public_port=public_port,
pid_file=pid_file,
log=log,
cert = ca_certificate,
key = key,
ca_crl = ca_crl,
ca_path = ca_path,
private_port = private_port,
) )
stunnel_conf_path = self.createConfigurationFile("stunnel.conf", path_list.append(post_rotate)
self.substituteTemplate(template_filename,
stunnel_conf))
self.path_list.append(stunnel_conf_path)
wrapper = zc.buildout.easy_install.scripts([('stunnel',
'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws,
sys.executable, self.wrapper_directory, arguments=[
[self.options['stunnel_binary'].strip(), stunnel_conf_path],
[ca_certificate, key]]
)[0]
self.path_list.append(wrapper)
return stunnel_conf
def installMysqlServer(self, ip, port, database='db', user='user', mysql_conf_file = self.createFile(
template_filename=None, mysql_conf=None): self.options['conf-file'],
if mysql_conf is None: self.substituteTemplate(template_filename, mysql_conf)
mysql_conf = {}
backup_directory = self.createBackupDirectory('mysql')
if template_filename is None:
template_filename = self.getTemplateFilename('my.cnf.in')
error_log = os.path.join(self.log_directory, 'mysqld.log')
slow_query_log = os.path.join(self.log_directory, 'mysql-slow.log')
mysql_conf.update(
ip=ip,
data_directory=os.path.join(self.data_root_directory,
'mysql'),
tcp_port=port,
pid_file=os.path.join(self.run_directory, 'mysqld.pid'),
socket=os.path.join(self.run_directory, 'mysqld.sock'),
error_log=error_log,
slow_query_log=slow_query_log,
mysql_database=database,
mysql_user=user,
mysql_password=self.generatePassword(),
) )
self.registerLogRotation('mysql', [error_log, slow_query_log], path_list.append(mysql_conf_file)
'%(mysql_binary)s --no-defaults -B --user=root '
'--socket=%(mysql_socket)s -e "FLUSH LOGS"' % dict(
mysql_binary=self.options['mysql_binary'],
mysql_socket=mysql_conf['socket']))
self._createDirectory(mysql_conf['data_directory'])
mysql_conf_path = self.createConfigurationFile("my.cnf",
self.substituteTemplate(template_filename,
mysql_conf))
mysql_script_list = [] mysql_script_list = []
mysql_script_list.append(pkg_resources.resource_string(__name__,
'template/initmysql.sql.in') % { init_script = self.substituteTemplate(
'mysql_database': mysql_conf['mysql_database'], self.getTemplateFilename('initmysql.sql.in'),
'mysql_user': mysql_conf['mysql_user'], {
'mysql_password': mysql_conf['mysql_password']}) 'mysql_database': mysql_conf['mysql_database'],
'mysql_user': mysql_conf['mysql_user'],
'mysql_password': mysql_conf['mysql_password']
}
)
mysql_script_list.append(init_script)
mysql_script_list.append('EXIT') mysql_script_list.append('EXIT')
mysql_script = '\n'.join(mysql_script_list) mysql_script = '\n'.join(mysql_script_list)
self.path_list.extend(zc.buildout.easy_install.scripts([('mysql_update',
__name__ + '.mysql', 'updateMysql')], self.ws, mysql_upgrade_binary = self.options['mysql-upgrade-binary']
sys.executable, self.wrapper_directory, arguments=[dict( mysql_update = self.createPythonScript(
self.options['update-wrapper'],
'%s.mysql.updateMysql' % __name__,
dict(
mysql_script=mysql_script, mysql_script=mysql_script,
mysql_binary=self.options['mysql_binary'].strip(), mysql_binary=mysql_binary,
mysql_upgrade_binary=self.options['mysql_upgrade_binary'].strip(), mysql_upgrade_binary=mysql_upgrade_binary,
socket=mysql_conf['socket'], socket=socket,
)])) )
self.path_list.extend(zc.buildout.easy_install.scripts([('mysqld', )
__name__ + '.mysql', 'runMysql')], self.ws, path_list.append(mysql_update)
sys.executable, self.wrapper_directory, arguments=[dict(
mysql_install_binary=self.options['mysql_install_binary'].strip(), mysqld_binary = self.options['mysqld-binary']
mysqld_binary=self.options['mysqld_binary'].strip(), mysqld = self.createPythonScript(
data_directory=mysql_conf['data_directory'].strip(), self.options['wrapper'],
mysql_binary=self.options['mysql_binary'].strip(), '%s.mysql.runMysql' % __name__,
socket=mysql_conf['socket'].strip(), dict(
configuration_file=mysql_conf_path, mysql_install_binary=self.options['mysql-install-binary'],
)])) mysqld_binary=mysqld_binary,
self.path_list.extend([mysql_conf_path]) data_directory=mysql_conf['data_directory'],
mysql_binary=mysql_binary,
socket=socket,
configuration_file=mysql_conf_file,
)
)
path_list.append(mysqld)
# backup configuration # backup configuration
backup_directory = self.createBackupDirectory('mysql') mysqldump_binary = self.options['mysqldump-binary']
tmp_backup_directory = self.createBackupDirectory('mysql_pending') backup_directory = self.options['backup-directory']
mysqldump_cmdline_list = [self.options['mysqldump_binary'], pending_backup_dir = self.options['backup-pending-directory']
mysql_conf['mysql_database'], dump_filename = self.options['dumpname']
'-u', 'root',
'-S', mysql_conf['socket'].strip(), mysqldump_cmd = [mysqldump_binary,
'--single-transaction', '--opt', mysql_conf['mysql_database'],
] '-u', 'root',
mysqldump_cmdline_str = ' '.join( '-S', mysql_conf['socket'].strip(),
[self.parseCmdArgument(arg) for arg in mysqldump_cmdline_list] '--single-transaction', '--opt',
) ]
dump_filename = 'dump.sql.gz'
dump_file = os.path.join(backup_directory, dump_filename) dump_file = os.path.join(backup_directory, dump_filename)
tmpdump_file = os.path.join(tmp_backup_directory, dump_filename) tmpdump_file = os.path.join(pending_backup_dir, dump_filename)
mysql_backup_cron = os.path.join(self.cron_d, 'mysql_backup') backup_script = self.createPythonScript(
with open(mysql_backup_cron, 'w') as file_: self.options['backup-script'],
file_.write('0 0 * * * %(mysqldump)s | %(gzip)s > %(tmpdump)s' \ '%s.backup.do_backup' % __name__,
'&& mv -f %(tmpdump)s %(dumpfile)s' % { {
'mysqldump': mysqldump_cmdline_str, 'mysqldump': mysqldump_cmd,
'gzip': self.options['gzip_binary'], 'gzip': self.options['gzip-binary'],
'tmpdump': self.parseCmdArgument(tmpdump_file), 'tmpdump': tmpdump_file,
'dumpfile': self.parseCmdArgument(dump_file), 'dumpfile': dump_file,
} },
) )
self.path_list.append(mysql_backup_cron) path_list.append(backup_script)
mysql_conf.update(backup_directory=backup_directory)
# Remote backup # Recovering backup
if self.software_type in ['Backuped', 'Recover']: if self.optionIsTrue('recovering', default=False):
remote_url = self.parameter_dict['remote_backup'] recovering_script = self.createPythonScript(
remote_backup_bin = zc.buildout.easy_install.scripts([('remote_backup', self.options['recovering-wrapper'],
'slapos.recipe.librecipe.execute', 'execute')], self.ws, '%s.recover.import_remote_dump' % __name__,
sys.executable, self.bin_directory, arguments=[ {
self.options['duplicity_binary'], '--no-encryption',
backup_directory, remote_url]
)[0]
self.path_list.append(remote_backup_bin)
remote_backup_cron = os.path.join(self.cron_d, 'remote_backup')
self.path_list.append(remote_backup_cron)
with open(remote_backup_cron, 'w') as file_:
file_.write('1 0 * * * %s' % self.parseCmdArgument(
remote_backup_bin))
if self.software_type == 'Recover':
zc.buildout.easy_install.scripts([('import_backup',
__name__+'.recover', 'import_remote_dump')], self.ws,
sys.executable, self.wrapper_directory, arguments={
'lock_file': os.path.join(self.work_directory, 'lock_file': os.path.join(self.work_directory,
'import_done'), 'import_done'),
'database': mysql_conf['mysql_database'], 'database': mysql_conf['mysql_database'],
'mysql_binary': self.options['mysql_binary'], 'mysql_binary': self.options['mysql-binary'],
'mysql_socket': mysql_conf['socket'], 'mysql_socket': mysql_conf['socket'],
'duplicity_binary': self.options['duplicity_binary'], 'duplicity_binary': self.options['duplicity-binary'],
'remote_backup': remote_url, 'remote_backup': self.parameter_dict['remote-backup'],
'local_directory': backup_directory, 'local_directory': self.mysql_backup_directory,
'dump_name': dump_filename, 'dump_name': dump_filename,
'zcat_binary': self.options['zcat_binary'], 'zcat_binary': self.options['zcat-binary'],
}) }
# The return could be more explicit database, user ... )
return mysql_conf path_list.append(recovering_script)
return path_list
import subprocess
import os
# Replace mysqldump | gzip > tmpdump && mv -f tmpdump dumpfile
def do_backup(kwargs):
mysqldump_cmd = kwargs['mysqldump']
gzip_bin = kwargs['gzip']
tmpdump = kwargs['tmpdump']
dumpfile = kwargs['dumpfile']
# mysqldump | gzip > tmpdump
with open(tmpdump, 'w') as output:
mysqldump = subprocess.Popen(mysqldump_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
gzip = subprocess.Popen([gzip_bin],
stdin=mysqldump.stdout,
stdout=output,
stderr=subprocess.STDOUT)
mysqldump.stdout.close()
if gzip.wait() != 0:
raise ValueError("Gzip return a non zero value.")
os.rename(tmpdump, dumpfile)
...@@ -4,9 +4,8 @@ import time ...@@ -4,9 +4,8 @@ import time
import sys import sys
def runMysql(args): def runMysql(conf):
sleep = 60 sleep = 60
conf = args[0]
mysqld_wrapper_list = [conf['mysqld_binary'], '--defaults-file=%s' % mysqld_wrapper_list = [conf['mysqld_binary'], '--defaults-file=%s' %
conf['configuration_file']] conf['configuration_file']]
# we trust mysql_install that if mysql directory is available mysql was # we trust mysql_install that if mysql directory is available mysql was
...@@ -35,8 +34,7 @@ def runMysql(args): ...@@ -35,8 +34,7 @@ def runMysql(args):
os.execl(mysqld_wrapper_list[0], *mysqld_wrapper_list) os.execl(mysqld_wrapper_list[0], *mysqld_wrapper_list)
def updateMysql(args): def updateMysql(conf):
conf = args[0]
sleep = 30 sleep = 30
is_succeed = False is_succeed = False
while True: while True:
......
%(file_list)s {
daily
dateext
rotate 30
compress
notifempty
sharedscripts
create
postrotate
%(postrotate)s
endscript
olddir %(olddir)s
}
##############################################################################
#
# 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 zc.buildout
from slapos.recipe.librecipe import GenericSlapRecipe
class Recipe(GenericSlapRecipe):
def _options(self, options):
self.useparts = True
if 'url' in options:
self.useparts = False
self.url = options['url']
else:
self.urlparts = {}
if 'scheme' not in options:
raise zc.buildout.UserError("No scheme specified.")
else:
self.urlparts.update(scheme=options['scheme'])
if 'host' not in options:
raise zc.buildout.UserError("No host specified.")
else:
self.urlparts.update(host=options['host'])
def _install(self):
if self.useparts:
for option in ['path', 'params', 'query', 'fragment', 'port']:
if option in self.options:
self.urlparts[option] = self.options[option]
if 'user' in self.options:
self.urlparts.update(auth=(self.options['user'],))
if 'password' in self.options:
self.urlparts.update(auth=(self.options['user'],
self.options['password']))
self.setConnectionUrl(**self.urlparts)
else:
self.setConnectionDict(dict(url=self.url))
return []
##############################################################################
#
# 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 logging
import os
from slapos import slap as slapmodule
class Recipe(object):
def parseMultiValues(self, string):
return dict([ [str(column).strip() for column in line.split('=', 1)]
for line in str(string).splitlines() if '=' in line])
def __init__(self, buildout, name, options):
self.logger = logging.getLogger(name)
slap = slapmodule.slap()
slap_connection = buildout['slap_connection']
self.software_release_url = slap_connection['software_release_url']
# XXX: Dirty network interation stuff
slap.initializeConnection(slap_connection['server_url'],
slap_connection.get('key_file'),
slap_connection.get('cert_file'),
)
computer_partition = slap.registerComputerPartition(
slap_connection['computer_id'], slap_connection['partition_id'])
self.request = computer_partition.request
if 'software-url' not in options:
options['software-url'] = self.software_release_url
if 'name' not in options:
options['name'] = name
self.return_parameters = []
if 'return' in options:
self.return_parameters = [str(parameter).strip()
for parameter in options['return'].splitlines()]
else:
self.logger.warning("No parameter to return to main instance."
"Be careful about that...")
software_type = 'RootInstanceSoftware'
if 'software-type' in options:
software_type = options['software-type']
filter_kw = {}
if 'sla' in options:
filter_kw = self.parseMultiValues(options['sla'])
partition_parameter_kw = {}
if 'config' in options:
partition_parameter_kw = self.parseMultiValues(options['config'])
instance = self.request(options['software-url'], software_type,
options['name'], partition_parameter_kw=partition_parameter_kw,
filter_kw=filter_kw)
result = {}
for param in self.return_parameters:
result[param] = instance.getConnectionParameter(param)
# Return the connections parameters in options dict
for key, value in result.items():
options['connection-%s' % key] = value
def install(self):
return []
update = install
##############################################################################
#
# 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 shutil
import os
import sys
import time
from slapos.recipe.librecipe import GenericBaseRecipe
def log(args):
directory, suffix = args
filename = time.strftime('%Y-%m-%d.%H:%M.%s') + suffix
with open(os.path.join(directory, filename), 'aw') as logfile:
shutil.copyfileobj(sys.stdin, logfile)
class Recipe(GenericBaseRecipe):
def install(self):
self.logger.info("Simple logger installation")
binary = self.options['binary']
output = self.options['output']
suffix = self.options.get('suffix', '.log')
script = self.createPythonScript(binary,
'slapos.recipe.simplelogger.log',
arguments=[output, suffix])
self.logger.debug("Logger script created at : %r", script)
self.logger.info("Simple logger installed.")
return [script]
##############################################################################
#
# 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 sys
import copy
from ConfigParser import ConfigParser
import subprocess
import slapos.slap
import netaddr
import logging
import zc.buildout
class Recipe:
def __init__(self, buildout, name, options):
self.buildout = buildout
self.options = options
self.name = name
self.logger = logging.getLogger(self.name)
def _getIpAddress(self, test_method):
"""Internal helper method to fetch ip address"""
if not 'ip_list' in self.parameter_dict:
raise AttributeError
for name, ip in self.parameter_dict['ip_list']:
if test_method(ip):
return ip
raise AttributeError
def getLocalIPv4Address(self):
"""Returns local IPv4 address available on partition"""
# XXX: Lack checking for locality of address
return self._getIpAddress(netaddr.valid_ipv4)
def getGlobalIPv6Address(self):
"""Returns global IPv6 address available on partition"""
# XXX: Lack checking for globality of address
return self._getIpAddress(netaddr.valid_ipv6)
def install(self):
slap = slapos.slap.slap()
slap_connection = self.buildout['slap_connection']
computer_id = slap_connection['computer_id']
computer_partition_id = slap_connection['partition_id']
server_url = slap_connection['server_url']
key_file = slap_connection.get('key_file')
cert_file = slap_connection.get('cert_file')
slap.initializeConnection(server_url, key_file, cert_file)
self.computer_partition = slap.registerComputerPartition(
computer_id,
computer_partition_id)
self.parameter_dict = self.computer_partition.getInstanceParameterDict()
software_type = self.parameter_dict['slap_software_type']
if software_type not in self.options:
if 'default' in self.options:
software_type = 'default'
else:
raise zc.buildout.UserError("This software type isn't mapped. And"
"there's no default software type.")
instance_file_path = self.options[software_type]
if not os.path.exists(instance_file_path):
raise zc.buildout.UserError("The specified buildout config file does not"
"exist.")
buildout = ConfigParser()
with open(instance_file_path) as instance_path:
buildout.readfp(instance_path)
buildout.set('buildout', 'installed',
'.installed-%s.cfg' % software_type)
buildout.add_section('slap-parameter')
for parameter, value in self.parameter_dict.items():
buildout.set('slap-parameter', parameter, value)
buildout.add_section('slap-network-information')
buildout.set('slap-network-information', 'local-ipv4',
self.getLocalIPv4Address())
buildout.set('slap-network-information', 'global-ipv6',
self.getGlobalIPv6Address())
# Copy/paste slap_connection
buildout.add_section('slap-connection')
for key, value in self.buildout['slap_connection'].iteritems():
# XXX: Waiting for SlapBaseRecipe to use dash instead of underscores
buildout.set('slap-connection', key.replace('_', '-'), value)
work_directory = os.path.abspath(self.buildout['buildout'][
'directory'])
buildout_filename = os.path.join(work_directory,
'buildout-%s.cfg' % software_type)
with open(buildout_filename, 'w') as buildout_file:
buildout.write(buildout_file)
# XXX-Antoine: We gotta find a better way to do this. I tried to check
# out how slapgrid-cp was running buildout. But it is worse than that.
command_line_args = copy.copy(sys.argv) + ['-c', buildout_filename]
self.logger.info("Invoking commandline : '%s'",
' '.join(command_line_args))
subprocess.check_call(command_line_args, cwd=work_directory,
env=os.environ.copy())
return []
update = install
##############################################################################
#
# 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 itertools
import zc.buildout
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def _options(self, options):
self.types = ['local', 'remote']
self.datas = ['address', 'port']
for type_ in self.types:
for data in self.datas:
opt = '%s-%s' % (type_, data)
if opt not in options:
raise zc.buildout.UserError("No %s for %s connections." % (data, type_))
self.isClient = self.optionIsTrue('client', default=False)
if self.isClient:
self.logger.info("Client mode")
else:
self.logger.info("Server mode")
if 'name' not in options:
options['name'] = self.name
def install(self):
path_list = []
conf = {}
gathered_options = ['%s-%s' % option
for option in itertools.product(self.types,
self.datas)]
for option in gathered_options:
# XXX: Because the options are using dash and the template uses
# underscore
conf[option.replace('-', '_')] = self.options[option]
pid_file = self.options['pid-file']
conf.update(pid_file=pid_file)
path_list.append(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.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute',
[self.options['stunnel-binary'], conf_file]
)
path_list.append(wrapper)
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
...@@ -2,11 +2,9 @@ foreground = yes ...@@ -2,11 +2,9 @@ foreground = yes
output = %(log)s output = %(log)s
pid = %(pid_file)s pid = %(pid_file)s
syslog = no syslog = no
CApath = %(ca_path)s
key = %(key)s key = %(key)s
CRLpath = %(ca_crl)s
cert = %(cert)s cert = %(cert)s
[service] [service]
accept = %(public_ip)s:%(public_port)s accept = %(remote_address)s:%(remote_port)s
connect = %(private_ip)s:%(private_port)s connect = %(local_address)s:%(local_port)s
[buildout]
parts =
davstorage
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[davstorage]
recipe = slapos.cookbook:davstorage
# Binaries
dcrond_binary = ${dcron:location}/sbin/crond
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
apache_binary = ${apache:location}/bin/httpd
apache_modules_dir = ${apache:location}/modules/
apache_mime_file = ${apache:location}/conf/mime.types
apache_htpasswd = ${apache:location}/bin/htpasswd
# Real configuration
key_file = $${certificate_authority:certificate_authority_dir}/davstorage.key
cert_file = $${certificate_authority:certificate_authority_dir}/davstorage.crt
# [ca]
# recipe = slapos.cookbook:ca
# openssl_binary = ${openssl:location}/bin/openssl
# certificate_authority_dir = $${directory:srv}/ssl/
#
# [ca-davstorage]
# recipe = slapos.cookbook:part
# part = $${certificate_authority:part}
# parameters =
# key_file=$${davstorage:key_file}
# cert_file=$${davstorage:cert_file}
[buildout] [buildout]
parts = parts =
instance switch_softwaretype
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[instance] [switch_softwaretype]
recipe = ${instance-recipe:egg}:${instance-recipe:module} recipe = slapos.cookbook:softwaretype
dcrond_binary = ${dcron:location}/sbin/crond default = ${instance_davstorage:output}
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
apache_binary = ${apache:location}/bin/httpd
apache_modules_dir = ${apache:location}/modules/
apache_mime_file = ${apache:location}/conf/mime.types
apache_htpasswd = ${apache:location}/bin/htpasswd
openssl_binary = ${openssl:location}/bin/openssl
...@@ -55,15 +55,22 @@ eggs = ${instance-recipe:egg} ...@@ -55,15 +55,22 @@ eggs = ${instance-recipe:egg}
# Default template for the instance. # Default template for the instance.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
md5sum = 51b6213889573ae7b1dec0bd65384432 md5sum = 4c79e2e42704a2ffe5eebfa0b2e70e28
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
[instance_davstorage]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-davstorage.cfg
md5sum = 009103c87c8d31fb758e7a0782e77723
output = ${buildout:directory}/template-davstorage.cfg
mode = 0644
[lxml-python] [lxml-python]
python = python2.7 python = python2.7
[versions] [versions]
zc.buildout = 1.5.3-dev-SlapOS-010 zc.buildout = 1.6.0-dev-SlapOS-002
Jinja2 = 2.6 Jinja2 = 2.6
Werkzeug = 0.7.1 Werkzeug = 0.7.1
buildout-versions = 1.6 buildout-versions = 1.6
...@@ -71,7 +78,6 @@ hexagonit.recipe.cmmi = 1.5.0 ...@@ -71,7 +78,6 @@ hexagonit.recipe.cmmi = 1.5.0
hexagonit.recipe.download = 1.5.0 hexagonit.recipe.download = 1.5.0
meld3 = 0.6.7 meld3 = 0.6.7
slapos.cookbook = 0.26 slapos.cookbook = 0.26
slapos.recipe.template = 1.1
# Required by: # Required by:
# slapos.core==0.14 # slapos.core==0.14
......
[buildout]
parts =
url
mariadb
stunnel
certificate-authority
logrotate
logrotate-entry-mariadb
cron
cron-entry-logrotate
cron-entry-mariadb-backup
gzip-binary = ${gzip:location}/bin/gzip
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[url]
recipe = slapos.cookbook:publishurl
url = mysqls://$${mariadb:user}:$${mariadb:password}@[$${stunnel:remote-address}]:$${stunnel:remote-port}/$${mariadb:database}
[mariadb]
recipe = slapos.cookbook:mysql
# Options
recovering = false
user = user
port = 3306
ip = $${slap-network-information:local-ipv4}
database = db
# Paths
wrapper = $${basedirectory:services}/mariadb
update-wrapper = $${basedirectory:services}/mariadb_update
backup-script = $${rootdirectory:bin}/mariadb_backup
logrotate-post = $${rootdirectory:bin}/mariadb_post_logrotate
backup-directory = $${directory:mariadb-backup}
data-directory = $${directory:mariadb-data}
pid-file = $${basedirectory:run}/mariadb.pid
socket = $${basedirectory:run}/mariadb.sock
error-log = $${basedirectory:log}/mariadb_error.log
slow-query-log = $${basedirectory:log}/mariadb_slowquery.log
conf-file = $${rootdirectory:etc}/mariadb.cnf
backup-pending-directory = $${directory:mariadb-backup-pending}
dumpname = dump.sql.gz
# Binary information
mysql-binary = ${mariadb:location}/bin/mysql
mysql-install-binary = ${mariadb:location}/bin/mysql_install_db
mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade
mysqld-binary = ${mariadb:location}/libexec/mysqld
mysqldump-binary = ${mariadb:location}/bin/mysqldump
gzip-binary = $${buildout:gzip-binary}
zcat-binary = ${gzip:location}/bin/zcat
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}
[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests/
private = $${directory:ca-dir}/private/
certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = $${directory:stunnel-conf}/stunnel.key
cert-file = $${directory:stunnel-conf}/stunnel.crt
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
[stunnel]
recipe = slapos.cookbook:stunnel
stunnel-binary = ${stunnel:location}/bin/stunnel
wrapper = $${rootdirectory:bin}/stunnel
log-file = $${basedirectory:log}/stunnel.log
config-file = $${rootdirectory:etc}/stunnel.conf
key-file = $${ca-stunnel:key-file}
cert-file = $${ca-stunnel:cert-file}
pid-file = $${basedirectory:run}/stunnel.pid
local-port = $${mariadb:port}
local-address = $${mariadb:ip}
remote-address = $${slap-network-information:global-ipv6}
remote-port = 6446
client = false
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = $${buildout:gzip-binary}
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
[logrotate-entry-mariadb]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = mariadb
log = $${mariadb:error-log} $${mariadb:slow-query-log}
frequency = daily
rotate-num = 30
post = $${mariadb:logrotate-post}
sharedscripts = true
notifempty = true
create = true
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:binary}
binary = $${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
binary = $${rootdirectory:bin}/cron_simplelogger
output = $${directory:cronoutput}
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}
[cron-entry-mariadb-backup]
<= cron
recipe = slapos.cookbook:cron.d
name = mariadb-backup
frequency = 0 0 * * *
command = $${mariadb:backup-script}
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log/
services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
[directory]
recipe = slapos.cookbook:mkdirectory
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
cronstamps = $${rootdirectory:etc}/cronstamps/
cronoutput = $${basedirectory:log}/cron/
ca-dir = $${rootdirectory:srv}/ssl/
mariadb-backup = $${basedirectory:backup}/mariadb/
mariadb-backup-pending = $${basedirectory:backup}/mariadb-pending/
mariadb-data = $${rootdirectory:srv}/mariadb/
logrotate-backup = $${basedirectory:backup}/logrotate/
stunnel-conf = $${rootdirectory:etc}/stunnel/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
[buildout]
extends =
${instance-remotebackuped:output}
[mariadb]
recovering = true
recovering-wrapper = $${basedirectory:services}/mariadb_recover
[buildout]
extends =
${instance-mariadb:output}
parts =
url
mariadb
duplicity
stunnel
certificate-authority
logrotate
logrotate-entry-mariadb
cron
cron-entry-logrotate
cron-entry-mariadb-backup
cron-entry-duplicity
[duplicity]
recipe = slapos.cookbook:duplicity
remote_backup = $${slap-parameter:remote-backup}
directory = $${mariadb:backup-directory}
duplicity_binary = ${buildout:bin-directory}/duplicity
wrapper = $${rootdirectory:bin}/duplicity
recover = false
[cron-entry-duplicity]
<= cron
recipe = slapos.cookbook:cron.d
name = mariadb_remotebackup
frequency = 0 1 * * *
command = $${duplicity:wrapper}
[buildout] [buildout]
parts = parts =
instance switch-softwaretype
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[instance] [switch-softwaretype]
recipe = ${instance-recipe:egg}:${instance-recipe:module} recipe = slapos.cookbook:softwaretype
dcrond_binary = ${dcron:location}/sbin/crond default = ${instance-mariadb:output}
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate backuped = ${instance-remotebackuped:output}
mysql_binary = ${mariadb:location}/bin/mysql recover = ${instance-recover:output}
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
mysqld_binary = ${mariadb:location}/libexec/mysqld
mysqldump_binary = ${mariadb:location}/bin/mysqldump
openssl_binary = ${openssl:location}/bin/openssl
stunnel_binary = ${stunnel:location}/bin/stunnel
gzip_binary = ${gzip:location}/bin/gzip
duplicity_binary = ${buildout:bin-directory}/duplicity
gzip_binary = ${gzip:location}/bin/gzip
zcat_binary = ${gzip:location}/bin/zcat
...@@ -29,17 +29,26 @@ allow-hosts = ...@@ -29,17 +29,26 @@ allow-hosts =
psutil.googlecode.com psutil.googlecode.com
www.dabeaz.com www.dabeaz.com
# XXX: This is dirty, recipe trick shall be used.
develop =
/opt/slapdev
versions = versions versions = versions
parts = parts =
# Create instance template # Create instance template
#TODO : list here all parts. #TODO : list here all parts.
template template
instance-remotebackuped
instance-mariadb
instance-recover
libxslt libxslt
eggs eggs
gzip gzip
instance-recipe-egg instance-recipe-egg
duplicity duplicity
mariadb
stunnel
# XXX: Workaround of SlapOS limitation # XXX: Workaround of SlapOS limitation
# Unzippig of eggs is required, as SlapOS do not yet provide nicely working # Unzippig of eggs is required, as SlapOS do not yet provide nicely working
...@@ -70,13 +79,33 @@ eggs = ...@@ -70,13 +79,33 @@ eggs =
# Default template for the instance. # Default template for the instance.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
md5sum = 426f3cf33899a1f78de8b6ff35917852 md5sum = 3e1ea477d48080e9bdb98579f7f28be6
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
dollar = $
[instance-mariadb]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb.cfg
md5sum = 737a6d2f1ea9938b8d76e2d35e18e482
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
[instance-remotebackuped]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-remotebackuped.cfg
md5sum = bf9e5aa9d63bda9c4aa87d9527fec3e8
output = ${buildout:directory}/template-backuped.cfg
mode = 0644
[instance-recover]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-recover.cfg
md5sum = a8df936b6abf82d0d798b83ddfebdc8a
output = ${buildout:directory}/template-recover.cfg
mode = 0644
[versions] [versions]
slapos.cookbook = 0.29 slapos.cookbook =
# Required by slapos.cookbook==0.25 # Required by slapos.cookbook==0.25
slapos.core = 0.4 slapos.core = 0.4
...@@ -90,4 +119,4 @@ hexagonit.recipe.download = 1.5.0 ...@@ -90,4 +119,4 @@ hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1 plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-010 zc.buildout = 1.6.0-dev-SlapOS-002
[buildout]
parts =
apache-php
request-mariadb
mkdir
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[apache-php]
recipe = slapos.cookbook:lamp.request
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
httpd_binary = ${apache:location}/bin/httpd
stunnel_binary = ${stunnel:location}/bin/stunnel
mysql-url = $${request-mariadb:connection-url}
[request-mariadb]
recipe = slapos.cookbook:request
name = MariaDB DataBase
software-url = $${slap_connection:software_release_url}
software-type = mariadb
return = url
[buildout] [buildout]
parts =
switch_softwaretype
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
parts = instance [switch_softwaretype]
recipe = slapos.cookbook:softwaretype
[instance] default = ${instance_wordpress:output}
recipe = ${instance-recipe:egg}:${instance-recipe:module} mariadb = ${instance_mariadb:output}
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
httpd_binary = ${apache:location}/bin/httpd
stunnel_binary = ${stunnel:location}/bin/stunnel
davstorage-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.52:/software/davstorage/software.cfg
mariadb-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.54:/software/mariadb/software.cfg
...@@ -2,15 +2,22 @@ ...@@ -2,15 +2,22 @@
versions = versions versions = versions
parts = parts =
template
apache-php apache-php
template
eggs eggs
instance-recipe-egg instance-recipe-egg
instance_wordpress
instance_mariadb
extends = extends =
../../component/gzip/buildout.cfg
../../stack/apache-php.cfg ../../stack/apache-php.cfg
../../stack/shacache-client.cfg ../../stack/shacache-client.cfg
# XXX: This is dirty, recipe trick shall be used.
develop =
/opt/slapdev
[application] [application]
url = http://wordpress.org/latest.tar.gz url = http://wordpress.org/latest.tar.gz
#md5sum = Student may put here md5sum of this file, this is good idea #md5sum = Student may put here md5sum of this file, this is good idea
...@@ -18,7 +25,7 @@ url = http://wordpress.org/latest.tar.gz ...@@ -18,7 +25,7 @@ url = http://wordpress.org/latest.tar.gz
[application-template] [application-template]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/wp-config.php.in url = ${:_profile_base_location_}/wp-config.php.in
#md5sum = ${application-configuration:md5sum} md5sum = ${application-configuration:md5sum}
download-only = True download-only = True
filename = template.in filename = template.in
mode = 0644 mode = 0644
...@@ -26,6 +33,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_} ...@@ -26,6 +33,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration] [application-configuration]
location = wp-config.php location = wp-config.php
md5sum = 608dd9003a8edeb59c3aabc6cf43bbf9
[instance-recipe] [instance-recipe]
egg = slapos.cookbook egg = slapos.cookbook
...@@ -40,12 +48,26 @@ eggs = ${instance-recipe:egg} ...@@ -40,12 +48,26 @@ eggs = ${instance-recipe:egg}
# Default template for the instance. # Default template for the instance.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
md5sum = c821944d1ab8d8c0305b08ea7c09c2e0 md5sum = 817407b6bb7af1dce7588e259ead0d26
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
[instance_mariadb]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/../mariadb/instance-mariadb.cfg
md5sum = 38aefa725d21988485c20ae9d58f9455
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
[instance_wordpress]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-wordpress.cfg
md5sum = 220e14b7a46742b1fd83d699c352b888
output = ${buildout:directory}/template-wordpress.cfg
mode = 0644
[versions] [versions]
slapos.cookbook = 0.28 #slapos.cookbook = 0.12
# Required by slapos.cookbook==0.12 # Required by slapos.cookbook==0.12
slapos.core = 0.8 slapos.core = 0.8
...@@ -59,4 +81,4 @@ hexagonit.recipe.download = 1.5.0 ...@@ -59,4 +81,4 @@ hexagonit.recipe.download = 1.5.0
plone.recipe.command = 1.1 plone.recipe.command = 1.1
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-010 zc.buildout = 1.6.0-dev-SlapOS-002
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