Giter VIP home page Giter VIP logo

goproxy's People

Contributors

bastjan avatar codeskyblue avatar edwardpro avatar fancy-rabbit avatar fsm-xyz avatar httpcheck avatar hxzhao527 avatar ianwoolf avatar imneov avatar jamesaorson avatar jsign avatar mmelnyk avatar mr-tron avatar na4ma4 avatar nafisfaysal avatar oiooj avatar pingtest avatar prologic avatar rainbowmango avatar rmfish avatar schemacs avatar senmumu avatar stanxing avatar superryanguo avatar wolfogre avatar y4ssss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goproxy's Issues

go get -u is not latest version ,is bug?

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?

Use path.Match instead of regexp

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.

/cc @imneov @prologic

can't get cloud.google.com/go

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/

can`t build on go1.12

 :~/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

thanks

😋 头疼下载墙外的包 ,解决了获取goalng.org/x/... 的问题 谢谢 goproxy.io

Unable to download library with initials capitalized

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"

can i control the caching time ?

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 ?

Docker Hub -> Automated Build

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.

could goproxy support mirror?

To install goproxy inside Greatwall, mirror is essential.

Repository mirrors

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",
]

unknown revision

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

Cannot get the new version of a package: parsing go.mod: missing module line

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

无法安装golang.org/x/net

  1. 在google cloud的一台机器上安装了自己编译出来的goproxy
  2. 本地mac笔记本设置了GOPROXY
  3. go get -v -u golang.org/x/net
    本地日志:
    go: finding golang.org/x/net latest
    go: finding golang.org/x latest
    go: finding golang.org latest
    go get golang.org/x/net: no matching versions for query "latest"

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]
就可以安装成功

cacheDir in docker-compose.yaml causes cache only in docker container.

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.

can't get last tag version

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

double brackets in build/generate.sh

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.

build failed in go1.12

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

你好,我使用 set export GOPROXY=https://goproxy.io,仍然无法拉去依赖包

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

the `internal` package is missing

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?

The `internal` package is missing

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?

[bug] goproxy returning earliest version instead of latest

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

Some libraries will always have unexpected end of JSON input errors

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

Fetch package isn't latest version

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.

Add more tests into proxy_test

We need to add more tests into proxy_test.go, like:

  • golang.org/x/net latest (pass)
  • github.com/micro/go-api/resolver cbf6e7fcfe8a (maybe fail)
  • github.com/micro/go-api master (pass)
  • cloud.google.com/go (pass)
  • github.com/oiooj/agent v0.2.2 (maybe fail)
  • github.com/mritd/sshutils v0.0.0-20181227030943-b85e20a7d4b8 (pass)

Cannot parse capital package

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

The project doesn't buld

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!

404 not found

  • docker build . -t goproxy
  • docker run -d -p 8081:8081 goproxy
  • Then I wrote a script to test :
#!/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
  • Script output:

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 output:

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

  • When I replace 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

unknown version

Hi,I use go mod download,I got this:
2
then I accessed https://goproxy.io/github.com/micro/go-micro/@v/v0.27.0.info by chrome, and it was blank.
v0.27.0 is the newest version of go-micro.
so does the goproxy.io need some time for synchronization?

Can't recognize newly added repo tags

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

Docker image is broken

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:

  • Build a static binary in the build iamge

or

  • Use the same base image root file-system so expected run-time libraries are the same.

I can submit a PR to fix this -- I'll likely do the later and use golang:alpine for the builder image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.