Support specifying password via environment variable
This commit is contained in:
parent
0bed4617a8
commit
ccf9dd359e
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
@ -6,6 +6,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"code.rocket9labs.com/tslocum/bgammon-tabula-bot/bot"
|
||||
|
@ -36,6 +37,10 @@ func main() {
|
|||
flag.IntVar(&debug, "debug", 0, "Port to serve debug information on (pprof)")
|
||||
flag.Parse()
|
||||
|
||||
if password == "" {
|
||||
password = os.Getenv("BOT_PASSWORD")
|
||||
}
|
||||
|
||||
if debug > 0 {
|
||||
go func() {
|
||||
log.Fatal(http.ListenAndServe(fmt.Sprintf("localhost:%d", debug), nil))
|
||||
|
|
Loading…
Reference in a new issue