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

Fix ssh #16

Closed
wants to merge 15 commits into from
Closed
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
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: go

go:
- 1.7.x
- 1.8.x
- 1.x

install: make setup
sudo: required # required for docker service
services:
# Required for dockertest
- docker
script:
# check compilation on supported targets
- GOOS=linux GOARCH=amd64 make binaries
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
* Experimental HTTP2 support
* Experimental connection pool

### Changed
* The top-level listener at the wh-server level now only listens on TCP - allowing each handler control over TLS/SSH

### Removed

### Fixed
* Complies with bug introduces from https://github.com/golang/go/issues/19767

## [0.5.35] - 2017-06-15
### Added
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ build: ## build the go packages

test: ## run tests, except integration tests
@echo "🎈 $@"
@go test -parallel 8 ${RACE} $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES})
@go test ${RACE} $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES})

integration: ## run integration tests
@echo "🎈 $@"
@go test -parallel 8 ${RACE} ${INTEGRATION_PACKAGE}
@go test ${RACE} ${INTEGRATION_PACKAGE}

FORCE:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Wormhole is a reverse proxy that creates a secure tunnel between two endpoints.

## Compiling
**Wormhole requires Go1.7+**
**Wormhole requires Go1.8+**

go get github.com/superfly/wormhole
cd $GOPATH/src/github.com/superfly/wormhole
Expand Down
2 changes: 1 addition & 1 deletion cmd/wormhole/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"net/http"

log "github.com/Sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
"github.com/superfly/wormhole"
"github.com/superfly/wormhole/config"
)
Expand Down
27 changes: 25 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"

bugsnag_hook "github.com/Shopify/logrus-bugsnag"
"github.com/Sirupsen/logrus"
bugsnag "github.com/bugsnag/bugsnag-go"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
prefixed "github.com/x-cray/logrus-prefixed-formatter"
)
Expand Down Expand Up @@ -178,6 +178,18 @@ func NewServerConfig() (*ServerConfig, error) {
}
cfg.TLSPrivateKey = tlsKey

tlsCert, err := ioutil.ReadFile(viper.GetString("tls_cert_file"))
if err != nil {
return nil, cfgErr(unsetEnvStr, "FLY_TLS_CERT_FILE")
}
cfg.TLSCert = tlsCert
case HTTP2:
tlsKey, err := ioutil.ReadFile(viper.GetString("tls_private_key_file"))
if err != nil {
return nil, cfgErr(unsetEnvStr, "FLY_TLS_PRIVATE_KEY_FILE")
}
cfg.TLSPrivateKey = tlsKey

tlsCert, err := ioutil.ReadFile(viper.GetString("tls_cert_file"))
if err != nil {
return nil, cfgErr(unsetEnvStr, "FLY_TLS_CERT_FILE")
Expand Down Expand Up @@ -278,7 +290,14 @@ func NewClientConfig() (*ClientConfig, error) {
Logger: logger,
}

if protocol == TLS {
switch protocol {
case TLS:
tlsCert, err := ioutil.ReadFile(viper.GetString("tls_cert_file"))
if err != nil {
return nil, cfgErr(unsetEnvStr, "FLY_TLS_CERT_FILE")
}
shared.TLSCert = tlsCert
case HTTP2:
tlsCert, err := ioutil.ReadFile(viper.GetString("tls_cert_file"))
if err != nil {
return nil, cfgErr(unsetEnvStr, "FLY_TLS_CERT_FILE")
Expand Down Expand Up @@ -351,6 +370,8 @@ const (
TCP
// TLS connection pool
TLS
// HTTP2 connection pool
HTTP2
_
_
_
Expand All @@ -367,6 +388,8 @@ func ParseTunnelProto(proto string) TunnelProto {
return TCP
case "tls":
return TLS
case "http2":
return HTTP2
default:
return UNSUPPORTED
}
Expand Down
Loading