diff --git a/.circleci/config.yml b/.circleci/config.yml index 844ed294b..fb9159ff3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,14 +4,12 @@ defaults: working_directory: '/go/src/github.com/influxdata/telegraf' environment: GOFLAGS: -p=8 - go-1_12: &go-1_12 - docker: - - image: 'quay.io/influxdb/telegraf-ci:1.12.17' - environment: - GO111MODULE: 'on' go-1_13: &go-1_13 docker: - - image: 'quay.io/influxdb/telegraf-ci:1.13.8' + - image: 'quay.io/influxdb/telegraf-ci:1.13.11' + go-1_14: &go-1_14 + docker: + - image: 'quay.io/influxdb/telegraf-ci:1.14.3' mac: &mac macos: xcode: 11.3.1 @@ -23,7 +21,7 @@ defaults: version: 2 jobs: deps: - <<: [ *defaults, *go-1_13 ] + <<: [ *defaults, *go-1_14 ] steps: - checkout - restore_cache: @@ -64,22 +62,22 @@ jobs: - 'usr/local/bin/gofmt' - 'Users/distiller/go' - test-go-1.12: - <<: [ *defaults, *go-1_12 ] + test-go-1.13: + <<: [ *defaults, *go-1_13 ] steps: - attach_workspace: at: '/go' - run: 'make' - run: 'make test' - test-go-1.12-386: - <<: [ *defaults, *go-1_12 ] + test-go-1.13-386: + <<: [ *defaults, *go-1_13 ] steps: - attach_workspace: at: '/go' - run: 'GOARCH=386 make' - run: 'GOARCH=386 make test' - test-go-1.13: - <<: [ *defaults, *go-1_13 ] + test-go-1.14: + <<: [ *defaults, *go-1_14 ] steps: - attach_workspace: at: '/go' @@ -87,8 +85,8 @@ jobs: - run: 'make check' - run: 'make check-deps' - run: 'make test' - test-go-1.13-386: - <<: [ *defaults, *go-1_13 ] + test-go-1.14-386: + <<: [ *defaults, *go-1_14 ] steps: - attach_workspace: at: '/go' @@ -105,7 +103,7 @@ jobs: - run: 'make test' package: - <<: [ *defaults, *go-1_13 ] + <<: [ *defaults, *go-1_14 ] steps: - attach_workspace: at: '/go' @@ -114,7 +112,7 @@ jobs: path: './build' destination: 'build' release: - <<: [ *defaults, *go-1_13 ] + <<: [ *defaults, *go-1_14 ] steps: - attach_workspace: at: '/go' @@ -123,7 +121,7 @@ jobs: path: './build' destination: 'build' nightly: - <<: [ *defaults, *go-1_13 ] + <<: [ *defaults, *go-1_14 ] steps: - attach_workspace: at: '/go' @@ -144,18 +142,6 @@ workflows: filters: tags: only: /.*/ - - 'test-go-1.12': - requires: - - 'deps' - filters: - tags: - only: /.*/ - - 'test-go-1.12-386': - requires: - - 'deps' - filters: - tags: - only: /.*/ - 'test-go-1.13': requires: - 'deps' @@ -168,6 +154,18 @@ workflows: filters: tags: only: /.*/ + - 'test-go-1.14': + requires: + - 'deps' + filters: + tags: + only: /.*/ + - 'test-go-1.14-386': + requires: + - 'deps' + filters: + tags: + only: /.*/ - 'test-go-1.13-darwin': requires: - 'macdeps' @@ -176,16 +174,16 @@ workflows: only: /.*/ - 'package': requires: - - 'test-go-1.12' - - 'test-go-1.12-386' - 'test-go-1.13' - 'test-go-1.13-386' + - 'test-go-1.14' + - 'test-go-1.14-386' - 'release': requires: - - 'test-go-1.12' - - 'test-go-1.12-386' - 'test-go-1.13' - 'test-go-1.13-386' + - 'test-go-1.14' + - 'test-go-1.14-386' filters: tags: only: /.*/ @@ -194,24 +192,24 @@ workflows: nightly: jobs: - 'deps' - - 'test-go-1.12': - requires: - - 'deps' - - 'test-go-1.12-386': - requires: - - 'deps' - 'test-go-1.13': requires: - 'deps' - 'test-go-1.13-386': requires: - 'deps' + - 'test-go-1.14': + requires: + - 'deps' + - 'test-go-1.14-386': + requires: + - 'deps' - 'nightly': requires: - - 'test-go-1.12' - - 'test-go-1.12-386' - 'test-go-1.13' - 'test-go-1.13-386' + - 'test-go-1.14' + - 'test-go-1.14-386' triggers: - schedule: cron: "0 7 * * *" diff --git a/README.md b/README.md index 3391a038e..c749811de 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,9 @@ Ansible role: https://github.com/rossmcdonald/telegraf ### From Source: -Telegraf requires Go version 1.12 or newer, the Makefile requires GNU make. +Telegraf requires Go version 1.13 or newer, the Makefile requires GNU make. -1. [Install Go](https://golang.org/doc/install) >=1.12 (1.13 recommended) +1. [Install Go](https://golang.org/doc/install) >=1.13 (1.14 recommended) 2. Clone the Telegraf repository: ``` cd ~/src diff --git a/appveyor.yml b/appveyor.yml index bff7dc0cb..b454c8dc8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,7 @@ version: "{build}" +image: Visual Studio 2019 + cache: - C:\gopath\pkg\mod -> go.sum - C:\ProgramData\chocolatey\bin -> appveyor.yml @@ -8,13 +10,13 @@ cache: clone_folder: C:\gopath\src\github.com\influxdata\telegraf environment: - GOVERSION: 1.13.8 GOPATH: C:\gopath +stack: go 1.14 + platform: x64 install: - - choco install golang --version "%GOVERSION%" - choco install make - cd "%GOPATH%\src\github.com\influxdata\telegraf" - git config --system core.longpaths true diff --git a/docs/TLS.md b/docs/TLS.md index 363b0d968..3cd6a1025 100644 --- a/docs/TLS.md +++ b/docs/TLS.md @@ -20,9 +20,23 @@ For client TLS support we have the following options: # insecure_skip_verify = false ``` +### Server Configuration + +The server TLS configuration provides support for TLS mutual authentication: + +```toml +## Set one or more allowed client CA certificate file names to +## enable mutually authenticated TLS connections. +# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"] + +## Add service certificate and key. +# tls_cert = "/etc/telegraf/cert.pem" +# tls_key = "/etc/telegraf/key.pem" +``` + #### Advanced Configuration -For plugins using the standard client configuration you can also set several +For plugins using the standard server configuration you can also set several advanced settings. These options are not included in the sample configuration for the interest of brevity. @@ -47,14 +61,14 @@ for the interest of brevity. ## "TLS_RSA_WITH_AES_128_CBC_SHA256", ## "TLS_RSA_WITH_AES_128_CBC_SHA", ## "TLS_RSA_WITH_AES_256_CBC_SHA" -# ] +## ] # tls_cipher_suites = [] ## Minimum TLS version that is acceptable. # tls_min_version = "TLS10" ## Maximum SSL/TLS version that is acceptable. -# tls_max_version = "TLS12" +# tls_max_version = "TLS13" ``` Cipher suites for use with `tls_cipher_suites`: @@ -80,8 +94,6 @@ Cipher suites for use with `tls_cipher_suites`: - `TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384` - `TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305` - `TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305` - -TLS 1.3 cipher suites require Telegraf 1.12 and Go 1.12 or later: - `TLS_AES_128_GCM_SHA256` - `TLS_AES_256_GCM_SHA384` - `TLS_CHACHA20_POLY1305_SHA256` @@ -90,24 +102,4 @@ TLS versions for use with `tls_min_version` or `tls_max_version`: - `TLS10` - `TLS11` - `TLS12` -- `TLS13` (Telegraf 1.12 and Go 1.12 required, must enable TLS 1.3 using environment variables) - -### TLS 1.3 - -TLS 1.3 is available only on an opt-in basis in Go 1.12. To enable it, set the -GODEBUG environment variable (comma-separated key=value options) such that it -includes "tls13=1". - -### Server Configuration - -The server TLS configuration provides support for TLS mutual authentication: - -```toml -## Set one or more allowed client CA certificate file names to -## enable mutually authenticated TLS connections. -# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"] - -## Add service certificate and key. -# tls_cert = "/etc/telegraf/cert.pem" -# tls_key = "/etc/telegraf/key.pem" -``` +- `TLS13` diff --git a/internal/tls/common.go b/internal/tls/common.go index 3100a73a1..1ceb20c3f 100644 --- a/internal/tls/common.go +++ b/internal/tls/common.go @@ -6,6 +6,7 @@ var tlsVersionMap = map[string]uint16{ "TLS10": tls.VersionTLS10, "TLS11": tls.VersionTLS11, "TLS12": tls.VersionTLS12, + "TLS13": tls.VersionTLS13, } var tlsCipherMap = map[string]uint16{ @@ -31,4 +32,7 @@ var tlsCipherMap = map[string]uint16{ "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + "TLS_AES_128_GCM_SHA256": tls.TLS_AES_128_GCM_SHA256, + "TLS_AES_256_GCM_SHA384": tls.TLS_AES_256_GCM_SHA384, + "TLS_CHACHA20_POLY1305_SHA256": tls.TLS_CHACHA20_POLY1305_SHA256, } diff --git a/internal/tls/common_go112.go b/internal/tls/common_go112.go deleted file mode 100644 index 988d6f936..000000000 --- a/internal/tls/common_go112.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build go1.12 - -package tls - -import "crypto/tls" - -func init() { - tlsVersionMap["TLS13"] = tls.VersionTLS13 - tlsCipherMap["TLS_AES_128_GCM_SHA256"] = tls.TLS_AES_128_GCM_SHA256 - tlsCipherMap["TLS_AES_256_GCM_SHA384"] = tls.TLS_AES_256_GCM_SHA384 - tlsCipherMap["TLS_CHACHA20_POLY1305_SHA256"] = tls.TLS_CHACHA20_POLY1305_SHA256 -} diff --git a/plugins/inputs/apcupsd/apcupsd_test.go b/plugins/inputs/apcupsd/apcupsd_test.go index dfad765b3..e749d5137 100644 --- a/plugins/inputs/apcupsd/apcupsd_test.go +++ b/plugins/inputs/apcupsd/apcupsd_test.go @@ -1,5 +1,3 @@ -// +build go1.11 - package apcupsd import ( diff --git a/plugins/inputs/clickhouse/clickhouse.go b/plugins/inputs/clickhouse/clickhouse.go index cf28def66..4336444eb 100644 --- a/plugins/inputs/clickhouse/clickhouse.go +++ b/plugins/inputs/clickhouse/clickhouse.go @@ -205,6 +205,10 @@ func (ch *ClickHouse) Gather(acc telegraf.Accumulator) (err error) { return nil } +func (ch *ClickHouse) Stop() { + ch.client.CloseIdleConnections() +} + func (ch *ClickHouse) clusterIncludeExcludeFilter() string { if len(ch.ClusterInclude) == 0 && len(ch.ClusterExclude) == 0 { return "" diff --git a/plugins/inputs/clickhouse/clickhouse_go1.11.go b/plugins/inputs/clickhouse/clickhouse_go1.11.go deleted file mode 100644 index e043dd492..000000000 --- a/plugins/inputs/clickhouse/clickhouse_go1.11.go +++ /dev/null @@ -1,6 +0,0 @@ -// +build !go1.12 - -package clickhouse - -// Stop ClickHouse input service -func (ch *ClickHouse) Stop() {} diff --git a/plugins/inputs/clickhouse/clickhouse_go1.12.go b/plugins/inputs/clickhouse/clickhouse_go1.12.go deleted file mode 100644 index 86bb69e2b..000000000 --- a/plugins/inputs/clickhouse/clickhouse_go1.12.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build go1.12 - -package clickhouse - -// Stop ClickHouse input service -func (ch *ClickHouse) Stop() { - ch.client.CloseIdleConnections() -} diff --git a/scripts/ci-1.12.docker b/scripts/ci-1.12.docker deleted file mode 100644 index f3f59349a..000000000 --- a/scripts/ci-1.12.docker +++ /dev/null @@ -1,28 +0,0 @@ -FROM golang:1.12.17 - -RUN chmod -R 755 "$GOPATH" - -RUN DEBIAN_FRONTEND=noninteractive \ - apt update && apt install -y --no-install-recommends \ - autoconf \ - git \ - libtool \ - locales \ - make \ - python-boto \ - rpm \ - ruby \ - ruby-dev \ - zip && \ - rm -rf /var/lib/apt/lists/* - -RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime -RUN locale-gen C.UTF-8 || true -ENV LANG=C.UTF-8 - -RUN gem install fpm - -RUN go get -d github.com/golang/dep && \ - cd src/github.com/golang/dep && \ - git checkout -q v0.5.0 && \ - go install -ldflags="-X main.version=v0.5.0" ./cmd/dep diff --git a/scripts/ci-1.13.docker b/scripts/ci-1.13.docker index 9ee601ee1..0f312bc21 100644 --- a/scripts/ci-1.13.docker +++ b/scripts/ci-1.13.docker @@ -1,4 +1,4 @@ -FROM golang:1.13.8 +FROM golang:1.13.11 RUN chmod -R 755 "$GOPATH" diff --git a/scripts/ci-1.9.docker b/scripts/ci-1.14.docker similarity index 66% rename from scripts/ci-1.9.docker rename to scripts/ci-1.14.docker index 0a931c817..64bf18d9e 100644 --- a/scripts/ci-1.9.docker +++ b/scripts/ci-1.14.docker @@ -1,4 +1,4 @@ -FROM golang:1.9.7 +FROM golang:1.14.3 RUN chmod -R 755 "$GOPATH" @@ -21,8 +21,3 @@ RUN locale-gen C.UTF-8 || true ENV LANG=C.UTF-8 RUN gem install fpm - -RUN go get -d github.com/golang/dep && \ - cd src/github.com/golang/dep && \ - git checkout -q v0.5.0 && \ - go install -ldflags="-X main.version=v0.5.0" ./cmd/dep