Update README.md

This commit is contained in:
Iwasaki Yudai 2017-09-01 15:29:56 +09:00
parent 2c50c43290
commit 79e132824a

View File

@ -14,9 +14,9 @@ GoTTY is a simple command line tool that turns your CLI tools into web applicati
# Installation # Installation
Download the latest stable binary file from the [Releases](https://github.com/yudai/gotty/releases) page. Note that the release marked `Pre-release` is built automatically when new code is pushed to the repository, which can include unstable or breaking changes. Download a release marked `Latest release` for a stabale build. Download the latest stable binary file from the [Releases](https://github.com/yudai/gotty/releases) page. Note that the release marked `Pre-release` is built for testing purpose, which can include unstable or breaking changes. Download a release marked [Latest release](https://github.com/yudai/gotty/releases/latest) for a stabale build.
(`darwin_amd64.tar.gz` is for Mac OS X users) (Files named with `darwin_amd64` are for Mac OS X users)
## Homebrew Installation ## Homebrew Installation
@ -47,27 +47,32 @@ By default, GoTTY starts a web server at port 8080. Open the URL on your web bro
## Options ## Options
``` ```
--address, -a IP address to listen [$GOTTY_ADDRESS] --address value, -a value IP address to listen (default: "0.0.0.0") [$GOTTY_ADDRESS]
--port, -p "8080" Port number to listen [$GOTTY_PORT] --port value, -p value Port number to liten (default: "8080") [$GOTTY_PORT]
--permit-write, -w Permit clients to write to the TTY (BE CAREFUL) [$GOTTY_PERMIT_WRITE] --permit-write, -w Permit clients to write to the TTY (BE CAREFUL) [$GOTTY_PERMIT_WRITE]
--credential, -c Credential for Basic Authentication (ex: user:pass, default disabled) [$GOTTY_CREDENTIAL] --credential value, -c value Credential for Basic Authentication (ex: user:pass, default disabled) [$GOTTY_CREDENTIAL]
--random-url, -r Add a random string to the URL [$GOTTY_RANDOM_URL] --random-url, -r Add a random string to the URL [$GOTTY_RANDOM_URL]
--random-url-length "8" Random URL length [$GOTTY_RANDOM_URL_LENGTH] --random-url-length value Random URL length (default: 8) [$GOTTY_RANDOM_URL_LENGTH]
--tls, -t Enable TLS/SSL [$GOTTY_TLS] --tls, -t Enable TLS/SSL [$GOTTY_TLS]
--tls-crt "~/.gotty.crt" TLS/SSL certificate file path [$GOTTY_TLS_CRT] --tls-crt value TLS/SSL certificate file path (default: "~/.gotty.crt") [$GOTTY_TLS_CRT]
--tls-key "~/.gotty.key" TLS/SSL key file path [$GOTTY_TLS_KEY] --tls-key value TLS/SSL key file path (default: "~/.gotty.key") [$GOTTY_TLS_KEY]
--tls-ca-crt "~/.gotty.ca.crt" TLS/SSL CA certificate file for client certifications [$GOTTY_TLS_CA_CRT] --tls-ca-crt value TLS/SSL CA certificate file for client certifications (default: "~/.gotty.ca.crt") [$GOTTY_TLS_CA_CRT]
--index Custom index.html file [$GOTTY_INDEX] --index value Custom index.html file [$GOTTY_INDEX]
--title-format "GoTTY - {{ .Command }} ({{ .Hostname }})" Title format of browser window [$GOTTY_TITLE_FORMAT] --title-format value Title format of browser window (default: "{{ .command }}@{{ .hostname }}") [$GOTTY_TITLE_FORMAT]
--reconnect Enable reconnection [$GOTTY_RECONNECT] --reconnect Enable reconnection [$GOTTY_RECONNECT]
--reconnect-time "10" Time to reconnect [$GOTTY_RECONNECT_TIME] --reconnect-time value Time to reconnect (default: 10) [$GOTTY_RECONNECT_TIME]
--timeout "0" Timeout seconds for waiting a client (0 to disable) [$GOTTY_TIMEOUT] --max-connection value Maximum connection to gotty (default: 0) [$GOTTY_MAX_CONNECTION]
--max-connection "0" Set the maximum number of simultaneous connections (0 to disable) --once Accept only one client and exit on disconnection [$GOTTY_ONCE]
--once Accept only one client and exit on disconnection [$GOTTY_ONCE] --timeout value Timeout seconds for waiting a client(0 to disable) (default: 0) [$GOTTY_TIMEOUT]
--permit-arguments Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB) [$GOTTY_PERMIT_ARGUMENTS] --permit-arguments Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB) [$GOTTY_PERMIT_ARGUMENTS]
--close-signal "1" Signal sent to the command process when gotty close it (default: SIGHUP) [$GOTTY_CLOSE_SIGNAL] --width value Static width of the screen, 0(default) means dynamically resize (default: 0) [$GOTTY_WIDTH]
--config "~/.gotty" Config file path [$GOTTY_CONFIG] --height value Static height of the screen, 0(default) means dynamically resize (default: 0) [$GOTTY_HEIGHT]
--version, -v print the version --ws-origin value A regular expression that matches origin URLs to be accepted by WebSocket. No cross origin requests are acceptable by default [$GOTTY_WS_ORIGIN]
--term value Terminal name to use on the browser, one of xterm or hterm. (default: "xterm") [$GOTTY_TERM]
--close-signal value Signal sent to the command process when gotty close it (default: SIGHUP) (default: 1) [$GOTTY_CLOSE_SIGNAL]
--close-timeout value Time in seconds to force kill process after client is disconnected (default: -1) (default: -1) [$GOTTY_CLOSE_TIMEOUT]
--config value Config file path (default: "~/.gotty") [$GOTTY_CONFIG]
--version, -v print the version
``` ```
### Config File ### Config File
@ -146,26 +151,20 @@ $ gotty -w docker run -it --rm busybox
## Development ## Development
You can build a binary using the following commands. Windows is not supported now. You can build a binary using the following commands. Windows is not supported now. go1.9 is required.
```sh ```sh
# Install tools # Install tools
go get github.com/jteeuwen/go-bindata/... go get github.com/jteeuwen/go-bindata/...
go get github.com/tools/godep go get github.com/tools/godep
# Checkout hterm
git submodule sync && git submodule update --init --recursive
# Restore libraries in Godeps
godep restore
# Build # Build
make make
``` ```
## Architecture ## Architecture
GoTTY uses [hterm](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-hterm) to run a JavaScript based terminal on web browsers. GoTTY itself provides a websocket server that simply relays output from the TTY to clients and receives input from clients and forwards it to the TTY. This hterm + websocket idea is inspired by [Wetty](https://github.com/krishnasrinivas/wetty). GoTTY uses [xterm.js](https://xtermjs.org/) and [hterm](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-hterm) to run a JavaScript based terminal on web browsers. GoTTY itself provides a websocket server that simply relays output from the TTY to clients and receives input from clients and forwards it to the TTY. This hterm + websocket idea is inspired by [Wetty](https://github.com/krishnasrinivas/wetty).
## Alternatives ## Alternatives