diff --git a/README.md b/README.md index 3a6e533..62199d8 100644 --- a/README.md +++ b/README.md @@ -61,34 +61,9 @@ If you are using the docker-compose file above, you can use this command to trig 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 diff --git a/examples/docker-compose.mysql.yml b/examples/docker-compose.mysql.yml index 74b5963..e9f3aae 100644 --- a/examples/docker-compose.mysql.yml +++ b/examples/docker-compose.mysql.yml @@ -3,6 +3,7 @@ services: image: "gutmensch/dmarc-report:latest" hostname: dmarc-report container_name: dmarc-report + restart: always depends_on: db: condition: service_healthy @@ -22,15 +23,20 @@ services: - "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=dmarc_report" - - "MYSQL_USER=dmarc_report" - - "MYSQL_PASSWORD=${DMARC_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: diff --git a/examples/docker-compose.postgres.yml b/examples/docker-compose.postgres.yml index 42cead9..b8da03b 100644 --- a/examples/docker-compose.postgres.yml +++ b/examples/docker-compose.postgres.yml @@ -3,6 +3,7 @@ services: image: "gutmensch/dmarc-report:latest" hostname: dmarc-report container_name: dmarc-report + restart: always depends_on: db: condition: service_healthy @@ -10,8 +11,8 @@ services: - "80:80" environment: - "REPORT_DB_HOST=${DB_HOST:-db}" - - "REPORT_DB_TYPE=${DB_TYPE:-mysql}" - - "REPORT_DB_PORT=${DB_PORT:-3306}" + - "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}" @@ -22,13 +23,18 @@ services: - "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=dmarc_report" - - "POSTGRES_USER=dmarc_report" - - "POSTGRES_PASSWORD=${DMARC_DB_PASSWORD}" + - "POSTGRES_DB=${DB_NAME:-dmarc_report}" + - "POSTGRES_USER=${DB_USER:-dmarc_report}" + - "POSTGRES_PASSWORD=${DB_PASSWORD}" volumes: - ./run/db:/var/lib/postgresql/data healthcheck: diff --git a/examples/env.example b/examples/env.example index 067afc8..0e51447 100644 --- a/examples/env.example +++ b/examples/env.example @@ -1,16 +1,16 @@ -# databse host address +# database host address, leave empty for default host "db" DB_HOST= -# the database type mysql or pgsql +# the database type mysql or pgsql, leave empty for default (depending on your docker-compose.yml) DB_TYPE= -# the datbase port (mysql 3306) (pqsql 5432) +# the database port (mysql 3306) (pqsql 5432), leave empty for default (depending on your docker-compose.yml) DB_PORT= -# the databse name +# the database name, leave empty for default "dmarc_report" DB_NAME= -# the databse name +# the database name, leave empty for default "dmarc_report" DB_USER= # mysql root password. Irrelevant if you are using postgres @@ -28,7 +28,7 @@ IMAP_PASSWORD= # the server the email address is hosted on IMAP_SERVER= -# optional: default is 993 ( or 143) +# optional: default is 993 (or 143) IMAP_PORT= # optional: default is "Inbox" @@ -38,4 +38,16 @@ IMAP_READ_FOLDER IMAP_MOVE_FOLDER= # optional: default is "error" -IMAP_MOVE_FOLDER_ERR= \ No newline at end of file +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 \ No newline at end of file