diff --git a/.builds/amd64_freebsd.yml b/.builds/amd64_freebsd.yml deleted file mode 100644 index bd84fa6..0000000 --- a/.builds/amd64_freebsd.yml +++ /dev/null @@ -1,14 +0,0 @@ -arch: amd64 -environment: - PROJECT_NAME: 'sshtargate' - CGO_ENABLED: '1' - GO111MODULE: 'on' -image: freebsd/latest -packages: - - go -sources: - - https://git.sr.ht/~tslocum/sshtargate -tasks: - - test: | - cd $PROJECT_NAME - go test ./... diff --git a/.builds/amd64_linux_alpine.yml b/.builds/amd64_linux_alpine.yml deleted file mode 100644 index 3a88b5f..0000000 --- a/.builds/amd64_linux_alpine.yml +++ /dev/null @@ -1,14 +0,0 @@ -arch: x86_64 -environment: - PROJECT_NAME: 'sshtargate' - CGO_ENABLED: '1' - GO111MODULE: 'on' -image: alpine/edge -packages: - - go -sources: - - https://git.sr.ht/~tslocum/sshtargate -tasks: - - test: | - cd $PROJECT_NAME - go test ./... diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e66f95d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,8 @@ +stages: + - test + +test: + image: golang:latest + stage: test + script: + - go test -v ./... diff --git a/README.md b/README.md index bee7a35..9d48b43 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # sshtargate -[![GoDoc](https://godoc.org/git.sr.ht/~tslocum/sshtargate?status.svg)](https://godoc.org/git.sr.ht/~tslocum/sshtargate) -[![builds.sr.ht status](https://builds.sr.ht/~tslocum/sshtargate.svg)](https://builds.sr.ht/~tslocum/sshtargate) +[![GoDoc](https://godoc.org/gitlab.com/tslocum/sshtargate?status.svg)](https://godoc.org/gitlab.com/tslocum/sshtargate) +[![CI status](https://gitlab.com/tslocum/sshtargate/badges/master/pipeline.svg)](https://gitlab.com/tslocum/sshtargate/commits/master) [![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space) Host SSH portals to applications @@ -16,13 +16,13 @@ Choose one of the following methods: ### Compile ``` -GO111MODULE=on go get git.sr.ht/~tslocum/sshtargate +go get gitlab.com/tslocum/sshtargate ``` ## Configure -See [CONFIGURATION.md](https://man.sr.ht/~tslocum/sshtargate/CONFIGURATION.md) +See [CONFIGURATION.md](https://gitlab.com/tslocum/sshtargate/blob/master/CONFIGURATION.md) ## Support -Please share issues/suggestions [here](https://todo.sr.ht/~tslocum/sshtargate). +Please share issues/suggestions [here](https://gitlab.com/tslocum/sshtargate/issues). diff --git a/go.mod b/go.mod index 169460b..c3f98db 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,13 @@ -module git.sr.ht/~tslocum/sshtargate +module gitlab.com/tslocum/sshtargate go 1.13 require ( github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 github.com/creack/pty v1.1.9 + github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect github.com/gliderlabs/ssh v0.2.2 - golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 - golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7 // indirect + golang.org/x/crypto v0.0.0-20200117160349-530e935923ad + golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 // indirect gopkg.in/yaml.v2 v2.2.7 ) diff --git a/go.sum b/go.sum index 97d5eb3..0932ad6 100644 --- a/go.sum +++ b/go.sum @@ -7,14 +7,15 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200117160349-530e935923ad h1:Jh8cai0fqIK+f6nG0UgPW5wFk8wmiMhM3AyciDBdtQg= +golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7 h1:/W9OPMnnpmFXHYkcp2rQsbFUbRlRzfECQjmAFiOyHE8= -golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/goreleaser.yml b/goreleaser.yml index 6e66c43..d4a9340 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -7,7 +7,7 @@ builds: env: - CGO_ENABLED=0 ldflags: - - -s -w -X git.sr.ht/~tslocum/sshtargate/version={{.Version}} + - -s -w -X gitlab.com/tslocum/sshtargate/version={{.Version}} goos: - darwin - freebsd diff --git a/main.go b/main.go index bf6dd69..8b87187 100644 --- a/main.go +++ b/main.go @@ -11,15 +11,15 @@ import ( "sync" "syscall" - "git.sr.ht/~tslocum/sshtargate/pkg/gate" "github.com/anmitsu/go-shlex" + "gitlab.com/tslocum/sshtargate/pkg/gate" ) const ( version = "0.0.0" versionInfo = `sshtargate - Host SSH portals to applications - v` + version + ` -https://git.sr.ht/~tslocum/sshtargate +https://gitlab.com/tslocum/sshtargate The MIT License (MIT) Copyright (c) 2020 Trevor Slocum ` diff --git a/pkg/gate/portal.go b/pkg/gate/portal.go index 95234e4..15bb59a 100644 --- a/pkg/gate/portal.go +++ b/pkg/gate/portal.go @@ -61,8 +61,7 @@ func NewPortal(name string, address string, command []string) (*Portal, error) { } cmd := exec.CommandContext(cmdCtx, command[0], args...) - cmd.Env = sshSession.Environ() - cmd.Env = append(cmd.Env, fmt.Sprintf("TERM=%s", ptyReq.Term)) + cmd.Env = append(sshSession.Environ(), fmt.Sprintf("TERM=%s", ptyReq.Term)) f, err := pty.Start(cmd) if err != nil {