Skip to content

Commit

Permalink
Merge branch 'release/v3.7.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlen committed Dec 1, 2022
2 parents 0ef3be2 + fca6f21 commit cf7aebf
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ src
.ruby-version

.bundle
docker-compose/.env
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.7.3...HEAD)
## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.7.5...HEAD)

## [3.7.5](https://github.com/passbolt/passbolt_docker/compare/v3.7.4...v3.7.5) - 2022-12-01

### Added

- Improved logging for cron tasks

## [3.7.4](https://github.com/passbolt/passbolt_docker/compare/v3.7.3...v3.7.4) - 2022-11-17

### Added

- Directory sync commands on docker-compose pro

### Fixed

- Multiple merge request from community. Thanks a lot to all of you who contributed!

## [3.7.3](https://github.com/passbolt/passbolt_docker/compare/v3.0.2...v3.7.3) - 2022-11-04

Expand All @@ -15,7 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add new subscription file machinery
- Add pro dependencies

### Changed
### Changed
- Default key length from 2048 to 3072
- Bump php version to 8 on dev Dockerfile
- PB-14373 fix composer files
Expand Down
5 changes: 2 additions & 3 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ RUN apt-get update \
&& sed -i '/listen \[\:\:\]\:443 ssl http2;/a listen 443 ssl http2;' /etc/nginx/snippets/passbolt-ssl.conf \
&& sed -i 's,__CERT_PATH__,/etc/ssl/certs/certificate.crt;,' /etc/nginx/snippets/passbolt-ssl.conf \
&& sed -i 's,__KEY_PATH__,/etc/ssl/certs/certificate.key;,' /etc/nginx/snippets/passbolt-ssl.conf \
&& sed -i 's,www-data.*$,www-data exec /bin/bash -c ". /etc/environment \&\& $PASSBOLT_BASE_DIR/bin/cron",' /etc/cron.d/$PASSBOLT_PKG \
&& sed -i 's,www-data.*$,root su -s /bin/bash -c ". /etc/environment \&\& $PASSBOLT_BASE_DIR/bin/cron" www-data >/proc/1/fd/1 2>\&1,' /etc/cron.d/$PASSBOLT_PKG \
&& sed -i 's/# server_tokens/server_tokens/' /etc/nginx/nginx.conf \
&& ln -sf /dev/stdout /var/log/nginx/passbolt-access.log \
&& ln -sf /dev/stderr /var/log/nginx/passbolt-error.log \
&& ln -sf /dev/stderr /var/log/passbolt/error.log \
&& ln -sf /dev/stderr /var/log/php$PHP_VERSION-fpm.log \
&& crontab /etc/cron.d/$PASSBOLT_PKG
&& ln -sf /dev/stderr /var/log/php$PHP_VERSION-fpm.log

COPY conf/supervisor/cron.conf /etc/supervisor/conf.d/cron.conf
COPY conf/supervisor/nginx.conf /etc/supervisor/conf.d/nginx.conf
Expand Down
25 changes: 10 additions & 15 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM composer:2.4 AS composer

FROM php:8-fpm

LABEL maintainer="Passbolt SA <[email protected]>"
Expand All @@ -8,6 +10,7 @@ ARG PASSBOLT_CURL_HEADERS=""
ARG PASSBOLT_FLAVOUR="ce"

ARG PHP_EXTENSIONS="gd \
zip \
intl \
pdo_mysql \
opcache \
Expand All @@ -24,6 +27,8 @@ ARG PASSBOLT_DEV_PACKAGES="libgpgme11-dev \
libicu-dev \
libxslt1-dev \
libmcrypt-dev \
libzip-dev \
zip \
unzip \
libldap2-dev"

Expand All @@ -40,6 +45,9 @@ ENV PHP_EXT_DIR="/usr/src/php/ext"
ENV PASSBOLT_FLAVOUR=$PASSBOLT_FLAVOUR

WORKDIR /var/www/passbolt

COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apt-get update \
&& apt-get -y install --no-install-recommends \
$PASSBOLT_DEV_PACKAGES \
Expand All @@ -56,31 +64,18 @@ RUN apt-get update \
&& docker-php-ext-install -j4 $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \
&& docker-php-ext-enable $PHP_EXTENSIONS $PECL_PASSBOLT_EXTENSIONS \
&& docker-php-source delete \
&& EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig) \
&& curl -o composer-setup.php https://getcomposer.org/installer \
&& ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") \
&& if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then \
>&2 echo 'ERROR: Invalid installer signature'; \
rm composer-setup.php; \
exit 1; \
fi \
&& php composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& rm composer-setup.php \
&& curl -sSL -H "$PASSBOLT_CURL_HEADERS" "$PASSBOLT_URL" | tar zxf - -C . --strip-components 1 \
&& composer install -n --no-dev --optimize-autoloader \
&& composer install --no-ansi --no-interaction \
&& chown -R www-data:www-data . \
&& chmod 775 $(find /var/www/passbolt/tmp -type d) \
&& chmod 664 $(find /var/www/passbolt/tmp -type f) \
&& chmod 775 $(find /var/www/passbolt/webroot/img/public -type d) \
&& chmod 664 $(find /var/www/passbolt/webroot/img/public -type f) \
&& rm /etc/nginx/sites-enabled/default \
&& apt-get purge -y --auto-remove $PASSBOLT_DEV_PACKAGES \
&& rm -rf /var/lib/apt/lists/* \
&& rm /usr/local/bin/composer \
&& echo 'php_flag[expose_php] = off' > /usr/local/etc/php-fpm.d/expose.conf \
&& sed -i 's/# server_tokens/server_tokens/' /etc/nginx/nginx.conf \
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" \
&& echo "* * * * * su -c \"source /etc/environment ; /var/www/passbolt/bin/cake EmailQueue.sender\" -s /bin/bash www-data >> /var/log/cron.log 2>&1" >> /etc/cron.d/passbolt_email \
&& crontab /etc/cron.d/passbolt_email \
&& ln -s $(which php-fpm) $(which php-fpm)7.3
Expand Down
1 change: 1 addition & 0 deletions docker-compose/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASSBOLT_API_PATH="/path/to/passbolt_api"
32 changes: 30 additions & 2 deletions docker-compose/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,61 @@
version: '3.9'

services:
db:
image: mariadb:10.3
container_name: passbolt-db-dev
env_file:
- env/mysql.env
volumes:
- ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
- database_volume:/var/lib/mysql
ports:
- "127.0.0.1:3306:3306"
- "3306:3306"

passbolt:
build:
context: ..
dockerfile: dev/Dockerfile
args:
PECL_PASSBOLT_EXTENSIONS: "redis gnupg xdebug"
container_name: passbolt-app-dev
depends_on:
- db
- mailhog
env_file:
- env/passbolt.env
volumes:
#- <PATH_TO_PASSBOLT_API>:/var/www/passbolt
- ${PASSBOLT_API_PATH}:/var/www/passbolt
- gpg_volume:/var/www/passbolt/config/gpg
- images_volume:/var/www/passbolt/webroot/img/public/images
command: ["/usr/bin/wait-for.sh", "db:3306", "--", "/docker-entrypoint.sh"]
ports:
- 80:80
- 443:443

####################
# Dev tools starts #
####################
adminer:
image: adminer
container_name: passbolt-adminer-dev
restart: always
ports:
- "9501:8080"
depends_on:
- db

mailhog:
image: mailhog/mailhog:latest
container_name: passbolt-mailhog-dev
restart: always
# Mailhog logs are noisy so not logging it
logging:
driver: none
ports:
- "1025:1025" # SMTP server
- "9502:8025" # Web UI

volumes:
database_volume:
gpg_volume:
Expand Down
11 changes: 10 additions & 1 deletion docker-compose/env/passbolt.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# URL
DEBUG=true
APP_FULL_BASE_URL=https://passbolt.local

# Database settings
Expand All @@ -8,6 +8,15 @@ DATASOURCES_DEFAULT_PASSWORD=P4ssb0lt
DATASOURCES_DEFAULT_DATABASE=passbolt
DATASOURCES_DEFAULT_PORT=3306
DATASOURCES_QUOTE_IDENTIFIER=true
# Test Database
DATASOURCES_TEST_HOST=db
DATASOURCES_TEST_USERNAME=passbolt
DATASOURCES_TEST_PASSWORD=P4ssb0lt
DATASOURCES_TEST_DATABASE=test_passbolt
DATASOURCES_TEST_PORT=3306

# Registration
PASSBOLT_REGISTRATION_PUBLIC=false

# Email settings
EMAIL_TRANSPORT_DEFAULT_URL="smtp://:@mailhog:1025"
3 changes: 3 additions & 0 deletions docker-compose/mysql/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE DATABASE IF NOT EXISTS `test_passbolt`;
GRANT ALL PRIVILEGES ON test_passbolt.* TO 'passbolt'@'%';
FLUSH PRIVILEGES;

0 comments on commit cf7aebf

Please sign in to comment.