Compare commits

...

8 Commits

Author SHA1 Message Date
jorgegv
78144ee1e4
fix mariadb root password interpolation in health check configuration (#73)
* fix mariadb root password interpolation in health check configuration

* fix env.example typo

---------

Co-authored-by: Robert Schumann <robert@schumann.link>
2025-03-20 12:59:09 +01:00
github-actions[bot]
2bd4fa2677
[chore] update contributors svg (#72)
Co-authored-by: gutmensch <gutmensch@users.noreply.github.com>
2025-03-20 12:57:45 +01:00
Simon
5e95ad2e14
Resolve small issues in the docker-compose files (#71)
And move optional extended configs directly into the compose/.env files
2025-02-12 20:07:14 +01:00
github-actions[bot]
81cad2e81e
[chore] update contributors svg (#69)
Co-authored-by: gutmensch <gutmensch@users.noreply.github.com>
2025-01-21 15:28:18 +01:00
Perlenjaeger
919fe857ae
remove of some inconsistency in the docker compose examples (#63)
Co-authored-by: Sven Förster <acc_gitlab@svfo.de>
2025-01-20 18:27:27 +01:00
github-actions[bot]
b28ae804bf
[chore] update contributors svg (#62)
Co-authored-by: gutmensch <gutmensch@users.noreply.github.com>
2024-08-27 18:24:33 +02:00
corelgott
552f67da65
docs: Manual Update and docker-compose cleanup (#61)
* Added command to trigger a manual report update. Removes verison-tag from docker-compose, since its deprecated

* chore: Added docker-compose examples and env-file

- Added examples-folder
- Added an example for a docker-compose with mysql
- Added an example for a docker-compose with postgres
- Extracted the most important variables to an env.example file
- Added some documentation on how to use the env-file and the compose files
2024-08-27 18:23:15 +02:00
Robert Schumann
072c8e5e33
chore: add arm64 image, fixes #34 (#37) 2024-02-18 14:40:46 +01:00
6 changed files with 200 additions and 86 deletions

View File

@ -17,6 +17,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
@ -36,10 +42,13 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ steps.meta.outputs.tags }}
gutmensch/dmarc-report:latest
labels: ${{ steps.meta.outputs.labels }}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -40,80 +40,30 @@ CAUTION: The old gutmensch/dmarc-report:latest image (older alpine, php5, etc.)
## Sample docker compose / Environment variables
The variables should be self-explanatory. Make sure to create the IMAP folders before the cron job runs!
Make sure to create the IMAP-Folders for processed and error reports before the cron job runs!
**docker-compose.yml**
The default foldernames are are [`error`](examples/env.example) & [`processed`](examples/env.example) but they can be changed within the [`env-file`](examples/env.example).
```yaml
version: "3.6"
Make sure to rename the [`env.example`](examples/env.example) file to `.env` and adjust the values to your needs.
services:
dmarc-report:
image: "gutmensch/dmarc-report:latest"
hostname: dmarc-report
container_name: dmarc-report
depends_on:
- db
ports:
- "80:80"
environment:
- "REPORT_DB_HOST=db"
- "REPORT_DB_PORT=3306"
- "REPORT_DB_NAME=dmarc_report"
- "REPORT_DB_USER=dmarc_report"
- "REPORT_DB_PASS=dbpassword"
- "PARSER_IMAP_SERVER=mail"
- "PARSER_IMAP_PORT=143"
- "PARSER_IMAP_USER=foobar@example.com"
- "PARSER_IMAP_PASS=foobar"
- "PARSER_IMAP_READ_FOLDER=Inbox"
- "PARSER_IMAP_MOVE_FOLDER=processed"
- "PARSER_IMAP_MOVE_FOLDER_ERR=error"
You can find templates for both, [`postgreql`](examples/docker-compose.postgres.yml)
and [`mysql`](examples/docker-compose.mysql.yml)
db in the [`examples`](examples) directory. Just rename the setup you want to use to `docker-compose.yml`.
db:
image: mariadb:10
command: --skip-innodb-read-only-compressed
environment:
- "MYSQL_ROOT_PASSWORD=dbrootpassword"
- "MYSQL_DATABASE=dmarc_report"
- "MYSQL_USER=dmarc_report"
- "MYSQL_PASSWORD=dbpassword"
volumes:
- ./dmarc-report-db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pdbrootpassword"]
interval: 10s
timeout: 10s
retries: 5
## Manual update
If you are using the docker-compose file above, you can use this command to trigger an manual update. It will fetch the latest reports and parse them.
```bash
docker compose exec dmarc-report /usr/bin/dmarcts-report-parser.pl -i -d -r=1
```
## Optional extended configuration
Use SSL instead of default TLS. Set both to 0 to turn off encryption. (not recommended)
```yaml
- "PARSER_IMAP_SSL=1"
- "PARSER_IMAP_TLS=0"
```
Ignore ERROR: message_string() issue experienced with Exchange Online.
```yaml
- "PARSER_IMAP_IGNORE_ERROR=1"
```
Parser and Viewer support Postgres now too (default is mysql)
```yaml
- "REPORT_DB_TYPE=pgsql"
```
Increase the maximum size of the XML file. (default is `50000` bytes)
When the size exceeds the maximum, one could experience an error `Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty`.
```yaml
- "PARSER_XML_MAXSIZE=500000"
```
For further optional configuration see the docker-compose [`env-file`](examples/env.example).
## Contributors

View File

@ -0,0 +1,46 @@
services:
dmarc-report:
image: "gutmensch/dmarc-report:latest"
hostname: dmarc-report
container_name: dmarc-report
restart: always
depends_on:
db:
condition: service_healthy
ports:
- "80:80"
environment:
- "REPORT_DB_HOST=${DB_HOST:-db}"
- "REPORT_DB_TYPE=${DB_TYPE:-mysql}"
- "REPORT_DB_PORT=${DB_PORT:-3306}"
- "REPORT_DB_NAME=${DB_NAME:-dmarc_report}"
- "REPORT_DB_USER=${DB_USER:-dmarc_report}"
- "REPORT_DB_PASS=${DB_PASSWORD}"
- "PARSER_IMAP_SERVER=${IMAP_SERVER}"
- "PARSER_IMAP_PORT=${IMAP_PORT:-993}"
- "PARSER_IMAP_USER=${IMAP_USER}"
- "PARSER_IMAP_PASS=${IMAP_PASSWORD}"
- "PARSER_IMAP_READ_FOLDER=${IMAP_READ_FOLDER:-Inbox}"
- "PARSER_IMAP_MOVE_FOLDER=${IMAP_MOVE_FOLDER:-processed}"
- "PARSER_IMAP_MOVE_FOLDER_ERR=${IMAP_MOVE_FOLDER_ERR:-error}"
- "PARSER_IMAP_SSL=${PARSER_IMAP_SSL}"
- "PARSER_IMAP_TLS=${PARSER_IMAP_TLS}"
- "PARSER_IMAP_IGNORE_ERROR=${PARSER_IMAP_IGNORE_ERROR}"
- "PARSER_XML_MAXSIZE=${PARSER_XML_MAXSIZE}"
db:
image: mariadb:10
command: --skip-innodb-read-only-compressed
restart: always
environment:
- "MYSQL_ROOT_PASSWORD=${ROOT_DB_PASSWORD}"
- "MYSQL_DATABASE=${DB_NAME:-dmarc_report}"
- "MYSQL_USER=${DB_USER:-dmarc_report}"
- "MYSQL_PASSWORD=${DB_PASSWORD}"
volumes:
- ./run/db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${ROOT_DB_PASSWORD}"]
interval: 10s
timeout: 10s
retries: 5

View File

@ -0,0 +1,44 @@
services:
dmarc-report:
image: "gutmensch/dmarc-report:latest"
hostname: dmarc-report
container_name: dmarc-report
restart: always
depends_on:
db:
condition: service_healthy
ports:
- "80:80"
environment:
- "REPORT_DB_HOST=${DB_HOST:-db}"
- "REPORT_DB_TYPE=${DB_TYPE:-pgsql}"
- "REPORT_DB_PORT=${DB_PORT:-5432}"
- "REPORT_DB_NAME=${DB_NAME:-dmarc_report}"
- "REPORT_DB_USER=${DB_USER:-dmarc_report}"
- "REPORT_DB_PASS=${DB_PASSWORD}"
- "PARSER_IMAP_SERVER=${IMAP_SERVER}"
- "PARSER_IMAP_PORT=${IMAP_PORT:-993}"
- "PARSER_IMAP_USER=${IMAP_USER}"
- "PARSER_IMAP_PASS=${IMAP_PASSWORD}"
- "PARSER_IMAP_READ_FOLDER=${IMAP_READ_FOLDER:-Inbox}"
- "PARSER_IMAP_MOVE_FOLDER=${IMAP_MOVE_FOLDER:-processed}"
- "PARSER_IMAP_MOVE_FOLDER_ERR=${IMAP_MOVE_FOLDER_ERR:-error}"
- "PARSER_IMAP_SSL=${PARSER_IMAP_SSL}"
- "PARSER_IMAP_TLS=${PARSER_IMAP_TLS}"
- "PARSER_IMAP_IGNORE_ERROR=${PARSER_IMAP_IGNORE_ERROR}"
- "PARSER_XML_MAXSIZE=${PARSER_XML_MAXSIZE}"
db:
image: postgres:latest
restart: always
environment:
- "POSTGRES_DB=${DB_NAME:-dmarc_report}"
- "POSTGRES_USER=${DB_USER:-dmarc_report}"
- "POSTGRES_PASSWORD=${DB_PASSWORD}"
volumes:
- ./run/db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dmarc_report"]
interval: 10s
timeout: 10s
retries: 5

53
examples/env.example Normal file
View File

@ -0,0 +1,53 @@
# database host address, leave empty for default host "db"
DB_HOST=
# the database type mysql or pgsql, leave empty for default (depending on your docker-compose.yml)
DB_TYPE=
# the database port (mysql 3306) (pqsql 5432), leave empty for default (depending on your docker-compose.yml)
DB_PORT=
# the database name, leave empty for default "dmarc_report"
DB_NAME=
# the database name, leave empty for default "dmarc_report"
DB_USER=
# mysql root password. Irrelevant if you are using postgres
ROOT_DB_PASSWORD=
# database password for the database user
DB_PASSWORD=
# the email address receiving the DMARC reports
IMAP_USER=
# the password for the email address receiving the DMARC reports
IMAP_PASSWORD=
# the server the email address is hosted on
IMAP_SERVER=
# optional: default is 993 (or 143)
IMAP_PORT=
# optional: default is "Inbox"
IMAP_READ_FOLDER=
# optional: default is "processed"
IMAP_MOVE_FOLDER=
# optional: default is "error"
IMAP_MOVE_FOLDER_ERR=
# Enable SSL and/or (START-)TLS. Set both to 0 to disable encryption (not recommended)
PARSER_IMAP_SSL=0
PARSER_IMAP_TLS=1
# Ignore ERROR: message_string() issue experienced with Exchange Online. Set to 1 to enable
PARSER_IMAP_IGNORE_ERROR=0
# Increase the maximum size of the XML file. (default is 50000 bytes)
# When the size exceeds the maximum, one could experience an error Uncaught ValueError: DOMDocument::loadXML():
# Argument #1 ($source) must not be empty.
PARSER_XML_MAXSIZE=50000