Update import strings to reference this fork name

Merge in manually the fixes from PR #197, never accepted
Update .gitignore
Update the README with a Changelog for the fork
This commit is contained in:
jhegge 2018-11-16 18:26:26 -06:00
parent a080c85cbc
commit 89a27a859e
9 changed files with 22 additions and 12 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ gotty
bindata
builds
js/node_modules/*
.idea

View file

@ -53,6 +53,7 @@ By default, GoTTY starts a web server at port 8080. Open the URL on your web bro
--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-length value Random URL length (default: 8) [$GOTTY_RANDOM_URL_LENGTH]
--custom-url, -u Add a customized string to the URL
--tls, -t Enable TLS/SSL [$GOTTY_TLS]
--tls-crt value TLS/SSL certificate file path (default: "~/.gotty.crt") [$GOTTY_TLS_CRT]
--tls-key value TLS/SSL key file path (default: "~/.gotty.key") [$GOTTY_TLS_KEY]
@ -186,6 +187,10 @@ GoTTY uses [xterm.js](https://xtermjs.org/) and [hterm](https://groups.google.co
* [termshare](https://termsha.re): Terminal-Terminal sharing through a HTTP server
* [tmux](https://tmux.github.io/): Tmux itself also supports TTY sharing through SSH)
# Changelog for this fork
* Merged in waiting PR for origin repo (https://github.com/yudai/gotty/pull/197), adding the `--custom-url` option
# License
The MIT License

View file

@ -4,7 +4,7 @@ import (
"syscall"
"time"
"github.com/yudai/gotty/server"
"github.com/nimbix/gotty/server"
)
type Options struct {

View file

@ -11,10 +11,10 @@ import (
"github.com/codegangsta/cli"
"github.com/yudai/gotty/backend/localcommand"
"github.com/yudai/gotty/pkg/homedir"
"github.com/yudai/gotty/server"
"github.com/yudai/gotty/utils"
"github.com/nimbix/gotty/backend/localcommand"
"github.com/nimbix/gotty/pkg/homedir"
"github.com/nimbix/gotty/server"
"github.com/nimbix/gotty/utils"
)
func main() {

View file

@ -13,7 +13,7 @@ import (
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/yudai/gotty/webtty"
"github.com/nimbix/gotty/webtty"
)
func (server *Server) generateHandleWS(ctx context.Context, cancel context.CancelFunc, counter *counter) http.HandlerFunc {

View file

@ -12,6 +12,7 @@ type Options struct {
Credential string `hcl:"credential" flagName:"credential" flagSName:"c" flagDescribe:"Credential for Basic Authentication (ex: user:pass, default disabled)" default:""`
EnableRandomUrl bool `hcl:"enable_random_url" flagName:"random-url" flagSName:"r" flagDescribe:"Add a random string to the URL" default:"false"`
RandomUrlLength int `hcl:"random_url_length" flagName:"random-url-length" flagDescribe:"Random URL length" default:"8"`
CustomUrl string `hcl:"custom_url" flagName:"custom-url" flagSName:"u" flagDescribe:"Custom URL" default:""`
EnableTLS bool `hcl:"enable_tls" flagName:"tls" flagSName:"t" flagDescribe:"Enable TLS/SSL" default:"false"`
TLSCrtFile string `hcl:"tls_crt_file" flagName:"tls-crt" flagDescribe:"TLS/SSL certificate file path" default:"~/.gotty.crt"`
TLSKeyFile string `hcl:"tls_key_file" flagName:"tls-key" flagDescribe:"TLS/SSL key file path" default:"~/.gotty.key"`

View file

@ -18,9 +18,9 @@ import (
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/yudai/gotty/pkg/homedir"
"github.com/yudai/gotty/pkg/randomstring"
"github.com/yudai/gotty/webtty"
"github.com/nimbix/gotty/pkg/homedir"
"github.com/nimbix/gotty/pkg/randomstring"
"github.com/nimbix/gotty/webtty"
)
// Server provides a webtty HTTP endpoint.
@ -97,7 +97,10 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
path := "/"
if server.options.EnableRandomUrl {
path = "/" + randomstring.Generate(server.options.RandomUrlLength) + "/"
path += randomstring.Generate(server.options.RandomUrlLength) + "/"
}
if server.options.CustomUrl != "" {
path += server.options.CustomUrl + "/"
}
handlers := server.setupHandlers(cctx, cancel, path, counter)

View file

@ -1,7 +1,7 @@
package server
import (
"github.com/yudai/gotty/webtty"
"github.com/nimbix/gotty/webtty"
)
// Slave is webtty.Slave with some additional methods.

View file

@ -11,7 +11,7 @@ import (
"github.com/fatih/structs"
"github.com/yudai/hcl"
"github.com/yudai/gotty/pkg/homedir"
"github.com/nimbix/gotty/pkg/homedir"
)
func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[string]string, err error) {