Skip to content

Commit 43edcbb

Browse files
committed
Merge branch 'release/v3.9.4'
2 parents cf7fa09 + 842dcae commit 43edcbb

File tree

9 files changed

+291
-10
lines changed

9 files changed

+291
-10
lines changed

.gitlab-ci/Jobs/test_images.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ ce-docker-runtime-no-envs:
4040
variables:
4141
TEST_NAME: docker_runtime_no_envs
4242

43+
ce-docker-runtime-no-envs:
44+
extends: .test-images
45+
variables:
46+
TEST_NAME: docker_runtime_with_passbolt_php
47+
4348
pro-docker-image:
4449
extends: .test-pro-images
4550
variables:
@@ -55,6 +60,11 @@ pro-docker-runtime-no-envs:
5560
variables:
5661
TEST_NAME: docker_runtime_no_envs
5762

63+
pro-docker-runtime-with-passbolt-php:
64+
extends: .test-images
65+
variables:
66+
TEST_NAME: docker_runtime_with_passbolt_php
67+
5868
ce-non-root-docker-image:
5969
extends: .test-images
6070
variables:
@@ -73,6 +83,12 @@ ce-non-root-docker-runtime-no-envs:
7383
TEST_NAME: docker_runtime_no_envs
7484
ROOTLESS: "true"
7585

86+
ce-non-root-docker-runtime-with-passbolt-php:
87+
extends: .test-images
88+
variables:
89+
TEST_NAME: docker_runtime_with_passbolt_php
90+
ROOTLESS: "true"
91+
7692
pro-non-root-docker-image:
7793
extends: .test-pro-images
7894
variables:
@@ -90,3 +106,9 @@ pro-non-root-docker-runtime-no-envs:
90106
variables:
91107
TEST_NAME: docker_runtime_no_envs
92108
ROOTLESS: "true"
109+
110+
pro-non-root-docker-runtime-with-passbolt-php:
111+
extends: .test-images
112+
variables:
113+
TEST_NAME: docker_runtime_with_passbolt_php
114+
ROOTLESS: "true"

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.9.3...HEAD)
5+
## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.9.4...HEAD)
6+
7+
## [3.9.4](https://github.com/passbolt/passbolt_docker/compare/v3.9.3...v3.9.4) - 2023-04-18
8+
9+
### Added
10+
- Update mariadb to version 10.10 [#190](https://github.com/passbolt/passbolt_docker/pull/190)
11+
- Added PASSBOLT_GPG_SERVER_KEY_FINGERPRINT_FORCE env variable. Fixes [#192](https://github.com/passbolt/passbolt_docker/issues/192)
12+
- Arm arch support for arm64/v8, arm/v7 and arm/v5 linux architectures.
613

714
## [3.9.3](https://github.com/passbolt/passbolt_docker/compare/v3.9.2...v3.9.3) - 2023-03-17
815

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Passbolt docker image provides several environment variables to configure differ
111111
| PASSBOLT_KEY_EMAIL | Key owner email address | passbolt@yourdomain.com
112112
| PASSBOLT_KEY_EXPIRATION | Key expiration date | 0, never expires
113113
| PASSBOLT_GPG_SERVER_KEY_FINGERPRINT | GnuPG fingerprint | null
114+
| PASSBOLT_GPG_SERVER_KEY_FINGERPRINT_FORCE | Force calculation of GnuPG fingerprint for server key | null
114115
| PASSBOLT_GPG_SERVER_KEY_PUBLIC | Path to GnuPG public server key | /etc/passbolt/gpg/serverkey.asc
115116
| PASSBOLT_GPG_SERVER_KEY_PRIVATE | Path to GnuPG private server key | /etc/passbolt/gpg/serverkey_private.asc
116117
| PASSBOLT_PLUGINS_EXPORT_ENABLED | Enable export plugin | true
@@ -208,3 +209,10 @@ This feature is only supported for:
208209
This repository also provides a way to quickly setup Passbolt for development purposes. This way should never be used in production, as this would be unsafe.
209210
You can use the docker-compose files under [docker-compose/](./docker-compose/) to spin up Passbolt for production using docker compose.
210211
If you would like to setup Passbolt for development purposes, please follow the steps described [here](./dev/README.md).
212+
213+
## Run passbolt docker tests
214+
215+
```bash
216+
PASSBOLT_FLAVOUR=ce PASSBOLT_COMPONENT=stable ROOTLESS=false bundle exec rake spec
217+
```
218+

Rakefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
require 'rake'
22
require 'rspec/core/rake_task'
33

4-
task :spec => 'spec:all'
5-
task :default => :spec
4+
task spec: 'spec:all'
5+
task default: :spec
66

77
namespace :spec do
88
targets = []
99
Dir.glob('./spec/*').each do |dir|
1010
next unless File.directory?(dir)
11+
1112
target = File.basename(dir)
12-
target = "_#{target}" if target == "default"
13+
target = "_#{target}" if target == 'default'
1314
targets << target
1415
end
1516

16-
task :all => targets
17-
task :default => :all
17+
task all: targets
18+
task default: :all
1819

1920
targets.each do |target|
20-
original_target = target == "_default" ? target[1..-1] : target
21+
original_target = target == '_default' ? target[1..-1] : target
2122
desc "Run serverspec tests to #{original_target}"
2223
RSpec::Core::RakeTask.new(target.to_sym) do |t|
2324
ENV['TARGET_HOST'] = original_target
25+
ENV['PASSBOLT_FLAVOUR'] || ENV['PASSBOLT_FLAVOUR'] = 'ce'
26+
ENV['PASSBOLT_COMPONENT'] || ENV['PASSBOLT_COMPONENT'] = 'stable'
27+
ENV['ROOTLESS'] || ENV['ROOTLESS'] = 'false'
2428
t.pattern = "spec/#{original_target}/*_spec.rb"
2529
end
2630
end

docker-compose/docker-compose-ce.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.9'
22
services:
33
db:
4-
image: mariadb:10.3
4+
image: mariadb:10.10
55
restart: unless-stopped
66
environment:
77
MYSQL_RANDOM_ROOT_PASSWORD: "true"

docker-compose/docker-compose-pro.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.9'
22
services:
33
db:
4-
image: mariadb:10.3
4+
image: mariadb:10.10
55
restart: unless-stopped
66
environment:
77
MYSQL_RANDOM_ROOT_PASSWORD: "true"

scripts/entrypoint/passbolt/entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ function install() {
9393
su -c "cp $passbolt_config/app.default.php $passbolt_config/app.php" -s /bin/bash www-data
9494
fi
9595

96-
if [ -z "${PASSBOLT_GPG_SERVER_KEY_FINGERPRINT+xxx}" ] && [ ! -f "$passbolt_config/passbolt.php" ]; then
96+
if [[ ( "${PASSBOLT_GPG_SERVER_KEY_FINGERPRINT_FORCE}" == "true" ) || \
97+
( -z "${PASSBOLT_GPG_SERVER_KEY_FINGERPRINT+xxx}" && \
98+
! -f "$passbolt_config/passbolt.php" ) ]]; then
9799
gpg_auto_fingerprint="$(su -c "gpg --homedir $GNUPGHOME --list-keys --with-colons ${PASSBOLT_KEY_EMAIL:-passbolt@yourdomain.com} |grep fpr |head -1| cut -f10 -d:" -ls /bin/bash www-data)"
98100
export PASSBOLT_GPG_SERVER_KEY_FINGERPRINT=$gpg_auto_fingerprint
99101
fi
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
require 'spec_helper'
3+
4+
describe 'passbolt_api service' do
5+
before(:all) do
6+
@mysql_image =
7+
if ENV['GITLAB_CI']
8+
Docker::Image.create(
9+
'fromImage' => 'registry.gitlab.com/passbolt/passbolt-ci-docker-images/mariadb-10.3:latest'
10+
)
11+
else
12+
Docker::Image.create('fromImage' => 'mariadb:latest')
13+
end
14+
15+
@mysql = Docker::Container.create(
16+
'Env' => [
17+
'MYSQL_ROOT_PASSWORD=test',
18+
'MYSQL_DATABASE=passbolt',
19+
'MYSQL_USER=passbolt',
20+
'MYSQL_PASSWORD=±!@#$%^&*()_+=-}{|:;<>?'
21+
],
22+
'Healthcheck' => {
23+
"Test": [
24+
'CMD-SHELL',
25+
'mysqladmin ping --silent'
26+
]
27+
},
28+
'Image' => @mysql_image.id
29+
)
30+
31+
@mysql.start
32+
33+
sleep 1 while @mysql.json['State']['Health']['Status'] != 'healthy'
34+
35+
if ENV['GITLAB_CI']
36+
Docker.authenticate!(
37+
'username' => ENV['CI_REGISTRY_USER'].to_s,
38+
'password' => ENV['CI_REGISTRY_PASSWORD'].to_s,
39+
'serveraddress' => 'https://registry.gitlab.com/'
40+
)
41+
@image =
42+
if ENV['ROOTLESS'] == 'true'
43+
Docker::Image.create(
44+
'fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-rootless-latest"
45+
)
46+
else
47+
Docker::Image.create(
48+
'fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-root-latest"
49+
)
50+
end
51+
else
52+
@image = Docker::Image.build_from_dir(
53+
ROOT_DOCKERFILES,
54+
{
55+
'dockerfile' => $dockerfile,
56+
'buildargs' => JSON.generate($buildargs)
57+
}
58+
)
59+
end
60+
61+
@container = Docker::Container.create(
62+
'Env' => [
63+
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}",
64+
'DATASOURCES_DEFAULT_PASSWORD=±!@#$%^&*()_+=-}{|:;<>?',
65+
'DATASOURCES_DEFAULT_USERNAME=passbolt',
66+
'DATASOURCES_DEFAULT_DATABASE=passbolt',
67+
'PASSBOLT_SSL_FORCE=true',
68+
'PASSBOLT_GPG_SERVER_KEY_FINGERPRINT_FORCE=true'
69+
],
70+
'Image' => @image.id,
71+
'Binds' => $binds.append(
72+
"#{FIXTURES_PATH + '/passbolt-no-fingerprint.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}",
73+
"#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}",
74+
"#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}",
75+
),
76+
)
77+
78+
@container.start
79+
@container.logs(stdout: true)
80+
81+
set :docker_container, @container.id
82+
sleep 17
83+
end
84+
85+
after(:all) do
86+
@mysql.kill
87+
@container.kill
88+
end
89+
90+
describe 'force fingerprint calculation' do
91+
it 'is contains fingerprint environment variable' do
92+
expect(file('/etc/environment').content).to match(/PASSBOLT_GPG_SERVER_KEY_FINGERPRINT/)
93+
end
94+
end
95+
96+
end
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?php
2+
/**
3+
* Passbolt ~ Open source password manager for teams
4+
* Copyright (c) Passbolt SARL (https://www.passbolt.com)
5+
*
6+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
7+
* For full copyright and license information, please see the LICENSE.txt
8+
* Redistributions of files must retain the above copyright notice.
9+
*
10+
* @copyright Copyright (c) Passbolt SARL (https://www.passbolt.com)
11+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
12+
* @link https://www.passbolt.com Passbolt(tm)
13+
* @since 2.0.0
14+
*/
15+
/**
16+
* PASSBOLT CONFIGURATION FILE TEMPLATE
17+
*
18+
* By default passbolt try to use the environment variables or fallback on the default values as
19+
* defined in default.php. You can use passbolt.default.php as a basis to set your own configuration
20+
* without using environment variables.
21+
*
22+
* 1. copy/paste passbolt.default.php to passbolt.php
23+
* 2. set the variables in the App section
24+
* 3. set the variables in the passbolt section
25+
*
26+
* To see all available options, you can refer to the default.php file, and modify passsbolt.php accordingly.
27+
* Do not modify default.php or you may break your upgrade process.
28+
*
29+
* Read more about how to install passbolt: https://www.passbolt.com/help/tech/install
30+
* Any issue, check out our FAQ: https://www.passbolt.com/faq
31+
* An installation issue? Ask for help to the community: https://community.passbolt.com/
32+
*/
33+
return [
34+
35+
/**
36+
* DEFAULT APP CONFIGURATION
37+
*
38+
* All the information in this section must be provided in order for passbolt to work
39+
* This configuration overrides the CakePHP defaults locating in app.php
40+
* Do not edit app.php as it may break your upgrade process
41+
*/
42+
'App' => [
43+
// A base URL to use for absolute links.
44+
// The url where the passbolt instance will be reachable to your end users.
45+
// This information is need to render images in emails for example
46+
'fullBaseUrl' => 'https://passbolt.local',
47+
],
48+
49+
// Database configuration.
50+
'Datasources' => [
51+
'default' => [
52+
//'host' => 'db',
53+
//'port' => 'non_standard_port_number',
54+
'username' => 'passbolt',
55+
'password' => '±!@#$%^&*()_+=-}{|:;<>?',
56+
'database' => 'passbolt',
57+
],
58+
],
59+
60+
// Email configuration.
61+
'EmailTransport' => [
62+
'default' => [
63+
'host' => 'localhost',
64+
'port' => 25,
65+
'username' => 'user',
66+
'password' => 'secret',
67+
// Is this a secure connection? true if yes, null if no.
68+
'tls' => null,
69+
//'timeout' => 30,
70+
//'client' => null,
71+
//'url' => null,
72+
],
73+
],
74+
'Email' => [
75+
'default' => [
76+
// Defines the default name and email of the sender of the emails.
77+
'from' => ['passbolt@your_organization.com' => 'Passbolt'],
78+
//'charset' => 'utf-8',
79+
//'headerCharset' => 'utf-8',
80+
],
81+
],
82+
83+
/**
84+
* DEFAULT PASSBOLT CONFIGURATION
85+
*
86+
* This is the default configuration.
87+
* It enforces the use of ssl, and does not provide a default OpenPGP key.
88+
* If your objective is to try passbolt quickly for evaluation purpose, and security is not important
89+
* you can use the demo config example provided in the next section below.
90+
*/
91+
'passbolt' => [
92+
// GPG Configuration.
93+
// The keyring must to be owned and accessible by the webserver user.
94+
// Example: www-data user on Debian
95+
'gpg' => [
96+
// Tell GPG where to find the keyring.
97+
// If putenv is set to false, gnupg will use the default path ~/.gnupg.
98+
// For example :
99+
// - Apache on Centos it would be in '/usr/share/httpd/.gnupg'
100+
// - Apache on Debian it would be in '/var/www/.gnupg'
101+
// - Nginx on Centos it would be in '/var/lib/nginx/.gnupg'
102+
// - etc.
103+
'keyring' => '/var/lib/passbolt/.gnupg',
104+
//
105+
// Replace GNUPGHOME with above value even if it is set.
106+
//'putenv' => false,
107+
108+
// Main server key.
109+
'serverKey' => [
110+
// Server private key fingerprint.
111+
'fingerprint' => '',
112+
'public' => CONFIG . DS . 'gpg' . DS . 'unsecure.key',
113+
'private' => CONFIG . DS . 'gpg' . DS . 'unsecure_private.key',
114+
],
115+
],
116+
],
117+
118+
/**
119+
* DEMO CONFIGURATION EXAMPLE
120+
*
121+
* Uncomment the lines below if you want to try passbolt quickly.
122+
* and if you are not concerned about the security of your installation.
123+
* (Don't forget to comment the default config above).
124+
*/
125+
// 'debug' => true,
126+
// 'passbolt' => [
127+
// 'registration' => [
128+
// 'public' => true
129+
// ],
130+
// 'ssl' => [
131+
// 'force' => false,
132+
// ],
133+
// 'gpg' => [
134+
// 'serverKey' => [
135+
// 'fingerprint' => '2FC8945833C51946E937F9FED47B0811573EE67E',
136+
// 'public' => CONFIG . DS . 'gpg' . DS . 'unsecure.key',
137+
// 'private' => CONFIG . DS . 'gpg' . DS . 'unsecure_private.key',
138+
// ],
139+
// ],
140+
// ]
141+
142+
];

0 commit comments

Comments
 (0)