diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-06-30 04:04:29 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-06-30 04:04:29 +0300 |
commit | 43a10756427e3287539b15541918c9c3d0b87aa5 (patch) | |
tree | 0cc14f9fd98292283a3a69bf9504bd0b0e8bb186 | |
parent | 0cdbc9fadb609c426b87a58796a14a5dd4f0e7dc (diff) |
Drop Go 1.12 and bump minimum Go 1.13
-rw-r--r-- | .gitlab-ci.yml | 6 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | internal/tlsconfig/tlsconfig_go1_12.go | 17 | ||||
-rw-r--r-- | internal/tlsconfig/tlsconfig_go1_12_test.go | 41 |
5 files changed, 3 insertions, 65 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99875ecc..0e121cb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ workflow: - if: '$CI_COMMIT_BRANCH =~ /^security\//' default: - image: golang:1.12 + image: golang:1.13 tags: - gitlab-org @@ -122,10 +122,6 @@ code_quality: paths: - ${REPORT_FILE} -test:1.12: - extends: .tests - image: golang:1.12 - test:1.13: extends: .tests image: golang:1.13 @@ -4,7 +4,7 @@ [![coverage report](https://gitlab.com/gitlab-org/gitlab-pages/badges/master/coverage.svg)](https://gitlab.com/gitlab-org/gitlab-pages/commits/master) This is a simple HTTP server written in Go, made to serve GitLab Pages with -CNAMEs and SNI using HTTP/HTTP2. The minimum supported Go version is v1.12. +CNAMEs and SNI using HTTP/HTTP2. The minimum supported Go version is v1.13. This is made to work in small to medium-scale environments. Start-up time scales with the number of projects being served, so the daemon is currently unsuitable @@ -1,6 +1,6 @@ module gitlab.com/gitlab-org/gitlab-pages -go 1.12 +go 1.14 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible diff --git a/internal/tlsconfig/tlsconfig_go1_12.go b/internal/tlsconfig/tlsconfig_go1_12.go deleted file mode 100644 index f92bdf09..00000000 --- a/internal/tlsconfig/tlsconfig_go1_12.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build go1.12 - -package tlsconfig - -import ( - "crypto/tls" -) - -func init() { - AllTLSVersions["tls1.3"] = tls.VersionTLS13 - - preferredCipherSuites = append(preferredCipherSuites, - tls.TLS_AES_128_GCM_SHA256, - tls.TLS_AES_256_GCM_SHA384, - tls.TLS_CHACHA20_POLY1305_SHA256, - ) -} diff --git a/internal/tlsconfig/tlsconfig_go1_12_test.go b/internal/tlsconfig/tlsconfig_go1_12_test.go deleted file mode 100644 index 09d18284..00000000 --- a/internal/tlsconfig/tlsconfig_go1_12_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// +build go1.12 - -package tlsconfig - -import ( - "os" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestEnableTLS13(t *testing.T) { - tests := map[string]struct { - tlsMin string - tlsMax string - enableTLS13 bool - }{ - "ask for minimum TLS 1.3": {tlsMin: "tls1.3", tlsMax: "", enableTLS13: true}, - "ask for maximim TLS 1.3": {tlsMin: "", tlsMax: "tls1.3", enableTLS13: true}, - "do not ask for TLS 1.3": {tlsMin: "tls1.2", tlsMax: "tls1.2", enableTLS13: false}, - } - - // Store original GODEBUG value - godebug := os.Getenv("GODEBUG") - - for name, tc := range tests { - t.Run(name, func(t *testing.T) { - err := ValidateTLSVersions(tc.tlsMin, tc.tlsMax) - require.NoError(t, err) - - if tc.enableTLS13 { - require.Regexp(t, "tls13=1", os.Getenv("GODEBUG")) - } else { - require.NotRegexp(t, "tls13=1", godebug) - } - }) - - // Restore original GODEBUG value - os.Setenv("GODEBUG", godebug) - } -} |