You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Matthew Strasiotto 70fdd083eb
Use nerd font patched Source Code Pro as default font for better rendering of glyphs (#16)
* Squashed commit of the following:

(Done for a cleaner merge)

commit 3f2ef96c66
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:23:23 2020 +0000

    Completely remove devDependencies

commit 5b7b34c86c
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:22:05 2020 +0000

    Change install deps from dev to production

commit 2b23f00d7d
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:08:30 2020 +0000

    Oops add more detail to Sauce Code Pro provenance

commit 56696b2bcb
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:07:54 2020 +0000

    Acknowledge SauceCodePro provenence/license

commit bfb93f4982
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:00:53 2020 +0000

    Revert "Regen assets_bundle.go"

    This reverts commit 51f189421b.

    This is because I don't want this diff in the squash just yet

commit ac15b25af6
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:57:49 2020 +0000

    Resolve unnecessary diffs

commit 8a274365dc
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:50:07 2020 +0000

    Add some fallback fonts if SauceCodePro is loading

commit 8ff2901bc7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:30:36 2020 +0000

    Remove SO comment ( wasnt relevant )

commit aa29bf232e
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:29:47 2020 +0000

    Finally fix font pathing

commit 86a5ec20cd
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:38:48 2020 +0000

    Use publicPath ?

commit d225edb5f9
Merge: 492a835 81295b8
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:28:19 2020 +0000

    Merge branch 'fonts' of https://github.com/mstr3336/tty-server into fonts

commit 492a83589d
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:26:59 2020 +0000

    Comment stack overflow link in webpack config

commit 81295b8689
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 20:26:22 2020 +1000

    Move stuff to static i guess?

commit a3a2238d35
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:49:58 2020 +1000

    Specify esmodule false for font loader

commit be7cc94ade
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:39:03 2020 +1000

    Hopefully make webpack load fonts?

commit 97e76cee0b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:31:28 2020 +1000

    Add file-loader npm module

commit 913ce076fb
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:25:40 2020 +1000

    Change font setting in tty-reciever.ts to new font

commit 2387c0132b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:24:44 2020 +1000

    Add nerd font rules

commit 622d834bf9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:23:43 2020 +1000

    Fix format spec for fonts

commit 6df46eacf7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:20:50 2020 +1000

    Finish script for building stylesheet

commit e47d0de28b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:15:58 2020 +1000

    Add python script for building css

commit b38526cca7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:35:54 2020 +1000

    Remove _Nerd_Font suffix

commit cfd461ad7e
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:34:40 2020 +1000

    Remove _Complete_Mono_Windows_Compatible suffix from new fonts

commit 2333f1bf61
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:28:48 2020 +1000

    Add sauce code pro fonts from nerdfonts

commit 778f2194c9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 22:20:32 2020 +1000

    Remove unnessary css rule

commit c86e17f9ed
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:11:44 2020 +0000

    Remove vagrantfile for clean feature branch

commit 51f189421b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:07:03 2020 +0000

    Regen assets_bundle.go

commit 3e0462604b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:06:39 2020 +0000

    Set the fontFamily of the tty-reciever to SourceCodePro

commit cd06e4b013
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:04:18 2020 +0000

    Rename font family string for source code pro

commit 87a50edcaf
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 20:46:07 2020 +1000

    Update css to include source code pro for font family

commit a036043573
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 19:59:51 2020 +1000

    Finally fixed env escapes

commit ed7dc41c46
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 19:24:27 2020 +1000

    Fix heredoc

commit a9ad558316
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 18:56:25 2020 +1000

    Add serve script to vagrantfile

commit 433353c70f
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 18:33:11 2020 +1000

    added vagrantfile

* Regen frontend/package-lock.json after merging upstream into feature
4 years ago
frontend Use nerd font patched Source Code Pro as default font for better rendering of glyphs (#16) 4 years ago
vendor Initial commit 4 years ago
.gitignore Initial commit 4 years ago
.travis.yml Update the node dependencies 4 years ago
Dockerfile Add Dockerfile 4 years ago
Gopkg.lock Initial commit 4 years ago
Gopkg.toml Initial commit 4 years ago
LICENSE Initial commit 4 years ago
Makefile Update makefile so make all works in any state (after a full clean) (#13) 4 years ago
README.md Improve documentation for the TLS setup (#6) 4 years ago
assets_bundle.go Update the node dependencies 4 years ago
protocol.go Initial commit 4 years ago
server.go Initial commit 4 years ago
server_main.go Initial commit 4 years ago
session.go Initial commit 4 years ago
tty_protocol_conn.go Initial commit 4 years ago
vagrantfile Add vagrantfile which is rough equivalent to dockerfile, but primarily for bootstrapping dev servers (#11) 4 years ago
websockets_connection.go Initial commit 4 years ago

README.md

Build Status

tty-server

Server side for tty-share.

Docker

The server can be built into a docker image as follows:

docker build -t tty-server .

To run the container, type:

docker run \
  -p 6543:6543 -p 5000:5000 \
  -e URL=http://localhost:5000 \
  --cap-drop=all --rm \
  tty-server

where you can replace URL by whatever will be the publicly visible URL of the server.

After this, clients can be connected as follows:

tty-share -useTLS=false -server localhost:6543

In the above command, 6543 is the default port where tty-server listens for incoming shares (i.e. tty-share clients), and 5000 is the port of the web interface through which remote users can connect. You can override the defaults by specifying a different port mapping on the command line, e.g. -p 7654:6543 -p 80:5000 to listen on 7654 and serve on 80.

TLS Setup

You'll need a certificate and the associed key file. Here is an example for a setup with nginx as proxy The idea is use nginx as

  • reverse proxy for the web interface at port 5000 (listen at 443, terminate the TLS, and redirect to localhost:5000)
  • TLS endpoint at port 7654, and redirect to localhost:6543

The client usage (after this TLS setup): tty-share -server server:7654

nginx config for the web/browser side (http+websockets connection)

This section can go for example in /etc/nginx/site-enabled/default

server {
    server_name _;
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    ssl_certificate /etc/ssl/certs/server.crt;
    ssl_certificate_key /etc/ssl/private/server.key;
    proxy_send_timeout 1600;
    proxy_read_timeout 1600;
    ########### tty-server application
    # the /s/, /ws/ and /static/ locations - all used by the actual tty-server.
    location / {
            proxy_pass              http://localhost:5000;
            proxy_redirect off;
            proxy_set_header        Host $host;
            proxy_set_header        X-Real-IP $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header        X-Forwarded-Proto $scheme;

            # Allow websocket upgrade
            # https://iota.stackexchange.com/questions/2535/hornet-dashboard-not-working-the-client-is-not-using-the-websocket-protocol
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
    }
}

nginx config for the tty-share command line client (TLS connection)

For the stream , you'll need the stream module from nginx. This configuration cannot go in the site-enabled/ because it's limited to the http module and not the stream module. Store it in /etc/nginx/modules-enabled/99-tty-server-stream.conf, for example

stream {
    server {
        # https://nginx.org/en/docs/stream/ngx_stream_core_module.html#server
        # the tty-server tcp connection ssl proxy
        listen 7654 ssl so_keepalive=30m::10;
        proxy_pass localhost:6543;
        ssl_certificate /etc/ssl/certs/server.crt;
        ssl_certificate_key /etc/ssl/private/server.key;
    }
}

You'll have to adapt the URL variable to use the nginx URL:

docker run \
  -p 6543:6543 -p 5000:5000 \
  -e URL=https://server.domain.com \
  --cap-drop=all --rm \
  tty-server