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

Store password in a separate file outside of the ini file. #227

Merged
merged 13 commits into from
Apr 6, 2016
Merged

Store password in a separate file outside of the ini file. #227

merged 13 commits into from
Apr 6, 2016

Conversation

Schnoop
Copy link
Contributor

@Schnoop Schnoop commented Apr 5, 2016

Store the password outside of the phploy.ini file.
Great feature if you would like to share your phploy.ini file.
It is also usefull for security reasons.

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 5, 2016

Fixed some DocBlocks.

@banago
Copy link
Owner

banago commented Apr 5, 2016

@Schnoop this is a great feature indeed, thank you for taking the time to implement it. However, it's a but unintuitive and hard to remember. Can you please re-implement this to make use of an argument instead. For example:

phploy --password="pass-goes-here"

I find this solution much more clean and easy. Let me know.

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 5, 2016

I see your point. But in my/our case, we have a team of 5 developers that are working on a project. Not every developer has the permission to deploy to the servers. Nevertheless we would like to share the phploy.ini file to all developers via git, so that modification is possible even by those who will not execute the deployment. To fit our requirement, we have to remove the password from the ini file.

The problem with an argument is, that i have to remember or copy the password from wherever. This is complicated and i don't want to do this all the time over and over again.

Another problem is, that the password will be stored in the bash history, so it's not really save. If the deployment process is running, everybody could grab those infos via "ps -faux".

@banago
Copy link
Owner

banago commented Apr 5, 2016

I see your point and it makes total sense. And I'd love to accommodate your contribution, but I don't find it clean enough. What do you think of just a .phploy config file, instead of a whole directory?

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 5, 2016

Yes, i thought about that,but  how to handle multiple passwords, for different servers, in one file? Maybe choose ini as file format? That would be possible, but a bit overhead.
Am 05.04.2016 12:51 schrieb Baki Goxhaj notifications@github.com:I see your point and it makes total sense. And I'd love to accommodate your contribution, but I don't find it clean enough. What do you think of just a .phploy config file, instead of a whole directory?

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

@banago
Copy link
Owner

banago commented Apr 5, 2016

Yes, I was thinking of making the .phploy in 'ini' format. We can later extend on it and is a start it can be like this:

[staging]
    password="pass-goes-here"
[production]
    password="pass-goes-here"

This might require a bit of more effort to implement, but it's worth it for the user experience. What do you think?

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 5, 2016

Allright. Let's do this. I'm out of office for the rest of the day. I'll have a look in the evening or at latest tomorrow.

@banago
Copy link
Owner

banago commented Apr 5, 2016 via email

@banago
Copy link
Owner

banago commented Apr 5, 2016

Pull from master when you restart, I made a small update.

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 5, 2016

Ready, set, go! :)

@banago
Copy link
Owner

banago commented Apr 5, 2016

@Schnoop looks pretty good, thanks a lot. Two things:

Does it work if we remove .ini extension from .phploy.ini?

Why have you used an Exception here:

try {
    $values = $this->parseIniFile($this->getPasswordFile());
    if (isset($values[$servername]['password']) === true) {
        return $values[$servername]['password'];
    }

    return '';
} catch (\Exception $e) {
    return '';
}

It could just be this:

$values = $this->parseIniFile($this->getPasswordFile());
if (isset($values[$servername]['password']) === true) {
    return $values[$servername]['password'];
}
return;

@Schnoop
Copy link
Contributor Author

Schnoop commented Apr 6, 2016

I've removed the file suffix. Worked.
Also removed the try - catch block.

@banago
Copy link
Owner

banago commented Apr 6, 2016

All seems perfect. Thank you for this contribution. 👍

@banago banago merged commit 9e6a56d into banago:master Apr 6, 2016
banago added a commit that referenced this pull request Apr 17, 2016
Signed-off-by: Baki Goxhaj <banago@gmail.com>
#227: Implements storing password in a separate file outside of the ini file.
#237: Fixes user-imput passowors with special chars.
banago added a commit that referenced this pull request Apr 17, 2016
Signed-off-by: Baki Goxhaj <banago@gmail.com>
#227: Implements storing password in a separate file outside of the ini file.
#237: Fixes user-imput passowors with special chars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants