Sign inSign up

lziolkowski1/caddy-fail2ban

By lziolkowski1

โ€ขUpdated 6 months ago
Archived

Caddy + Fail2Ban image with reverse proxy templates for multiple providers.

Image
Security
Web servers
0

471

lziolkowski1/caddy-fail2ban repository overview

โ Caddy-fail2ban

Fail2Ban integration with Caddy for advanced brute-force attack protection


โ ๐Ÿ“Œ Available Tags

Each tag corresponds to a specific DNS provider. Choose the one that matches your hosting provider.

โ ovh-**

For OVH users. Required environment variables:

OVH_APP_KEY=
OVH_APP_SECRET=
OVH_CONSUMER_KEY=
โ gandi-**

For GANDI users. Required environment variables:

GANDI_BEARER_TOKEN=
โ cloudflare-**

For Cloudflare users. Required environment variables:

CF_API_TOKEN=
โ all-**

For multi-provider setups. Required environment variables:

# OVH
OVH_APP_KEY=
OVH_APP_SECRET=
OVH_CONSUMER_KEY=

# GANDI
GANDI_BEARER_TOKEN=

# CLOUDFLARE
CF_API_TOKEN=

โ ๐Ÿš€ Example Docker Compose Setup

Hereโ€™s a quick-start example:

services:
  caddy-fail2ban:
    image: lziolkowski1/caddy-fail2ban:[tag]
    cap_add:
      - NET_ADMIN
      - NET_RAW
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./data:/data
      - config:/config
      - ./fail2ban:/etc/fail2ban
    ports:
      - 80:80
      - 443:443
volumes:
  config:

โ ๐Ÿ“„ Caddyfile Examples

โ Single Provider
import templates/default.conf

http:// {
    redir https://{host}{uri} permanent
}

gokapi.home {
    import [provider]-default gokapi 53842
}
โ Multi-Provider
import templates/{provider}-default.conf

http:// {
    redir https://{host}{uri} permanent
}

gokapi.home {
    import {provider}-default gokapi 53842
}

โ โš ๏ธ Important Notes

  • Ensure NET_ADMIN and NET_RAW capabilities are set for Fail2Ban to work properly.
  • Environment variables must be set before starting the container.
  • Replace {provider} with your chosen provider.

Tag summary

Content type

Image

Digest

sha256:d31616c57โ€ฆ

Size

57.6 MB

Last updated

6 months ago

docker pull lziolkowski1/caddy-fail2ban:all-dev-develop