mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-17 05:53:15 +02:00
In test filters also priorize .local filters over .conf filters and return always also the explicit used filter path in results
This commit is contained in:
@@ -1325,12 +1325,15 @@ func TestFilterHandler(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
output, err := conn.TestFilter(c.Request.Context(), req.FilterName, req.LogLines)
|
||||
output, filterPath, err := conn.TestFilter(c.Request.Context(), req.FilterName, req.LogLines)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to test filter: " + err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"output": output})
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"output": output,
|
||||
"filterPath": filterPath,
|
||||
})
|
||||
}
|
||||
|
||||
// ApplyFail2banSettings updates /etc/fail2ban/jail.local [DEFAULT] with our JSON
|
||||
|
||||
Reference in New Issue
Block a user