mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 21:52:18 +01:00
Add findTime, useDNS, maxRetry to toplevel get for jail information
This commit is contained in:
parent
b46fd86c8a
commit
2541520b69
1 changed files with 7 additions and 1 deletions
8
jail.go
8
jail.go
|
@ -10,6 +10,9 @@ import (
|
||||||
func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fail2go.Fail2goConn) {
|
func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fail2go.Fail2goConn) {
|
||||||
currentlyFailed, totalFailed, fileList, currentlyBanned, totalBanned, IPList, _ := fail2goConn.JailStatus(mux.Vars(req)["jail"])
|
currentlyFailed, totalFailed, fileList, currentlyBanned, totalBanned, IPList, _ := fail2goConn.JailStatus(mux.Vars(req)["jail"])
|
||||||
failRegexes, _ := fail2goConn.JailFailRegex(mux.Vars(req)["jail"])
|
failRegexes, _ := fail2goConn.JailFailRegex(mux.Vars(req)["jail"])
|
||||||
|
findTime, _ := fail2goConn.JailFindTime(mux.Vars(req)["jail"])
|
||||||
|
useDNS, _ := fail2goConn.JailUseDNS(mux.Vars(req)["jail"])
|
||||||
|
maxRetry, _ := fail2goConn.JailMaxRetry(mux.Vars(req)["jail"])
|
||||||
|
|
||||||
encodedOutput, err := json.Marshal(map[string]interface{}{
|
encodedOutput, err := json.Marshal(map[string]interface{}{
|
||||||
"currentlyFailed": currentlyFailed,
|
"currentlyFailed": currentlyFailed,
|
||||||
|
@ -18,7 +21,10 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai
|
||||||
"currentlyBanned": currentlyBanned,
|
"currentlyBanned": currentlyBanned,
|
||||||
"totalBanned": totalBanned,
|
"totalBanned": totalBanned,
|
||||||
"IPList": IPList,
|
"IPList": IPList,
|
||||||
"failRegexes": failRegexes})
|
"failRegexes": failRegexes,
|
||||||
|
"findTime": findTime,
|
||||||
|
"useDNS": useDNS,
|
||||||
|
"maxRetry": maxRetry})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue