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

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.