Skip to content

Commit

Permalink
Merge branch 'mainnet' into bug/messaging-data-race-354
Browse files Browse the repository at this point in the history
  • Loading branch information
志宇 authored May 25, 2019
2 parents e5fe91f + c633881 commit a501534
Show file tree
Hide file tree
Showing 33 changed files with 492 additions and 328 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of the problem and bug effects.

**Environment information:**

- OS: e.g. Linux, Windows, Mac OS X
- Platform: the equivalent of `uname -smr` or `uname -smrv` e.g. Darwin 17.4.0 x86_64

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Run '....'
3. Write data to '....'
4. See error

**Actual behavior**
Explain the failure modes and effects, everything indicating the existence of the bug.
If applicable, add logs or screenshots of the bug.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.

**Possible implementation**
Hints to fix the bug.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'feature'
assignees: ''

---

**Feature description**

Describe the feature

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the problem here.

**Possible implementation**
Preliminary ideas to get this done.
If you have all details in mind then provide a checklist

- [ ] Start with ...
- [ ] When done do ...
- [ ] Finally ...
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixes #

Changes:
-

How to test this PR:
32 changes: 18 additions & 14 deletions cmd/apps/chat/README.org → cmd/apps/chat/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
* Skywire Chat app
# Skywire Chat app

Chat implements basic text messaging between skywire nodes. Messaging
UI is exposed via web interface. Chat only supports one WEB client
user at a time.
Chat implements basic text messaging between skywire nodes.

** Local setup
Messaging UI is exposed via web interface.

Chat only supports one WEB client user at a time.

## Local setup

Create 2 node config files:

~skywire1.json~
#+BEGIN_SRC js
`skywire1.json`

```json
"apps": [
{
"app": "chat",
Expand All @@ -18,10 +21,11 @@ Create 2 node config files:
"port": 1
}
]
#+END_SRC
```

`skywire2.json`

~skywire2.json~
#+BEGIN_SRC js
```json
"apps": [
{
"app": "chat",
Expand All @@ -31,14 +35,14 @@ Create 2 node config files:
"args": ["-addr", ":8001"]
}
]
#+END_SRC
```

Compile binaries and start 2 nodes:

#+BEGIN_SRC bash
```bash
$ go build -o apps/chat.v1.0 ./cmd/apps/chat
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
#+END_SRC
```

Chat interface will be available on ports ~8000~ and ~8001~.
Chat interface will be available on ports `8000` and `8001`.
11 changes: 11 additions & 0 deletions cmd/apps/therealproxy-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Skywire SOCKS5 proxy client app

`therealproxy-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
~skywire~ connection.

Any conventional SOCKS5 client should be able to connect to the proxy client.

Please check docs for `therealproxy` app for further instructions.
8 changes: 0 additions & 8 deletions cmd/apps/therealproxy-client/README.org

This file was deleted.

4 changes: 4 additions & 0 deletions cmd/apps/therealproxy-client/therealproxy-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ func main() {
log.Fatal("Failed to dial to a server: ", err)
}

log.Printf("Connected to %v\n", pk)

client, err := therealproxy.NewClient(conn)
if err != nil {
log.Fatal("Failed to create a new client: ", err)
}

log.Printf("Serving %v\n", addr)

log.Fatal(client.ListenAndServe(*addr))
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
* Skywire SOCKS5 proxy app
# Skywire SOCKS5 proxy app

~therealproxy~ app implements SOCKS5 functionality over skywire
net. Any conventional SOCKS5 client should be able to connect to the
proxy client. Currently the server supports authentication with a user and passcode pair that are set in the configuration file. If none are provided, the server does not require authentication.
`therealproxy` app implements SOCKS5 functionality over skywire
net.
Any conventional SOCKS5 client should be able to connect to the
proxy client.
Currently the server supports authentication with a user and passcode pair
that are set in the configuration file.
If none are provided, the server does not require authentication.

** Local setup
## Local setup

Create 2 node config files:

~skywire1.json~
#+BEGIN_SRC js
- `skywire1.json`

```json
"apps": [
{
"app": "therealproxy",
Expand All @@ -19,10 +24,11 @@ Create 2 node config files:
"args": ["-passcode", "123456"]
}
]
#+END_SRC
```

- `skywire2.json`

~skywire2.json~
#+BEGIN_SRC js
```json
"apps": [
{
"app": "therealproxy-client",
Expand All @@ -32,19 +38,19 @@ Create 2 node config files:
"args": ["-srv", "024ec47420176680816e0406250e7156465e4531f5b26057c9f6297bb0303558c7"]
}
]
#+END_SRC
```

Compile binaries and start 2 nodes:

#+BEGIN_SRC bash
```sh
$ go build -o apps/therealproxy.v1.0 ./cmd/apps/therealproxy
$ go build -o apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
#+END_SRC
```

You should be able to connect to a secondary node via ~curl~:
You should be able to connect to a secondary node via `curl`:

#+BEGIN_SRC bash
```sh
$ curl -v -x socks5://123456:@localhost:1080 https://api.ipify.org
#+END_SRC
```
8 changes: 8 additions & 0 deletions cmd/apps/therealssh-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Skywire SSH client app

`therealssh-client` app implements client for the SSH app.

It starts RCP interface for `therealssh-cli` and handles incoming requests to
the remote node via `skywire` connection.

Please check docs for `therealssh` app for further instructions.
6 changes: 0 additions & 6 deletions cmd/apps/therealssh-client/README.org

This file was deleted.

52 changes: 30 additions & 22 deletions cmd/apps/therealssh/README.org → cmd/apps/therealssh/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
* Skywire SSH app
# Skywire SSH app

~therealssh~ app implements SSH functionality over skywire
net. ~therealssh-cli~ is used to initiate communication via client RPC
exposed by ~therealssh~ app. ~therealssh~ app implements common SSH
operations: starting remote shell and executing commands
remotely. PubKey whitelisting is performed by adding public key to the
authentication file (~$HOME/.therealssh/authorized_keys~ by default).
`therealssh` app implements SSH functionality over skywirenet.

`therealssh-cli` is used to initiate communication via client RPC
exposed by `therealssh` app.

`therealssh` app implements common SSH operations:

- starting remote shell
- and executing commands remotely

PubKey whitelisting is performed by adding public key to the
authentication file (`$HOME/.therealssh/authorized_keys` by default).

** Local setup

Create 2 node config files:

~skywire1.json~
#+BEGIN_SRC js
`skywire1.json`

```json
"apps": [
{
"app": "therealssh",
Expand All @@ -21,10 +28,11 @@ Create 2 node config files:
"port": 2
}
]
#+END_SRC
```

`skywire2.json`

~skywire2.json~
#+BEGIN_SRC js
```json
"apps": [
{
"app": "therealssh-client",
Expand All @@ -33,30 +41,30 @@ Create 2 node config files:
"port": 22
}
]
#+END_SRC
```

Compile binaries and start 2 nodes:

#+BEGIN_SRC bash
```bash
$ go build -o apps/therealssh.v1.0 ./cmd/apps/therealssh
$ go build -o apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
$ go build ./cmd/therealssh-cli
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
#+END_SRC
```

Add public key of the second node to the auth file:

#+BEGIN_SRC bash
$ mkdir ~/.therealssh
$ echo "0348c941c5015a05c455ff238af2e57fb8f914c399aab604e9abb5b32b91a4c1fe" > ~/.therealssh/authorized_keys
#+END_SRC
```bash
$ mkdir `/.therealssh
$ echo "0348c941c5015a05c455ff238af2e57fb8f914c399aab604e9abb5b32b91a4c1fe" > `/.therealssh/authorized_keys
```

Connect to the first node using CLI:

#+BEGIN_SRC bash
```bash
$ ./therealssh-cli 024ec47420176680816e0406250e7156465e4531f5b26057c9f6297bb0303558c7
#+END_SRC
```

This should get you to the local folder of the ~therealssh~ app, which
This should get you to the $HOME folder of the user(you in this case), which
will indicate that you are seeing remote PTY session.
9 changes: 7 additions & 2 deletions cmd/skywire-cli/commands/node/transports.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ var rmTpCmd = &cobra.Command{
func printTransports(tps ...*node.TransportSummary) {
sortTransports(tps...)
w := tabwriter.NewWriter(os.Stdout, 0, 0, 5, ' ', tabwriter.TabIndent)
_, err := fmt.Fprintln(w, "type\tid\tlocal\tremote")
_, err := fmt.Fprintln(w, "type\tid\tremote\tmode")
internal.Catch(err)
for _, tp := range tps {
_, err = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", tp.Type, tp.ID, tp.Local, tp.Remote)
tpMode := "regular"
if tp.IsSetup {
tpMode = "setup"
}

_, err = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", tp.Type, tp.ID, tp.Remote, tpMode)
internal.Catch(err)
}
internal.Catch(w.Flush())
Expand Down
6 changes: 6 additions & 0 deletions cmd/therealssh-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CLI for SSH app

`therealssh-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.
5 changes: 0 additions & 5 deletions cmd/therealssh-cli/README.org

This file was deleted.

Loading

0 comments on commit a501534

Please sign in to comment.