mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
🍱 change default mode to live
This commit is contained in:
@@ -51,7 +51,7 @@ At each start of synchronisation, the middleware will wait a random number of se
|
||||
- enable the plugin
|
||||
- CrowdsecMode
|
||||
- string
|
||||
- default: `stream`, expected value are: `none`, `live`, `stream`
|
||||
- default: `live`, expected value are: `none`, `live`, `stream`
|
||||
- CrowdsecLapiScheme
|
||||
- string
|
||||
- default: `http`, expected value are: `http`, `https`
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ type Config struct {
|
||||
func CreateConfig() *Config {
|
||||
return &Config{
|
||||
Enabled: false,
|
||||
CrowdsecMode: noneMode,
|
||||
CrowdsecMode: liveMode,
|
||||
CrowdsecLapiScheme: "http",
|
||||
CrowdsecLapiHost: "crowdsec:8080",
|
||||
CrowdsecLapiKey: "",
|
||||
|
||||
+4
-6
@@ -1,22 +1,20 @@
|
||||
package crowdsec_bouncer_traefik_plugin_test
|
||||
package crowdsec_bouncer_traefik_plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
crowdsec_bouncer_traefik_plugin "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
|
||||
)
|
||||
|
||||
func TestCrowdSec(t *testing.T) {
|
||||
cfg := crowdsec_bouncer_traefik_plugin.CreateConfig()
|
||||
cfg.CrowdsecLapiKey = "caca"
|
||||
cfg := CreateConfig()
|
||||
cfg.CrowdsecLapiKey = "test"
|
||||
|
||||
ctx := context.Background()
|
||||
next := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {})
|
||||
|
||||
handler, err := crowdsec_bouncer_traefik_plugin.New(ctx, next, cfg, "demo-plugin")
|
||||
handler, err := New(ctx, next, cfg, "demo-plugin")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user