From 10187ca0f0729851a5bb3ca73c53e1451c3a11ac Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:47:03 +0100 Subject: [PATCH] Fix typo microtik -> mikrotik (#33) --- config/crowdsec-blocklist-mirror.yaml | 2 +- docker/README.md | 10 +++++----- formatters.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/crowdsec-blocklist-mirror.yaml b/config/crowdsec-blocklist-mirror.yaml index e0165b9..f93f319 100644 --- a/config/crowdsec-blocklist-mirror.yaml +++ b/config/crowdsec-blocklist-mirror.yaml @@ -9,7 +9,7 @@ crowdsec_config: insecure_skip_verify: false blocklists: - - format: plain_text # Supported formats are either of "plain_text", "microtik" + - format: plain_text # Supported formats are either of "plain_text", "mikrotik" endpoint: /security/blocklist authentication: type: none # Supported types are either of "none", "ip_based", "basic" diff --git a/docker/README.md b/docker/README.md index 86239f4..fc01215 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,7 +16,7 @@ crowdsec_config: insecure_skip_verify: false blocklists: - - format: plain_text # Supported formats are either of "plain_text", "microtik" + - format: plain_text # Supported formats are either of "plain_text", "mikrotik" endpoint: /security/blocklist authentication: type: none # Supported types are either of "none", "ip_based", "basic" @@ -130,7 +130,7 @@ List of blocklists to serve. Each blocklist has the following configuration. #### `format`: -Format of the blocklist. Currently only `plain_text` and `microtik` are supported. +Format of the blocklist. Currently only `plain_text` and `mikrotik` are supported. #### `endpoint`: @@ -197,9 +197,9 @@ Example: 4.3.2.1 ``` -### microtik +### mikrotik -If your microtik router does not support ipv6, then you can use the global query parameters to only return ipv4 addresses. +If your mikrotik router does not support ipv6, then you can use the global query parameters to only return ipv4 addresses. Example: @@ -210,7 +210,7 @@ Example: /ip firewall address-list add list=CrowdSec address=4.3.2.1 comment="crowdsecurity/postfix-spam for 166h40m25.280338424s"/ipv6 firewall address-list add list=CrowdSec address=2001:470:1:c84::17 comment="crowdsecurity/ssh-bf for 165h13m42.405449876s" ``` -#### microtik query parameters +#### mikrotik query parameters `?listname=foo` - Set the list name to `foo`, by default `listname` is set to `CrowdSec` diff --git a/formatters.go b/formatters.go index 076d774..74ba747 100644 --- a/formatters.go +++ b/formatters.go @@ -10,7 +10,7 @@ import ( var FormattersByName map[string]func(w http.ResponseWriter, r *http.Request) = map[string]func(w http.ResponseWriter, r *http.Request){ "plain_text": PlainTextFormatter, - "microtik": MicroTikFormatter, + "mikrotik": MikroTikFormatter, } func PlainTextFormatter(w http.ResponseWriter, r *http.Request) { @@ -20,7 +20,7 @@ func PlainTextFormatter(w http.ResponseWriter, r *http.Request) { } } -func MicroTikFormatter(w http.ResponseWriter, r *http.Request) { +func MikroTikFormatter(w http.ResponseWriter, r *http.Request) { decisions := r.Context().Value(globalDecisionRegistry.Key).([]*models.Decision) listName := r.URL.Query().Get("listname") if listName == "" {