Skip to content

Commit fb0ccc3

Browse files
committed
Make FluffyChat container HTTP port configurable
This makes it possible to switch out the container image with one that uses a port other than 8080.
1 parent e641353 commit fb0ccc3

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

roles/custom/matrix-client-fluffychat/defaults/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ matrix_client_fluffychat_container_additional_networks: "{{ matrix_client_fluffy
3333
matrix_client_fluffychat_container_additional_networks_auto: []
3434
matrix_client_fluffychat_container_additional_networks_custom: []
3535

36+
# Configures the port number used inside the container image.
37+
matrix_client_fluffychat_container_http_port: 8080
38+
3639
# Controls whether the matrix-client-fluffychat container exposes its HTTP port (tcp/8080 in the container).
3740
#
38-
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8765"), or empty string to not expose.
41+
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8080"), or empty string to not expose.
42+
#
43+
# Also see: `matrix_client_fluffychat_container_http_port`
3944
matrix_client_fluffychat_container_http_host_bind_port: ''
4045

4146
# 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: ''
4449
# To inject your own other container labels, see `matrix_client_fluffychat_container_labels_additional_labels`.
4550
matrix_client_fluffychat_container_labels_traefik_enabled: true
4651
matrix_client_fluffychat_container_labels_traefik_docker_network: "{{ matrix_client_fluffychat_container_network }}"
52+
matrix_client_fluffychat_container_labels_traefik_http_service_load_balancer_port: "{{ matrix_client_fluffychat_container_http_port }}"
4753
matrix_client_fluffychat_container_labels_traefik_hostname: "{{ matrix_client_fluffychat_hostname }}"
4854
# The path prefix must either be `/` or not end with a slash (e.g. `/fluffychat`).
4955
matrix_client_fluffychat_container_labels_traefik_path_prefix: "{{ matrix_client_fluffychat_path_prefix }}"

roles/custom/matrix-client-fluffychat/templates/labels.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ traefik.enable=true
1111
traefik.docker.network={{ matrix_client_fluffychat_container_labels_traefik_docker_network }}
1212
{% endif %}
1313

14-
traefik.http.services.matrix-client-fluffychat.loadbalancer.server.port=8080
14+
traefik.http.services.matrix-client-fluffychat.loadbalancer.server.port={{ matrix_client_fluffychat_container_labels_traefik_http_service_load_balancer_port }}
1515

1616
{% set middlewares = [] %}
1717

roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
2222
--read-only \
2323
--network={{ matrix_client_fluffychat_container_network }} \
2424
{% if matrix_client_fluffychat_container_http_host_bind_port %}
25-
-p {{ matrix_client_fluffychat_container_http_host_bind_port }}:8080 \
25+
-p {{ matrix_client_fluffychat_container_http_host_bind_port }}:{{ matrix_client_fluffychat_container_http_port }} \
2626
{% endif %}
2727
--label-file={{ matrix_client_fluffychat_data_path }}/labels \
2828
--tmpfs=/tmp:rw,noexec,nosuid,size=10m \

0 commit comments

Comments
 (0)