From bc2421685cab18c22009ecad9fa045f76e83c080 Mon Sep 17 00:00:00 2001 From: Alex Yu Date: Thu, 30 May 2019 07:18:17 +0300 Subject: [PATCH] therealssh -> SSH, therealproxy->socksproxy --- Makefile | 32 +++++++++---------- README.md | 16 +++++----- cmd/apps/therealproxy-client/README.md | 4 +-- .../therealproxy-client.go | 2 +- cmd/apps/therealproxy/README.md | 10 +++--- cmd/apps/therealproxy/therealproxy.go | 2 +- cmd/apps/therealssh-client/README.md | 6 ++-- .../therealssh-client/therealssh-client.go | 2 +- cmd/apps/therealssh/therealssh.go | 2 +- cmd/skywire-cli/commands/node/gen-config.go | 4 +-- cmd/skywire-node/config.json | 2 +- cmd/therealssh-cli/README.md | 2 +- cmd/therealssh-cli/commands/root.go | 4 +-- internal/therealssh/channel.go | 2 +- pkg/node/node.go | 2 +- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index cd636d3379..bf45670e65 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ clean: ## Clean project: remove created binaries and apps -rm -rf ./apps -rm -f ./skywire-node ./skywire-cli ./setup-node ./manager-node ./thereallssh-cli -install: ## Install `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli` +install: ## Install `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli` ${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/setup-node ./cmd/manager-node ./cmd/therealssh-cli rerun: stop @@ -95,31 +95,31 @@ dep: ## Sorts dependencies host-apps: ## Build app ${OPTS} go build -race -o ./apps/skychat.v1.0 ./cmd/apps/skychat ${OPTS} go build -race -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld - ${OPTS} go build -race -o ./apps/therealproxy.v1.0 ./cmd/apps/therealproxy - ${OPTS} go build -race -o ./apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client - ${OPTS} go build -race -o ./apps/therealssh.v1.0 ./cmd/apps/therealssh - ${OPTS} go build -race -o ./apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client + ${OPTS} go build -race -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy + ${OPTS} go build -race -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client + ${OPTS} go build -race -o ./apps/SSH.v1.0 ./cmd/apps/therealssh + ${OPTS} go build -race -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client # Bin -bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli` +bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli` ${OPTS} go build -race -o ./skywire-node ./cmd/skywire-node ${OPTS} go build -race -o ./skywire-cli ./cmd/skywire-cli ${OPTS} go build -race -o ./setup-node ./cmd/setup-node ${OPTS} go build -race -o ./manager-node ./cmd/manager-node - ${OPTS} go build -race -o ./therealssh-cli ./cmd/therealssh-cli + ${OPTS} go build -race -o ./SSH-cli ./cmd/therealssh-cli release: ## Build skywire-node`, skywire-cli, manager-node, therealssh-cli and apps without -race flag ${OPTS} go build -o ./skywire-node ./cmd/skywire-node ${OPTS} go build -o ./skywire-cli ./cmd/skywire-cli ${OPTS} go build -o ./setup-node ./cmd/setup-node ${OPTS} go build -o ./manager-node ./cmd/manager-node - ${OPTS} go build -o ./therealssh-cli ./cmd/therealssh-cli + ${OPTS} go build -o ./SSH-cli ./cmd/therealssh-cli ${OPTS} go build -o ./apps/skychat.v1.0 ./cmd/apps/skychat ${OPTS} go build -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld - ${OPTS} go build -o ./apps/therealproxy.v1.0 ./cmd/apps/therealproxy - ${OPTS} go build -o ./apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client - ${OPTS} go build -o ./apps/therealssh.v1.0 ./cmd/apps/therealssh - ${OPTS} go build -o ./apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client + ${OPTS} go build -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy + ${OPTS} go build -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client + ${OPTS} go build -o ./apps/SSH.v1.0 ./cmd/apps/therealssh + ${OPTS} go build -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client @@ -137,10 +137,10 @@ docker-network: ## Create docker network ${DOCKER_NETWORK} docker-apps: ## Build apps binaries for dockerized skywire-node. `go build` with ${DOCKER_OPTS} -${DOCKER_OPTS} go build -race -o ./node/apps/skychat.v1.0 ./cmd/apps/skychat -${DOCKER_OPTS} go build -race -o ./node/apps/helloworld.v1.0 ./cmd/apps/helloworld - -${DOCKER_OPTS} go build -race -o ./node/apps/therealproxy.v1.0 ./cmd/apps/therealproxy - -${DOCKER_OPTS} go build -race -o ./node/apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client - -${DOCKER_OPTS} go build -race -o ./node/apps/therealssh.v1.0 ./cmd/apps/therealssh - -${DOCKER_OPTS} go build -race -o ./node/apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client + -${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy.v1.0 ./cmd/apps/therealproxy + -${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client + -${DOCKER_OPTS} go build -race -o ./node/apps/SSH.v1.0 ./cmd/apps/therealssh + -${DOCKER_OPTS} go build -race -o ./node/apps/SSH-client.v1.0 ./cmd/apps/therealssh-client docker-bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli`. `go build` with ${DOCKER_OPTS} ${DOCKER_OPTS} go build -race -o ./node/skywire-node ./cmd/skywire-node diff --git a/README.md b/README.md index 840f070402..488d481b26 100644 --- a/README.md +++ b/README.md @@ -184,13 +184,13 @@ This will: ├── apps # node `apps` compiled with DOCKER_OPTS │   ├── skychat.v1.0 # │   ├── helloworld.v1.0 # -│   ├── therealproxy-client.v1.0 # -│   ├── therealproxy.v1.0 # +│   ├── socksproxy-client.v1.0 # +│   ├── socksproxy.v1.0 # │   ├── therealssh-client.v1.0 # │   └── therealssh.v1.0 # ├── local # **Created inside docker** │   ├── skychat # according to "local_path" in skywire-config.json -│   ├── therealproxy # +│   ├── socksproxy # │   └── therealssh # ├── PK # contains public key of node ├── skywire # db & logs. **Created inside docker** @@ -291,7 +291,7 @@ $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/skywire-node ./cmd/skywire- # 3. compile apps $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/skychat.v1.0 ./cmd/apps/skychat $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/helloworld.v1.0 ./cmd/apps/helloworld -$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealproxy.v1.0 ./cmd/apps/therealproxy +$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/socksproxy.v1.0 ./cmd/apps/therealproxy $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealssh.v1.0 ./cmd/apps/therealssh $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client # 4. Create skywire-config.json for node @@ -302,7 +302,7 @@ $ tree /tmp/SKYNODE # ├── apps # │   ├── skychat.v1.0 # │   ├── helloworld.v1.0 -# │   ├── therealproxy.v1.0 +# │   ├── socksproxy.v1.0 # │   ├── therealssh-client.v1.0 # │   └── therealssh.v1.0 # ├── skywire-config.json @@ -314,7 +314,7 @@ $ docker run -it -v /tmp/SKYNODE:/sky --network=SKYNET --name=SKYNODE skywire-ru # [2019-03-15T13:55:10Z] INFO [skywire]: Connected to messaging servers # [2019-03-15T13:55:10Z] INFO [skywire]: Starting skychat.v1.0 # [2019-03-15T13:55:10Z] INFO [skywire]: Starting RPC interface on 127.0.0.1:3435 -# [2019-03-15T13:55:10Z] INFO [skywire]: Starting therealproxy.v1.0 +# [2019-03-15T13:55:10Z] INFO [skywire]: Starting socksproxy.v1.0 # [2019-03-15T13:55:10Z] INFO [skywire]: Starting therealssh.v1.0 # [2019-03-15T13:55:10Z] INFO [skywire]: Starting packet router # [2019-03-15T13:55:10Z] INFO [router]: Starting router @@ -324,8 +324,8 @@ $ docker run -it -v /tmp/SKYNODE:/sky --network=SKYNET --name=SKYNODE skywire-ru # [2019-03-15T13:55:10Z] INFO [skychat.v1.0]: 2019/03/15 13:55:10 Serving HTTP on :8000 # [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"therealssh",# "app-version":"1.0","protocol-version":"0.0.1"} # [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app therealssh.v1.0 -# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"therealproxy",# "app-version":"1.0","protocol-version":"0.0.1"} -# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app therealproxy.v1.0 +# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"socksproxy",# "app-version":"1.0","protocol-version":"0.0.1"} +# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app socksproxy.v1.0 ``` Note that in this example docker is running in non-detached mode - it could be useful in some scenarios. diff --git a/cmd/apps/therealproxy-client/README.md b/cmd/apps/therealproxy-client/README.md index 568b1a6ec4..7d8d7d9951 100644 --- a/cmd/apps/therealproxy-client/README.md +++ b/cmd/apps/therealproxy-client/README.md @@ -1,6 +1,6 @@ # Skywire SOCKS5 proxy client app -`therealproxy-client` app implements client for the SOCKS5 app. +`socksproxy-client` app implements client for the SOCKS5 app. It opens persistent `skywire` connection to the configured remote node and local TCP port, all incoming TCP traffics is forwarded to the @@ -8,4 +8,4 @@ and local TCP port, all incoming TCP traffics is forwarded to the Any conventional SOCKS5 client should be able to connect to the proxy client. -Please check docs for `therealproxy` app for further instructions. +Please check docs for `socksproxy` app for further instructions. diff --git a/cmd/apps/therealproxy-client/therealproxy-client.go b/cmd/apps/therealproxy-client/therealproxy-client.go index 1b561b7d0d..554b514e6f 100644 --- a/cmd/apps/therealproxy-client/therealproxy-client.go +++ b/cmd/apps/therealproxy-client/therealproxy-client.go @@ -19,7 +19,7 @@ func main() { var serverPK = flag.String("srv", "", "PubKey of the server to connect to") flag.Parse() - config := &app.Config{AppName: "therealproxy-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"} + config := &app.Config{AppName: "socksproxy-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"} socksApp, err := app.Setup(config) if err != nil { log.Fatal("Setup failure: ", err) diff --git a/cmd/apps/therealproxy/README.md b/cmd/apps/therealproxy/README.md index a9c8023ff1..5ad2e0bed8 100644 --- a/cmd/apps/therealproxy/README.md +++ b/cmd/apps/therealproxy/README.md @@ -1,6 +1,6 @@ # Skywire SOCKS5 proxy app -`therealproxy` app implements SOCKS5 functionality over skywire +`socksproxy` app implements SOCKS5 functionality over skywire net. Any conventional SOCKS5 client should be able to connect to the proxy client. @@ -17,7 +17,7 @@ Create 2 node config files: ```json "apps": [ { - "app": "therealproxy", + "app": "socksproxy", "version": "1.0", "auto_start": true, "port": 3, @@ -31,7 +31,7 @@ Create 2 node config files: ```json "apps": [ { - "app": "therealproxy-client", + "app": "socksproxy-client", "version": "1.0", "auto_start": true, "port": 33, @@ -43,8 +43,8 @@ Create 2 node config files: Compile binaries and start 2 nodes: ```sh -$ go build -o apps/therealproxy.v1.0 ./cmd/apps/therealproxy -$ go build -o apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client +$ go build -o apps/socksproxy.v1.0 ./cmd/apps/therealproxy +$ go build -o apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client $ ./skywire-node skywire1.json $ ./skywire-node skywire2.json ``` diff --git a/cmd/apps/therealproxy/therealproxy.go b/cmd/apps/therealproxy/therealproxy.go index 3aa0ca99b1..0da3fdd8ee 100644 --- a/cmd/apps/therealproxy/therealproxy.go +++ b/cmd/apps/therealproxy/therealproxy.go @@ -15,7 +15,7 @@ func main() { var passcode = flag.String("passcode", "", "Authorise user against this passcode") flag.Parse() - config := &app.Config{AppName: "therealproxy", AppVersion: "1.0", ProtocolVersion: "0.0.1"} + config := &app.Config{AppName: "socksproxy", AppVersion: "1.0", ProtocolVersion: "0.0.1"} socksApp, err := app.Setup(config) if err != nil { log.Fatal("Setup failure: ", err) diff --git a/cmd/apps/therealssh-client/README.md b/cmd/apps/therealssh-client/README.md index f98717cfec..3aaec45251 100644 --- a/cmd/apps/therealssh-client/README.md +++ b/cmd/apps/therealssh-client/README.md @@ -1,8 +1,8 @@ # Skywire SSH client app -`therealssh-client` app implements client for the SSH app. +`SSH-client` app implements client for the SSH app. -It starts RCP interface for `therealssh-cli` and handles incoming requests to +It starts RCP interface for `SSH-cli` and handles incoming requests to the remote node via `skywire` connection. -Please check docs for `therealssh` app for further instructions. +Please check docs for `SSH` app for further instructions. diff --git a/cmd/apps/therealssh-client/therealssh-client.go b/cmd/apps/therealssh-client/therealssh-client.go index 66421c04f8..b0ab610052 100644 --- a/cmd/apps/therealssh-client/therealssh-client.go +++ b/cmd/apps/therealssh-client/therealssh-client.go @@ -17,7 +17,7 @@ func main() { var debug = flag.Bool("debug", false, "enable debug messages") flag.Parse() - config := &app.Config{AppName: "therealssh-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"} + config := &app.Config{AppName: "SSH-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"} sshApp, err := app.Setup(config) if err != nil { log.Fatal("Setup failure: ", err) diff --git a/cmd/apps/therealssh/therealssh.go b/cmd/apps/therealssh/therealssh.go index eeca8621f8..69e813baa0 100644 --- a/cmd/apps/therealssh/therealssh.go +++ b/cmd/apps/therealssh/therealssh.go @@ -19,7 +19,7 @@ func main() { flag.Parse() - config := &app.Config{AppName: "therealssh", AppVersion: "1.0", ProtocolVersion: "0.0.1"} + config := &app.Config{AppName: "SSH", AppVersion: "1.0", ProtocolVersion: "0.0.1"} sshApp, err := app.Setup(config) if err != nil { log.Fatal("Setup failure: ", err) diff --git a/cmd/skywire-cli/commands/node/gen-config.go b/cmd/skywire-cli/commands/node/gen-config.go index f3e512443d..4e9ef259e6 100644 --- a/cmd/skywire-cli/commands/node/gen-config.go +++ b/cmd/skywire-cli/commands/node/gen-config.go @@ -87,8 +87,8 @@ func defaultConfig() *node.Config { passcode := base64.StdEncoding.EncodeToString(cipher.RandByte(8)) conf.Apps = []node.AppConfig{ {App: "skychat", Version: "1.0", Port: 1, AutoStart: true, Args: []string{}}, - {App: "therealssh", Version: "1.0", Port: 2, AutoStart: true, Args: []string{}}, - {App: "therealproxy", Version: "1.0", Port: 3, AutoStart: true, Args: []string{"-passcode", passcode}}, + {App: "SSH", Version: "1.0", Port: 2, AutoStart: true, Args: []string{}}, + {App: "socksproxy", Version: "1.0", Port: 3, AutoStart: true, Args: []string{"-passcode", passcode}}, } conf.TrustedNodes = []cipher.PubKey{} diff --git a/cmd/skywire-node/config.json b/cmd/skywire-node/config.json index 402030c195..72aeb19563 100644 --- a/cmd/skywire-node/config.json +++ b/cmd/skywire-node/config.json @@ -23,7 +23,7 @@ "ports": [1] }, { - "app": "therealssh-server", + "app": "SSH-server", "auto_start": true, "ports": [2] } diff --git a/cmd/therealssh-cli/README.md b/cmd/therealssh-cli/README.md index 72350f3282..90df7c21c3 100644 --- a/cmd/therealssh-cli/README.md +++ b/cmd/therealssh-cli/README.md @@ -1,6 +1,6 @@ # CLI for SSH app -`therealssh-cli` implements PTY related operations for SSH app. +`SSH-cli` implements PTY related operations for SSH app. It connects to SSH client's RPC server, configures terminal for raw pty data and handles pty data exchange. diff --git a/cmd/therealssh-cli/commands/root.go b/cmd/therealssh-cli/commands/root.go index aff40b4053..6937d587b5 100644 --- a/cmd/therealssh-cli/commands/root.go +++ b/cmd/therealssh-cli/commands/root.go @@ -27,8 +27,8 @@ var ( ) var rootCmd = &cobra.Command{ - Use: "therealssh-cli [user@]remotePK [command] [args...]", - Short: "Client for the therealssh-client app", + Use: "SSH-cli [user@]remotePK [command] [args...]", + Short: "Client for the SSH-client app", Args: cobra.MinimumNArgs(1), Run: func(_ *cobra.Command, args []string) { client, err := rpc.DialHTTP("tcp", rpcAddr) diff --git a/internal/therealssh/channel.go b/internal/therealssh/channel.go index 79418fa9fa..c3fd9a1b6e 100644 --- a/internal/therealssh/channel.go +++ b/internal/therealssh/channel.go @@ -19,7 +19,7 @@ import ( "github.com/skycoin/skywire/pkg/app" ) -// Port reserved for therealssh app +// Port reserved for SSH app const Port = 2 // Debug enables debug messages. diff --git a/pkg/node/node.go b/pkg/node/node.go index 3a37cb8992..3db8e649b0 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -45,7 +45,7 @@ const Version = "0.0.1" const supportedProtocolVersion = "0.0.1" -var reservedPorts = map[uint16]string{0: "router", 1: "skychat", 2: "therealssh", 3: "therealproxy"} +var reservedPorts = map[uint16]string{0: "router", 1: "skychat", 2: "therealssh", 3: "socksproxy"} // AppState defines state parameters for a registered App. type AppState struct {