abiosoft / caddy-git

git middleware for Caddy

Home Page:http://caddyserver.com/docs/http.git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this package assume git repo URLs with always have ".git" in them?

soypunk opened this issue · comments

I'm using AWS CodeCommit and the repo ssh URLs do not have ".git" on the end and will respond with repo not found if you append one to the URL. Is there anyway to disable the suffix being added?

What responds with repo not found? AWS CodeCommit or caddy-git?

Caddy-git is giving me the error on caddy restart that the repo is not found. When I looked at the caddy logs I saw it was appending a suffix of ".git" onto the repo URL I provided. I then manually tried to fetch the same git repo (using the .git suffix) over ssh using the same key, etc as the caddy server does. Git told me the repo was not found. I did see that it auth'd over SSH just fine though (I originally thought it might be a permissions error.). I then retried the request without ".git" and it worked fine.

I poked around the source code quickly for caddy-git it does seem like there's a spot in the function where the repo URL is constructed where it is appending ".git" but I couldn't see a means of controlling that behavior.

Oh, I understand your situation now. Yes, caddy-git appends .git to the URL if it's not there.
This was actually intentional, since git hosts generally honour the .git suffix.

I'll look at introducing a config to make that optional.

Fixed with c2dcbb4.

I've triggered a new release and should be available soon on caddyserver.com/download. If you build from source, your new build should have the fix.

Feel free to re-open if the issue is still not fixed.

Thanks so much for the quick response, Abiola. Apologies for not filing a pull-request with my initial issue...my work day didn't allow me to explore a bit more to submit that.