Snawoot / hola-proxy

Standalone Hola proxy client
MIT License
514 stars 46 forks source link

Upgrade dependency "github.com/AdguardTeam/dnsproxy" #73

Closed Ben131-Go closed 1 year ago

Ben131-Go commented 1 year ago

Background

Repo github.com/Snawoot/hola-proxy depends on github.com/AdguardTeam/dnsproxy@v0.46.1.
https://github.com/Snawoot/hola-proxy/blob/master/go.mod#L6
However, comparing version v0.46.1 of github.com/AdguardTeam/dnsproxy from proxy.golang.org and github, there are inconsistencies.

commit time of the copy on github.com

"committer": {
"name": "Andrey Meshkov",
"email": "am@adguard.com",
"date": "2022-10-19T12:47:27Z"
}

commit time of the copy on proxy.golang.org

{"Version":"v0.46.1","Time":"2022-10-19T11:49:20Z","Origin":{"VCS":"git","URL":"https://github.com/adguardteam/dnsproxy","Ref":"refs/tags/v0.46.1","Hash":"c76fa430b5e8f1588a552a982c0feda0b634873a"}}

So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v0.46.1 tag of github.com/AdguardTeam/dnsproxy might have been retagged after a minor edition on github. I guess you use proxy.golang.org to get dependencies, but that also shows that your project is depending on the copy of github.com/AdguardTeam/dnsproxy@v0.46.1 before its edition. Depending upon such inconsistent tag version may also result in some unexpected errors as well as build errors due to different proxy settings.
For example, when someone who does not use proxy.golang.org, say GOPROXY=direct, attempts to get github.com/AdguardTeam/dnsproxy@v0.46.1, the following error occurs.


go: downloading github.com/AdguardTeam/dnsproxy v0.46.1
go: github.com/AdguardTeam/dnsproxy@v0.46.1: verifying module: checksum mismatch
downloaded: h1:MPqUyAnIeIq5r7X4VpaJMPdQu3HwoWddKon2xM4IYGg=
sum.golang.org: h1:ej9iRorG+vekaXGYB854waAiS+q8OfswYZ1MQRZolHk=

SECURITY ERROR This download does NOT match the one reported by the checksum server. The bits may have been replaced on the origin server, or an attacker may have intercepted the download attempt.

For more information, see 'go help module-auth'.


So, this is a reminder in the hope that you can get rid of this problematic version of project `github.com/AdguardTeam/dnsproxy`.
## Solution
### 1. Bump the version of dependency `github.com/AdguardTeam/dnsproxy`
I would recommend bumping the version of `github.com/AdguardTeam/dnsproxy` to a new release to ensure dependency copy in proxy.golang.org and github in sync.

## References
+ <https://proxy.golang.org/>
Snawoot commented 1 year ago

@Ben131-Go Thank you for rich description! Update released in version 1.5.9.