mirror of
https://github.com/gutmensch/docker-dmarc-report.git
synced 2025-12-29 16:15:55 +00:00
Initial commit of dmarc reports image
This commit is contained in:
44
manifest/entrypoint.sh
Normal file
44
manifest/entrypoint.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
# Display PHP error's or not
|
||||
if [[ "$ERRORS" != "1" ]] ; then
|
||||
sed -i -e "s/error_reporting =.*=/error_reporting = E_ALL/g" /usr/etc/php.ini
|
||||
sed -i -e "s/display_errors =.*/display_errors = stdout/g" /usr/etc/php.ini
|
||||
fi
|
||||
|
||||
# Disable opcache?
|
||||
if [[ -v NO_OPCACHE ]]; then
|
||||
sed -i -e "s/zend_extension=opcache.so/;zend_extension=opcache.so/g" /etc/php.d/zend-opcache.ini
|
||||
fi
|
||||
|
||||
# Tweak nginx to match the workers to cpu's
|
||||
procs=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||
sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf
|
||||
|
||||
# Very dirty hack to replace variables in code with ENVIRONMENT values
|
||||
if [[ -v TEMPLATE_NGINX_HTML ]] ; then
|
||||
for i in $(env)
|
||||
do
|
||||
variable=$(echo "$i" | cut -d'=' -f1)
|
||||
value=$(echo "$i" | cut -d'=' -f2)
|
||||
if [[ "$variable" != '%s' ]] ; then
|
||||
replace='\$\$_'${variable}'_\$\$'
|
||||
find /var/www/html -type f -not -path "/var/www/html/vendor/*" -exec sed -i -e 's#'${replace}'#'${value}'#g' {} \;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Very dirty hack to replace variables in conf with ENVIRONMENT values
|
||||
if [[ -v TEMPLATE_PERL_CONF ]] ; then
|
||||
for i in $(env)
|
||||
do
|
||||
variable=$(echo "$i" | cut -d'=' -f1)
|
||||
value=$(echo "$i" | cut -d'=' -f2)
|
||||
if [[ "$variable" != '%s' ]] ; then
|
||||
replace='\$\$_'${variable}'_\$\$'
|
||||
find /usr/bin -type f -name *.conf -exec sed -i -e 's#'${replace}'#'${value}'#g' {} \;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Start supervisord and services
|
||||
/usr/bin/supervisord -n -c /etc/supervisord.conf
|
||||
|
||||
1
manifest/etc/cron.d/root
Normal file
1
manifest/etc/cron.d/root
Normal file
@@ -0,0 +1 @@
|
||||
*/5 * * * * /usr/bin/dmarcts-report-parser.pl -i -d -r
|
||||
7
manifest/etc/supervisor/conf.d/crond.conf
Normal file
7
manifest/etc/supervisor/conf.d/crond.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
[program:cron]
|
||||
command=crond -f -l 0 -L - -c /etc/cron
|
||||
autostart=true
|
||||
autorestart=true
|
||||
priority=10
|
||||
stdout_events_enabled=true
|
||||
stderr_events_enabled=true
|
||||
41
manifest/usr/bin/dmarcts-report-parser.conf
Normal file
41
manifest/usr/bin/dmarcts-report-parser.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
################################################################################
|
||||
### configuration ##############################################################
|
||||
################################################################################
|
||||
|
||||
# If IMAP access is not used, config options starting with $imap do not need to
|
||||
# be set and are ignored.
|
||||
|
||||
$debug = 0;
|
||||
$delete_reports = 0;
|
||||
|
||||
$dbname = '$$_REPORT_DB_NAME_$$';
|
||||
$dbuser = '$$_REPORT_DB_USER_$$';
|
||||
$dbpass = '$$_REPORT_DB_PASS_$$';
|
||||
$dbhost = '$$_REPORT_DB_HOST_$$'; # Set the hostname if we can't connect to the local socket.
|
||||
|
||||
$imapserver = '$$_PARSER_IMAP_SERVER_WITH_PORT_$$';
|
||||
$imapuser = '$$_PARSER_IMAP_USER_$$';
|
||||
$imappass = '$$_PARSER_IMAP_PASS_$$';
|
||||
$imapssl = '0'; # If set to 1, remember to change server port to 993 and disable imaptls.
|
||||
$imaptls = '1'; # Enabled as the default and best-practice.
|
||||
$tlsverify = '0'; # Enable verify server cert as the default and best-practice.
|
||||
$imapignoreerror = 0; # set it to 1 if you see an "ERROR: message_string()
|
||||
# expected 119613 bytes but received 81873 you may
|
||||
# need the IgnoreSizeErrors option" because of malfunction
|
||||
# imap server as MS Exchange 2007, ...
|
||||
$imapreadfolder = '$$_PARSER_IMAP_READ_FOLDER_$$';
|
||||
|
||||
# If $imapmovefolder is set, processed IMAP messages will be moved (overruled by
|
||||
# the --delete option!)
|
||||
$imapmovefolder = '$$_PARSER_IMAP_MOVE_FOLDER_$$';
|
||||
|
||||
# maximum size of XML files to store in database, long files can cause transaction aborts
|
||||
$maxsize_xml = 50000;
|
||||
# store XML as base64 encopded gzip in database (save space, harder usable)
|
||||
$compress_xml = 0;
|
||||
|
||||
# if there was an error during file processing (message does not contain XML or ZIP parts,
|
||||
# or a database error) the parser reports an error and does not delete the file, even if
|
||||
# delete_reports is set (or --delete is given). Deletion can be enforced by delete_failed,
|
||||
# however not for database errors.
|
||||
$delete_failed = 0;
|
||||
18
manifest/var/www/html/dmarcts-report-viewer-config.php
Normal file
18
manifest/var/www/html/dmarcts-report-viewer-config.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// ####################################################################
|
||||
// ### configuration ##################################################
|
||||
// ####################################################################
|
||||
|
||||
$dbhost='$$_REPORT_DB_HOST_$$';
|
||||
$dbname='$$_REPORT_DB_NAME_$$';
|
||||
$dbuser='$$_REPORT_DB_USER_$$';
|
||||
$dbpass='$$_REPORT_DB_PASS_$$';
|
||||
$dbport='3306';
|
||||
|
||||
$cssfile="default.css";
|
||||
|
||||
$default_lookup = 1; # 1=on 0=off (on is old behaviour )
|
||||
$default_sort = 1; # 1=ASCdening 0=DESCending (ASCending is default behaviour )
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user