HTTP Basic Authentication support. Close #8
This commit is contained in:
7
main.go
7
main.go
@@ -32,6 +32,11 @@ func main() {
|
||||
Usage: "Permit clients to write to the TTY (BE CAREFUL)",
|
||||
EnvVar: "GOTTY_PERMIT_WRITE",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "credential, c",
|
||||
Usage: "Credential for Basic Authentication (ex: user:pass)",
|
||||
EnvVar: "GOTTY_CREDENTIAL",
|
||||
},
|
||||
}
|
||||
cmd.Action = func(c *cli.Context) {
|
||||
if len(c.Args()) == 0 {
|
||||
@@ -39,7 +44,7 @@ func main() {
|
||||
cli.ShowAppHelp(c)
|
||||
os.Exit(1)
|
||||
}
|
||||
app := app.New(c.String("addr"), c.String("port"), c.Bool("permit-write"), c.Args())
|
||||
app := app.New(c.String("addr"), c.String("port"), c.Bool("permit-write"), c.String("credential"), c.Args())
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
||||
Reference in New Issue
Block a user