LOG_DRIVER just doesn't work

This commit is contained in:
Florent Daigniere
2023-04-02 17:08:30 +02:00
parent f9939eef94
commit 920f817009
7 changed files with 41 additions and 18 deletions

View File

@@ -135,12 +135,6 @@ WEBSITE=https://mailu.io
# Advanced settings # Advanced settings
################################### ###################################
# Log driver for front service. Possible values:
# json-file (default)
# journald (On systemd platforms, useful for Fail2Ban integration)
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker compose log` for front!)
LOG_DRIVER=json-file
# Docker-compose project name, this will prepended to containers names. # Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME=mailu COMPOSE_PROJECT_NAME=mailu

View File

@@ -9,7 +9,9 @@ services:
restart: always restart: always
env_file: .env env_file: .env
logging: logging:
driver: $LOG_DRIVER driver: journald
options:
tag: docker-front
ports: ports:
- "$BIND_ADDRESS4:80:80" - "$BIND_ADDRESS4:80:80"
- "$BIND_ADDRESS4:443:443" - "$BIND_ADDRESS4:443:443"
@@ -43,6 +45,10 @@ services:
image: mailu/dovecot:$VERSION image: mailu/dovecot:$VERSION
restart: always restart: always
env_file: .env env_file: .env
logging:
driver: journald
options:
tag: docker-imap
volumes: volumes:
- "$ROOT/mail:/mail" - "$ROOT/mail:/mail"
- "$ROOT/overrides/dovecot:/overrides:ro" - "$ROOT/overrides/dovecot:/overrides:ro"
@@ -53,6 +59,10 @@ services:
image: mailu/postfix:$VERSION image: mailu/postfix:$VERSION
restart: always restart: always
env_file: .env env_file: .env
logging:
driver: journald
options:
tag: docker-smtp
volumes: volumes:
- "$ROOT/mailqueue:/queue" - "$ROOT/mailqueue:/queue"
- "$ROOT/overrides/postfix:/overrides:ro" - "$ROOT/overrides/postfix:/overrides:ro"
@@ -63,6 +73,10 @@ services:
image: mailu/rspamd:$VERSION image: mailu/rspamd:$VERSION
restart: always restart: always
env_file: .env env_file: .env
logging:
driver: journald
options:
tag: docker-antispam
volumes: volumes:
- "$ROOT/filter:/var/lib/rspamd" - "$ROOT/filter:/var/lib/rspamd"
- "$ROOT/dkim:/dkim:ro" - "$ROOT/dkim:/dkim:ro"
@@ -88,6 +102,10 @@ services:
image: mailu/admin:$VERSION image: mailu/admin:$VERSION
restart: always restart: always
env_file: .env env_file: .env
logging:
driver: journald
options:
tag: docker-admin
volumes: volumes:
- "$ROOT/data:/data" - "$ROOT/data:/data"
- "$ROOT/dkim:/dkim" - "$ROOT/dkim:/dkim"

View File

@@ -35,8 +35,6 @@ services:
image: mailu/nginx:$VERSION image: mailu/nginx:$VERSION
restart: always restart: always
env_file: .env env_file: .env
logging:
driver: $LOG_DRIVER
labels: # Traefik labels for simple reverse-proxying labels: # Traefik labels for simple reverse-proxying
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.port=80" - "traefik.port=80"

View File

@@ -579,8 +579,7 @@ down brute force attacks. The same applies to login attempts via the single sign
We *do* provide a possibility to export the logs from the ``front`` service and ``Admin`` service to the host. We *do* provide a possibility to export the logs from the ``front`` service and ``Admin`` service to the host.
The ``front`` container logs failed logon attempts on SMTP, IMAP and POP3. The ``front`` container logs failed logon attempts on SMTP, IMAP and POP3.
The ``Admin`` container logs failed logon attempt on the single sign on page. The ``Admin`` container logs failed logon attempt on the single sign on page.
For this you need to set ``LOG_DRIVER=journald`` or ``syslog``, depending on the log You will need to setup the proper Regex in the Fail2Ban configuration.
manager of the host. You will need to setup the proper Regex in the Fail2Ban configuration.
Below an example how to do so. Below an example how to do so.
If you use a reverse proxy in front of Mailu, it is vital to set the environment variables REAL_IP_HEADER and REAL_IP_FROM. If you use a reverse proxy in front of Mailu, it is vital to set the environment variables REAL_IP_HEADER and REAL_IP_FROM.

View File

@@ -26,7 +26,9 @@ services:
restart: always restart: always
env_file: {{ env }} env_file: {{ env }}
logging: logging:
driver: {{ log_driver or 'json-file' }} driver: journald
options:
tag: docker-front
ports: ports:
{% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %} {% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %}
{% if bind4 %} {% if bind4 %}
@@ -66,6 +68,10 @@ services:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-{{ version }}} image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-{{ version }}}
restart: always restart: always
env_file: {{ env }} env_file: {{ env }}
logging:
driver: journald
options:
tag: docker-admin
{% if not admin_enabled %} {% if not admin_enabled %}
ports: ports:
- 127.0.0.1:8080:80 - 127.0.0.1:8080:80
@@ -85,6 +91,10 @@ services:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-{{ version }}} image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-{{ version }}}
restart: always restart: always
env_file: {{ env }} env_file: {{ env }}
logging:
driver: journald
options:
tag: docker-imap
volumes: volumes:
- "{{ root }}/mail:/mail" - "{{ root }}/mail:/mail"
- "{{ root }}/overrides/dovecot:/overrides:ro" - "{{ root }}/overrides/dovecot:/overrides:ro"
@@ -100,6 +110,10 @@ services:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-{{ version }}} image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-{{ version }}}
restart: always restart: always
env_file: {{ env }} env_file: {{ env }}
logging:
driver: journald
options:
tag: docker-smtp
volumes: volumes:
- "{{ root }}/mailqueue:/queue" - "{{ root }}/mailqueue:/queue"
- "{{ root }}/overrides/postfix:/overrides:ro" - "{{ root }}/overrides/postfix:/overrides:ro"
@@ -131,6 +145,10 @@ services:
hostname: antispam hostname: antispam
restart: always restart: always
env_file: {{ env }} env_file: {{ env }}
logging:
driver: journald
options:
tag: docker-antispam
{% if oletools_enabled %} {% if oletools_enabled %}
networks: networks:
- default - default

View File

@@ -158,12 +158,6 @@ DOMAIN_REGISTRATION=true
# Advanced settings # Advanced settings
################################### ###################################
# Log driver for front service. Possible values:
# json-file (default)
# journald (On systemd platforms, useful for Fail2Ban integration)
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker compose log` for front!)
# LOG_DRIVER={{ log_driver or 'json-file' }}
# Docker-compose project name, this will prepended to containers names. # Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME={{ compose_project_name or 'mailu' }} COMPOSE_PROJECT_NAME={{ compose_project_name or 'mailu' }}

View File

@@ -0,0 +1,2 @@
Remove LOG_DRIVER which never worked and replace it with journald by default
Fix a bug where front may get attached to networks that don't exist