Skip to content
Permalink
Browse files

refactor: adapt to changes in github.com/goproxy/goproxy

  • Loading branch information
aofei committed Jan 7, 2020
1 parent 10421ed commit 41e5edb8ea53368e89ddf37699bd72b7ad684be1
Showing with 17 additions and 8 deletions.
  1. +2 −2 README.md
  2. +1 −1 README.zh-CN.md
  3. +3 −1 go.mod
  4. +10 −4 go.sum
  5. +1 −0 handler/handler.go
@@ -102,8 +102,8 @@ they are, so we can assure you that they will never be tampered with on our
side. However, if you still can't fully trust us, then you can use the most
trusted checksum database [sum.golang.org](https://sum.golang.org) to ensure
that the modules you get from us have not been tampered with, since Goproxy
China has supported
[proxying checksum databases](https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md#proxying-a-checksum-database).
China already supports
[proxying checksum databases](https://golang.org/design/25530-sumdb#proxying-a-checksum-database).

### Is Goproxy China legal in China?

@@ -73,7 +73,7 @@ C:\> $env:GOPROXY = "https://goproxy.cn"

### 使用 Goproxy 中国是否安全?

当然,和所有其他的 Go 模块代理一样,我们只是将模块原封不动地缓存起来,所以我们可以向你保证它们绝对不会在我们这边被篡改。不过,如果你还是不能够完全信任我们,那么你可以使用最值得信任的校验和数据库 [sum.golang.org](https://sum.golang.org) 来确保你从我们这里获取的模块没有被篡改过,因为 Goproxy 中国已经支持了[代理校验和数据库](https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md#proxying-a-checksum-database)。
当然,和所有其他的 Go 模块代理一样,我们只是将模块原封不动地缓存起来,所以我们可以向你保证它们绝对不会在我们这边被篡改。不过,如果你还是不能够完全信任我们,那么你可以使用最值得信任的校验和数据库 [sum.golang.org](https://sum.golang.org) 来确保你从我们这里获取的模块没有被篡改过,因为 Goproxy 中国已经支持了[代理校验和数据库](https://golang.org/design/25530-sumdb#proxying-a-checksum-database)。

### Goproxy 中国在中国是合法的吗?

4 go.mod
@@ -3,13 +3,14 @@ module github.com/goproxy/goproxy.cn
go 1.13

require (
github.com/VictoriaMetrics/fastcache v1.5.5 // indirect
github.com/air-gases/cacheman v0.9.1
github.com/air-gases/defibrillator v0.14.1
github.com/air-gases/limiter v0.14.1
github.com/air-gases/logger v0.14.1
github.com/air-gases/redirector v0.14.1
github.com/aofei/air v0.14.1
github.com/goproxy/goproxy v0.0.0-20191230065511-e5db0f793706
github.com/goproxy/goproxy v0.0.0-20200107124007-93d07b5deef8
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/qiniu/api.v7/v7 v7.4.1
github.com/rs/zerolog v1.17.2
@@ -18,4 +19,5 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.6.1
github.com/tdewolff/minify/v2 v2.7.0 // indirect
)
14 go.sum
@@ -4,6 +4,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/VictoriaMetrics/fastcache v1.5.4 h1:0BaXbRH01RycJk79OOBwMCXlNryko9z4yEf6RqbP+Xo=
github.com/VictoriaMetrics/fastcache v1.5.4/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8=
github.com/VictoriaMetrics/fastcache v1.5.5 h1:HsBlzPgzKG0566YOl1mmfyz8SCU0zLKfbl9RDLsiLD8=
github.com/VictoriaMetrics/fastcache v1.5.5/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8=
github.com/air-gases/cacheman v0.9.1 h1:e/PV1mPbH7hZO/p7WkBiXvKab0aVtnnB/flXc0h+/6c=
github.com/air-gases/cacheman v0.9.1/go.mod h1:hn+UVogaMW0T/68oZsvmBtNOOKgLBx97099Kl120ZIk=
github.com/air-gases/defibrillator v0.14.1 h1:yTtyKU9ZvzhBU3T3oenPU0s/trAw7q6jcsPEhSW9ckY=
@@ -65,8 +67,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goproxy/goproxy v0.0.0-20191230065511-e5db0f793706 h1:H1GdcuuKi9zVMx4MxoCeWmd82K8V/NZ6eLgY9wckvY4=
github.com/goproxy/goproxy v0.0.0-20191230065511-e5db0f793706/go.mod h1:v9SbTf+Ca4/C2RKSbdW6JQz3jje3Oftwd+muiK4y6b0=
github.com/goproxy/goproxy v0.0.0-20200107124007-93d07b5deef8 h1:8K8PLmKA1QJBvSTSG7flvQMPWIlfI5I0vg6/JoUeihc=
github.com/goproxy/goproxy v0.0.0-20200107124007-93d07b5deef8/go.mod h1:k8bGf4HX4TtzYllrWtaaOPcBR6N/TEAQ7spMjY3tBZo=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
@@ -165,9 +167,13 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tdewolff/minify/v2 v2.6.1 h1:UJLhbs2Q/iDrqA79EEyKE48uYHeAMPVdiUzdtKsatJ8=
github.com/tdewolff/minify/v2 v2.6.1/go.mod h1:l9hbQnH096st77OkscoRUvKdd23oUM6pDZpYx381sPo=
github.com/tdewolff/minify/v2 v2.7.0 h1:z1+mk91VJ5lyspFq9QVbgiPKqYP4r7rTz4CfGg0gLuU=
github.com/tdewolff/minify/v2 v2.7.0/go.mod h1:BkDSm8aMMT0ALGmpt7j3Ra7nLUgZL0qhyrAHXwxcy5w=
github.com/tdewolff/parse/v2 v2.3.14/go.mod h1:+V2lSZ93xpH2Csfs/vtNY1Fjr8kcFMsZKjyLoSkZbM0=
github.com/tdewolff/parse/v2 v2.4.1 h1:ANb9ubvS28GT8zFE618BlvJbGopChGFExK5v1KEm2w0=
github.com/tdewolff/parse/v2 v2.4.1/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho=
github.com/tdewolff/parse/v2 v2.4.2 h1:Bu2Qv6wepkc+Ou7iB/qHjAhEImlAP5vedzlQRUdj3BI=
github.com/tdewolff/parse/v2 v2.4.2/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho=
github.com/tdewolff/test v1.0.4/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.6 h1:76mzYJQ83Op284kMT+63iCNCI7NEERsIN8dLM+RiKr4=
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
@@ -219,8 +225,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76 h1:Dho5nD6R3PcW2SH1or8vS0dszDaXRxIw55lBX7XiE5g=
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e h1:LwyF2AFISC9nVbS6MgzsaQNSUsRXI49GS+YQ5KX/QH0=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -66,6 +66,7 @@ func init() {
localCacheRoot: goproxyViper.GetString("local_cache_root"),
}

g.ProxiedSUMDBNames = []string{"sum.golang.org"}
g.ErrorLogger = log.New(base.Logger, "", 0)
g.DisableNotFoundLog = true

0 comments on commit 41e5edb

Please sign in to comment.
You can’t perform that action at this time.