From 6fb158d062c7a49f58b6742ad7c0ce1984ac0c59 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 29 Jul 2021 18:27:55 +0200 Subject: [PATCH 1/2] feat: support smtp via ssl --- README.md | 6 +++--- postorius/mailman-web/settings.py | 2 +- web/README.md | 3 +++ web/mailman-web/settings.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b84ae49..4cd8cd0 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ the host running the containers and are imported at runtime in the containers. * `/opt/mailman/web/settings_local.py` : This is the Django configuration that is imported by the [existing configuration][2] - provided by the mailman-web container. **This file is referred to as + provided by the mailman-web container. **This file is referred to as `settings.py` in most of the Postorius and Django documentation.** To change or override any settings in Django/Postorius, you need to create/edit this file. A useful configuration for troubleshooting is `DEBUG = True`. @@ -201,8 +201,8 @@ EMAIL_PORT = 25 Alternatively, you can use the environment variables `SMTP_HOST` (defaults to the container's gateway), `SMTP_PORT` (defaults to `25`), `SMTP_HOST_USER` (defaults to -an empty string), `SMTP_HOST_PASSWORD` (defaults to an empty string) and -`SMTP_USE_TLS` (defaults to `False`). +an empty string), `SMTP_HOST_PASSWORD` (defaults to an empty string), +`SMTP_USE_TLS` (defaults to `False`) and `SMTP_USE_SSL` (defaults to `False`). This is required in addition to the [Setup your MTA](#setting-up-your-mta) section below, which covers email setup for Mailman Core. diff --git a/postorius/mailman-web/settings.py b/postorius/mailman-web/settings.py index 984fbc3..d701c4e 100644 --- a/postorius/mailman-web/settings.py +++ b/postorius/mailman-web/settings.py @@ -216,7 +216,7 @@ EMAIL_PORT = os.environ.get('SMTP_PORT', 25) EMAIL_HOST_USER = os.environ.get('SMTP_HOST_USER', '') EMAIL_HOST_PASSWORD = os.environ.get('SMTP_HOST_PASSWORD', '') EMAIL_USE_TLS = os.environ.get('SMTP_USE_TLS', False) - +EMAIL_USE_SSL = os.environ.get('SMTP_USE_SSL', False) # Compatibility with Bootstrap 3 from django.contrib.messages import constants as messages # flake8: noqa diff --git a/web/README.md b/web/README.md index 7d8d991..54bef5f 100644 --- a/web/README.md +++ b/web/README.md @@ -59,6 +59,9 @@ change them unless you know what you want. - `SMTP_USE_TLS`: Specifies wheather the SMTP connection is encrypted via TLS. Default is `False`. +- `SMTP_USE_SSL`: Specifies wheather the SMTP connection is encrypted + via SSL. Default is `False`. + - `DJANGO_LOG_URL`: Path to the django's log file. Defaults to `/opt/mailman-web-data/logs/mailmanweb.log`. diff --git a/web/mailman-web/settings.py b/web/mailman-web/settings.py index 84afc49..6c2d0d0 100644 --- a/web/mailman-web/settings.py +++ b/web/mailman-web/settings.py @@ -221,7 +221,7 @@ EMAIL_PORT = os.environ.get('SMTP_PORT', 25) EMAIL_HOST_USER = os.environ.get('SMTP_HOST_USER', '') EMAIL_HOST_PASSWORD = os.environ.get('SMTP_HOST_PASSWORD', '') EMAIL_USE_TLS = os.environ.get('SMTP_USE_TLS', False) - +EMAIL_USE_SSL = os.environ.get('SMTP_USE_SSL', False) # Compatibility with Bootstrap 3 from django.contrib.messages import constants as messages # flake8: noqa From a6d2792ee13346939b7c8cdc580a3c63c6d131f6 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Wed, 25 Aug 2021 04:27:50 -0700 Subject: [PATCH 2/2] Iterate over commits until we find something that passed CI (#494) * Iterate over commits until we find something that passed CI * Fix a bug --- get_latest_ref.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/get_latest_ref.py b/get_latest_ref.py index 4276e44..a761d7e 100755 --- a/get_latest_ref.py +++ b/get_latest_ref.py @@ -25,14 +25,17 @@ def main(): gl = gitlab.Gitlab('https://gitlab.com/', gl_token) project = gl.projects.get(project_name) - branch = project.branches.get(branch_name) - top_commit = project.commits.get(branch.commit['short_id']) - - if top_commit.last_pipeline['status'] == 'success': - print(top_commit.short_id) - else: - exit(1) + # Find the last commit in the branch that passed the CI + # successfully and return the reference to it. + for commit in project.commits.list(ref=branch_name): + stasues = list(status.status == 'success' for status in + commit.statuses.list() if status.allow_failure == False) + if len(stasues) == 0: + continue + if all(stasues): + print(commit.short_id) + break if __name__ == '__main__': main()