diff --git a/roles/custom/matrix-client-fluffychat/defaults/main.yml b/roles/custom/matrix-client-fluffychat/defaults/main.yml index 03a8bd613..017d58410 100644 --- a/roles/custom/matrix-client-fluffychat/defaults/main.yml +++ b/roles/custom/matrix-client-fluffychat/defaults/main.yml @@ -33,9 +33,14 @@ matrix_client_fluffychat_container_additional_networks: "{{ matrix_client_fluffy matrix_client_fluffychat_container_additional_networks_auto: [] matrix_client_fluffychat_container_additional_networks_custom: [] +# Configures the port number used inside the container image. +matrix_client_fluffychat_container_http_port: 8080 + # Controls whether the matrix-client-fluffychat container exposes its HTTP port (tcp/8080 in the container). # -# Takes an ":" or "" value (e.g. "127.0.0.1:8765"), or empty string to not expose. +# Takes an ":" or "" value (e.g. "127.0.0.1:8080"), or empty string to not expose. +# +# Also see: `matrix_client_fluffychat_container_http_port` matrix_client_fluffychat_container_http_host_bind_port: '' # matrix_client_fluffychat_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. @@ -44,6 +49,7 @@ matrix_client_fluffychat_container_http_host_bind_port: '' # To inject your own other container labels, see `matrix_client_fluffychat_container_labels_additional_labels`. matrix_client_fluffychat_container_labels_traefik_enabled: true matrix_client_fluffychat_container_labels_traefik_docker_network: "{{ matrix_client_fluffychat_container_network }}" +matrix_client_fluffychat_container_labels_traefik_http_service_load_balancer_port: "{{ matrix_client_fluffychat_container_http_port }}" matrix_client_fluffychat_container_labels_traefik_hostname: "{{ matrix_client_fluffychat_hostname }}" # The path prefix must either be `/` or not end with a slash (e.g. `/fluffychat`). matrix_client_fluffychat_container_labels_traefik_path_prefix: "{{ matrix_client_fluffychat_path_prefix }}" diff --git a/roles/custom/matrix-client-fluffychat/templates/labels.j2 b/roles/custom/matrix-client-fluffychat/templates/labels.j2 index f3527c61a..8c71045de 100644 --- a/roles/custom/matrix-client-fluffychat/templates/labels.j2 +++ b/roles/custom/matrix-client-fluffychat/templates/labels.j2 @@ -11,7 +11,7 @@ traefik.enable=true traefik.docker.network={{ matrix_client_fluffychat_container_labels_traefik_docker_network }} {% endif %} -traefik.http.services.matrix-client-fluffychat.loadbalancer.server.port=8080 +traefik.http.services.matrix-client-fluffychat.loadbalancer.server.port={{ matrix_client_fluffychat_container_labels_traefik_http_service_load_balancer_port }} {% set middlewares = [] %} diff --git a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 index ad10c6297..57ae43d06 100644 --- a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 +++ b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 @@ -22,7 +22,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --read-only \ --network={{ matrix_client_fluffychat_container_network }} \ {% if matrix_client_fluffychat_container_http_host_bind_port %} - -p {{ matrix_client_fluffychat_container_http_host_bind_port }}:8080 \ + -p {{ matrix_client_fluffychat_container_http_host_bind_port }}:{{ matrix_client_fluffychat_container_http_port }} \ {% endif %} --label-file={{ matrix_client_fluffychat_data_path }}/labels \ --tmpfs=/tmp:rw,noexec,nosuid,size=10m \