1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-20 13:21:30 +00:00

Add support for custom_templates folder to override Jinja2 templates

This commit is contained in:
FreddleSpl0it
2025-05-22 13:42:17 +02:00
parent 3eb17a5f78
commit 13b4f86d29
16 changed files with 32 additions and 8 deletions

View File

@@ -31,7 +31,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/etc/clamav/config_templates'),
loader=FileSystemLoader([
'/etc/clamav/custom_templates',
'/etc/clamav/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -30,7 +30,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/etc/dovecot/config_templates'),
loader=FileSystemLoader([
'/etc/dovecot/custom_templates',
'/etc/dovecot/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -30,7 +30,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/etc/mysql/conf.d/config_templates'),
loader=FileSystemLoader([
'/etc/mysql/conf.d/custom_templates',
'/etc/mysql/conf.d/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -22,7 +22,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/etc/nginx/conf.d/config_templates'),
loader=FileSystemLoader([
'/etc/nginx/conf.d/custom_templates',
'/etc/nginx/conf.d/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -15,7 +15,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/php-conf/config_templates'),
loader=FileSystemLoader([
'/php-conf/custom_templates',
'/php-conf/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -17,7 +17,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/opt/postfix/conf/config_templates'),
loader=FileSystemLoader([
'/opt/postfix/conf/custom_templates',
'/opt/postfix/conf/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -60,7 +60,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader('/etc/rspamd/config_templates'),
loader=FileSystemLoader([
'/etc/rspamd/custom_templates',
'/etc/rspamd/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True

View File

@@ -27,7 +27,10 @@ class Bootstrap(BootstrapBase):
# Setup Jinja2 Environment and load vars
self.env = Environment(
loader=FileSystemLoader("/etc/sogo/config_templates"),
loader=FileSystemLoader([
'/etc/sogo/custom_templates',
'/etc/sogo/config_templates'
]),
keep_trailing_newline=True,
lstrip_blocks=True,
trim_blocks=True