A jail's actions are now return in its top level handler

This commit is contained in:
Sean DuBois 2014-11-22 04:41:26 +00:00
parent 9119ebb08e
commit 4d84eda7db

View file

@ -3,12 +3,13 @@ package main
import ( import (
"bufio" "bufio"
"encoding/json" "encoding/json"
"github.com/Sean-Der/fail2go"
"github.com/gorilla/mux"
"net/http" "net/http"
"os" "os"
"regexp" "regexp"
"strings" "strings"
"github.com/Sean-Der/fail2go"
"github.com/gorilla/mux"
) )
func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fail2go.Conn) { func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fail2go.Conn) {
@ -22,6 +23,7 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai
findTime, _ := fail2goConn.JailFindTime(mux.Vars(req)["jail"]) findTime, _ := fail2goConn.JailFindTime(mux.Vars(req)["jail"])
useDNS, _ := fail2goConn.JailUseDNS(mux.Vars(req)["jail"]) useDNS, _ := fail2goConn.JailUseDNS(mux.Vars(req)["jail"])
maxRetry, _ := fail2goConn.JailMaxRetry(mux.Vars(req)["jail"]) maxRetry, _ := fail2goConn.JailMaxRetry(mux.Vars(req)["jail"])
actions, _ := fail2goConn.JailActions(mux.Vars(req)["jail"])
if IPList == nil { if IPList == nil {
IPList = []string{} IPList = []string{}
@ -40,7 +42,8 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai
"failRegexes": failRegexes, "failRegexes": failRegexes,
"findTime": findTime, "findTime": findTime,
"useDNS": useDNS, "useDNS": useDNS,
"maxRetry": maxRetry}) "maxRetry": maxRetry,
"actions": actions})
res.Write(encodedOutput) res.Write(encodedOutput)
} }