passbolt_api icon indicating copy to clipboard operation
passbolt_api copied to clipboard

Healthcheck fullBaseUrlReachable returning an incorrect error

Open AntiGuide opened this issue 4 years ago • 1 comments

Healthcheck fullBaseUrlReachable returning an incorrect error

  • Passbolt Version: 3.0.0+
  • Platform and Target: -- Operating system: FreeBSD 11.4 -- PHP: 7.3.27 -- Web server: Apache 2.4.46 -- Database server: MariaDB 10.3.27

What you did

Manual installation with the help of https://help.passbolt.com/hosting/install/ce/from-source.html and a healthcheck. Config was 'fullBaseUrl' => 'https://192.168.1.23' and 'base' => '/passbolt'

What happened

The healthcheck showed errors for the fullBaseUrlReachable check.

What you expected to happen

No errors as the URL is available under the base.

Suggested change

Take the App.base into account.

src/Utility/Healthchecks.php:175

Old: $url = Configure::read('App.fullBaseUrl') . '/healthcheck/status.json';

New: $url = Configure::read('App.fullBaseUrl') . Configure::read('App.base') . '/healthcheck/status.json';

AntiGuide avatar Feb 24 '21 21:02 AntiGuide

Hello @AntiGuide,

Thank you for you report and the suggested code change, I confirm the issue.

I adapted it a bit, but I cannot validate it now as it requires a further investigation. It returns a false positive if the server doesn't point to this base but passbolt is configured with.

$settingAppFullBaseUrl = Configure::read('App.fullBaseUrl');
$settingAppBase = Configure::read('App.base') ? Configure::read('App.base') : "";
$url = "$settingAppFullBaseUrl$settingAppBase/healthcheck/status.json";

Your contribution is very much appreciated, don't hesitate to send us a PR next time.

cedricalfonsi avatar Feb 25 '21 11:02 cedricalfonsi