-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Question] - Anyone Successful with Index hosted on private GitLab repo? #44
Comments
I wouldn't expect any particular difficulties using a private GitLab repo. What issues are you seeing? Can you share any config files, and the command you're using to run the docker image? |
Just trying with a very simple local setup. Config.json is:
Server starts up (via docker) and I can get to the UI just fine - naturally everything is empty as the registry is. My .cargo/config is:
What I'm running into is when following directions, I try to search my registry - I get errors:
Would this be expected until I publish something? Or do I have something misconfigured? |
One of the least straightforward parts of the way the cargo registry index key works is that you need to actually point it at a git repo containing the index, rather than at the website itself. The index then points to the api of the site. So if you're hosting an index on gitlab at ~/.cargo/config: [registries.my-registry]
index = "https://gitlab.com/username/crate-index" You'll then also want to add that index url to your I think everything else looks correct. If you want to test without a remote index, change both the registry index and the index in |
Yeah, so doing that results in:
Its forcing git into basic auth vs ssh. Using the ssh url for the index also does not work. Does cargo assume that the index is public?? Thanks for your help - I'm from JVM-land and sort of expected this to work like a Maven repo, which it doesn't... |
Glad to help. This definitely seemed weird, so I tried it out myself to confirm the weirdness... To get it working, I ended up having to use a somewhat modified SSH url. I thought I recalled having an issue like this a while ago, I think it might be a weird cargo thing. ~/.cargo/config [registries.test]
index = "ssh://[email protected]/bmhenry/test-registry.git" Note two key differences from copy/pasting the SSH url from gitlab's I set my git remote to the same: Now that I think about it more, I think I recall this being a libgit2 requirement? I was trying to use private repos as cargo dependencies a year or so ago, and to use SSH I think I had to do the same URL changing. Kinda annoying. Another way may be to force Alexandrie to use the git cli backend, and the same for cargo. |
Thanks - that was very helpful! I had to also force Cargo to use the CLI via setting the env var Then it all worked! Thx again for your help - this should be in the documentation. Maybe I'll submit a PR for that - I also have a potential PR to alter the Dockerfile to use an Arg to specify the git host so it will properly ssh-keyscan. |
Been trying to get Alexandrie setup using a Gitlab private index - and am confused on the configuration I'd need.
I adjusted the Dockerfile to do an ssh-keyscan of gitlab.com - and that helped get me a bit further. Noticed that Gitlab locked down the master branch, so I set that as 'unprotected' - so in theory I can push to it. But wondering if there's anything else I need to setup so that this will work as expected.
Anyone have any luck going down this path?
The text was updated successfully, but these errors were encountered: