Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
slapos
Commits
4e5a356d
Commit
4e5a356d
authored
Apr 03, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use slapos.cookbook:generate.password
parent
c419daae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
14 deletions
+42
-14
slapos/recipe/drupal/__init__.py
slapos/recipe/drupal/__init__.py
+2
-8
software/DrupalDataPublic/instance-custom.cfg.in
software/DrupalDataPublic/instance-custom.cfg.in
+13
-1
software/DrupalDataPublic/software.cfg
software/DrupalDataPublic/software.cfg
+1
-1
software/DrupalOpenPublic/instance-custom.cfg.in
software/DrupalOpenPublic/instance-custom.cfg.in
+13
-1
software/DrupalOpenPublic/software.cfg
software/DrupalOpenPublic/software.cfg
+1
-1
software/drupal/instance-custom.cfg.in
software/drupal/instance-custom.cfg.in
+11
-1
software/drupal/software.cfg
software/drupal/software.cfg
+1
-1
No files found.
slapos/recipe/drupal/__init__.py
View file @
4e5a356d
...
...
@@ -39,7 +39,6 @@ from slapos.recipe.librecipe import GenericBaseRecipe
# - drush connects to mysql with the password on command line
# see http://stackoverflow.com/questions/6607675/shell-script-password-security-of-command-line-parameters
# it could use a socket, but we are on a different instance than mysql
# - the admin_password is not published yet.
# - using slapproxy, sometimes this recipe is not able to connect to mysql (tunnel down).
# restarting from supervisor usually solves it.
#
...
...
@@ -77,12 +76,11 @@ class InitRecipe(GenericBaseRecipe):
drush_output
=
subprocess
.
check_output
([
drush_binary
,
'-y'
,
'site-install'
,
'--account-name=admin'
'--account-name=admin'
,
'--account-pass=%s'
%
self
.
options
[
'admin-password'
],
],
stderr
=
subprocess
.
STDOUT
)
self
.
options
[
'admin-password'
]
=
self
.
extract_password
(
drush_output
)
# drush removes the 'w' bit from both the settings file and its
# directory.
# we restore them, otherwise buildout will see the file as changed
...
...
@@ -95,10 +93,6 @@ class InitRecipe(GenericBaseRecipe):
return
[]
def
extract_password
(
self
,
drush_output
):
return
re
.
search
(
'User password: (
\
S+)
'
, drush_output).groups()[0]
def
is_db_empty
(
self
,
php_binary
,
settings_php
):
with
tempfile
.
NamedTemporaryFile
()
as
fout
:
settings_dirname
,
settings_filename
=
os
.
path
.
split
(
settings_php
)
...
...
software/DrupalDataPublic/instance-custom.cfg.in
View file @
4e5a356d
...
...
@@ -11,10 +11,22 @@ drush-binary = ${apache-php:location}/bin/drush
php-binary = ${apache-php:location}/bin/php
settings-php = ${application-configuration:location}
htdocs = $${rootdirectory:srv}/www
#admin-password =
admin-password = $${gen-passwd:passwd}
dependency = $${apache-php:recipe}
#----------------
#--
#-- Generates a random password and stores it in the filesystem
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directories:srv}/drupal_passwd
bytes = 16
[drupal-init]
recipe = iw.recipe.cmd
cmds =
$${drupal-init-base:drush-binary} install drush make build-datapublic.make DrupalDataPublic
software/DrupalDataPublic/software.cfg
View file @
4e5a356d
...
...
@@ -52,7 +52,7 @@ part-list = drupal-init publish-drupal-admin-password
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-custom.cfg.in
output = ${buildout:directory}/instance-custom.cfg
md5sum =
cde648fb7477fd5927062d6df575e895
md5sum =
4d07c8018c3e78e46a5f6cb1958434d4
mode = 0644
...
...
software/DrupalOpenPublic/instance-custom.cfg.in
View file @
4e5a356d
...
...
@@ -11,10 +11,22 @@ drush-binary = ${apache-php:location}/bin/drush
php-binary = ${apache-php:location}/bin/php
settings-php = ${application-configuration:location}
htdocs = $${rootdirectory:srv}/www
#admin-password =
admin-password = $${gen-passwd:passwd}
dependency = $${apache-php:recipe}
#----------------
#--
#-- Generates a random password and stores it in the filesystem
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directories:srv}/drupal_passwd
bytes = 16
[drupal-init]
recipe = iw.recipe.cmd
cmds =
$${drupal-init-base:drush-binary} install drush make --prepare-install build-openpublic.make DrupalOpenPublic
software/DrupalOpenPublic/software.cfg
View file @
4e5a356d
...
...
@@ -52,7 +52,7 @@ part-list = drupal-init publish-drupal-admin-password
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-custom.cfg.in
output = ${buildout:directory}/instance-custom.cfg
md5sum =
d318cbc4d417616b9d7afa4a398f3569
md5sum =
5a787592514eb5baa24edcda9a44f6b7
mode = 0644
...
...
software/drupal/instance-custom.cfg.in
View file @
4e5a356d
...
...
@@ -11,6 +11,16 @@ drush-binary = ${apache-php:location}/bin/drush
php-binary = ${apache-php:location}/bin/php
settings-php = ${application-configuration:location}
htdocs = $${rootdirectory:srv}/www
#admin-password =
admin-password = $${gen-passwd:passwd}
dependency = $${apache-php:recipe}
#----------------
#--
#-- Generates a random password and stores it in the filesystem
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directories:srv}/drupal_passwd
bytes = 16
software/drupal/software.cfg
View file @
4e5a356d
...
...
@@ -34,7 +34,7 @@ part-list = drupal-init publish-drupal-admin-password
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-custom.cfg.in
output = ${buildout:directory}/instance-custom.cfg
md5sum =
283cb53ff8cd34635703e771062db919
md5sum =
30b3d75d79916ae25ef19969499a3aa2
mode = 0644
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment