From ea8026ba005ceeb20a85e28d40e150617a4a8791 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 30 Dec 2024 16:06:56 +0100 Subject: [PATCH 1/2] Add the mariadb connector as per 3449 (cherry picked from commit adc8ef9aba92450fc8c5696bffb9d8e1e1163837) --- core/base/requirements-dev.txt | 1 + core/base/requirements-prod.txt | 1 + docs/faq.rst | 10 ++++++++++ towncrier/newsfragments/3449.bugfix | 1 + 4 files changed, 13 insertions(+) create mode 100644 towncrier/newsfragments/3449.bugfix diff --git a/core/base/requirements-dev.txt b/core/base/requirements-dev.txt index 6ac3daac..936abfcb 100644 --- a/core/base/requirements-dev.txt +++ b/core/base/requirements-dev.txt @@ -22,6 +22,7 @@ gunicorn idna itsdangerous limits +mariadb marshmallow marshmallow-sqlalchemy mysql-connector-python diff --git a/core/base/requirements-prod.txt b/core/base/requirements-prod.txt index 6152a45a..40b97bc4 100644 --- a/core/base/requirements-prod.txt +++ b/core/base/requirements-prod.txt @@ -42,6 +42,7 @@ jsonschema==4.22.0 jsonschema-specifications==2023.12.1 limits==3.11.0 Mako==1.3.3 +mariadb==1.1.11 MarkupSafe==2.1.5 marshmallow==3.21.2 marshmallow-sqlalchemy==1.0.0 diff --git a/docs/faq.rst b/docs/faq.rst index 1111481d..5b4c153f 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -986,3 +986,13 @@ Below are the steps for writing the postfix (mail) logs to a log file on the fil if [ -d /run/systemd/system ]; then systemctl kill -s HUP rsyslog.service fi + + +Admin container fails to connect to external MariaDB database +````````````````````````````````````````````````````````````` + +If the admin container is `unable to connect to an external MariaDB database due to incompatible collation`_, you may need to change the ``SQLALCHEMY_DATABASE_URI`` setting to ensure the right connector is used. + +MariaDB has no support for utf8mb4_0900_ai_ci which is the new default since MySQL version 8.0. + +.. _`unable to connect to an external MariaDB database due to incompatible collation`: https://github.com/Mailu/Mailu/issues/3449 diff --git a/towncrier/newsfragments/3449.bugfix b/towncrier/newsfragments/3449.bugfix new file mode 100644 index 00000000..ca641393 --- /dev/null +++ b/towncrier/newsfragments/3449.bugfix @@ -0,0 +1 @@ +Add the mariadb connector, as per #3449 From 188c1f08ebdfba03fc899a429f6576e6d83317b6 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 30 Dec 2024 16:17:45 +0100 Subject: [PATCH 2/2] doh (cherry picked from commit a0558bf5c079811431062b446005ae371d0af327) --- core/base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base/Dockerfile b/core/base/Dockerfile index 5e3ad092..34b878ba 100644 --- a/core/base/Dockerfile +++ b/core/base/Dockerfile @@ -53,7 +53,7 @@ ENV \ RUN set -euxo pipefail \ ; machine="$(uname -m)" \ - ; deps="build-base gcc libffi-dev python3-dev" \ + ; deps="build-base gcc libffi-dev python3-dev mariadb-dev" \ ; [[ "${machine}" != x86_64 ]] && \ deps="${deps} cargo git libretls-dev mariadb-connector-c-dev postgresql-dev" \ ; apk add --virtual .build-deps ${deps} \