Skip to content

Commit

Permalink
Merge pull request #157 from antoniomika/am/dependency-upgrade
Browse files Browse the repository at this point in the history
Updated dependencies and fix #155
  • Loading branch information
antoniomika authored Feb 15, 2021
2 parents a147db6 + 545d16b commit 19dee65
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 361 deletions.
58 changes: 31 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
module github.com/antoniomika/sish

go 1.15

require (
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5
github.com/antoniomika/go-proxyproto v0.1.4-0.20200616163129-7fa9d35a141d
github.com/antoniomika/oxy v1.1.1-0.20200517194743-bedd7c62c77e
github.com/caddyserver/certmagic v0.11.2
github.com/cenkalti/backoff/v4 v4.0.2 // indirect
github.com/caddyserver/certmagic v0.12.0
github.com/fsnotify/fsnotify v1.4.9
github.com/gin-gonic/gin v1.6.3
github.com/go-playground/validator/v10 v10.3.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/gorilla/websocket v1.4.2
github.com/jpillora/ipfilter v1.2.1
github.com/jpillora/ipfilter v1.2.2
github.com/json-iterator/go v1.1.10 // indirect
github.com/klauspost/cpuid v1.3.0 // indirect
github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381
github.com/mailgun/timetools v0.0.0-20170619190023-f3a7b8ffff47 // indirect
github.com/miekg/dns v1.1.29 // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/magiconair/properties v1.8.4 // indirect
github.com/mholt/acmez v0.1.3 // indirect
github.com/miekg/dns v1.1.38 // indirect
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/mitchellh/mapstructure v1.3.2 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/phuslu/geoip v1.0.20200531 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/afero v1.2.2 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/phuslu/iploc v1.0.20210129 // indirect
github.com/pires/go-proxyproto v0.4.2
github.com/sirupsen/logrus v1.7.0
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/cobra v1.1.3
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect
google.golang.org/protobuf v1.24.0 // indirect
gopkg.in/ini.v1 v1.57.0 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
github.com/spf13/viper v1.7.1
github.com/ugorji/go v1.2.4 // indirect
github.com/vulcand/oxy v1.1.0
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/text v0.3.5 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
)

go 1.15
replace github.com/vulcand/oxy => github.com/antoniomika/oxy v1.1.1-0.20210215225031-0afb828604bb

replace github.com/pires/go-proxyproto => github.com/antoniomika/go-proxyproto v0.1.4-0.20210215223815-7210fcdac442
440 changes: 129 additions & 311 deletions go.sum

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions httpmuxer/httpmuxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"strings"
"time"

"github.com/antoniomika/go-proxyproto"
"github.com/antoniomika/oxy/forward"
"github.com/antoniomika/sish/utils"
"github.com/caddyserver/certmagic"
"github.com/pires/go-proxyproto"
"github.com/spf13/viper"
"github.com/vulcand/oxy/forward"

"github.com/gin-gonic/gin"
)
Expand Down Expand Up @@ -154,6 +154,10 @@ func Start(state *utils.State) {
// You can use sish without a wildcard cert, but you really should. If you get a lot of clients
// with many random subdomains, you'll burn through your Let's Encrypt quota. Be careful!
if viper.GetBool("https") {
certmagic.Default.Storage = &certmagic.FileStorage{
Path: filepath.Join(viper.GetString("https-certificate-directory"), "certmagic"),
}

certManager := certmagic.NewDefault()

acmeManager := certmagic.NewACMEManager(certManager, certmagic.DefaultACME)
Expand All @@ -163,10 +167,6 @@ func Start(state *utils.State) {

certManager.Issuer = acmeManager

certManager.Storage = &certmagic.FileStorage{
Path: filepath.Join(viper.GetString("https-certificate-directory"), "certmagic"),
}

certManager.OnDemand = &certmagic.OnDemandConfig{
DecisionFunc: func(name string) error {
if !viper.GetBool("https-ondemand-certificate") {
Expand Down
2 changes: 1 addition & 1 deletion sshmuxer/aliashandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"strings"
"sync"

"github.com/antoniomika/oxy/roundrobin"
"github.com/antoniomika/sish/utils"
"github.com/logrusorgru/aurora"
"github.com/spf13/viper"
"github.com/vulcand/oxy/roundrobin"
)

// handleAliasListener handles the creation of the aliasHandler
Expand Down
4 changes: 2 additions & 2 deletions sshmuxer/httphandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"strings"
"sync"

"github.com/antoniomika/oxy/forward"
"github.com/antoniomika/oxy/roundrobin"
"github.com/antoniomika/sish/httpmuxer"
"github.com/antoniomika/sish/utils"
"github.com/logrusorgru/aurora"
"github.com/spf13/viper"
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/roundrobin"
)

// handleHTTPListener handles the creation of the httpHandler
Expand Down
14 changes: 6 additions & 8 deletions sshmuxer/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strconv"
"sync"

"github.com/antoniomika/go-proxyproto"
"github.com/antoniomika/sish/utils"
"github.com/logrusorgru/aurora"
"github.com/pires/go-proxyproto"
"github.com/spf13/viper"
"golang.org/x/crypto/ssh"
)
Expand Down Expand Up @@ -250,13 +250,11 @@ func handleRemoteForward(newRequest *ssh.Request, sshConn *utils.SSHConnection,
}

proxyProtoHeader := proxyproto.Header{
Version: sshConn.ProxyProto,
Command: proxyproto.ProtocolVersionAndCommand(proxyproto.PROXY),
TransportProtocol: proxyproto.AddressFamilyAndProtocol(proxyproto.TCPv4),
SourceAddress: sourceInfo.IP,
DestinationAddress: destInfo.IP,
SourcePort: uint16(sourceInfo.Port),
DestinationPort: uint16(destInfo.Port),
Version: sshConn.ProxyProto,
Command: proxyproto.ProtocolVersionAndCommand(proxyproto.PROXY),
TransportProtocol: proxyproto.AddressFamilyAndProtocol(proxyproto.TCPv4),
SourceAddr: sourceInfo,
DestinationAddr: destInfo,
}

_, err := proxyProtoHeader.WriteTo(newChan)
Expand Down
2 changes: 1 addition & 1 deletion sshmuxer/sshmuxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sync"
"time"

"github.com/antoniomika/go-proxyproto"
"github.com/antoniomika/sish/httpmuxer"
"github.com/antoniomika/sish/utils"
"github.com/pires/go-proxyproto"
"github.com/spf13/viper"
"golang.org/x/crypto/ssh"
)
Expand Down
4 changes: 2 additions & 2 deletions sshmuxer/tcphandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"strings"
"sync"

"github.com/antoniomika/go-proxyproto"
"github.com/antoniomika/oxy/roundrobin"
"github.com/antoniomika/sish/utils"
"github.com/logrusorgru/aurora"
"github.com/pires/go-proxyproto"
"github.com/spf13/viper"
"github.com/vulcand/oxy/roundrobin"
)

// handleTCPListener handles the creation of the tcpHandler
Expand Down
4 changes: 2 additions & 2 deletions utils/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"sync"
"time"

"github.com/antoniomika/oxy/forward"
"github.com/antoniomika/oxy/roundrobin"
"github.com/jpillora/ipfilter"
"github.com/spf13/viper"
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/roundrobin"
)

// ListenerType represents any listener sish supports.
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"time"

"github.com/ScaleFT/sshkeys"
"github.com/antoniomika/go-proxyproto"
"github.com/fsnotify/fsnotify"
"github.com/jpillora/ipfilter"
"github.com/logrusorgru/aurora"
"github.com/mikesmitty/edkey"
"github.com/pires/go-proxyproto"
"github.com/spf13/viper"
"golang.org/x/crypto/ssh"
)
Expand Down

0 comments on commit 19dee65

Please sign in to comment.