Skip to content

Commit a41b6ea

Browse files
committed
Merge branch 'feature/PB-46630' into 'master'
fix: pin dind image to version 28, upgrade runtime tests See merge request passbolt/passbolt_docker!240
2 parents 074e350 + d33514e commit a41b6ea

File tree

4 files changed

+40
-36
lines changed

4 files changed

+40
-36
lines changed

.gitlab-ci/Jobs/test_images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
services:
2-
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:dind
2+
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:28.5.2-dind-rootless
33
alias: docker
44
command: ["--tls=false"]
55

scripts/entrypoint/passbolt/entrypoint-rootless.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function clear_cake_cache_engines() {
7373
function migrate_command() {
7474
echo "Running migrations"
7575
/usr/share/php/passbolt/bin/cake passbolt migrate --no-clear-cache
76-
clear_cake_cache_engines model core
76+
clear_cake_cache_engines model core translations
7777
}
7878

7979
function jwt_keys_creation() {

scripts/entrypoint/passbolt/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function clear_cake_cache_engines() {
7373
function migrate_command() {
7474
echo "Running migrations"
7575
su -c '/usr/share/php/passbolt/bin/cake passbolt migrate --no-clear-cache' -s /bin/bash www-data
76-
clear_cake_cache_engines model core
76+
clear_cake_cache_engines model core translations
7777
}
7878

7979
function jwt_keys_creation() {

spec/docker_runtime/runtime_spec.rb

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
'PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED=true'
5858
],
5959
'Image' => @image.id,
60-
'Binds' => $binds
60+
'HostConfig' => {
61+
'Binds' => $binds
62+
}
6163
)
6264

6365
@container.start
@@ -74,7 +76,7 @@
7476

7577
let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }
7678
let(:uri) { '/healthcheck/status.json' }
77-
let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" }
79+
let(:curl) { "curl -sLk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}#{uri}" }
7880
let(:jwt_conf) { "#{PASSBOLT_CONFIG_PATH + '/jwt'}" }
7981
let(:jwt_key_pair) { ["#{jwt_conf}/jwt.key", "#{jwt_conf}/jwt.pem"] }
8082

@@ -160,11 +162,15 @@
160162
end
161163

162164
describe 'hide information' do
163-
let(:curl) { "curl -Isk -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/" }
165+
let(:curl) { "curl -skL -D - -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}#{uri} -o /dev/null" }
164166
it 'hides php version' do
165167
expect(command("#{curl} | grep 'X-Powered-By: PHP'").stdout).to be_empty
166168
end
167169

170+
it 'returns 200' do
171+
expect(command(curl).stdout).to contain 'HTTP/2 200'
172+
end
173+
168174
it 'hides nginx version' do
169175
expect(command("#{curl} | grep 'server:'").stdout.strip).to match(/^server:\s+nginx.*$/)
170176
end
@@ -177,20 +183,21 @@
177183
let(:gnupghome) { '/var/lib/passbolt/.gnupg' }
178184

179185
let(:list_keys_cmd) do
180-
if ENV['ROOTLESS'] == 'true'
181-
['gpg', '--homedir', gnupghome, '--list-keys', '--with-colons']
182-
else
183-
['su', '-s', '/bin/bash', '-c', "gpg --homedir #{gnupghome} --list-keys --with-colons", 'www-data']
184-
end
185-
end
186-
187-
let(:healthcheck_cmd) do
188-
if ENV['ROOTLESS'] == 'true'
189-
['bash', '-c', 'source /etc/environment && /usr/share/php/passbolt/bin/cake passbolt healthcheck --gpg']
190-
else
191-
['su', '-s', '/bin/bash', '-c', 'source /etc/environment && /usr/share/php/passbolt/bin/cake passbolt healthcheck --gpg', 'www-data']
192-
end
193-
end
186+
if ENV['ROOTLESS'] == 'true'
187+
['gpg', '--homedir', gnupghome, '--list-keys', '--with-colons']
188+
else
189+
['su', '-s', '/bin/bash', '-c', "gpg --homedir #{gnupghome} --list-keys --with-colons", 'www-data']
190+
end
191+
end
192+
193+
let(:healthcheck_cmd) do
194+
if ENV['ROOTLESS'] == 'true'
195+
['bash', '-c', 'source /etc/environment && /usr/share/php/passbolt/bin/cake passbolt healthcheck --gpg']
196+
else
197+
['su', '-s', '/bin/bash', '-c',
198+
'source /etc/environment && /usr/share/php/passbolt/bin/cake passbolt healthcheck --gpg', 'www-data']
199+
end
200+
end
194201

195202
describe 'generated keys' do
196203
it 'should have created private key file' do
@@ -220,10 +227,8 @@
220227
expect(usage_flags).to include('s')
221228
expect(usage_flags).to include('c')
222229
expect(usage_flags).not_to include('e')
223-
224230
end
225231

226-
227232
it 'should have correct key usage for subkey' do
228233
output = @container.exec(list_keys_cmd)[0].join
229234
sub_line = output.lines.find { |line| line.start_with?('sub:') }
@@ -238,26 +243,25 @@
238243
end
239244
end
240245

241-
it 'should pass all GPG checks' do
242-
output = @container.exec(healthcheck_cmd)[0].join
246+
it 'should pass all GPG checks' do
247+
output = @container.exec(healthcheck_cmd)[0].join
243248

244-
expect(output).to include('[PASS] PHP GPG Module is installed and loaded')
245-
expect(output).to include('[PASS] The environment variable GNUPGHOME is set')
246-
expect(output).to include('[PASS] The server OpenPGP key is not the default one')
247-
expect(output).to include('[PASS] The public key file is defined')
248-
expect(output).to include('[PASS] The private key file is defined')
249+
expect(output).to include('[PASS] PHP GPG Module is installed and loaded')
250+
expect(output).to include('[PASS] The environment variable GNUPGHOME is set')
251+
expect(output).to include('[PASS] The server OpenPGP key is not the default one')
252+
expect(output).to include('[PASS] The public key file is defined')
253+
expect(output).to include('[PASS] The private key file is defined')
249254

250-
pass_count = output.scan(/\[PASS\]/).count
251-
fail_count = output.scan(/\[FAIL\]/).count
255+
pass_count = output.scan(/\[PASS\]/).count
256+
fail_count = output.scan(/\[FAIL\]/).count
252257

253-
expect(pass_count).to be >= 10
254-
expect(fail_count).to eq(0)
258+
expect(pass_count).to be >= 10
259+
expect(fail_count).to eq(0)
255260

256-
expect(output).to include('[PASS] No error found')
257-
end
261+
expect(output).to include('[PASS] No error found')
262+
end
258263
end
259264

260-
261265
describe 'jwt configuration' do
262266
it 'should have the correct permissions' do
263267
expect(file(jwt_conf)).to be_a_directory

0 commit comments

Comments
 (0)