@majid I was able to reproduce the issue on ubuntu. I noticed that this issue is linked to the secret key not being present in the keyring. Somehow, when importing the key in an empty keyring on ubuntu the secret key fails to be added (the public key is imported fine). It seems that there is some quirks between gpg and gpg2 key generation / keyring management.
This did the trick:
- Delete the keyring
- Recreate it using gpg2
- Import the key using the passbolt install
In commands are as follow assuming your keyring is in /var/www/.gnupg, the default location on ubuntu to make things simpler :
$ sudo mkdir /var/www/.gnupg
$ sudo chown www-data:www-data /var/www/.gnupg
$ sudo chmod 700 /var/www/.gnupg
$ sudo su -s /bin/bash -c "gpg2 --list-secret-keys" www-data
$ sudo su -s /bin/bash -c "gpg2 --list-keys" www-data
$ sudo su -s /bin/bash -c "app/Console/cake install" www-data
If after the last step you still don’t have the secret key in your keyring you can try importing it manually:
$ sudo su -s /bin/bash -c "gpg2 --import-key /var/www/passbolt_api/app/Config/gpg/private.key" www-data