Make Traefik labels files look better

This moves the comments from being just in Jinja,
to actually ending up in the generated `labels` file,
which makes inspection of the final result easier.

Also, some new lines were added here and there to make labels
more legible.

The generated file may still include weird new-lines due to
various `if` statements yielding content or not, but that's not so ugly
anymore - now that we have proper start/end sections that are visible in
the final `labels` file.
This commit is contained in:
Slavi Pantaleev
2024-01-15 10:41:15 +02:00
parent b9148675db
commit 48a4afb114
26 changed files with 948 additions and 419 deletions

View File

@ -8,10 +8,12 @@ traefik.docker.network={{ matrix_static_files_container_labels_traefik_docker_ne
traefik.http.services.{{ matrix_static_files_identifier }}.loadbalancer.server.port={{ matrix_static_files_environment_variable_server_port }}
{#
Related to /.well-known/matrix on the matrix domain
#}
{% if matrix_static_files_container_labels_well_known_matrix_endpoint_enabled %}
############################################################
# #
# Related to /.well-known/matrix on the matrix domain #
# #
############################################################
{% set well_known_matrix_endpoint_middlewares = [] %}
@ -39,16 +41,21 @@ traefik.http.routers.{{ matrix_static_files_identifier }}-well-known.tls={{ matr
traefik.http.routers.{{ matrix_static_files_identifier }}-well-known.tls.certResolver={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls_certResolver }}
{% endif %}
############################################################
# #
# /Related to /.well-known/matrix on the matrix domain #
# #
############################################################
{% endif %}
{#
/Related to /.well-known/matrix on the matrix domain
#}
{#
Base domain serving
#}
{% if matrix_static_files_container_labels_base_domain_enabled %}
############################################################
# #
# Base domain serving #
# #
############################################################
traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.rule={{ matrix_static_files_container_labels_base_domain_traefik_rule }}
{% if matrix_static_files_container_labels_base_domain_traefik_priority | int > 0 %}
@ -63,10 +70,13 @@ traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.tls={{ mat
traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.tls.certResolver={{ matrix_static_files_container_labels_base_domain_traefik_tls_certResolver }}
{% endif %}
############################################################
# #
# /Base domain serving #
# #
############################################################
{% endif %}
{#
/Base domain serving
#}
{% endif %}