ERP5 SR: Generate real password for mariadb.

Get rid of this insecure password.
Warning: for existing instances that are upgraded, it requires to manually
change the mariadb password by the new one.
parent be7c4bf1
...@@ -30,9 +30,6 @@ import os ...@@ -30,9 +30,6 @@ import os
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
def _options(self, options): def _options(self, options):
options['password'] = self.generatePassword()
if 'test-database' in options:
options['test-password'] = self.generatePassword()
options.setdefault('parallel-test-database-amount', '0') options.setdefault('parallel-test-database-amount', '0')
for x in xrange(int(options['parallel-test-database-amount'])): for x in xrange(int(options['parallel-test-database-amount'])):
options['test-password-%s' % x] = self.generatePassword() options['test-password-%s' % x] = self.generatePassword()
......
...@@ -181,7 +181,7 @@ context = ...@@ -181,7 +181,7 @@ context =
[template-mariadb] [template-mariadb]
< = template-jinja2-base < = template-jinja2-base
filename = instance-mariadb.cfg filename = instance-mariadb.cfg
md5sum = 49ae6f1bf97d3755978fe08b8e29fb5a md5sum = b5500e3fdb5f64fbaff9137c394f576f
extra-context = extra-context =
key coreutils_location coreutils:location key coreutils_location coreutils:location
key dcron_location dcron:location key dcron_location dcron:location
......
...@@ -38,6 +38,8 @@ test-user = erp5_test ...@@ -38,6 +38,8 @@ test-user = erp5_test
test-database = erp5_test test-database = erp5_test
mysql-test-database-base = testdb mysql-test-database-base = testdb
mysql-test-user-base = testuser mysql-test-user-base = testuser
password = ${generate-password:passwd}
test-password = ${:password}
# Paths # Paths
wrapper = ${basedirectory:services}/mariadb wrapper = ${basedirectory:services}/mariadb
...@@ -102,6 +104,11 @@ pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain ...@@ -102,6 +104,11 @@ pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain
xtrabackup-binary = {{ xtrabackup_location }}/bin/xtrabackup_51 xtrabackup-binary = {{ xtrabackup_location }}/bin/xtrabackup_51
perl-binary = {{ perl_location }}/bin/perl perl-binary = {{ perl_location }}/bin/perl
[generate-password]
recipe = slapos.cookbook:generate.password
storage-path = ${rootdirectory:srv}/passwd
bytes = 32
[logrotate] [logrotate]
recipe = slapos.cookbook:logrotate recipe = slapos.cookbook:logrotate
# Binaries # Binaries
......
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