From 18c632b981af474949149821fc1ef8fa1e1959ac Mon Sep 17 00:00:00 2001 From: meliurwen Date: Fri, 21 Aug 2020 16:21:09 +0200 Subject: [PATCH] Moved on git --- .env.example | 14 ++++++++++++++ .gitignore | 1 + docker-compose.yml | 36 ++++++++++++++++++++++++++++++++++++ fail2ban.env.example | 5 +++++ 4 files changed, 56 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 fail2ban.env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..46b7ee7 --- /dev/null +++ b/.env.example @@ -0,0 +1,14 @@ +# Global Settings +LOCAL_STACK_DIR=/srv/docker/volumes/fail2ban +TZ=Europe/Berlin + +# Global Settings (optional) +SRV_RESTART= + +# fail2ban-input (optional) +F2BI_CONTAINER_NAME= +F2BI_TAG= + +# fail2ban-docker (optional) +F2BD_CONTAINER_NAME= +F2BD_TAG= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03bd412 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d3b52ae --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +version: "3.2" + +services: + fail2ban-input: + image: crazymax/fail2ban:${F2BI_TAG:-latest} + container_name: ${F2BI_CONTAINER_NAME:-fail2ban-input} + restart: ${SRV_RESTART:-unless-stopped} + network_mode: "host" + cap_add: + - NET_ADMIN + - NET_RAW + volumes: + - ${LOCAL_STACK_DIR}/data-input:/data + - /var/log:/var/log:ro + env_file: + - "./fail2ban.env" + environment: + - TZ=${TZ} + - F2B_IPTABLES_CHAIN=INPUT + + fail2ban-docker: + image: crazymax/fail2ban:${F2BD_TAG:-latest} + container_name: ${F2BD_CONTAINER_NAME:-fail2ban-docker} + restart: ${SRV_RESTART:-unless-stopped} + network_mode: "host" + cap_add: + - NET_ADMIN + - NET_RAW + volumes: + - ${LOCAL_STACK_DIR}/data-docker:/data + - /var/log:/var/log:ro + env_file: + - "./fail2ban.env" + environment: + - TZ=${TZ} + - F2B_IPTABLES_CHAIN=DOCKER-USER diff --git a/fail2ban.env.example b/fail2ban.env.example new file mode 100644 index 0000000..02fe9db --- /dev/null +++ b/fail2ban.env.example @@ -0,0 +1,5 @@ +# fail2ban +F2B_LOG_TARGET=STDOUT +F2B_LOG_LEVEL=INFO +F2B_DB_PURGE_AGE=7d +F2B_MAX_RETRY=3