-
Notifications
You must be signed in to change notification settings - Fork 18k
x/vgo: vgo removed -insecure flag #25434
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
Comments
@rsc Was the removal of the |
Insecure was probably removed because many commands can now hit remote servers. Adding insecure flags to all such commands is probably not great idea. Perhaps if this remains a requirement we could introduce a new environment variable that takes a list of host prefixes to whitelist. GO_WHITELIST_ALLOW_INSECURE=internal.mycorp.local/vcs:vcs.test.local |
I would prefer if this was a flag. I would like to see it with the |
This is the first report I've seen of GitHub Enterprise running over HTTP instead of HTTPS. Is it really not available under HTTPS in your environment? One workaround is to put something in your ~/.gitconfig to tell git to rewrite https://your.server to http://your.server. |
Thank you for your answer very much. However, this method does not solve the problem, because vgo does not read .gitconfig file, it still access https://rnd-github.huawei.com/db/parser?go-get=1. baas@SZX1000428520:~/git/go/src/sql$ git config --get url.http://rnd-github.1485827954.workers.dev/.insteadof
https://rnd-github.1485827954.workers.dev/
baas@SZX1000428520:~/git/go/src/sql$ vgo get rnd-github.huawei.com/db/parser
FindRepo: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect
vgo get rnd-github.huawei.com/db/parser: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect
vgo: finding rnd-github.huawei.com/db/parser v0.0.0-20180125184044-316ea1d6f45f
FindRepo: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect
vgo: rnd-github.huawei.com/db/parser: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect
vgo: finding rnd-github.huawei.com/go/otto v1.0.0
FindRepo: Get https://rnd-github.huawei.com/go/otto?go-get=1: cannotconnect
vgo: rnd-github.huawei.com/go/otto: Get https://rnd-github.huawei.com/go/otto?go-get=1: cannotconnect
vgo: finding rnd-github.huawei.com/go/otto v1.0.0
FindRepo: Get https://rnd-github.huawei.com/go/otto?go-get=1: cannotconnect
vgo: rnd-github.huawei.com/go/otto: Get https://rnd-github.huawei.com/go/otto?go-get=1: cannotconnect
vgo get: Get https://rnd-github.huawei.com/go/otto?go-get=1: cannotconnect
baas@SZX1000428520:~/git/go/src/sql$ |
It looks like your git config isn't quite right (missing a colon). Here's an example:
Notice the Also, you'll need to ensure that you don't have old configs that are potentially clashing:
But like @rsc asked, do you really not have |
Thank you very much. I tested it, this does not solve the problem baas@SZX1000428520:~/git/go/src/sql$ git config -l | grep -i insteadof
url.http://rnd-github.1485827954.workers.dev/:.insteadof=https://rnd-github.1485827954.workers.dev/
baas@SZX1000428520:~/git/go/src/sql$ vgo build
vgo: finding rnd-github.huawei.com/db/parser v0.0.0-20180125184044-316ea1d6f45f
FindRepo: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect
vgo: rnd-github.huawei.com/db/parser: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect For the follow problem, I have used nginx agent to solve this problem:) But like @rsc asked, do you really not have https available? |
Just for the record, it looks like the So you would need to have the following:
Glad you have a solution. |
I feel sorry for my mistake I tested it again, but it still can not solve the problem baas@SZX1000428520:~/git/go/src/sql$ git config -l | grep .insteadof
url.http://rnd-github.huawei.com/:.insteadof=https://rnd-github.huawei.com/
baas@SZX1000428520:~/git/go/src/sql$ vgo build
vgo: finding rnd-github.huawei.com/db/parser v0.0.0-20180125184044-316ea1d6f45f
FindRepo: Get https://rnd-github.huawei.com/db/parser?go-get=1: cannotconnect I found that vgo does not use .gitconfig's url map: func lookupCustomDomain(path string) (Repo, error) {
var body io.ReadCloser
err := web.Get(
"https://"+path+"?go-get=1",
web.Non200OK(),
web.Body(&body),
)
if body != nil {
defer body.Close()
}
//...
} |
me too:) baas@SZX1000428520:~/git/go/src$ (command cd $(go list -f "{{.Dir}}" github.com/golang/vgo); git rev-parse HEAD)
6a94eb3b5ccc04453d2fb45c23641e5993118068 |
Sorry, I've also missed something obvious here. I'll defer to @rsc on whether we want to align this with the |
If a company runs GitHub Enterprise or something similar behind VPN, they typically do not use HTTPS because setting it up is a hassle. For example, if they use their own custom domain like So |
What version of Go are you using (
go version
)?go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/baas/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/baas/git/go"
GORACE=""
GOROOT="/home/baas/my/go"
GOTMPDIR=""
GOTOOLDIR="/home/baas/my/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build608113082=/tmp/go-build -gno-record-gcc-switches"
What did you do?
What did you expect to see?
get the rnd-github.huawei.com/db/parser/sql from github enterprise
What did you see instead?
The text was updated successfully, but these errors were encountered: