mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 13:42:17 +01:00
A jail's actions are now return in its top level handler
This commit is contained in:
parent
9119ebb08e
commit
4d84eda7db
1 changed files with 12 additions and 9 deletions
9
jail.go
9
jail.go
|
@ -3,12 +3,13 @@ package main
|
|||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"github.com/Sean-Der/fail2go"
|
||||
"github.com/gorilla/mux"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/Sean-Der/fail2go"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
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"])
|
||||
useDNS, _ := fail2goConn.JailUseDNS(mux.Vars(req)["jail"])
|
||||
maxRetry, _ := fail2goConn.JailMaxRetry(mux.Vars(req)["jail"])
|
||||
actions, _ := fail2goConn.JailActions(mux.Vars(req)["jail"])
|
||||
|
||||
if IPList == nil {
|
||||
IPList = []string{}
|
||||
|
@ -40,7 +42,8 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai
|
|||
"failRegexes": failRegexes,
|
||||
"findTime": findTime,
|
||||
"useDNS": useDNS,
|
||||
"maxRetry": maxRetry})
|
||||
"maxRetry": maxRetry,
|
||||
"actions": actions})
|
||||
res.Write(encodedOutput)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue