mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-10-31 01:57:59 +00:00 
			
		
		
		
	Add DB_APPENDIX to support additional parameters
With https://github.com/Mailu/Mailu/pull/3701 the remark was left to set the DB collation for MariaDB setups. However, the Helm chart has no option to overwrite the SQLAlchemy URI really. It selfs DB_USER, DB_PW, DB_NAME and DB_HOST and thus triggers the Alchemy URI to be overwritten (and it overwrites it statically as well...). This commit adds the parameter / environment variable DB_APPENDIX allowing for, e.g., '?collation=utf8mb4_unicode_ci' to be set using an environment variable which the Helm chart can then set.
This commit is contained in:
		| @@ -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): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Till Skrodzki
					Till Skrodzki