Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies: Wireguard, go-ini and logrus #3

Merged
merged 3 commits into from
Dec 10, 2021

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented Dec 9, 2021

Let's upgrade dependencies again!

The Wireguard dependency was tripping up Dependabot on wg-access-server because the old tags no longer exist:

go: golang.zx2c4.com/wireguard@v0.0.20201118: reading golang.zx2c4.com/wireguard/go.mod at revision v0.0.20201118: unknown revision v0.0.20201118

Changes

  • github.com/sirupsen/logrus v1.6.0 -> v1.8.1
  • golang.zx2c4.com/wireguard v0.0.20200320 -> v0.0.0-20211129173154-2dd424e2d808
  • golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b -> v0.0.0-20211207222515-92d582e4e166
  • gopkg.in/ini.v1 v1.57.0 -> v1.66.2

The latest tagged version of Wireguard was buggy, peers couldn't connect because they never reached the running state, and handshake packets errored with Received invalid initiation message. So I chose the latest commit on master instead, which works just fine.
The Wireguard upgrade required changes to iface.go, because device.NewDevice() now takes a conn.Bind parameter, we just call conn.NewDefaultBind() for that, like wireguard-go does, too.

It will also bump the minimum Go version required for compilation to Go 1.17, as Wireguard uses some new language features.

The ini upgrade deprecated ini.DEFAULT_SECTION, it is now called ini.DefaultSection, parse() in config.go has been adjusted accordingly.
Also thanks to go-ini/ini#220 go-ini supports duplicate section names (i.e. multiple Peer sections), which simplifies config parsing a lot.
Technically this was already present in v1.57.0, but place1 never updated the code despite the comment.
I've expanded one of the unit test cases to make sure the parsing works as expected (although wg-access-server never uses any ini files)

* github.com/sirupsen/logrus v1.6.0 -> v1.8.1
* golang.zx2c4.com/wireguard v0.0.20200320 -> v0.0.0-20211129173154-2dd424e2d808
* golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b -> v0.0.0-20211207222515-92d582e4e166
* gopkg.in/ini.v1 v1.57.0 -> v1.66.2

I had to upgrade golang.zx2c4.com/wireguard and golang.zx2c4.com/wireguard/wgctrl to the latest master commit, as peers couldn't connect with the latest tag.
The Wireguard upgrade required changes to iface.go, because `device.NewDevice()` now takes a `conn.Bind` parameter, we just create a `NewDefaultBind()` for that.

The ini upgrade deprecated `ini.DEFAULT_SECTION`, it is now called `ini.DefaultSection`, `parse()` in config.go has been adjusted accordingly.
Copy link
Member

@GoliathLabs GoliathLabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants