otac0n / WebGitNet

WebGit .NET is an ASP.NET MVC app that provides access to your git repositories over HTTP. It supports browsing in a web browser AND push / pull over Git's "Smart HTTP protocol".
zlib License
132 stars 62 forks source link

Cannot Create Repo #45

Closed ghost closed 12 years ago

ghost commented 12 years ago

I'm unable to create a repository. When I click on "Create Repo" or "Create a new Repo" on the bottom, I get a 404 error.

otac0n commented 12 years ago

Interesting.

Can you tell me a little bit more about how your stuff is configured? Did you make sure to edit the App.config to specify the repositories path? You may have to create that folder on disk, first.

This line needs to be a folder that exists on disk: https://github.com/otac0n/WebGitNet/blob/master/WebGitNet/Web.config#L4

ghost commented 12 years ago

Yeah. So, what I did was basically install the application under its own website in IIS, then I configured it to be authenticated by Active Directory so that not anyone could just hit it.

I enabled impersonation, setup the application so that it was running it its own app pool, configured the app pool to allow for 32 bit applications, made sure the app pool was running under the LocalSystem account, configured the application to connect to my existing home folder full of existing git repositories. Installed MVC 3.

I'm running on IIS7 on a Windows 2008 server.

When I get to the browse page, everything looks good - I can see the repositories. If I click on a repository, it takes me to the page of that repository where I can see all of the history, etc. I can manage the repository by clicking on "Manage Repo." I even added a few more fields in the manage repo section so that I can track "Type" and "Tags" for the repo. (Type: Windows Service, Web Application, WPF Application, etc.) The only problem is that when I try to create a repo from the GUI, it doesn't let me create. Just takes me straight to the 404 error.

ghost commented 12 years ago

Sorry. I didn't mean to close the issue.

otac0n commented 12 years ago

Hrm, everything sounds alright, but I've never set it up with impersonation. I usually used AD groups to restrict access. I'll try installing ot like that to see if I can reproduce the error.

ghost commented 12 years ago

Yeah, so, temporarily, I've commented out the "Create" links so that they don't appear on the webpage. It would be cool if it worked though. That way, when we're setting up a new repo, I don't have to remote into the server just to run git init --bare in the new directory.

I'm not super familiar with MVC, but I did notice that you didn't have a "Create Repo" route in the RegisterRoutes void in the Browse Controller. So, I added one like this: It still didn't work.

            routes.MapRoute(
                "Create Repo",
                "manage/create/",
                new { controller = "Manage", action = "Create" });
otac0n commented 12 years ago

I'm really perplexed as to how this is happening. That controller action does not throw any 404 errors anywhere.

What this means is that it is unable to locate that controller class or action method, but I can't imagine how everything else is working if that were the case.

Can you send me a zip of the application folder, so I can poke at it?

ghost commented 12 years ago

Even better - I actually forked your repo, made my changes and pushed it back up to my repo. Feel free to take a look.

https://github.com/jaressloo/WebGitNet

otac0n commented 12 years ago

Did that fix the problem?

ghost commented 12 years ago

My registering the route? Unfortunately, no. 

otac0n commented 12 years ago

Alright, I am able to reproduce the problem. I'll hopefully have a resolution soon. Interestingly, this exists on master, when I do a clean build.

otac0n commented 12 years ago

Ok, I figured it out. It is looking for a repository called "create", which doesn't exist on disk. This broke when we added support for archiving repositories. I'll have a fix pushed up shortly.

ghost commented 12 years ago

Awesome! Looking forward to seeing it.

otac0n commented 12 years ago

Fixed in d9ed76b55198d5e51e78b595f09c1bd7b5f2aeca

ghost commented 12 years ago

Just merged in your changes and everything looks good. Thanks, John!

otac0n commented 12 years ago

:) Glad to hear it. You're welcome.