rubenv / grunt-git

Git commands for grunt.
MIT License
227 stars 83 forks source link

store password for public key? #120

Closed mtizziani closed 8 years ago

mtizziani commented 8 years ago

i have the following code:

grunt.initConfig({
    repositoryUrl: 'git@myprivate.gilab:group/project.git',
    repositoryDir: 'cloned',
    gitclone: {
        repo: {
            options: {
                repository: '<%= repositoryUrl %>',
                branch: 'master',
                directory: '<%= repositoryDir %>'
            }
        }
    }
});

it works, but it has to ask me everytime for my password to my private key. is there a way to save the pwd or inject it? i need it for a automatic app factory that works on a separate server without somebody has to interact with it

rubenv commented 8 years ago

Just remove the password from the key (it's pointless to have it if you're going to store the password on the same server as the key) or use ssh-agent.

mtizziani commented 8 years ago

i found a workaround by myself:

repositoryUrl: 'https://user:password@domain:group/project.git'

this works perfectly

dylancwood commented 8 years ago

I am glad that you found something that works @mtizziani. You should know that it is not a good idea to store your github credentials in plain text though. If your code is stored on Github (or anywhere else on the Internet), then your password could be easily stolen by anyone (even if you have a private repo). I highly recommend following @rubenv's advice and using an SSH agent or an SSH key without a passphrase. it is out of scope to discuss security issues in this issue, so I will leave it at that.

mtizziani commented 8 years ago

i know, i'll never do it with public server. all is running in a local gitlab repository, only available in our network