-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Unable to push local repo into http server #75
Comments
Added the necessary configuration-line which seems to allow pushing to the repository via HTTP. But please note that this sample server does not do much useful stuff, it is mostly just a sample to show that the GitServlet does work basically. |
Thanks, but how to add credentials to the GitServlet? Is there any sample code or documentation? I didn't find helpful stuff yet. |
Unfortunately I don't have much knowledge about it and I also could not find much information when I worked on this sample. I am not a JGit developer at all, so you might need to contact JGit developers to get more information. |
Ok, Thanks. So if I find something useful, I will share it. |
I asked JGit developers and here is the solution that I found (based on the answer): In my java web application (a simple servlet application) I defined a security constraint and basic login config in web.xml:
Also in jetty 9.4 standalone server (my servlet container) I defined a bean for handling security in jetty/etc/jetty.xml:
Also I created realm.properties under jetty/etc that contained users credentials and roles: note that adminuser is a username and secret123 is password and admin is role that defined in web.xml in the first step. So the user with adminuser username and the role of admin is able to clone, push and fetch repositories which is configured to be accessible under GitServlet. Here is my extended class from org.eclipse.jgit.http.server.GitServlet in my web application:
|
Thanks for the update, I will review if some of that should be incorporated into the sample in this project. |
Great. I'm available to help if needed. |
Hi,
I ran the Example under httpserver and want to push my local repository to http://localhost:8080/TestRepo .But it fails in authentication:
Authentication failed for 'http://localhost:8080/TestRepo/'
So how could I provide authentication mechanism for GitServlet to accept credentials?
I also tried extending org.eclipse.jgit.http.server.GitServlet in a servlet project running on a standalone Jetty, but I faced the similar issue.
The text was updated successfully, but these errors were encountered: