From fee52e87eddbf445b15359eea95cde576bc13666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 6 Dec 2018 11:34:28 +0200 Subject: [PATCH 1/5] Don't allow for 1 review when review/need2 label is set --- .mergify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mergify.yml b/.mergify.yml index 023bf59b..f18eec13 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -10,6 +10,7 @@ pull_request_rules: conditions: - author~=(kaiyou|muhlemmer|mildred|HorayNarea|adi90x|hoellen|ofthesun9) - status-success=continuous-integration/travis-ci/pr + - label!=["review/need2"] - "#approved-reviews-by>=1" actions: merge: From a2a9512afaf3cc550820dc0f42c77c3b0fcd7929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 7 Dec 2018 11:53:43 +0200 Subject: [PATCH 2/5] Enable mergify strict mode In the past we had strict mode in branch protection. This didn't really work as it broke mergify. Now mergify supports this options and takes care of the merging automatically. Let's see how it goes ;) Reason is the recent build failures we had on master, during a busy merge day. This could have been prevented if sequential PR's where re-merging with master. More info: https://doc.mergify.io/strict-workflow.html --- .mergify.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 023bf59b..1cbb0999 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,6 +6,7 @@ pull_request_rules: actions: merge: method: merge + strict: true - name: Trusted author, successful travis and 1 approved review conditions: - author~=(kaiyou|muhlemmer|mildred|HorayNarea|adi90x|hoellen|ofthesun9) @@ -14,3 +15,4 @@ pull_request_rules: actions: merge: method: merge + strict: true From 94edb48f08653957db54a8ff6ae3a85ccb7438d1 Mon Sep 17 00:00:00 2001 From: Ionut Filip Date: Fri, 7 Dec 2018 13:37:40 +0200 Subject: [PATCH 3/5] Dynamic attachment size --- docs/compose/.env | 1 + setup/flavors/compose/mailu.env | 1 + webmails/rainloop/Dockerfile | 2 +- webmails/rainloop/config.ini | 2 +- webmails/rainloop/php.ini | 5 +++-- webmails/rainloop/start.py | 3 +++ webmails/roundcube/Dockerfile | 4 ++-- webmails/roundcube/php.ini | 5 +++-- webmails/roundcube/start.py | 7 +++++++ 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/compose/.env b/docs/compose/.env index 2100e27a..7b1e6d01 100644 --- a/docs/compose/.env +++ b/docs/compose/.env @@ -61,6 +61,7 @@ ANTIVIRUS=none # Message size limit in bytes # Default: accept messages up to 50MB +# Max attachment size will be 33% smaller MESSAGE_SIZE_LIMIT=50000000 # Networks granted relay permissions, make sure that you include your Docker diff --git a/setup/flavors/compose/mailu.env b/setup/flavors/compose/mailu.env index 3f67b0dd..b4505c62 100644 --- a/setup/flavors/compose/mailu.env +++ b/setup/flavors/compose/mailu.env @@ -73,6 +73,7 @@ ANTISPAM={{ antispam_enabled or 'none'}} # Message size limit in bytes # Default: accept messages up to 50MB +# Max attachment size will be 33% smaller MESSAGE_SIZE_LIMIT={{ message_size_limit or '50000000' }} # Networks granted relay permissions, make sure that you include your Docker diff --git a/webmails/rainloop/Dockerfile b/webmails/rainloop/Dockerfile index db7403f5..92479489 100644 --- a/webmails/rainloop/Dockerfile +++ b/webmails/rainloop/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists COPY include.php /var/www/html/include.php -COPY php.ini /usr/local/etc/php/conf.d/rainloop.ini +COPY php.ini /php.ini COPY config.ini /config.ini COPY default.ini /default.ini diff --git a/webmails/rainloop/config.ini b/webmails/rainloop/config.ini index 7fb13889..6ae5fff7 100644 --- a/webmails/rainloop/config.ini +++ b/webmails/rainloop/config.ini @@ -1,7 +1,7 @@ ; RainLoop Webmail configuration file [webmail] -attachment_size_limit = 25 +attachment_size_limit = {{ MAX_FILESIZE }} [security] allow_admin_panel = Off diff --git a/webmails/rainloop/php.ini b/webmails/rainloop/php.ini index 9b241b46..39abbdd5 100644 --- a/webmails/rainloop/php.ini +++ b/webmails/rainloop/php.ini @@ -1,3 +1,4 @@ date.timezone=UTC -upload_max_filesize = 25M -post_max_size = 25M +upload_max_filesize = {{ MAX_FILESIZE }}M +post_max_size = {{ MAX_FILESIZE }}M + diff --git a/webmails/rainloop/start.py b/webmails/rainloop/start.py index 9e8465a2..4c116e09 100755 --- a/webmails/rainloop/start.py +++ b/webmails/rainloop/start.py @@ -10,6 +10,8 @@ convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read() os.environ["FRONT_ADDRESS"] = os.environ.get("FRONT_ADDRESS", "front") os.environ["IMAP_ADDRESS"] = os.environ.get("IMAP_ADDRESS", "imap") +os.environ["MAX_FILESIZE"] = str(int(int(os.environ.get("MESSAGE_SIZE_LIMIT"))*0.66/1048576)) + base = "/data/_data_/_default_/" shutil.rmtree(base + "domains/", ignore_errors=True) os.makedirs(base + "domains", exist_ok=True) @@ -17,6 +19,7 @@ os.makedirs(base + "configs", exist_ok=True) convert("/default.ini", "/data/_data_/_default_/domains/default.ini") convert("/config.ini", "/data/_data_/_default_/configs/config.ini") +convert("/php.ini", "/usr/local/etc/php/conf.d/rainloop.ini") os.system("chown -R www-data:www-data /data") diff --git a/webmails/roundcube/Dockerfile b/webmails/roundcube/Dockerfile index 14bee56e..00b843b2 100644 --- a/webmails/roundcube/Dockerfile +++ b/webmails/roundcube/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \ ENV ROUNDCUBE_URL https://github.com/roundcube/roundcubemail/releases/download/1.3.8/roundcubemail-1.3.8-complete.tar.gz RUN apt-get update && apt-get install -y \ - zlib1g-dev \ + zlib1g-dev python3-jinja2 \ && docker-php-ext-install zip \ && echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \ && rm -rf /var/www/html/ \ @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y \ && chown -R www-data: logs temp \ && rm -rf /var/lib/apt/lists -COPY php.ini /usr/local/etc/php/conf.d/roundcube.ini +COPY php.ini /php.ini COPY config.inc.php /var/www/html/config/ COPY start.py /start.py diff --git a/webmails/roundcube/php.ini b/webmails/roundcube/php.ini index 9b241b46..39abbdd5 100644 --- a/webmails/roundcube/php.ini +++ b/webmails/roundcube/php.ini @@ -1,3 +1,4 @@ date.timezone=UTC -upload_max_filesize = 25M -post_max_size = 25M +upload_max_filesize = {{ MAX_FILESIZE }}M +post_max_size = {{ MAX_FILESIZE }}M + diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py index 07b3a567..3a0bd0bc 100755 --- a/webmails/roundcube/start.py +++ b/webmails/roundcube/start.py @@ -1,6 +1,13 @@ #!/usr/bin/python3 import os +import jinja2 + +convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ)) + +os.environ["MAX_FILESIZE"] = str(int(int(os.environ.get("MESSAGE_SIZE_LIMIT"))*0.66/1048576)) + +convert("/php.ini", "/usr/local/etc/php/conf.d/roundcube.ini") # Fix some permissions os.system("mkdir -p /data/gpg") From 626559f99bee40723ffb2e9b5e6faf88446d0db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 7 Dec 2018 13:43:53 +0200 Subject: [PATCH 4/5] Mergify dismiss reviews --- .mergify.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 1cbb0999..f00c4086 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -7,6 +7,9 @@ pull_request_rules: merge: method: merge strict: true + dismiss_reviews: + approved: true + - name: Trusted author, successful travis and 1 approved review conditions: - author~=(kaiyou|muhlemmer|mildred|HorayNarea|adi90x|hoellen|ofthesun9) @@ -16,3 +19,5 @@ pull_request_rules: merge: method: merge strict: true + dismiss_reviews: + approved: true From 8e5ccf27541e9bda25fbf989db915dfe58dfd991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 7 Dec 2018 13:47:22 +0200 Subject: [PATCH 5/5] Don't merge when WIP or Blocked --- .mergify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index f18eec13..d7299d36 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,6 +2,7 @@ pull_request_rules: - name: Successful travis and 2 approved reviews conditions: - status-success=continuous-integration/travis-ci/pr + - label!=["status"/wip","status/blocked"] - "#approved-reviews-by>=2" actions: merge: @@ -10,7 +11,7 @@ pull_request_rules: conditions: - author~=(kaiyou|muhlemmer|mildred|HorayNarea|adi90x|hoellen|ofthesun9) - status-success=continuous-integration/travis-ci/pr - - label!=["review/need2"] + - label!=["status"/wip","status/blocked","review/need2"] - "#approved-reviews-by>=1" actions: merge: