feat: add fail2ban service

This commit is contained in:
2023-07-07 23:31:32 +02:00
parent 40d11f97f4
commit dff505037f
4 changed files with 97 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ import (
"syscall"
"gitea.urkob.com/urko/prosody-password/internal/api"
"gitea.urkob.com/urko/prosody-password/internal/services/fail2ban"
"gitea.urkob.com/urko/prosody-password/internal/services/prosody"
"gitea.urkob.com/urko/prosody-password/kit/config"
)
@@ -23,7 +24,7 @@ func main() {
ctx, cancel := context.WithCancel(signalContext(context.Background()))
defer cancel()
restServer := api.NewRestServer(prosody.NewProsody(cfg.Domain))
restServer := api.NewRestServer(prosody.NewProsody(cfg.Domain), fail2ban.NewFail2Ban())
go func() {
if err := restServer.Start(cfg.ApiPort, cfg.Views); err != nil {