document and tweak settings

This commit is contained in:
Pierre Dubouilh
2021-10-26 17:36:37 +02:00
parent 6cf3034c08
commit 40d3951c13
3 changed files with 5 additions and 6 deletions
-1
View File
@@ -10,4 +10,3 @@ features:
- libmusl static release builds, no libc dependency
- lighter alternative to fail2ban
Todo: more granular CLI args to filter HTTP Status codes (e.g. 5 401 leads to a block, but 30 404 before a block) ?
+3 -3
View File
@@ -43,7 +43,7 @@ fn judge(
async fn run() -> Result<()> {
let args = utils::cli().get_matches();
let mut lines = MuxedLines::new()?;
let mut lines = MuxedLines::new().context("parsing cli args")?;
// jail
let jailtime_str = args.value_of("jailtime").unwrap_or("");
@@ -52,7 +52,7 @@ async fn run() -> Result<()> {
let allowance_str = args.value_of("allowance").unwrap_or("");
let allowance = allowance_str.parse().context("parsing allowance")?;
let jail = Jail::new(allowance, jailtime)?;
let jail = Jail::new(allowance, jailtime).context("init jail")?;
eprintln!(
"+ jail setup, offences allowed: {}, jailtime {}s",
allowance, jailtime
@@ -68,7 +68,7 @@ async fn run() -> Result<()> {
// common log format
let path_clf = args.value_of("clf_logpath").unwrap_or("");
if !path_clf.is_empty() {
lines.add_file(path_clf).await?;
lines.add_file(path_clf).await.context("opening log file")?;
eprintln!("+ starting with clf parsing at {}", path_clf);
}
+2 -2
View File
@@ -29,14 +29,14 @@ pub fn cli() -> App<'static, 'static> {
Arg::with_name("jailtime")
.short("j")
.help("jail time (seconds)")
.default_value("3600")
.default_value("7200")
.takes_value(true),
)
.arg(
Arg::with_name("allowance")
.short("a")
.help("how many offences allowed (max 255")
.default_value("5")
.default_value("6")
.takes_value(true),
)
.arg(