mirror of
https://github.com/moul/sshportal.git
synced 2024-11-10 17:26:41 +08:00
Merge pull request #86 from moul/dev/moul/canonical
Switching to moul.io/sshportal (canonical url)
This commit is contained in:
commit
8e62d21c25
9 changed files with 22 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
defaults: &defaults
|
||||
working_directory: /go/src/github.com/moul/sshportal
|
||||
working_directory: /go/src/moul.io/sshportal
|
||||
docker:
|
||||
- image: circleci/golang:1.11
|
||||
environment:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# build
|
||||
FROM golang:1.11 as builder
|
||||
COPY . /go/src/github.com/moul/sshportal
|
||||
WORKDIR /go/src/github.com/moul/sshportal
|
||||
COPY . /go/src/moul.io/sshportal
|
||||
WORKDIR /go/src/moul.io/sshportal
|
||||
RUN make _docker_install
|
||||
|
||||
# minimal runtime
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
[![CircleCI](https://circleci.com/gh/moul/sshportal.svg?style=svg)](https://circleci.com/gh/moul/sshportal)
|
||||
[![Docker Build Status](https://img.shields.io/docker/build/moul/sshportal.svg)](https://hub.docker.com/r/moul/sshportal/)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/moul/sshportal)](https://goreportcard.com/report/github.com/moul/sshportal)
|
||||
[![GoDoc](https://godoc.org/github.com/moul/sshportal?status.svg)](https://godoc.org/github.com/moul/sshportal)
|
||||
[![Go Report Card](https://goreportcard.com/moul.io/sshportal)](https://goreportcard.com/report/moul.io/sshportal)
|
||||
[![GoDoc](https://godoc.org/moul.io/sshportal?status.svg)](https://godoc.org/moul.io/sshportal)
|
||||
[![License](https://img.shields.io/github/license/moul/sshportal.svg)](https://github.com/moul/sshportal/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/moul/sshportal.svg)](https://github.com/moul/sshportal/releases)
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmoul%2Fsshportal.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmoul%2Fsshportal?ref=badge_shield)
|
||||
|
@ -279,7 +279,7 @@ docker logs -f sshportal
|
|||
Get the latest version using GO.
|
||||
|
||||
```sh
|
||||
go get -u github.com/moul/sshportal
|
||||
go get -u moul.io/sshportal
|
||||
```
|
||||
|
||||
## portal alias (.ssh/config)
|
||||
|
|
4
go.mod
4
go.mod
|
@ -1,4 +1,4 @@
|
|||
module github.com/moul/sshportal
|
||||
module moul.io/sshportal
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.33.1 // indirect
|
||||
|
@ -21,7 +21,7 @@ require (
|
|||
github.com/jtolds/gls v4.2.1+incompatible // indirect
|
||||
github.com/kr/pty v1.1.3
|
||||
github.com/lib/pq v1.0.0 // indirect
|
||||
github.com/mattn/go-colorable v0.0.0-20171111065953-6fcc0c1fd9b6 // indirect
|
||||
github.com/mattn/go-colorable v0.0.9 // indirect
|
||||
github.com/mattn/go-isatty v0.0.4 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.3 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.10.0 // indirect
|
||||
|
|
2
go.sum
2
go.sum
|
@ -41,6 +41,8 @@ github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
|
|||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/mattn/go-colorable v0.0.0-20171111065953-6fcc0c1fd9b6 h1:G4Z3Qt5LMB7t8O2mvgRGe5Napynl/AXz+kEPvYXaggQ=
|
||||
github.com/mattn/go-colorable v0.0.0-20171111065953-6fcc0c1fd9b6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
|
||||
|
|
4
main.go
4
main.go
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package main // import "moul.io/sshportal"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -36,7 +36,7 @@ func main() {
|
|||
app.Name = path.Base(os.Args[0])
|
||||
app.Author = "Manfred Touron"
|
||||
app.Version = Version + " (" + GitSha + ")"
|
||||
app.Email = "https://github.com/moul/sshportal"
|
||||
app.Email = "https://moul.io/sshportal"
|
||||
app.Commands = []cli.Command{
|
||||
{
|
||||
Name: "server",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package bastionsession
|
||||
package bastionsession // import "moul.io/sshportal/pkg/bastionsession"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -9,9 +9,10 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/moul/ssh"
|
||||
"github.com/moul/sshportal/pkg/logtunnel"
|
||||
"github.com/sabban/bastion/pkg/logchannel"
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
|
||||
"moul.io/sshportal/pkg/logtunnel"
|
||||
)
|
||||
|
||||
type ForwardData struct {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package logtunnel
|
||||
package logtunnel // import "moul.io/sshportal/pkg/logtunnel"
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
@ -18,8 +18,8 @@ type logTunnel struct {
|
|||
type ForwardData struct {
|
||||
DestinationHost string
|
||||
DestinationPort uint32
|
||||
SourceHost string
|
||||
SourcePort uint32
|
||||
SourceHost string
|
||||
SourcePort uint32
|
||||
}
|
||||
|
||||
func writeHeader(fd io.Writer, length int) {
|
||||
|
@ -34,7 +34,7 @@ func writeHeader(fd io.Writer, length int) {
|
|||
|
||||
func New(channel ssh.Channel, writer io.WriteCloser, host string) *logTunnel {
|
||||
return &logTunnel{
|
||||
host: host,
|
||||
host: host,
|
||||
channel: channel,
|
||||
writer: writer,
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ func (l *logTunnel) Read(data []byte) (int, error) {
|
|||
}
|
||||
|
||||
func (l *logTunnel) Write(data []byte) (int, error) {
|
||||
writeHeader(l.writer, len(data) + len(l.host + ": "))
|
||||
writeHeader(l.writer, len(data)+len(l.host+": "))
|
||||
l.writer.Write([]byte(l.host + ": "))
|
||||
l.writer.Write(data)
|
||||
|
||||
|
|
3
ssh.go
3
ssh.go
|
@ -11,8 +11,9 @@ import (
|
|||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/moul/ssh"
|
||||
"github.com/moul/sshportal/pkg/bastionsession"
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
|
||||
"moul.io/sshportal/pkg/bastionsession"
|
||||
)
|
||||
|
||||
type sshportalContextKey string
|
||||
|
|
Loading…
Reference in a new issue