Skip to content

Commit 37b1fb9

Browse files
committed
Update to v2.2.1
1 parent 9c3e0c0 commit 37b1fb9

File tree

4 files changed

+152
-20
lines changed

4 files changed

+152
-20
lines changed

docker/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM webdevops/php-nginx:8.2-alpine
22

3-
ARG VERSION="v1.8"
3+
ARG VERSION="v2.2.1"
44

5-
ARG DIST_URL="https://github.com/liuch/dmarc-srg/archive/refs/tags/v1.8.tar.gz"
5+
ARG DIST_URL="https://github.com/liuch/dmarc-srg/archive/refs/tags/v2.2.1.tar.gz"
66
ARG BUILD_DATE
77
ARG VCS_REF
88
ENV PHP_DISMOD=amqp,apcu,bcmath,bz2,calendar,exif,ffi,gd,gettext,gmp,imagick,intl,ldap,memcached,mongodb,pcntl,mysqli,pdo_pgsql,pgsql,redis,shmop,soap,sockets,sysvmsg,sysvsem,sysvshm,vips,xmlrpc,xsl,yaml,ioncube
@@ -21,16 +21,19 @@ COPY nginx-vhost.conf /opt/docker/etc/nginx/vhost.conf
2121
USER application
2222
WORKDIR $WEB_DOCUMENT_ROOT
2323

24-
RUN curl -# -L -o dmarc-srg.tar.gz ${DIST_URL} && \
25-
tar -xzf dmarc-srg.tar.gz -C $WEB_DOCUMENT_ROOT --strip-components=1 && \
26-
rm dmarc-srg.tar.gz && \
27-
cd $WEB_DOCUMENT_ROOT && \
28-
curl -# -L -o - https://patch-diff.githubusercontent.com/raw/liuch/dmarc-srg/pull/80.diff | patch -p1 && \
29-
rm -vr *.md && \
24+
RUN set -eux; \
25+
curl -# -L -o dmarc-srg.tar.gz ${DIST_URL}; \
26+
tar -xzf dmarc-srg.tar.gz -C $WEB_DOCUMENT_ROOT --strip-components=1; \
27+
rm dmarc-srg.tar.gz; \
28+
cd $WEB_DOCUMENT_ROOT; \
29+
# curl -# -L -o - https://patch-diff.githubusercontent.com/raw/liuch/dmarc-srg/pull/<pr-id>.diff | patch -p1; \
30+
rm -vr *.md; \
3031
tree
3132

3233
COPY config.php /var/www/html/config/conf.php
3334

35+
RUN diff -u $WEB_DOCUMENT_ROOT/config/conf.sample.php /var/www/html/config/conf.php
36+
3437
# Metadata
3538
LABEL org.label-schema.vendor="liuch" \
3639
org.label-schema.url="https://github.com/liuch/dmarc-srg#readme" \

docker/config.php

Lines changed: 140 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'user' => getenv('DB_USER'),
1111
'password' => getenv('DB_PASSWORD'),
1212
/**
13-
* This parameter can be usefull if the database is shared with other applications
13+
* This parameter can be useful if the database is shared with other applications
1414
* to avoid conflicting table names. You do not need to specify this parameter
1515
* if you use a dedicated database.
1616
* Example value: dmarc_
@@ -45,19 +45,20 @@
4545
'password' => getenv('IMAP_PASSWORD'),
4646
// Mailbox name
4747
'mailbox' => getenv('MAILBOX_NAME'),
48-
// IMAP authorization methods to be excluded.
48+
// IMAP authentication methods to be excluded.
4949
// For example: 'auth_exclude' => [ 'GSSAPI', 'NTLM' ]
5050
'auth_exclude' => []
5151
];
5252

5353
/**
54-
* It is only required if you want to get reports from a server directory.
55-
* In order to collect report from several directories, you should put each
54+
* This option is NOT INTENDED for direct access to MAILBOX directories.
55+
* It is only required if you want to get reports files (xml, zip, gz) from a server directory.
56+
* In order to collect reports from several directories, you should put each
5657
* directory settings in an array. Processing of the directories is not recursive.
5758
* It is recommended to use atomic methods for adding files to these directories.
5859
* Attention! All successfully processed files will be deleted from the directories
5960
* and all others will be moved to subdirectory `failed`, that will be created
60-
* automatically if it does not exist.
61+
* automatically if it does not exist. You can change this behavior under fetcher->directories.
6162
*/
6263
//$directories = [
6364
// // Just for displaying in the web-admin and utilities. Not necessary.
@@ -66,12 +67,69 @@
6667
// 'location' => '/var/spool/dmarc-srg/rua'
6768
//];
6869

70+
/**
71+
* It is only required if you want to get reports from a remote filesystem.
72+
* In order to collect reports from several filesystems, you should put each
73+
* filesystem settings in an array. Processing of remote filesystems is not recursive.
74+
* It uses the flysystem library to access remote file systems. Make sure this library is installed.
75+
*/
76+
//$remote_filesystems = [
77+
// // Just for displaying in the web-admin and utilities. Not necessary.
78+
// 'name' => 'AWS-S3',
79+
//
80+
// /**
81+
// * Type of remote filesystem. Required. Only 's3' is supported at this time.
82+
// * Before using the S3 filesystem, you will need to install the Flysystem S3 package
83+
// * via the Composer package manager or your OS package manager.
84+
// * For the Composer package manager run:
85+
// * composer require league/flysystem-aws-s3-v3
86+
// */
87+
// 'type' => 's3',
88+
//
89+
// // Bucket name. Required.
90+
// 'bucket' => 'your-bucket-name',
91+
//
92+
// // Path where the reports are located. Required.
93+
// 'path' => '/',
94+
//
95+
// /**
96+
// * They do not recommend to add AWS access keys directly to configuration files. Use credentials provider or
97+
// * environment variables for that. However, you can list your credentials in the following options instead.
98+
// */
99+
// //'key' => 'YEpoT...',
100+
// //'secret' => 'uyASUDf...',
101+
// //'token' => '...',
102+
//
103+
// // The full URI of the webservice. This is only required when connecting to a custom endpoint.
104+
// //'endpoint' => 'http://localhost:9000',
105+
//
106+
// // Region to connect to. Required.
107+
// // See http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of available regions.
108+
// 'region' => 'us-east-1'
109+
//];
110+
69111
$admin = [
70112
// Set this value to null or remove this parameter to disable authentication
71-
// Note: The authentication always fails with an empty string password. Change it if you want to use the web ui.
113+
// Note: The authentication always fails with an empty string password. Change it if you want to use the web UI.
72114
'password' => getenv('UI_PASSWORD'),
73115
];
74116

117+
$users = [
118+
// Enables the use of multiple users in the web interface. The authentication dialog will ask for a username and
119+
// password. Use `admin` as the username for the above password. To add new users, use Administration -> Users.
120+
// The default value is false.
121+
'user_management' => false,
122+
123+
/**
124+
* Domain ownership verification method for users who are authorized to add domains.
125+
* This option has no effect on the admin. The valid values are:
126+
* 'none' - There is no verification.
127+
* 'dns' - Verification by adding DNS TXT record like dmarcsrg-verification=...
128+
* The default value is 'none'.
129+
*/
130+
'domain_verification' => 'none'
131+
];
132+
75133
//
76134
$fetcher = [
77135
'mailboxes' => [
@@ -104,7 +162,7 @@
104162

105163
/**
106164
* What to do with the report file when it has been successfully processed.
107-
* The folowing actions are available: 'delete', 'move_to'. See the when_done for mailboxes
165+
* The following actions are available: 'delete', 'move_to'. See the when_done for mailboxes
108166
* for detailed description.
109167
* The default value is 'delete'.
110168
*/
@@ -118,6 +176,16 @@
118176
*/
119177
'when_failed' => 'move_to:' . getenv('DIRECTORIES_WHEN_FAILED_MOVE_TO'),
120178
],
179+
'remote_filesystems' => [
180+
// See directories/files_maximum
181+
'files_maximum' => 50,
182+
183+
// See directories/when_done
184+
'when_done' => 'delete',
185+
186+
// See directories/when_failed
187+
'when_failed' => 'move_to:failed'
188+
],
121189
/**
122190
* Domains matching this regular expression will be automatically added to the database from processed
123191
* reports. This option does not affect domains that have already been added to the database.
@@ -134,8 +202,67 @@
134202
// Settings for sending summary reports if it is necessary.
135203
// It uses in utils/summary_report.php
136204
$mailer = [
205+
/**
206+
* The library used to send e-mails. The following values are currently supported:
207+
* 'internal' - use the PHP internal functions. Default value.
208+
* 'phpmailer' - use the PHPMailer library. You can install it with composer.
209+
*/
210+
'library' => 'internal',
211+
212+
/**
213+
* The method used to send email. Note: The 'smtp' method requires the PHPMailer library. Make sure it is installed.
214+
* 'mail' - use the standard PHP mail() function. Default value.
215+
* 'smtp' - sent via SMTP. This method required the PHPMailer library. See below for required parameters.
216+
*/
217+
'method' => 'mail',
218+
219+
/**
220+
* Sender's e-mail address
221+
*/
137222
'from' => getenv('MAILER_FROM'),
223+
224+
/**
225+
* Recepient's default e-mail address
226+
*/
138227
'default' => getenv('MAILER_DEFAULT'),
228+
229+
/*
230+
* For method 'smtp' the following parameters must be specified:
231+
*/
232+
233+
/**
234+
* SMTP host to connect to.
235+
*/
236+
'host' => getenv('IMAP_HOST'),
237+
238+
/**
239+
* TCP port to connect to.
240+
* Typically it is 465 for SSL/TLS, 587 for STARTTLS, or 25.
241+
*/
242+
'port' => 465,
243+
244+
/**
245+
* Connection encryption method. The valid values are:
246+
* 'none' - without encryption (strongly not recommend).
247+
* 'ssl' - SSL/TLS on a separate port, for SMTP it is usually port 465. Default value.
248+
* 'starttls' - STARTTLS method, usually on the standard SMTP port 587.
249+
*/
250+
'encryption' => 'ssl',
251+
252+
/**
253+
* Set true if you want to connect to the SMTP server without certificate validation
254+
*/
255+
'novalidate-cert' => false,
256+
257+
/**
258+
* User name. Specify an empty string if authentication is not required.
259+
*/
260+
'username' => getenv('IMAP_USER'),
261+
262+
/**
263+
* User password. Specify an empty string if authentication is not required.
264+
*/
265+
'password' => getenv('IMAP_PASSWORD'),
139266
];
140267

141268
//
@@ -179,3 +306,9 @@
179306
'leave_minimum' => 100
180307
]
181308
];
309+
310+
/**
311+
* Path to a custom CSS file to add it to the HTML header in order to use custom styles.
312+
* The file must be a regular CSS file and end with ".css".
313+
*/
314+
//$custom_css = 'css/custom.css';

docker/nginx-host.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,3 @@ location ~ ^/(css|js)/ {
3535
access_log off;
3636
expires 1d;
3737
}
38-
39-
location ~ ^/(utils|classes|config)/ {
40-
deny all;
41-
}

docker/nginx-vhost.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ server {
44

55
server_name _ docker;
66

7-
root "/var/www/html";
7+
root "/var/www/html/public";
88
index index.php;
99

1010
server_tokens off;

0 commit comments

Comments
 (0)