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

Not able to go get a repository with non-80 port #6985

Closed
2 of 7 tasks
laszbalo opened this issue May 18, 2019 · 6 comments · Fixed by #7041
Closed
2 of 7 tasks

Not able to go get a repository with non-80 port #6985

laszbalo opened this issue May 18, 2019 · 6 comments · Fixed by #7041
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@laszbalo
Copy link

laszbalo commented May 18, 2019

  • Gitea version (or commit ref): 1.8.1
  • Git version: 2.17.1
  • Operating system: Xubuntu 19.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

According to the gogs issue tracker this issue has been fixed there, but apparently it is still present in gitea.

In my case gitea is running on port 13000 and trying to go get my golang package:

go get -v 192.168.1.66:13000/my_user_name/my_golang_repo

but got the following error:

unrecognized import path "192.168.1.66:13000/my_user_name/my_golang_repo" (parse https://192.168.1.66:13000/my_user_name/my_golang_repo?go-get=1: no go-import meta tags (meta tag 192.168.1.66/my_user_name/my_golang_repo did not match import path 192.168.1.66:13000/my_user_name/my_golang_repo))

@zeripath
Copy link
Contributor

OK, so even with backporting similar fixes to gitea this won't work:

:; go get -v -insecure 'localhost:3000/administrator/bugpush'        [19:09:51]
package localhost:3000/administrator/bugpush: localhost:3000/administrator/bugpush: invalid import path: malformed import path "localhost:3000/administrator/bugpush": invalid char ':

This is because go get will not allow : in a name.

So how were you testing this? I think there's a way using go mod but if you could provide a quick example that is not working that would be very helpful for me to test this.

@zeripath
Copy link
Contributor

So I've pushed a branch https://github.com/zeripath/gitea/tree/adjust-go-get-url-fix-%236985 but not opened a PR yet as I don't understand whether that would fix this.

@zeripath zeripath added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 23, 2019
@laszbalo
Copy link
Author

laszbalo commented May 23, 2019

Actually I made it work this afternoon, without changing anything in the Gitea code, but had to go out before I could close this issue.

I think the problem was that inside my app.ini, the DOMAIN key/property did not contain the port number, so I appended it:

DOMAIN           = 192.168.1.66:13000    ; port number was missing before
HTTP_PORT        = 13000

I had enabled go modules before I called go get:

export GO111MODULE=on

Hence I did not get the malformed import path error you posted above.

Appending the custom port number to the domain seemingly solved my particular issue of go getting golang modules, therefore I am not really sure either about what difference the backport would make, or what was the point modifying gogs at the first place. If you cannot think of a use case where your modification would add any value, then I am happy if you close this issue.

@zeripath
Copy link
Contributor

Hmm so force adding a port number is likely to break other things.

Are you saying that you're getting these using go modules?

Ok that's interesting - do you have a minimal testcase that I can adjust to try this on?

@laszbalo
Copy link
Author

Are you saying that DOMAIN should not contain a port number?

I don't have any testcases, but tomorrow I can write down exactly what I did step by step, if it can help.

@zeripath
Copy link
Contributor

Setting Domain to include the port will break letsencrypt - however it will fix the url.IsExternalURL which appears to be broken probably causing redirects to fail on non-80/non-443 redirects.

lafriks added a commit to zeripath/gitea that referenced this issue May 27, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants