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

Allow using ssh keys other than the default #46

Open
lpw25 opened this issue Nov 28, 2016 · 8 comments
Open

Allow using ssh keys other than the default #46

lpw25 opened this issue Nov 28, 2016 · 8 comments

Comments

@lpw25
Copy link

lpw25 commented Nov 28, 2016

It seems that opam-publish does git clone [email protected]:ocaml/opam-repository.git to get the repository. This only works if the key associated with your account is in your default ssh identity. When that is not the case you can't use opam publish.

So it would be useful to give more control on how the repository is created. Either specifically specifying an identity file (I'm not sure how to pass that on through git but I assume there is a way), or just allowing to specify the command which should be used to clone the repo.

@AltGr
Copy link
Contributor

AltGr commented Dec 14, 2017

Not sure how best to handle this. You mean you have different SSH keys bound to different Github accounts ? Otherwise, you could probably set the proper identity for github.com in .ssh/config ?

I could add an option to pass arguments through to calls to git, but I am not sure it would solve your issue in the best way.

@lpw25
Copy link
Author

lpw25 commented Dec 14, 2017

Well I normally access github via an ssh Host declaration that uses the right hostname, identity file and user name (so I just write github:lpw25/ocaml and it does the right thing). The default identity file in my ssh config is not the one I use for github.

@AltGr
Copy link
Contributor

AltGr commented Dec 14, 2017

Ah, I see. Then why not define the same ssh Host as github.com ?

@lpw25
Copy link
Author

lpw25 commented Dec 14, 2017

I'd like to test if that will work, is there a way to do a dry run without making a pull request to the main opam repository?

@AltGr
Copy link
Contributor

AltGr commented Dec 14, 2017

You can make a PR to a different repo, see the opam-publish repo command. For example, use my fork:

$ opam publish repo add test AltGr/opam-repository
$ opam publish submit --repo=test ...

@XVilka
Copy link

XVilka commented Mar 20, 2018

Met the same problem here, what about adding the option of just using HTTPS?

@AltGr
Copy link
Contributor

AltGr commented Mar 20, 2018

Well, we need push access, so https is quite inconvenient there.

@XVilka
Copy link

XVilka commented Mar 20, 2018

@AltGr at GitHub HTTPS allows you to push without any problem.

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

No branches or pull requests

3 participants