Very small documentation and running instructions

pull/14/merge
Vasile Popescu 5 years ago
parent a395b295b9
commit 16974db44b

@ -13,20 +13,22 @@ TTY_SHARE_SRC=$(wildcard ./tty-share/*.go)
COMMON_SRC=$(wildcard ./common/*go)
TTY_SERVER_ASSETS=$(wildcard frontend/public/*)
## tty-share command (the client/sender side)
all: get-deps $(TTY_SHARE) # do this by default, so no need to mess up with building the frontend
## Keep this as the first and default target, so no need to mess up with building the frontend&rest if the server side is not needed
$(TTY_SHARE): get-deps $(TTY_SHARE_SRC) $(COMMON_SRC)
go build -o $@ $(TTY_SHARE_SRC)
## Build both the server and the tty-share
all: get-deps $(TTY_SHARE) $(TTY_SERVER)
@echo "All done"
get-deps:
go get $(DEPS)
# Building the server and tty-share
$(TTY_SERVER): $(TTY_SERVER_SRC) $(COMMON_SRC)
$(TTY_SERVER): get-deps $(TTY_SERVER_SRC) $(COMMON_SRC)
go build -o $@ $(TTY_SERVER_SRC)
$(TTY_SHARE): $(TTY_SHARE_SRC) $(COMMON_SRC)
go build -o $@ $(TTY_SHARE_SRC)
tty-server/assets_bundle.go: $(TTY_SERVER_ASSETS)
go-bindata --prefix frontend/public/ -o $@ $^
@ -55,8 +57,6 @@ clean:
rm -fr frontend/public
@echo "Cleaned"
## Server release binarires
## Development helper targets
### Runs the server, without TLS/HTTPS (no need for localhost testing)
runs: $(TTY_SERVER)

@ -39,6 +39,8 @@ make out/tty-share
This way you don't have to bother about the server side, nor about building the frontend, and you will get only the `tty-share` cmd line tool, inside `out` folder.
For cross-compilation you can use the GO building [environment variables](https://golang.org/doc/install/source#environment). For example, to build the `tty-share` for raspberrypi, you can do `GOOS=linux GOARCH=arm make out/tty-share`.
## Building and running everything
For an easy deployment, the `tty-server` is by bundling by default all frontend resources inside the final binary. So in the end, there will be only one file to be copied and deployed. However, the frontend resources can also be served from a local folder, with a command line flag.
@ -50,7 +52,7 @@ nvm use
npm install
npm run build # builds the frontend
cd -
make all # builds both the sender and server
make all # builds both the sender and server. Check the Makefile for more details
```
### Run a development server

@ -12,10 +12,10 @@ import (
var MainLogger = logrus.New()
func main() {
webAddress := flag.String("web_address", ":80", "The bind address for the web interface")
senderAddress := flag.String("sender_address", ":6543", "The bind address for the tty-share connections")
url := flag.String("url", "http://localhost", "The public web URL the server will be accessible at")
frontendPath := flag.String("frontend_path", "", "The path to the frontend resources")
webAddress := flag.String("web_address", ":80", "The bind address for the web interface. This is the listening address for the web server that hosts the \"browser terminal\". You might want to change this if you don't want to use the port 80, or only bind the localhost.")
senderAddress := flag.String("sender_address", ":6543", "The bind address for the tty-share TLS connections. tty-share tool will connect to this address.")
url := flag.String("url", "http://localhost", "The public web URL the server will be accessible at. This will be sent back to the tty-share tool to display it to the user.")
frontendPath := flag.String("frontend_path", "", "The path to the frontend resources. By default, these resources are included in the server binary, so you only need this path if you don't want to use the bundled ones.")
flag.Parse()
log := MainLogger

Loading…
Cancel
Save