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

How to use SSH for Ktra config file #18

Open
tomus85 opened this issue Mar 11, 2021 · 2 comments
Open

How to use SSH for Ktra config file #18

tomus85 opened this issue Mar 11, 2021 · 2 comments

Comments

@tomus85
Copy link

tomus85 commented Mar 11, 2021

I am using GitLab self hosting (Got Gitlab set up on my Synology - been using it for years now)

Now I want to implement Ktra for my Rust projects.

I've got to this stage:
https://book.ktra.dev/quick_start/create_ktra_configuration_file.html
I tried:

https_username
https_password

However, because it is self-hosting I'm not using HTTPS, it just HTTP so this doesn't work.

So I tried to use SSH instead, so here is the file

[index_config]
remote_url = "ssh://git@<self-hosting-url>/crate/registry.git"
ssh_privkey_path = "~/.ssh/id_rsa.pub"
branch = "master"

When I do this:

Ktra -c ./cargo/ktra.toml

I get a message

Error: git error: username not defined

So I did the following:

git config --global user.name

I can see my username, but can't work out the problem. Am I missing any additional ssh fields in the .ktra.toml film?

@tomus85
Copy link
Author

tomus85 commented Mar 11, 2021

I've been messing about again with it and noticed when I try this:

cargo login --registry=ktra

I get this

  failed to authenticate when downloading repository

  * attempted to find username/password via git's `credential.helper` support, but failed

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  failed to acquire username/password from local configuration

How do I store the username and password in git's credential.helper config?

@tomus85
Copy link
Author

tomus85 commented Mar 11, 2021

No worries, seem to have fixed it. I restarted my Mac then add the following

git config --global credential.helper osxkeychain

Everything is working now.

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

1 participant