Hi Dean,

Sorry for dropping off the radar for a week, I apologise sincerely for
missing our appointment to look in this with you.

Thanks for posting back to the list to explain how you got everything
working, a couple of notes (inline)

I settled on this in my deploy.rb file:
>
>> set :repository, "https://hikar...@github.com/hikari17/molex_acq.git";
>
>
Cap 2 has really, really bad support for HTTPs repositories, it stems from
the fact that Git provides no command line flags to pass in a username and
password in this context, preferring a .netrc, or to pass them on the
command line as part of the URL as you are doing, when the passowrd is not
given it can be prompted for, cached in credential helpers (if configured)
and you shouldn't need to prompt again, but all of this stuff is really not
neat. And regardless, one is still subject to the constraints about special
characters in URLs, so the passwords are limited in length/content, not
good.

I'm not sure why github are pushing the HTTPs authentication scheme, I
assume it has something to do with being able to eek out more performance
from HTTP based tools, and all the load balancing infrastructure they have
already, versus having to scale an openssl server.

> I then set the same thing in my [remote "origin"] entry in /.git/config:
>
>> url = https://hikar...@github.com/hikari17/molex_acq.git
>
> ****
>
> **
>
You shouldn't really play with this file by hand, the correct thing to do
would have been:

$ git remote rm origin
$ git remote add origin https://hikar...@github.com/hikari17/molex_acq.git

(but the effect is basically the same, I believe)

> On my production server, in the .git directory for my rails_root/current,
> there's an independent .git/config file, which manages to stay intact from
> deploy to deploy, and in it I've set:
>
> [remote "origin"]****
>
>        url = https://hikari17:passw...@github.com/hikari17/molex_acq.git**
> **
>
> **
>
Same here, except normally we'd build this cache for you, this is quite a
clever hack in a way, because there's no way that you could get Capistrano
to do that for you! Kudos.


> **So now when I cap deploy from my development box command line, I'm only
> prompted for my github password once, after that, the deploy process
> proceeds without any authorization problems.
>
Great! Although SSH keys, and agent forwarding would be better, and easier
to get set up, I guess that ship sailed when I missed our appointment!

> ****
>
> I don't completely understand why I can't leave the password out and be
> prompted for it like I was before, but it works, and I can finally deploy
> again.
>
When you are prompted for the password the first time, that's happening
locally, before you really get into Capistrano itself (not really, but
close enough), so that your workstation can determine the value of HEAD.
This check would usually be repeated (and you would usually see the prompt,
but not be able to respond to it through Capistrano) on the server side, at
which point you input goes nowhere, as Git isn't smart enough to recognise
that it *cannot* prompt a user over a Ruby client connection for input
(this is the pty/tty argument). This is where a lot of people get confused
"why does Cap accept my password the first time it's asked, but not the
second time", etc.

> Thanks for all your help,
>
Thanks for your patiance Dean, I'm really happy you were able to muddle
through to get something working, I'm just sorry that it hurt so much!

> Dean Richardson
>
 - Lee Hambley

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to