mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
Merge 'apatil2/master'
This commit is contained in:
commit
1edcacf955
@ -47,6 +47,7 @@ By default, GoTTY starts a web server at port 8080. Open the URL on your web bro
|
||||
```
|
||||
--address value, -a value IP address to listen (default: "0.0.0.0") [$GOTTY_ADDRESS]
|
||||
--port value, -p value Port number to listen (default: "8080") [$GOTTY_PORT]
|
||||
--path value, -m value Base path (default: "/") [$GOTTY_PATH]
|
||||
--permit-write, -w Permit clients to write to the TTY (BE CAREFUL) [$GOTTY_PERMIT_WRITE]
|
||||
--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]
|
||||
|
@ -47,6 +47,7 @@ By default, GoTTY starts a web server at port 8080. Open the URL on your web bro
|
||||
```
|
||||
--address value, -a value IP address to listen (default: "0.0.0.0") [$GOTTY_ADDRESS]
|
||||
--port value, -p value Port number to listen (default: "8080") [$GOTTY_PORT]
|
||||
--path value, -m value Base path (default: "/") [$GOTTY_PATH]
|
||||
--permit-write, -w Permit clients to write to the TTY (BE CAREFUL) [$GOTTY_PERMIT_WRITE]
|
||||
--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]
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
type Options struct {
|
||||
Address string `hcl:"address" flagName:"address" flagSName:"a" flagDescribe:"IP address to listen" default:"0.0.0.0"`
|
||||
Port string `hcl:"port" flagName:"port" flagSName:"p" flagDescribe:"Port number to liten" default:"8080"`
|
||||
Path string `hcl:"path" flagName:"path" flagSName:"m" flagDescribe:"Base path" default:"/"`
|
||||
PermitWrite bool `hcl:"permit_write" flagName:"permit-write" flagSName:"w" flagDescribe:"Permit clients to write to the TTY (BE CAREFUL)" default:"false"`
|
||||
EnableBasicAuth bool `hcl:"enable_basic_auth" default:"false"`
|
||||
Credential string `hcl:"credential" flagName:"credential" flagSName:"c" flagDescribe:"Credential for Basic Authentication (ex: user:pass, default disabled)" default:""`
|
||||
|
@ -106,7 +106,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
|
||||
|
||||
counter := newCounter(time.Duration(server.options.Timeout) * time.Second)
|
||||
|
||||
path := "/"
|
||||
path := server.options.Path
|
||||
if server.options.EnableRandomUrl {
|
||||
path = "/" + randomstring.Generate(server.options.RandomUrlLength) + "/"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user