Merge branch 'master' into release/v1.6.9

This commit is contained in:
Diego Lendoiro 2018-01-14 17:01:17 +01:00
commit d3ca2e4f77
2 changed files with 10 additions and 8 deletions

View File

@ -76,7 +76,7 @@ Passbolt docker image provides several environment variables to configure differ
* SALT: a random string used by cakephp in security hashing methods * SALT: a random string used by cakephp in security hashing methods
* CIPHERSEED: a random string used by cakephp to encrypt/decrypt strings * CIPHERSEED: a random string used by cakephp to encrypt/decrypt strings
* URL: URL of the passbolt installation (defaults to passbolt.local) * URL: URL of the passbolt installation (defaults to http://passbolt.local)
### Database variables ### Database variables
@ -96,6 +96,7 @@ Passbolt docker image provides several environment variables to configure differ
* EMAIL_AUTH: disable smtp auth ( defaults to true) * EMAIL_AUTH: disable smtp auth ( defaults to true)
* EMAIL_USERNAME: username for email server auth ( defaults to email_user) * EMAIL_USERNAME: username for email server auth ( defaults to email_user)
* EMAIL_PASSWORD: password for email server auth ( defaults to email_password) * EMAIL_PASSWORD: password for email server auth ( defaults to email_password)
* EMAIL_CLIENT: hostname to send as smtp helo ( defaults to null)
* EMAIL_TLS: set tls, boolean ( defaults to false) * EMAIL_TLS: set tls, boolean ( defaults to false)
## Advanced configuration ## Advanced configuration

View File

@ -45,16 +45,13 @@ core_setup() {
local default_salt='DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi' local default_salt='DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'
local default_seed='76859309657453542496749683645' local default_seed='76859309657453542496749683645'
local default_url='passbolt.local' local default_url='http://passbolt.local'
cp $core_config{.default,} cp $core_config{.default,}
sed -i s:$default_salt:${SALT:-$default_salt}:g $core_config sed -i s:$default_salt:${SALT:-$default_salt}:g $core_config
sed -i s:$default_seed:${CIPHERSEED:-$default_seed}:g $core_config sed -i s:$default_seed:${CIPHERSEED:-$default_seed}:g $core_config
sed -i "/example.com/ s:\/\/::" $core_config sed -i "/example.com/ s:\/\/::" $core_config
sed -i s:example.com:${URL:-$default_url}:g $core_config sed -i "s|http://example.com|${URL:-$default_url}|g" $core_config
if [ "${SSL:-true}" != false ]; then
sed -i s:http:https:g $core_config
fi
} }
db_setup() { db_setup() {
@ -109,6 +106,7 @@ email_setup() {
# EMAIL_AUTH # EMAIL_AUTH
# EMAIL_USERNAME # EMAIL_USERNAME
# EMAIL_PASSWORD # EMAIL_PASSWORD
# EMAIL_CLIENT
# EMAIL_TLS # EMAIL_TLS
local default_transport='Smtp' local default_transport='Smtp'
@ -118,6 +116,7 @@ email_setup() {
local default_timeout='30' local default_timeout='30'
local default_username="''" local default_username="''"
local default_password="''" local default_password="''"
local default_client=null
cp $email_config{.default,} cp $email_config{.default,}
sed -i s:$default_transport:${EMAIL_TRANSPORT:-Smtp}:g $email_config sed -i s:$default_transport:${EMAIL_TRANSPORT:-Smtp}:g $email_config
@ -132,7 +131,9 @@ email_setup() {
sed -i "0,/"$default_username"/s:"$default_username":'${EMAIL_USERNAME:-email_user}':" $email_config sed -i "0,/"$default_username"/s:"$default_username":'${EMAIL_USERNAME:-email_user}':" $email_config
sed -i "0,/"$default_password"/s:"$default_password":'${EMAIL_PASSWORD:-email_password}':" $email_config sed -i "0,/"$default_password"/s:"$default_password":'${EMAIL_PASSWORD:-email_password}':" $email_config
fi fi
if [ -n "$EMAIL_CLIENT" ] ; then
sed -i "0,/"$default_client"/s:"$default_client":'$EMAIL_CLIENT':" $email_config
fi
sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config
} }
@ -149,7 +150,7 @@ install() {
local database_user=${DB_USER:-$(cat $db_config | grep -m1 "'login'" | sed -r "s/\s*'login' => '(.*)',/\1/")} local database_user=${DB_USER:-$(cat $db_config | grep -m1 "'login'" | sed -r "s/\s*'login' => '(.*)',/\1/")}
local database_pass=${DB_PASS:-$(cat $db_config | grep -m1 "'password'" | sed -r "s/\s*'password' => '(.*)',/\1/")} local database_pass=${DB_PASS:-$(cat $db_config | grep -m1 "'password'" | sed -r "s/\s*'password' => '(.*)',/\1/")}
local database_name=${DB_NAME:-$(cat $db_config | grep -m1 "'database'" | sed -r "s/\s*'database' => '(.*)',/\1/")} local database_name=${DB_NAME:-$(cat $db_config | grep -m1 "'database'" | sed -r "s/\s*'database' => '(.*)',/\1/")}
tables=$(mysql -u ${database_user:-passbolt} -h $database_host -P $database_port -p -BN -e "SHOW TABLES FROM ${database_name:-passbolt}" -p${database_pass:-P4ssb0lt} |wc -l) tables=$(mysql -u ${database_user:-passbolt} -h $database_host -P ${database_port:-3306} -p -BN -e "SHOW TABLES FROM ${database_name:-passbolt}" -p${database_pass:-P4ssb0lt} |wc -l)
if [ $tables -eq 0 ]; then if [ $tables -eq 0 ]; then
su -c "/var/www/passbolt/app/Console/cake install --send-anonymous-statistics true --no-admin" -ls /bin/bash nginx su -c "/var/www/passbolt/app/Console/cake install --send-anonymous-statistics true --no-admin" -ls /bin/bash nginx