Merge branch 'release/v1.6.2'

This commit is contained in:
Diego Lendoiro 2017-08-16 16:51:05 +01:00
commit e6cfd09b1d
4 changed files with 50 additions and 36 deletions

View File

@ -2,7 +2,18 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v1.6.1...HEAD) ## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v1.6.2...HEAD)
## [1.6.2](https://github.com/passbolt/passbolt_docker/compare/v1.6.1+1...v1.6.2) - 2017-08-16
### Added
- PASSBOLT-2295: Added environment variable DB_PORT for non standard database ports. [#43](https://github.com/passbolt/passbolt_docker/issues/43)
- PASSBOLT-2321: Upgraded passbolt container to latest stable alpine (3.6)
### Fixed
- PASSBOLT-2319: Fullbaseurl parameter was not changing when specifying URL [#50](https://github.com/passbolt/passbolt_docker/issues/50)
- PASSBOLT-2320: TLS value on email.php should not be quoted PR[#53](https://github.com/passbolt/passbolt_docker/pull/53)
## [1.6.1+1](https://github.com/passbolt/passbolt_docker/compare/v1.6.1...v1.6.1+1) - 2017-07-31 ## [1.6.1+1](https://github.com/passbolt/passbolt_docker/compare/v1.6.1...v1.6.1+1) - 2017-07-31

View File

@ -1,8 +1,8 @@
FROM alpine:3.5 FROM alpine:3.6
MAINTAINER diego@passbolt.com MAINTAINER diego@passbolt.com
ENV PASSBOLT_VERSION 1.6.1 ENV PASSBOLT_VERSION 1.6.2
ENV PASSBOLT_URL https://github.com/passbolt/passbolt_api/archive/v${PASSBOLT_VERSION}.tar.gz ENV PASSBOLT_URL https://github.com/passbolt/passbolt_api/archive/v${PASSBOLT_VERSION}.tar.gz
ARG BASE_PHP_DEPS="php5-curl \ ARG BASE_PHP_DEPS="php5-curl \
@ -11,7 +11,6 @@ ARG BASE_PHP_DEPS="php5-curl \
php5-intl \ php5-intl \
php5-json \ php5-json \
php5-mcrypt \ php5-mcrypt \
php5-memcache \
php5-mysql \ php5-mysql \
php5-xsl \ php5-xsl \
php5-fpm \ php5-fpm \
@ -34,39 +33,40 @@ ARG PHP_GNUPG_DEPS="php5-dev \
re2c \ re2c \
gpgme-dev \ gpgme-dev \
autoconf \ autoconf \
zlib-dev \
file" file"
RUN apk update &&\ RUN apk add --no-cache $BASE_PHP_DEPS \
apk add $BASE_PHP_DEPS \
bash \
sed \ sed \
ca-certificates \
curl \
tar \ tar \
libpcre32 \ bash \
recode \ curl \
libxml2 \ nginx \
gpgme \ gpgme \
gnupg1 \ gnupg1 \
mysql-client \ recode \
libxml2 \
openssl \ openssl \
nginx libpcre32 \
mysql-client \
ca-certificates
RUN apk add $PHP_GNUPG_DEPS && \ RUN apk add --no-cache $PHP_GNUPG_DEPS \
&& ln -s /usr/bin/php5 /usr/bin/php \
&& ln -s /usr/bin/phpize5 /usr/bin/phpize \
#https://bugs.alpinelinux.org/issues/5378 #https://bugs.alpinelinux.org/issues/5378
sed -i "s/ -n / /" $(which pecl) && \ && sed -i "s/ -n / /" $(which pecl) \
pecl install gnupg && \ && pecl install gnupg memcache \
echo "extension=gnupg.so" > /etc/php5/conf.d/gnupg.ini && \ && echo "extension=memcache.so" > /etc/php5/conf.d/memcache.ini \
apk del $PHP_GNUPG_DEPS && echo "extension=gnupg.so" > /etc/php5/conf.d/gnupg.ini \
&& apk del $PHP_GNUPG_DEPS \
RUN curl -sS https://getcomposer.org/installer | php && \ && curl -sS https://getcomposer.org/installer | php \
mv composer.phar /usr/local/bin/composer && mv composer.phar /usr/local/bin/composer \
&& mkdir /var/www/passbolt \
RUN mkdir /var/www/passbolt && curl -sSL $PASSBOLT_URL | \ && curl -sSL $PASSBOLT_URL | tar zxf - -C /var/www/passbolt --strip-components 1 \
tar zxf - -C /var/www/passbolt --strip-components 1 && \ && chown -R nginx:nginx /var/www/passbolt \
chown -R nginx:nginx /var/www/passbolt && \ && chmod -R +w /var/www/passbolt/app/tmp \
chmod -R +w /var/www/passbolt/app/tmp && \ && chmod +w /var/www/passbolt/app/webroot/img/public
chmod +w /var/www/passbolt/app/webroot/img/public
COPY conf/passbolt.conf /etc/nginx/conf.d/default.conf COPY conf/passbolt.conf /etc/nginx/conf.d/default.conf
COPY bin/docker-entrypoint.sh /docker-entrypoint.sh COPY bin/docker-entrypoint.sh /docker-entrypoint.sh

View File

@ -79,6 +79,7 @@ Passbolt docker image provides several environment variables to configure differ
### Database variables ### Database variables
* DB_HOST: database hostname This param has to be specified either using env var or in database.php (defaults to passbolt.local) * DB_HOST: database hostname This param has to be specified either using env var or in database.php (defaults to passbolt.local)
* DB_PORT: database port (defaults to 3306)
* DB_USER: database username (defaults to passbolt) * DB_USER: database username (defaults to passbolt)
* DB_PASS: database password (defaults to P4ssb0lt) * DB_PASS: database password (defaults to P4ssb0lt)
* DB_NAME: database name (defaults to passbolt) * DB_NAME: database name (defaults to passbolt)

View File

@ -50,8 +50,8 @@ core_setup() {
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 "/$default_url/ s:\/\/::" $core_config sed -i "/example.com/ s:\/\/::" $core_config
sed -i s:$default_url:${URL:-$default_url}:g $core_config sed -i s:example.com:${URL:-$default_url}:g $core_config
if [ "$ssl" != false ]; then if [ "$ssl" != false ]; then
sed -i s:http:https:g $core_config sed -i s:http:https:g $core_config
fi fi
@ -70,6 +70,7 @@ db_setup() {
local default_db='database_name' local default_db='database_name'
cp $db_config{.default,} cp $db_config{.default,}
sed -i "/$default_host/a\ \t\t'port' => '${DB_PORT:-3306}'," $db_config
sed -i s:$default_host:${DB_HOST:-db}:g $db_config sed -i s:$default_host:${DB_HOST:-db}:g $db_config
sed -i s:$default_user:${DB_USER:-passbolt}:g $db_config sed -i s:$default_user:${DB_USER:-passbolt}:g $db_config
sed -i s:$default_pass\',:${DB_PASS:-P4ssb0lt}\',:g $db_config sed -i s:$default_pass\',:${DB_PASS:-P4ssb0lt}\',:g $db_config
@ -125,7 +126,7 @@ email_setup() {
sed -i s:$default_timeout:${EMAIL_TIMEOUT:-30}:g $email_config sed -i s:$default_timeout:${EMAIL_TIMEOUT:-30}:g $email_config
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
sed -i "0,/tls/s:false:'${EMAIL_TLS:-false}':" $email_config sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config
} }
@ -136,11 +137,12 @@ gen_ssl_cert() {
} }
install() { install() {
local database_host=${db_host:-$(cat $db_config | grep -m1 "'host'" | sed -r "s/\s*'host' => '(.*)',/\1/")} local database_host=${DB_HOST:-$(cat $db_config | grep -m1 "'host'" | sed -r "s/\s*'host' => '(.*)',/\1/")}
local database_user=${db_user:-$(cat $db_config | grep -m1 "'login'" | sed -r "s/\s*'login' => '(.*)',/\1/")} local database_port=${DB_PORT:-$(cat $db_config | grep -m1 "'port' => \d" | sed -r "s/\s*'port' => '(.*)',/\1/")}
local database_pass=${db_pass:-$(cat $db_config | grep -m1 "'password'" | sed -r "s/\s*'password' => '(.*)',/\1/")} local database_user=${DB_USER:-$(cat $db_config | grep -m1 "'login'" | sed -r "s/\s*'login' => '(.*)',/\1/")}
local database_name=${db_name:-$(cat $db_config | grep -m1 "'database'" | sed -r "s/\s*'database' => '(.*)',/\1/")} local database_pass=${DB_PASS:-$(cat $db_config | grep -m1 "'password'" | sed -r "s/\s*'password' => '(.*)',/\1/")}
tables=$(mysql -u ${database_user:-passbolt} -h $database_host -p -BN -e "SHOW TABLES FROM ${database_name:-passbolt}" -p${database_pass:-P4ssb0lt} |wc -l) 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)
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