added listen flag
This commit is contained in:
3
main.go
3
main.go
@@ -101,6 +101,7 @@ func validateUnlockCommand(command string) bool {
|
||||
|
||||
func main() {
|
||||
unlockCommandFlag := flag.String("command", "", "what script to execute to unlock the volume")
|
||||
listenOn := flag.String("listen", ":50059", "specify port to listen on")
|
||||
flag.Parse()
|
||||
|
||||
if *unlockCommandFlag == "" {
|
||||
@@ -125,7 +126,7 @@ func main() {
|
||||
mux.Handle("/api/unlock", apiKeyMiddleware(apiKey, http.HandlerFunc(unlockZFSHandler)))
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: ":8080",
|
||||
Addr: *listenOn,
|
||||
Handler: mux,
|
||||
ReadTimeout: 5 * time.Second,
|
||||
WriteTimeout: 31 * time.Second,
|
||||
|
||||
Reference in New Issue
Block a user