goproxyio / goproxy Goto Github PK
View Code? Open in Web Editor NEWA global proxy for Go modules.
Home Page: https://goproxy.io
License: MIT License
A global proxy for Go modules.
Home Page: https://goproxy.io
License: MIT License
Hope there is a docker image on DockerHub associate with the Dockerfile.
I create a repository github.com/foolin/goview, I made a mistake the repository is empty first, and i use the command:
go get github.com/foolin/goview
Then, I push the code to github, but I can't update the new version for forever, I clean the mod cache is sample problem:
go get -u github.com/foolin/goview
It always stay this version:
github.com/foolin/goview v0.0.0-20190414112242-eef16598e03f
How can I get the latest new version?
The flag exclude
in router mode should be a comma-separated list of glob patterns (in the syntax of Go's path.Match) of module path prefixes.
For example,
*.corp.example.com,rsc.io/private
Now, we use regexp
in https://github.com/goproxyio/goproxy/blob/master/proxy/router.go#L47
We can use this func from Go:
https://github.com/golang/go/blob/82cf8bca9cf20297bc0edf481cc530c9b3f4bf1e/src/cmd/go/internal/str/path.go#L54-L96
and we need set a GOPRIVATE
maybe in router mode.
error:
read: connection reset by peer
goproxy log:
2018/12/28 00:08:24 goproxy: 183.6.55.60:52545 request /cloud.google.com/go/
2018/12/28 00:08:24 goproxy: 183.6.55.60:52627 request /cloud.google.com/go/
2018/12/28 00:08:24 goproxy: 183.6.55.60:52628 request /cloud.google.com/go/
:~/goproxy$ go build
internal/modload/build.go:17:2: use of internal package internal/goroot not allowed
internal/buildid/buildid.go:11:2: use of internal package internal/xcoff not allowed
😋 头疼下载墙外的包 ,解决了获取goalng.org/x/... 的问题 谢谢 goproxy.io
go get -u
unable to download the new version just released, is there a cache or a delay?
It works fine when I remove GOPROXY.
Needs add tests for router mode.
see details here golang/go#33022
seems just catch signal.
go: finding github.com/PuerkitoBio/goquery v0.0.0-20181014175806-2af3d16e2bb8
go: finding github.com/Shopify/sarama v0.0.0-20180730132037-e7238b119b7d
go: finding github.com/Joinhack/fqueue v0.0.0-20140801051330-9afb37fd0de2
2018/12/27 16:03:36 goproxy: request /github.com/!puerkito!bio/goquery/@v/v0.0.0-20181014175806-2af3d16e2bb8.info
2018/12/27 16:03:36 goproxy: download github.com/!puerkito!bio/[email protected] get err invalid github.com/ import path "github.com/!puerkito!bio/goquery"
2018/12/27 16:03:36 goproxy: request /github.com/!joinhack/fqueue/@v/v0.0.0-20140801051330-9afb37fd0de2.info
2018/12/27 16:03:36 goproxy: download github.com/!joinhack/[email protected] get err invalid github.com/ import path "github.com/!joinhack/fqueue"
2018/12/27 16:03:36 goproxy: request /github.com/!shopify/sarama/@v/v0.0.0-20180730132037-e7238b119b7d.info
2018/12/27 16:03:36 goproxy: download github.com/!shopify/[email protected] get err invalid github.com/ import path "github.com/!shopify/sarama"
i setup a private goproxy, when i release a new git tag and use it immediately , the goproxy give an "goproxy: unknown revision v1.1.0" message, but after long time or restart the goproxy, it becomes ok, so i ask :
how long of the caching time to obtain git tag info?
where can i to adjust the caching time ?
Before we merge #43 -- Can you please remove the Docker Hub repo https://hub.docker.com/r/goproxy/goproxy and re-create it as an "Automated Build" so it builds automatically on new pushes to the Github repo?
This makes deployments far easier and more convenient as I can be sure that latest
points to mazter
and tags points to released versions.
Please remove go-api from your testdata.
To install goproxy inside Greatwall, mirror is essential.
Mirrors = [
"golang.org/x/(.*) => github.com/golang/$1",
"google.golang.org/appengine => github.com/golang/appengine",
"google.golang.org/genproto => github.com/google/go-genproto",
"google.golang.org/grpc => github.com/grpc/grpc-go",
"google.golang.org/api => github.com/googleapis/google-api-go-client",
"cloud.google.com/go => github.com/googleapis/google-cloud-go",
]
I build my own proxy can work well.
and i want to know if the https://goproxy.io is a public proxy service?
Because export GOPROXY=https://goproxy.io
doesn't work for me.
What I did:
$ go get github.com/ketao1989/[email protected]
go: finding github.com/ketao1989/gogo v1.0.0
go: github.com/ketao1989/[email protected]: unexpected status (https://goproxy.io/github.com/ketao1989/gogo/@v/v1.0.0.mod): 400 Bad Request
go: error loading module requirements
error log
2019/02/10 06:04:19 goproxy: 127.0.0.1:41230 request /github.com/ketao1989/gogo/@v/v1.0.0.info
2019/02/10 06:04:19 goproxy: 127.0.0.1:41232 request /github.com/ketao1989/gogo/@v/v1.0.0.mod
2019/02/10 06:04:19 goproxy: fetch modfile github.com/ketao1989/[email protected] get err unknown revision v1.0.0
2019/02/10 06:04:19 goproxy: unknown revision v1.0.0
When a certain package releases a new version, the proxy https://goproxy.io
cannot handle it.
For example, github.com/xgfone/gconf
releases a version v3.4.0
, then get it right now
[root@localhost gutils]# go mod tidy
go: finding github.com/xgfone/gconf v3.4.0+incompatible
go: github.com/xgfone/[email protected]+incompatible: parsing go.mod: missing module line
go: error loading module requirements
When I set GOPROXY
to https://gocenter.io
, however, it is ok.
[root@localhost gutils]# GOPROXY=https://gocenter.io go mod tidy
go: finding github.com/xgfone/gconf v3.4.0+incompatible
go: downloading github.com/xgfone/gconf v3.4.0+incompatible
go: downloading github.com/xgfone/klog v1.6.1
go: downloading github.com/xgfone/ship v1.5.0
go: downloading github.com/clbanning/mxj v1.6.1
go: downloading github.com/xgfone/logger v4.1.0+incompatible
go: downloading github.com/prometheus/client_golang v1.0.0
go: downloading github.com/prometheus/common v0.4.1
go: downloading golang.org/x/net v0.0.0-20181114220301-adae6a3d119a
go: downloading github.com/golang/protobuf v1.3.1
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/beorn7/perks v1.0.0
go: downloading github.com/prometheus/procfs v0.0.2
goproxy日志:
2018/12/26 14:11:39 goproxy: 119.130.228.90:30467 download /golang.org/x/net/@v/list
2018/12/26 14:11:39 goproxy: 119.130.228.90:30467 download /golang.org/x/net/@latest
2018/12/26 14:11:39 download get err not in cache
2018/12/26 14:11:40 goproxy: 119.130.228.90:30467 download /golang.org/x/@v/list
2018/12/26 14:11:40 goproxy: 119.130.228.90:30467 download /golang.org/x/@latest
2018/12/26 14:11:40 lookup failed: unrecognized import path "golang.org/x" (parse https://golang.org/x?go-get=1: no go-import meta tags ())
2018/12/26 14:11:40 goproxy: unrecognized import path "golang.org/x" (parse https://golang.org/x?go-get=1: no go-import meta tags ())
2018/12/26 14:11:40 goproxy: 119.130.228.90:30467 download /golang.org/@v/list
2018/12/26 14:11:40 goproxy: 119.130.228.90:30467 download /golang.org/@latest
2018/12/26 14:11:40 lookup failed: unrecognized import path "golang.org" (parse https://golang.org?go-get=1: no go-import meta tags ())
2018/12/26 14:11:40 goproxy: unrecognized import path "golang.org" (parse https://golang.org?go-get=1: no go-import meta tags ())
但是如果指定了版本号:
go get -v -u golang.org/x/[email protected]
就可以安装成功
if I attach the volume ./cacheDir to /ext as written in docker-compose.yaml, the logs show that goproxy will cache them under the path /go. So I edit docker-compose.yaml, change the line from "./cacheDir:/ext" to "./cacheDir:/go", goproxy write the files to the folder ./cacheDir.
1、i create a reposity A on my github,then i push my all code to the reposity and create tag "v1.0.0" for the reposity
2、i create go project B and import the package from github reposity A in my project B,that get the lastest version tag。
3、then i modify reposity A code and push to github,create tag v1.0.1 this time,to project B i run
"go build" command that can't use the v1.0.1 code from reposity A even i modify the version in go.mod file,but i cancel the goproxy , that's ok
Ubuntu 16.04 (and i think few over old LTS distros) doesn`t support double squre brackets [[
instead of [
.
I think it`s not so big script and supporting old systems is more important than better readability.
hi、When I am build goproxy in go1.12,I got this:
go generate
go build
go: finding github.com/goproxyio/goproxy/internal/sys latest
go: finding github.com/goproxyio/goproxy/internal latest
build github.com/goproxyio/goproxy: cannot load github.com/goproxyio/goproxy/internal/sys: cannot find module providing package github.com/goproxyio/goproxy/internal/sys
https://goproxy.io is timeout
set export GOPROXY=https://goproxy.io
go list
go: finding github.com/ugorji/go/codec latest go: finding github.com/gin-contrib/sse latest go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) go: error loading module requirements
go get gocloud.dev: unexpected status (https://goproxy.io/gocloud.dev/@v/list): 500 Internal Server Error.
go: finding github.com/mritd/sshutils v0.0.0-20181227030943-b85e20a7d4b8
go: github.com/mritd/[email protected]: unexpected status (https://goproxy.io/github.com/mritd/sshutils/@v/v0.0.0-20181227030943-b85e20a7d4b8.info): 404 Not Found
According to golang/go#10010 , and vcs.go#L226
go get
support fossil-scm.
But docker image buildpack-deps:stretch-scm does't contain it.
A lot of code depend the internal
package. like:
"github.com/goproxyio/goproxy/internal/cfg"
"github.com/goproxyio/goproxy/internal/modfetch"
"github.com/goproxyio/goproxy/internal/modfetch/codehost"
"github.com/goproxyio/goproxy/internal/modload"
"github.com/goproxyio/goproxy/internal/module"
But the internal
package is missing in the goproxy project. and the .gitignore
ignore internal/
.
Got this when build:
$ go build -o bin/goproxy -ldflags "-s -w" .
build github.com/goproxyio/goproxy: cannot load github.com/goproxyio/goproxy/internal/cfg: cannot find module providing package github.com/goproxyio/goproxy/internal/cfg
So, How can we build goproxy?
same with title.
Maybe we can abstract
Line 135 in 26d189e
A lot of code depend the internal
package. like:
"github.com/goproxyio/goproxy/internal/cfg"
"github.com/goproxyio/goproxy/internal/modfetch"
"github.com/goproxyio/goproxy/internal/modfetch/codehost"
"github.com/goproxyio/goproxy/internal/modload"
"github.com/goproxyio/goproxy/internal/module"
But the internal
package is missing in the goproxy project. and the .gitignore
ignore internal/
.
Got this when build:
$ go build -o bin/goproxy -ldflags "-s -w" .
build github.com/goproxyio/goproxy: cannot load github.com/goproxyio/goproxy/internal/cfg: cannot find module providing package github.com/goproxyio/goproxy/internal/cfg
So, How can we build goproxy?
go.mod
module first-go
go 1.12
main.go
package main
import "github.com/gonejack/glogger"
var logger = glogger.NewLogger("Service:Kafka")
func main() {
logger.Infof("info")
}
With command:
env GOPROXY=https://goproxy.io go mod tidy
goproxy.io is returning the earliest version:
go: finding github.com/gonejack/glogger latest
go: github.com/gonejack/[email protected]: parsing go.mod: unexpected module path "github.com/gonejack/logger"
go: error loading module requirements
With command:
env GOPROXY= go mod tidy
Everything is fine:
module first-go
go 1.12
require github.com/gonejack/glogger v1.0.2
https://goproxy.io/ cannot connect
Most of the vscode goalng extended dependencies will get this error, such as github.com/mdempsky/gocode
, golang.org/x/tools/cmd/guru
, golang.org/x/tools/cmd/gopls
.
go get -v golang.org/x/tools/cmd/gopls
go: finding golang.org/x/tools/cmd/gopls latest
go: finding golang.org/x/tools/cmd latest
go: finding golang.org latest
go: finding golang.org/x/tools latest
go: finding golang.org/x latest
go get golang.org/x/tools/cmd/gopls: module golang.org/x/tools/cmd: unexpected end of JSON input
Recently, I try to fetch firebase-admin-go
dependency by go get firebase.google.com/go
.
But it is previous version, not latest version.
go-xn (master)$ go get firebase.google.com/go
go: finding firebase.google.com/go v3.6.0+incompatible
go: downloading firebase.google.com/go v3.6.0+incompatible
go: extracting firebase.google.com/go v3.6.0+incompatible
go: finding google.golang.org/api/option latest
go: finding google.golang.org/api/iterator latest
go: finding google.golang.org/api/googleapi latest
go: finding golang.org/x/oauth2 latest
go: finding google.golang.org/api/transport latest
go: finding cloud.google.com/go/storage latest
go: finding golang.org/x/oauth2/google latest
go: finding google.golang.org/api/identitytoolkit/v3 latest
go: downloading google.golang.org/api v0.2.0
go: downloading golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914
go: finding cloud.google.com/go/firestore latest
go: finding google.golang.org/api/identitytoolkit latest
go: extracting golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914
Emm, its latest version v3.7.0
has been released for 19 days.
Try to write 'firebase.google.com/go v3.7.0+incompatible
' in go.mod file, then go mod download
, cloud not fetch other necessary packages, only fetch itself repo.
go-xn (master)$ go mod download
go: finding firebase.google.com/go v3.7.0
So, how can goproxy tool ensure pull dependency is up to date as early as possible.
I can't find my code in https://goproxy.io/github.com/nonetheless/docker-registry-client/@v/; So when I use GOPROXY="https://goproxy.io" go get -v github.com/nonetheless/docker-registry-client; I get nothing.
We need to add more tests into proxy_test.go
, like:
I try to use goproxy however I find it cannot parse packages whose name contain capital letters
> export GOPROXY=https://goproxy.io
> go get
go: github.com/Sirupsen/[email protected]: parsing go.mod: unexpected module path "github.com/sirupsen/logrus"
go: error loading module requirements
Hey folks, the project looks great!
I tried to build it from the source and looks like some dependencies (the github.com/goproxyio/goproxy/internal
modules) are missing. Can you please add them to GitHub?
Thanks!
#!/usr/bin/env bash
export GO111MODULE=on
export GOPROXY='http://127.0.0.1:8081'
export GOPATH=`pwd`
go get -v golang.org/x/crypto
go: finding golang.org/x/mod v0.1.0
Fetching http://127.0.0.1:8081/golang.org/x/mod/@v/v0.1.0.info
go: finding golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
Fetching http://127.0.0.1:8081/golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info
go: golang.org/x/[email protected]: unexpected status (http://127.0.0.1:8081/golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info): 404 Not Found
go: golang.org/x/[email protected]: unexpected status (http://127.0.0.1:8081/golang.org/x/mod/@v/v0.1.0.info): 404 Not Found
go: error loading module requirements
docker logs 5eb9215b4acc
0.630s 404 /golang.org/x/mod/@v/v0.1.0.info
0.629s 404 /golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info
0.614s 404 /golang.org/x/mod/@v/v0.1.0.info
0.612s 404 /golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info
0.640s 404 /golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info
0.651s 404 /golang.org/x/mod/@v/v0.1.0.info
0.652s 404 /golang.org/x/crypto/@v/v0.0.0-20190701094942-4def268fd1a4.info
0.660s 404 /golang.org/x/mod/@v/v0.1.0.info
http://127.0.0.1:8081
to https://goproxy.io
it is no problem. #!/usr/bin/env bash
export GO111MODULE=on
export GOPROXY='http://goproxy.io'
export GOPATH=`pwd`
go get -v golang.org/x/crypto
# go version
go version go1.12.7 linux/amd64
项目中的docker文件和https://goproxy.io是什么关系 设置了环境变量后还用启动docker goproxy/goproxy吗,如果必须端口能换成别的吗还是只能用80端口
Go Version: 1.12.0
ErrorMessage:
go: finding github.com/mattn/go-isatty v0.0.7
go: github.com/mattn/[email protected]: unexpected end of JSON input
go: error loading module requirements
But it can fetch the latest git summit hash.
国内还是不能用啊,有没有 china 的官方 goproxy.io 啊
I'm using local private goproxy with private repo (atlassian bitbucket)
repo A - comitted some code and added version tag v0.0.1
repo B - imported package from repo A and stated v0.0.1 in go.mod file
Added some code to repo A and tagged it with v0.0.2
changed go.mod file in repo B to follow version changes - changed to v0.0.2
GOPROXY can't get tag v0.0.2, console log:
2019/07/04 13:59:33 goproxy: 127.0.0.1:38454 request repoA/@v/v0.0.2.info
2019/07/04 13:59:33 goproxy: lookup [email protected] get err unknown revision v0.0.2
2019/07/04 13:59:33 goproxy: unknown revision v0.0.2
after restart of GOPROXY all working as expected:
2019/07/04 14:00:15 goproxy: 2019-07-04 14:00:15 inited. listen on 0.0.0.0:8081
2019/07/04 14:00:19 goproxy: 127.0.0.1:38474 request repoA/@v/v0.0.2.info
2019/07/04 14:00:19 goproxy: 127.0.0.1:38474 request repoA/@v/v0.0.2.mod
2019/07/04 14:00:19 goproxy: 127.0.0.1:38474 request repoA/@v/v0.0.2.zip
go get -u github.com/kataras/iris@master
go: finding github.com/kataras/iris master
go: finding github.com/kataras master
go: finding github.com master
go get github.com/kataras/iris@master: Get https://goproxy.io/github.com/kataras/iris/@v/master.info: x509: certificate has expired or is not yet valid
No matter what I install, the same problem will arise.
Because you are not building a static binary in the build image and use the golang:1.11
tag which uses an Ubuntu/Debian based file systme you are building against glibc. In the runtime image you then copy the resulting binary but use the alpine
base image.
This doesn't work :/
$ dki -t --rm goproxy/goproxy /bin/sh
/ # goproxy
/bin/sh: goproxy: not found
/ # ldd /bin/goproxy
/lib64/ld-linux-x86-64.so.2 (0x7ffba950e000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7ffba950e000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7ffba950e000)
Either we need to:
or
I can submit a PR to fix this -- I'll likely do the later and use golang:alpine
for the builder image.
仓库之前没有创建releases,使用https://goproxy.io/
代理拉了一次包,然后更新了代码创建了新的releases
用get get -u
,无法自动获取最新版本,list里也没有版本信息。只能手动指定版本。
比如这个项目https://goproxy.io/github.com/gojuukaze/go-watch-file/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.