summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-07-27 09:37:34 +0000
committerNick Thomas <nick@gitlab.com>2021-07-27 09:37:34 +0000
commitf9e7ffda68192d24ff26f0d5ff7fe70e376c32f2 (patch)
tree987108c203fe5583a82bdc44e6277ab6d11fe7af
parent82a2153dcc093a99445aedd3734fe7ef868e3a4b (diff)
parent76260c3b48b08879e631a3e410b5db4e473653e0 (diff)
downloadgitlab-shell-f9e7ffda68192d24ff26f0d5ff7fe70e376c32f2.tar.gz
Merge branch 'sh-update-go-proxyproto' into 'main'
Update go-proxyproto to v0.6.0 See merge request gitlab-org/gitlab-shell!499
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--internal/sshd/sshd.go6
3 files changed, 8 insertions, 4 deletions
diff --git a/go.mod b/go.mod
index 0b8e2d2..f0fe06d 100644
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@ require (
github.com/mattn/go-shellwords v1.0.11
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/otiai10/copy v1.4.2
- github.com/pires/go-proxyproto v0.5.0
+ github.com/pires/go-proxyproto v0.6.0
github.com/prometheus/client_golang v1.10.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
diff --git a/go.sum b/go.sum
index d1b51ff..a47a123 100644
--- a/go.sum
+++ b/go.sum
@@ -505,8 +505,8 @@ github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
-github.com/pires/go-proxyproto v0.5.0 h1:A4Jv4ZCaV3AFJeGh5mGwkz4iuWUYMlQ7IoO/GTuSuLo=
-github.com/pires/go-proxyproto v0.5.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY=
+github.com/pires/go-proxyproto v0.6.0 h1:cLJUPnuQdiNf7P/wbeOKmM1khVdaMgTFDLj8h9ZrVYk=
+github.com/pires/go-proxyproto v0.6.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY=
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
diff --git a/internal/sshd/sshd.go b/internal/sshd/sshd.go
index 7f96bef..8b49712 100644
--- a/internal/sshd/sshd.go
+++ b/internal/sshd/sshd.go
@@ -29,6 +29,7 @@ const (
StatusReady
StatusOnShutdown
StatusClosed
+ ProxyHeaderTimeout = 90 * time.Second
)
type Server struct {
@@ -84,7 +85,10 @@ func (s *Server) listen() error {
}
if s.Config.Server.ProxyProtocol {
- sshListener = &proxyproto.Listener{Listener: sshListener}
+ sshListener = &proxyproto.Listener{
+ Listener: sshListener,
+ ReadHeaderTimeout: ProxyHeaderTimeout,
+ }
log.Info("Proxy protocol is enabled")
}