Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt server password before connection. #298

Closed
ZhukV opened this issue May 26, 2015 · 4 comments
Closed

Prompt server password before connection. #298

ZhukV opened this issue May 26, 2015 · 4 comments
Labels

Comments

@ZhukV
Copy link
Contributor

ZhukV commented May 26, 2015

How i can configure stage with prompt password to server before connect?

Thank.

@antonmedv
Copy link
Member

Now it's not possible due many reasons: security, parallel execution, ext.

But i think it will be available when implement events in Deployer.

@ZhukV
Copy link
Contributor Author

ZhukV commented May 26, 2015

Ok. I now write codes for ask password before connecting. 1-2 hour(s) and i create pull request.

@ZhukV
Copy link
Contributor Author

ZhukV commented May 26, 2015

Now, with use PasswordGetter system you can customize logic for gets password.
In get password from Configuration, first checks PasswordGetterInterface instances, and if this it, then calls getPassword($host, $user);

As example, with use base callable (CallablePasswordGetter):

use Deployer\Server\Password\CallablePasswordGetter;

server('production', 'domain.com')
    ->user('user')
    ->password(new CallablePasswordGetter(function ($host, $user){
        return 'some_password';
    }))
    ->stage('production')
    ->env('deploy_path', '/var/www/domain.com');

And with ask password (AskPasswordGetter):

use Deployer\Server\Password\AskPasswordGetter;

server('production', 'domain.com')
    ->user('user')
    ->password(AskPasswordGetter::createLazyGetter())
    ->stage('production')
    ->env('deploy_path', '/var/www/domain.com');

Attention: in configure system, you must use lazy getter, because we should have a access to context for get ouput and input interfaces.

And, if send null password, then AskPasswordGetter will be created automatically.

server('production', 'domain.com')
    ->user('user')
    ->password()
    ->stage('production')
    ->env('deploy_path', '/var/www/domain.com');

Attention: this method not working in parallel... I used this feature only on SeriesExecutor.

Thank.

antonmedv pushed a commit that referenced this issue Jun 4, 2015
Add password getter system for customize getting password. (#298)
@ZhukV
Copy link
Contributor Author

ZhukV commented Jun 5, 2015

This feature was released in #299

@ZhukV ZhukV closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants