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

Go 1.7 #971

Merged
merged 2 commits into from
Aug 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Improvements**

* `emp ps` now displays the task's host. [#983](https://github.com/remind101/empire/pull/983)
* The `empire` and `emp` binaries are now built with Go 1.7 [#971](https://github.com/remind101/empire/pull/971)

## 0.11.0 (2016-08-22)

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.5.3
FROM golang:1.7.0
MAINTAINER Eric Holmes <[email protected]>

LABEL version 0.11.0

ADD . /go/src/github.com/remind101/empire
WORKDIR /go/src/github.com/remind101/empire
RUN GO15VENDOREXPERIMENT=1 go install ./cmd/empire
RUN go install ./cmd/empire

ENTRYPOINT ["/go/bin/empire"]
CMD ["server"]
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ There is also a `tests` directory that contains integration and functional tests
To get started, run:

```console
$ export GO15VENDOREXPERIMENT=1
$ make bootstrap
```

Expand Down
12 changes: 10 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
machine:
environment:
GO15VENDOREXPERIMENT: 1
GODIST: "go1.7.linux-amd64.tar.gz"
services:
- docker
post:
- mkdir -p download
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
- sudo ln -s /usr/local/go/bin/go /usr/bin/go
- sudo go install -a -race std

checkout:
post:
Expand All @@ -11,10 +18,11 @@ checkout:
- cp -R ~/empire ~/.go_workspace/src/github.com/remind101/empire

dependencies:
cache_directories:
- ~/download
pre:
- go get github.com/aktau/github-release
- sudo pip install awscli
- go install -a -race std
- go version
- cd ~/.go_workspace/src/github.com/remind101/empire && make bootstrap
override:
Expand Down
1 change: 0 additions & 1 deletion cmd/emp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ $ brew install emp
If you have a working Go 1.5+ environment, you can do the following:

```console
$ export GO15VENDOREXPERIMENT=1 # Required for Go 1.5.x
$ go get -u github.com/remind101/empire/cmd/emp
```

Expand Down
32 changes: 30 additions & 2 deletions cmd/emp/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Con
// from the hostname we're connecting to.
if config.ServerName == "" {
// Make a copy to avoid polluting argument or default.
c := *config
c := cloneTLSConfig(config)
c.ServerName = hostname
config = &c
config = c
}

conn := tls.Client(rawConn, config)
Expand Down Expand Up @@ -91,3 +91,31 @@ func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Con
func tlsDial(network, addr string, config *tls.Config) (net.Conn, error) {
return tlsDialWithDialer(new(net.Dialer), network, addr, config)
}

// Copied from https://golang.org/src/crypto/tls/common.go?s=9735:14940#L263,
// since the stdlib doesn't expose the `clone()` method.
func cloneTLSConfig(c *tls.Config) *tls.Config {
return &tls.Config{
Rand: c.Rand,
Time: c.Time,
Certificates: c.Certificates,
NameToCertificate: c.NameToCertificate,
GetCertificate: c.GetCertificate,
RootCAs: c.RootCAs,
NextProtos: c.NextProtos,
ServerName: c.ServerName,
ClientAuth: c.ClientAuth,
ClientCAs: c.ClientCAs,
InsecureSkipVerify: c.InsecureSkipVerify,
CipherSuites: c.CipherSuites,
PreferServerCipherSuites: c.PreferServerCipherSuites,
SessionTicketsDisabled: c.SessionTicketsDisabled,
SessionTicketKey: c.SessionTicketKey,
ClientSessionCache: c.ClientSessionCache,
MinVersion: c.MinVersion,
MaxVersion: c.MaxVersion,
CurvePreferences: c.CurvePreferences,
DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
Renegotiation: c.Renegotiation,
}
}