From d8f641207475ac9ab21f7db696b1b3d23de6227f Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Tue, 23 Nov 2021 08:00:23 +0100 Subject: [PATCH 01/15] Bump the mailman-hyperkitty plugin to 1.2.0. This new version sends the api_key as an Authorization header instead of a GET parameter, which fixes a security vulnerability. The change is needed since Hyperkitty has been upgraded to 1.3.5. --- core/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Dockerfile b/core/Dockerfile index 9b2cd53..32e7202 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ && python3 -m pip install psycopg2 \ gunicorn==19.9.0 \ mailman==3.3.5 \ - mailman-hyperkitty==1.1.0 \ + mailman-hyperkitty==1.2.0 \ pymysql \ 'sqlalchemy<1.4.0' \ && apk del build-deps \ From 231fb0b9fcb6d7184b85275a89c083f970c5d754 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Thu, 16 Dec 2021 22:08:43 +0100 Subject: [PATCH 02/15] Add py-cryptography --- core/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Dockerfile b/core/Dockerfile index 9b2cd53..6c2658d 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache \ && apk add --virtual build-deps gcc python3-dev musl-dev postgresql-dev \ libffi-dev \ # psutil needs linux-headers to compile on musl c library. - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers py-cryptography \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install psycopg2 \ gunicorn==19.9.0 \ From 96e0a2659576318ebf691de48f797532fe703139 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 26 Dec 2021 19:43:53 +0100 Subject: [PATCH 03/15] Add mariadb-connector-c for sha256_passwords --- core/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Dockerfile b/core/Dockerfile index 9b2cd53..0b35dd5 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache \ && apk add --virtual build-deps gcc python3-dev musl-dev postgresql-dev \ libffi-dev \ # psutil needs linux-headers to compile on musl c library. - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers mariadb-connector-c \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install psycopg2 \ gunicorn==19.9.0 \ From e79800f49b76c67811e1e11643c618ca697c0507 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 26 Dec 2021 19:44:29 +0100 Subject: [PATCH 04/15] Improve MySQL endpoint ping with custom ports --- core/docker-entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index 38338ad..9c6ab17 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -15,8 +15,8 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print(o.hostname);") - until mysqladmin ping --host "$HOSTNAME" --silent; do + readarray -d' ' -t ENDPOINT <<< $(python3 -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print('%s %s' % (o.hostname, o.port if o.port else '3306'));") + until mysqladmin ping --host ${ENDPOINT[0]} --port ${ENDPOINT[1]} --silent; do >&2 echo "MySQL is unavailable - sleeping" sleep 1 done From 3fbb7e641c98e5930566f079503458dc3bf70871 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 2 Jan 2022 10:26:20 +0100 Subject: [PATCH 05/15] Update web & postorius images with similar changes as core --- core/Dockerfile.dev | 2 +- postorius/Dockerfile | 2 +- postorius/Dockerfile.dev | 2 +- postorius/docker-entrypoint.sh | 13 ++----------- web/Dockerfile | 2 +- web/Dockerfile.dev | 2 +- web/docker-entrypoint.sh | 13 ++----------- 7 files changed, 9 insertions(+), 27 deletions(-) diff --git a/core/Dockerfile.dev b/core/Dockerfile.dev index 20a391f..66eb78a 100644 --- a/core/Dockerfile.dev +++ b/core/Dockerfile.dev @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ apk update \ && apk add --no-cache --virtual build-deps gcc python3-dev musl-dev \ postgresql-dev git libffi-dev \ - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers mariadb-connector-c \ && python3 -m pip install -U psycopg2 pymysql setuptools wheel \ && python3 -m pip install \ git+https://gitlab.com/mailman/mailman@${CORE_REF} \ diff --git a/postorius/Dockerfile b/postorius/Dockerfile index f8d719b..2d235b4 100644 --- a/postorius/Dockerfile +++ b/postorius/Dockerfile @@ -12,7 +12,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ python3 py3-pip libffi libuuid pcre-dev \ diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index f1560cb..f6bf5fa 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -16,7 +16,7 @@ ARG CLIENT_REF RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev git cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev git cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap \ python3 py3-pip libffi gettext \ diff --git a/postorius/docker-entrypoint.sh b/postorius/docker-entrypoint.sh index 26c7e38..2b8218b 100755 --- a/postorius/docker-entrypoint.sh +++ b/postorius/docker-entrypoint.sh @@ -16,23 +16,14 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 <&2 echo "MySQL is unavailable - sleeping" sleep 1 done >&2 echo "MySQL is up - continuing" } - function check_or_create () { # Check if the path exists, if not, create the directory. if [[ ! -e dir ]]; then diff --git a/web/Dockerfile b/web/Dockerfile index 011b4c5..ff3cf59 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -12,7 +12,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ python3 py3-pip xapian-core xapian-bindings-python3 libffi pcre-dev \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 2c5951c..426e195 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -17,7 +17,7 @@ ARG CLIENT_REF RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers git \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc pcre-dev \ python3 py3-pip postgresql-client mysql-client py3-mysqlclient \ curl mailcap xapian-core xapian-bindings-python3 libffi gettext \ diff --git a/web/docker-entrypoint.sh b/web/docker-entrypoint.sh index a02691c..a29c396 100755 --- a/web/docker-entrypoint.sh +++ b/web/docker-entrypoint.sh @@ -16,23 +16,14 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 <&2 echo "MySQL is unavailable - sleeping" sleep 1 done >&2 echo "MySQL is up - continuing" } - function check_or_create () { # Check if the path exists, if not, create the directory. if [[ ! -e dir ]]; then From 37db88f1b203998d93ba12dec0d0067b020ddc57 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 2 Jan 2022 10:30:42 +0100 Subject: [PATCH 06/15] Update web & postorius images with similar changes as core --- core/Dockerfile.dev | 2 +- postorius/Dockerfile | 2 +- postorius/Dockerfile.dev | 2 +- web/Dockerfile | 2 +- web/Dockerfile.dev | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/Dockerfile.dev b/core/Dockerfile.dev index 20a391f..15e19f8 100644 --- a/core/Dockerfile.dev +++ b/core/Dockerfile.dev @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ apk update \ && apk add --no-cache --virtual build-deps gcc python3-dev musl-dev \ postgresql-dev git libffi-dev \ - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers py-cryptography \ && python3 -m pip install -U psycopg2 pymysql setuptools wheel \ && python3 -m pip install \ git+https://gitlab.com/mailman/mailman@${CORE_REF} \ diff --git a/postorius/Dockerfile b/postorius/Dockerfile index f8d719b..4bc0b2f 100644 --- a/postorius/Dockerfile +++ b/postorius/Dockerfile @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ - python3 py3-pip libffi libuuid pcre-dev \ + python3 py3-pip libffi libuuid pcre-dev py-cryptography \ && python3 -m pip install -U 'Django<3.2' pip setuptools wheel \ && python3 -m pip install postorius==1.3.6 \ uwsgi \ diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index f1560cb..91409be 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -19,7 +19,7 @@ RUN --mount=type=cache,target=/root/.cache \ postgresql-dev mariadb-dev python3-dev libffi-dev git cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap \ - python3 py3-pip libffi gettext \ + python3 py3-pip libffi gettext py-cryptography \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install -U \ git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ diff --git a/web/Dockerfile b/web/Dockerfile index 011b4c5..ccfa3b2 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ - python3 py3-pip xapian-core xapian-bindings-python3 libffi pcre-dev \ + python3 py3-pip xapian-core xapian-bindings-python3 libffi pcre-dev py-cryptography \ && python3 -m pip install -U 'Django<3.2' pip setuptools wheel \ && pip install mailmanclient==3.3.3 \ postorius==1.3.6 \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 2c5951c..8a969e4 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/root/.cache \ postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc pcre-dev \ python3 py3-pip postgresql-client mysql-client py3-mysqlclient \ - curl mailcap xapian-core xapian-bindings-python3 libffi gettext \ + curl mailcap xapian-core xapian-bindings-python3 libffi gettext py-cryptography \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install -U \ git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ From 85659b47efb1c1432eb877c0ad6010199b9d59aa Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Sun, 20 Mar 2022 16:14:46 +0100 Subject: [PATCH 07/15] docker-compose: backport "stop_grace_period" and "restart" option to mysql variant * backport from 743bc8522cc24c8f7684c4671a2a29477fae73b6 * backport from 0b22a0da62c56f85076ca1999e81f224092e003a * also whitespace fix and line reordering Signed-off-by: Sven Roederer --- docker-compose-mysql.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose-mysql.yaml b/docker-compose-mysql.yaml index e97c602..5d8358e 100644 --- a/docker-compose-mysql.yaml +++ b/docker-compose-mysql.yaml @@ -7,6 +7,7 @@ services: hostname: mailman-core volumes: - /opt/mailman/core:/opt/mailman/ + stop_grace_period: 30s links: - database:database depends_on: @@ -34,8 +35,8 @@ services: volumes: - /opt/mailman/web:/opt/mailman-web-data environment: + - DATABASE_TYPE=mysql - DATABASE_URL=mysql://mailman:mailmanpass@database/mailmandb?charset=utf8mb4 - - DATABASE_TYPE=mysql - HYPERKITTY_API_KEY=someapikey - SECRET_KEY=thisisaverysecretkey - DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ @@ -51,7 +52,6 @@ services: MYSQL_USER: mailman MYSQL_PASSWORD: mailmanpass MYSQL_RANDOM_ROOT_PASSWORD: "yes" - restart: always image: mariadb:10.5 command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci volumes: @@ -60,7 +60,7 @@ services: mailman: networks: - mailman: + mailman: driver: bridge ipam: driver: default From 119f22b7c98b5024aadb1f067f7437413680d59c Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Sun, 20 Mar 2022 18:43:42 +0100 Subject: [PATCH 08/15] core/entrypoint: fix typo Signed-off-by: Sven Roederer --- core/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index 38338ad..7c761b0 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -36,7 +36,7 @@ fi # SMTP_HOST defaults to the gateway if [[ ! -v SMTP_HOST ]]; then export SMTP_HOST=$(/sbin/ip route | awk '/default/ { print $3 }') - echo "SMPT_HOST not specified, using the gateway ($SMTP_HOST) as default" + echo "SMTP_HOST not specified, using the gateway ($SMTP_HOST) as default" fi if [[ ! -v SMTP_PORT ]]; then From 941b7f0411ff2036d881871497dcf00669e7d2d5 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Thu, 14 Apr 2022 07:20:42 +0000 Subject: [PATCH 09/15] Remove the get_latest_ref script and use the primary branch. We previously used the get_latest_ref.py script to fetch the latest commit sha for each project that passed CI correctly. Although, that has some challenges due to requiring Gitlab Auth token. It causes issues with building PRs and we don't want to share the Gitlab token with PR authors. Instead, this commit removes the code and sha references and Instead simply uses the primary master branch from each project to build the rolling release container image. --- README.md | 16 ++-------------- build.sh | 30 ----------------------------- core/Dockerfile.dev | 4 ++-- get_latest_ref.py | 41 ---------------------------------------- postorius/Dockerfile.dev | 4 ++-- web/Dockerfile.dev | 6 +++--- 6 files changed, 9 insertions(+), 92 deletions(-) delete mode 100755 get_latest_ref.py diff --git a/README.md b/README.md index 133ebf3..d67df98 100644 --- a/README.md +++ b/README.md @@ -89,36 +89,24 @@ $ docker pull docker.io/maxking/mailman-web:rolling $ docker pull docker.io/maxking/mailman-core:rolling ``` -Rolling releases are built with every commit and also re-generated weekly. You +Rolling releases are built with every commit and also re-generated nightly. You can inspect the images to get which commit it was built using: ```bash $ docker inspect --format '{{json .Config.Labels }}' mailman-core | python -m json.tool { - "version.core": "31f434d0", "version.git_commit": "45a4d7805b2b3d0e7c51679f59682d64ba02f05f", - "version.mm3-hk": "c625bfd2" } $ docker inspect --format '{{json .Config.Labels }}' mailman-web | python -m json.tool { - "version.client": "d9e9cb73", - "version.dj-mm3": "72a7d6c4", "version.git_commit": "45a4d7805b2b3d0e7c51679f59682d64ba02f05f", - "version.hyperkitty": "b67ca8a8", - "version.postorius": "73328ad4" } ``` - `version.git_commit` : This is the commit hash of the Dockerfile in the [Github repo](https://github.com/maxking/docker-mailman) -- `version.core`: The commit hash of Mailman Core -- `version.mm3-hk`: The commit hash of Mailman3-hyperkitty plugin. -- `version.client`: The commit hash of Mailman Client. -- `version.hyperkitty`: The commit hash of Hyperkitty. -- `version.postorius`: The commit hash of Postorius. -- `version.dj-mm3`: The commit hash of Django-Mailman3 project. ## Dependencies @@ -414,7 +402,7 @@ smtp_port: $SMTP_PORT configuration: /etc/postfix-mailman.cfg ``` -So, if you need to update the values, you can set `SMTP_HOST`, `SMTP_PORT`, +So, if you need to update the values, you can set `SMTP_HOST`, `SMTP_PORT`, `MM_HOSTNAME` environment variables in `mailman-core` container. Please verify the output for `[mta]` section to ensure that it points to diff --git a/build.sh b/build.sh index 370d621..9d8fe7a 100755 --- a/build.sh +++ b/build.sh @@ -12,49 +12,19 @@ DOCKER=docker if [ "$BUILD_ROLLING" = "yes" ]; then echo "Building rolling releases..." - python3 -m venv venv - source venv/bin/activate - pip install python-gitlab - # Get the latest commit for repositories and set their reference values to be - # used in the development builds. - CORE_REF=$(python get_latest_ref.py mailman/mailman) - CLIENT_REF=$(python get_latest_ref.py mailman/mailmanclient) - POSTORIUS_REF=$(python get_latest_ref.py mailman/postorius) - HYPERKITTY_REF=$(python get_latest_ref.py mailman/hyperkitty) - DJ_MM3_REF=$(python get_latest_ref.py mailman/django-mailman3) - MM3_HK_REF=$(python get_latest_ref.py mailman/mailman-hyperkitty) - # Build the mailman-core image. $DOCKER build -f core/Dockerfile.dev \ - --build-arg CORE_REF=$CORE_REF \ - --build-arg MM3_HK_REF=$MM3_HK_REF \ - --label version.core="$CORE_REF" \ - --label version.mm3-hk="$MM3_HK_REF" \ --label version.git_commit="$COMMIT_ID" \ -t maxking/mailman-core:rolling core/ # Build the mailman-web image. $DOCKER build -f web/Dockerfile.dev \ --label version.git_commit="$COMMIT_ID" \ - --label version.postorius="$POSTORIUS_REF" \ - --label version.hyperkitty="$HYPERKITTY_REF" \ - --label version.client="$CLIENT_REF" \ - --label version.dj-mm3="$DJ_MM3_REF" \ - --build-arg POSTORIUS_REF=$POSTORIUS_REF \ - --build-arg CLIENT_REF=$CLIENT_REF \ - --build-arg HYPERKITTY_REF=$HYPERKITTY_REF \ - --build-arg DJ_MM3_REF=$DJ_MM3_REF \ -t maxking/mailman-web:rolling web/ # build the postorius image. $DOCKER build -f postorius/Dockerfile.dev\ --label version.git_commit="$COMMIT_ID"\ - --label version.postorius="$POSTORIUS_REF" \ - --label version.client="$CLIENT_REF" \ - --label version.dj-mm3="$DJ_MM3_REF" \ - --build-arg POSTORIUS_REF=$POSTORIUS_REF \ - --build-arg CLIENT_REF=$CLIENT_REF \ - --build-arg DJ_MM3_REF=$DJ_MM3_REF \ -t maxking/postorius:rolling postorius/ else echo "Building stable releases..." diff --git a/core/Dockerfile.dev b/core/Dockerfile.dev index 384b170..bb0c0b8 100644 --- a/core/Dockerfile.dev +++ b/core/Dockerfile.dev @@ -18,8 +18,8 @@ RUN --mount=type=cache,target=/root/.cache \ && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers py-cryptography mariadb-connector-c \ && python3 -m pip install -U psycopg2 pymysql setuptools wheel \ && python3 -m pip install \ - git+https://gitlab.com/mailman/mailman@${CORE_REF} \ - git+https://gitlab.com/mailman/mailman-hyperkitty@${MM3_HK_REF} \ + git+https://gitlab.com/mailman/mailman \ + git+https://gitlab.com/mailman/mailman-hyperkitty \ gunicorn==19.9.0 \ && apk del build-deps \ && adduser -S mailman diff --git a/get_latest_ref.py b/get_latest_ref.py deleted file mode 100755 index a761d7e..0000000 --- a/get_latest_ref.py +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env python -import os -import sys -import gitlab - - -def usage(): - print("{} ") - - -def main(): - if 2 > len(sys.argv) > 3: - usage() - - project_name = sys.argv[1] - if len(sys.argv) > 2: - branch_name = sys.argv[2] - else: - branch_name = 'master' - - gl_token = os.getenv('GITLAB_TOKEN') - if gl_token is None: - print('GITLAB_TOKEN not set!') - exit(1) - gl = gitlab.Gitlab('https://gitlab.com/', gl_token) - - project = gl.projects.get(project_name) - - # 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() diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index 622ccf0..a5d0041 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -22,8 +22,8 @@ RUN --mount=type=cache,target=/root/.cache \ python3 py3-pip libffi gettext py-cryptography \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install -U \ - git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ - git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \ + git+https://gitlab.com/mailman/mailmanclient \ + git+https://gitlab.com/mailman/postorius \ uwsgi \ 'psycopg2<2.9' \ dj-database-url \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 648c980..6d22688 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -23,9 +23,9 @@ RUN --mount=type=cache,target=/root/.cache \ curl mailcap xapian-core xapian-bindings-python3 libffi gettext py-cryptography \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install -U \ - git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ - git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \ - git+https://gitlab.com/mailman/hyperkitty@${HYPERKITTY_REF} \ + git+https://gitlab.com/mailman/mailmanclient \ + git+https://gitlab.com/mailman/postorius \ + git+https://gitlab.com/mailman/hyperkitty \ whoosh \ uwsgi \ 'psycopg2<2.9' \ From a4906c680fd5168b4a4dd3e135665599b6697de5 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Thu, 14 Apr 2022 07:38:07 +0000 Subject: [PATCH 10/15] Update names of jobs --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4078009..a1816a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,15 +45,15 @@ jobs: workflows: version: 2 - build-and-deploy-workflow: + test-stable: jobs: - - build: + - stable-build: rolling: "no" filters: tags: only: /^v\d+\.\d+\.\d+$/ - cron-workflow: + cron-builds: triggers: - schedule: cron: "0 0 * * *" @@ -61,13 +61,13 @@ workflows: branches: only: main jobs: - - build: + - cron-build: rolling: "yes" context: org-global - rolling-workflow: + rolling-builds: jobs: - - build: + - rolling-build: rolling: "yes" context: org-global filters: From c69b5c5d42bd686edadd8f9b9bfc1b62158bb466 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Thu, 14 Apr 2022 07:40:05 +0000 Subject: [PATCH 11/15] Fix some missed our references --- postorius/Dockerfile.dev | 2 +- web/Dockerfile.dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index a5d0041..e427a1c 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.cache \ django-utils-six \ && python3 -m pip install -U 'Django<3.2' \ && python3 -m pip install -U \ - git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \ + git+https://gitlab.com/mailman/django-mailman3 \ && apk del .build-deps \ && addgroup -S mailman \ && adduser -S -G mailman mailman \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 6d22688..9b2809c 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -38,7 +38,7 @@ RUN --mount=type=cache,target=/root/.cache \ django-utils-six \ && python3 -m pip install -U 'Django<3.2' \ && python3 -m pip install -U \ - git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \ + git+https://gitlab.com/mailman/django-mailman3 \ && apk del .build-deps \ && addgroup -S mailman \ && adduser -S -G mailman mailman \ From 02d9203a8f415283f5c19933221294b9815ad1f7 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Thu, 14 Apr 2022 07:42:12 +0000 Subject: [PATCH 12/15] Revert to using the right job names --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1816a2..7299263 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ workflows: version: 2 test-stable: jobs: - - stable-build: + - build: rolling: "no" filters: tags: @@ -61,13 +61,13 @@ workflows: branches: only: main jobs: - - cron-build: + - build: rolling: "yes" context: org-global rolling-builds: jobs: - - rolling-build: + - build: rolling: "yes" context: org-global filters: From 0b470ba8fb716937b81f8c3314c05e1694cc9ece Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Thu, 14 Apr 2022 07:43:03 +0000 Subject: [PATCH 13/15] Some more workflow renames --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7299263..c2aaaa5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ workflows: rolling: "yes" context: org-global - rolling-builds: + test-rolling: jobs: - build: rolling: "yes" From 7ce446e3dbea75469acd5610bed66f8d8ec49558 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sun, 19 Jun 2022 03:20:33 +0000 Subject: [PATCH 14/15] Empty commit to trigger build From 22b3b7d4024a00e9896837fa04883cbaeef38b20 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sun, 19 Jun 2022 03:56:39 +0000 Subject: [PATCH 15/15] Hyperkitty needs mistune 2.0.0rc1 --- web/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/web/Dockerfile b/web/Dockerfile index 31d53cc..297f074 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -21,6 +21,7 @@ RUN --mount=type=cache,target=/root/.cache \ postorius==1.3.6 \ hyperkitty==1.3.5 \ django-mailman3==1.3.7 \ + mistune==2.0.0rc1 \ whoosh \ uwsgi \ 'psycopg2<2.9' \