diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py index 228bb253..47ede0e9 100644 --- a/core/admin/mailu/configuration.py +++ b/core/admin/mailu/configuration.py @@ -25,6 +25,7 @@ DEFAULT_CONFIG = { 'DB_PW': None, 'DB_HOST': 'database', 'DB_NAME': 'mailu', + 'DB_APPENDIX': '', 'SQLITE_DATABASE_FILE': 'data/main.db', 'SQLALCHEMY_DATABASE_URI': 'sqlite:////data/main.db', 'SQLALCHEMY_DATABASE_URI_ROUNDCUBE': 'sqlite:////data/roundcube.db', @@ -102,8 +103,8 @@ class ConfigManager: DB_TEMPLATES = { 'sqlite': 'sqlite:////{SQLITE_DATABASE_FILE}', - 'postgresql': 'postgresql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}', - 'mysql': 'mysql+mysqlconnector://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}', + 'postgresql': 'postgresql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}{DB_APPENDIX}', + 'mysql': 'mysql+mysqlconnector://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}{DB_APPENDIX}', } def __init__(self): diff --git a/core/base/requirements-dev.txt b/core/base/requirements-dev.txt index 3d2495fb..9b27a124 100644 --- a/core/base/requirements-dev.txt +++ b/core/base/requirements-dev.txt @@ -46,6 +46,7 @@ watchdog # core/postfix postfix-mta-sts-resolver +uvloop # core/oletools python-magic @@ -56,4 +57,3 @@ requests # optional/radicale radicale - diff --git a/core/base/requirements-prod.txt b/core/base/requirements-prod.txt index 40b97bc4..81f32289 100644 --- a/core/base/requirements-prod.txt +++ b/core/base/requirements-prod.txt @@ -78,6 +78,7 @@ tabulate==0.9.0 tenacity==8.2.3 typing_extensions==4.11.0 urllib3==2.2.1 +uvloop==0.21.0 validators==0.28.1 visitor==0.1.3 vobject==0.9.7 diff --git a/docs/faq.rst b/docs/faq.rst index 423cfc80..e2cc7c5b 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -992,6 +992,7 @@ 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. +Alternatively, you may set ``DB_APPENDIX`` accordingly. For example: ``?collation=utf8mb4_unicode_ci`` is appended as is just after the database name in case DB_TYPE and related values are set. MariaDB has no support for utf8mb4_0900_ai_ci which is the new default since MySQL version 8.0. diff --git a/towncrier/newsfragments/3729.misc b/towncrier/newsfragments/3729.misc new file mode 100644 index 00000000..492d4998 --- /dev/null +++ b/towncrier/newsfragments/3729.misc @@ -0,0 +1 @@ +Add optional DB_APPENDIX configuration parameter which is appended as is to the postgresql or mysql URI \ No newline at end of file