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

Make go packages from subdirectories on gitea instances installable with "go get" #1485

Closed
jcgruenhage opened this issue Apr 11, 2017 · 7 comments · Fixed by #1518
Closed
Labels
Milestone

Comments

@jcgruenhage
Copy link

Currently, you can't fetch go projects from gitea, without the .git extension. This causes the binaries to have this ugly .git extension too and prevents people from fetching projects from subdirectories.

Documentation of meta-tags: https://golang.org/cmd/go/#hdr-Remote_import_paths
The PR and commit that fixed this in gitlab: gitlabhq/gitlabhq#7693 gitlabhq/gitlabhq@e23d6ad

@lunny lunny added the type/bug label Apr 12, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 12, 2017
@jcgruenhage
Copy link
Author

jcgruenhage commented Apr 13, 2017

Since this affects me more than I thought, I've decided to start looking into it. I've found that the header file in the base template folder already contains a meta tag for that, but that doesn't work, because somehow {{.GoGetImport}} doesn't start with the domain, but with localhost instead.

@jcgruenhage jcgruenhage changed the title Make go projects on gitea instances installable with "go get" Make go packages from subdirectories on gitea instances installable with "go get" Apr 13, 2017
@lunny
Copy link
Member

lunny commented Apr 20, 2017

@jcgruenhage any news?

@lunny
Copy link
Member

lunny commented Apr 20, 2017

I test go get git.lunny.info/lunny/tango. There is no problem. I found that you have to add DOMAIN = <your domain> on your custom/conf/app.ini before SSH_DOMAIN to let it work.

@jcgruenhage
Copy link
Author

I've changed the title. If the root directory is the go project you want to get, there is no problem, but if you want to get something in a subdirectory, that does not work, since the 404 page does not contain the appropriate meta tags.

@jcgruenhage
Copy link
Author

Works:

go get git.host.tld/user/repo

Doesn't work:

go get git.host.tld/user/repo/subdir

Workaround:

Clone the repo into $GOPATH/src/git.host.tld/user/repo first.

@lunny
Copy link
Member

lunny commented Apr 20, 2017

#1518 should fix go get git.host.tld/user/repo/subdir have you tried that?

@jcgruenhage
Copy link
Author

I am not sure why, but it seems to work.. I didn't think that that HTTP func was actually called when serving a 404..

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants