godoc not showing documentation for gitea repos #1111

Closed
opened 2025-11-02 03:49:01 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @thehowl on GitHub (Sep 30, 2017).

Description

https://try.gitea.io/Howl/gorepo is a valid go package. However, godoc.org does not recognise it as such - and renders a 404 https://godoc.org/try.gitea.io/Howl/gorepo

Here is proof that godoc.org still works with other package urls:

Originally created by @thehowl on GitHub (Sep 30, 2017). - Can you reproduce the bug at https://try.gitea.io: - [x] Yes - [ ] No - [ ] Not relevant ## Description https://try.gitea.io/Howl/gorepo is a valid go package. However, godoc.org does not recognise it as such - and renders a 404 https://godoc.org/try.gitea.io/Howl/gorepo Here is proof that godoc.org still works with other package urls: * https://godoc.org/robpike.io/ivy * https://godoc.org/try.gogs.io/gogs/gogs
GiteaMirror added the type/bug label 2025-11-02 03:49:01 -06:00
Author
Owner

@sapk commented on GitHub (Oct 1, 2017):

Seems related to go get not working :

go get -u -v try.gitea.io/Howl/gorepo
Fetching https://try.gitea.io/Howl/gorepo?go-get=1
Parsing meta tags from https://try.gitea.io/Howl/gorepo?go-get=1 (status code 200)
package try.gitea.io/Howl/gorepo: unrecognized import path "try.gitea.io/Howl/gorepo" (parse https://try.gitea.io/Howl/gorepo?go-get=1: no go-import meta tags (meta tag localhost/Howl/gorepo did not match import path try.gitea.io/Howl/gorepo))
@sapk commented on GitHub (Oct 1, 2017): Seems related to go get not working : ``` go get -u -v try.gitea.io/Howl/gorepo Fetching https://try.gitea.io/Howl/gorepo?go-get=1 Parsing meta tags from https://try.gitea.io/Howl/gorepo?go-get=1 (status code 200) package try.gitea.io/Howl/gorepo: unrecognized import path "try.gitea.io/Howl/gorepo" (parse https://try.gitea.io/Howl/gorepo?go-get=1: no go-import meta tags (meta tag localhost/Howl/gorepo did not match import path try.gitea.io/Howl/gorepo)) ```
Author
Owner

@sapk commented on GitHub (Oct 1, 2017):

https://try.gitea.io/Howl/gorepo?go-get=1

<html>
	<head>
		<meta name="go-import" content="localhost/Howl/gorepo git https://try.gitea.io/Howl/gorepo.git">
		<meta name="go-source" content="localhost/Howl/gorepo _ https://try.gitea.io/Howl/gorepo/src/master{/dir} https://try.gitea.io/Howl/gorepo/src/master{/dir}/{file}#L{line}">
	</head>
	<body>
		go get localhost/Howl/gorepo
	</body>
</html>

should be

<html>
	<head>
		<meta name="go-import" content="try.gitea.io/Howl/gorepo git https://try.gitea.io/Howl/gorepo.git">
		<meta name="go-source" content="try.gitea.io/Howl/gorepo _ https://try.gitea.io/Howl/gorepo/src/master{/dir} https://try.gitea.io/Howl/gorepo/src/master{/dir}/{file}#L{line}">
	</head>
	<body>
		go get try.gitea.io/Howl/gorepo
	</body>
</html>
@sapk commented on GitHub (Oct 1, 2017): https://try.gitea.io/Howl/gorepo?go-get=1 ``` <html> <head> <meta name="go-import" content="localhost/Howl/gorepo git https://try.gitea.io/Howl/gorepo.git"> <meta name="go-source" content="localhost/Howl/gorepo _ https://try.gitea.io/Howl/gorepo/src/master{/dir} https://try.gitea.io/Howl/gorepo/src/master{/dir}/{file}#L{line}"> </head> <body> go get localhost/Howl/gorepo </body> </html> ``` should be ``` <html> <head> <meta name="go-import" content="try.gitea.io/Howl/gorepo git https://try.gitea.io/Howl/gorepo.git"> <meta name="go-source" content="try.gitea.io/Howl/gorepo _ https://try.gitea.io/Howl/gorepo/src/master{/dir} https://try.gitea.io/Howl/gorepo/src/master{/dir}/{file}#L{line}"> </head> <body> go get try.gitea.io/Howl/gorepo </body> </html> ```
Author
Owner

@sapk commented on GitHub (Oct 1, 2017):

It seems that it need to be set in DOMAIN config inside app.ini to work.
I can't find where it is set on try.gitea.io (cc @tboerger ?) but for your install just edit your app.ini.

@sapk commented on GitHub (Oct 1, 2017): It seems that it need to be set in DOMAIN config inside app.ini to work. I can't find where it is set on try.gitea.io (cc @tboerger ?) but for your install just edit your app.ini.
Author
Owner

@thehowl commented on GitHub (Oct 1, 2017):

Nice catch. This explains why it doesn't work on try.gitea.io. However, this is an issue I found also on my instance, configured with the correct domain: https://zxq.co/x/rs?go-get=1 https://godoc.org/zxq.co/x/rs

If you try to go get -u -v zxq.co/x/rs, it will work, while godoc returns a 404. I did some digging into the gddo repo source, and this is the relevant code that parses the go-get pages.

I thought this might have to do with the fact that there is no doctype, but this does not seem to be the case

@thehowl commented on GitHub (Oct 1, 2017): Nice catch. This explains why it doesn't work on try.gitea.io. However, this is an issue I found also on my instance, configured with the correct domain: https://zxq.co/x/rs?go-get=1 https://godoc.org/zxq.co/x/rs If you try to `go get -u -v zxq.co/x/rs`, it will work, while godoc returns a 404. I did some digging into the gddo repo source, [and this is the relevant code that parses the go-get pages](https://github.com/golang/gddo/blob/baa18d854fce5823437a3414ef0df89f172e7ec3/gosrc/gosrc.go#L228-L339). I thought this might have to do with the fact that there is no doctype, but this [does not seem to be the case](https://play.golang.org/p/3a2pkeHLEs)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1111