Search code examples
symfony1debiancapistranocapifonycomposer-php

Capifony Deploy Requires Passphrase for internal Vendors file


I am deploying a Symfony 2 application to a Debian server via Capifony. The main repository for the application is private but I am also including some private repositories via a composer install. This is causing problems.

The main repository is cloning just fine. I have the public keys setup, a passphrase setup with the scm:passphrase: definition and the following line to enable the automatic entry of the passphrase:

default_run_options[:pty] = true

When I am installing the vendors a passphrase is required for the private repositories that have been required for the project - as I already have the private/public keys for allowing the connection to my repository. It returns the following:

** [out :: 106.187.50.216] Cloning master
** [out :: 106.187.50.216] Enter passphrase for key '/home/deploy/.ssh/id_rsa':

When this appears I cannot enter any passphrase because it is just an out. I would have though that it shared the passphrase but it appears that the composer.phar install doesn't use the same Capifony settings.


Solution

  • As a workaround you should use a password-free key for deployments I guess. You can set that as a deploy key on github or create a new account that has readonly access to the few repos you need. That way you get convenience without too much risk associated with the loss of that key.

    Now for a proper solution, I'm not sure what is needed. You can open an issue on composer and we discuss it further there. Basically the issue is that composer uses a normal git clone command, nothing special, and I imagine capifony does special things to unlock the key in the initial project checkout.