Skip to content

Instructions for privately hosted go modules #182

@drewwells

Description

@drewwells

It is clear that goproxy can be used for private repositories, but it is unclear how to correctly set this up. I have put goproxy on a computer with full ssh access (and populated GOPATH). I am able to use this to pull code from a machine without private repo access, but there's some caveats with it.

The client computer didn't appear to use the proxy if it could call git directly. So I removed ssh credentials to prevent this path. If I don't specify --insecure, then go get fails on sumdb checks.

This does not work, fails on sumdb

GONOPROXY=github.com/myorg GONOSUMDB=github.com/myorg go run *.go -listen=0.0.0.0:8082 -exclude "github.com/myorg" -proxy http://nope.nope
-> % GOPROXY=http://192.127.1.25:8082 go get -d -v github.com/myorg/myrepo@v1.6.4
github.com/myorg/myrepo@v1.6.4: verifying module: github.com/myorg/myrepo@v1.6.4: reading http://192.127.1.25:8082/sumdb/sum.golang.org/lookup/github.com/myorg/myrepo@v1.6.4: 410 Gone
	server response: not found: github.com/myorg/myrepo@v1.6.4: invalid version: unknown revision v1.6.4

Disabling sumdb checks makes it work

GOPROXY=http://192.127.1.25:8082 go get --insecure -d -v github.com/myorg/myrepo@v1.6.4
go get: -insecure flag is deprecated; see 'go help get' for details
go: downloading github.com/myorg/myrepo v1.6.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions