{% if matrix_appservice_polychat_container_labels_traefik_enabled %}
traefik.enable=true

{% if matrix_appservice_polychat_container_labels_traefik_docker_network %}
traefik.docker.network={{ matrix_appservice_polychat_container_labels_traefik_docker_network }}
{% endif %}

traefik.http.services.matrix-appservice-polychat.loadbalancer.server.port={{ matrix_appservice_polychat_matrix_port }}

{% if matrix_appservice_polychat_container_labels_public_endpoint_enabled %}
############################################################
#                                                          #
# Public                                                   #
#                                                          #
############################################################

traefik.http.middlewares.matrix-appservice-polychat-public-strip-prefix.stripprefix.prefixes={{ matrix_appservice_polychat_container_labels_public_endpoint_prefix }}

traefik.http.routers.matrix-appservice-polychat-public.rule={{ matrix_appservice_polychat_container_labels_public_endpoint_traefik_rule }}
traefik.http.routers.matrix-appservice-polychat-public.middlewares=matrix-appservice-polychat-public-strip-prefix

{% if matrix_appservice_polychat_container_labels_public_endpoint_traefik_priority | int > 0 %}
traefik.http.routers.matrix-appservice-polychat-public.priority={{ matrix_appservice_polychat_container_labels_public_endpoint_traefik_priority }}
{% endif %}

traefik.http.routers.matrix-appservice-polychat-public.service=matrix-appservice-polychat
traefik.http.routers.matrix-appservice-polychat-public.entrypoints={{ matrix_appservice_polychat_container_labels_public_endpoint_traefik_entrypoints }}

traefik.http.routers.matrix-appservice-polychat-public.tls={{ matrix_appservice_polychat_container_labels_public_endpoint_traefik_tls | to_json }}
{% if matrix_appservice_polychat_container_labels_public_endpoint_traefik_tls %}
traefik.http.routers.matrix-appservice-polychat-public.tls.certResolver={{ matrix_appservice_polychat_container_labels_public_endpoint_traefik_tls_certResolver }}
{% endif %}

############################################################
#                                                          #
# /Public                                                  #
#                                                          #
############################################################
{% endif %}


{% endif %}

{{ matrix_appservice_polychat_container_labels_additional_labels }}
