From 88c7cf21f7d5b454af4449dab6a7fbccb2b1b4d2 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 18 May 2023 10:03:02 +0300 Subject: [PATCH] Make Honoroit not try to capture all matrix.DOMAIN traffic It only serves a metrics endpoint, so it shouldn't try to capture anything else. --- docs/configuring-playbook-bot-honoroit.md | 3 +++ .../custom/matrix-bot-honoroit/defaults/main.yml | 1 - .../matrix-bot-honoroit/templates/labels.j2 | 15 --------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/docs/configuring-playbook-bot-honoroit.md b/docs/configuring-playbook-bot-honoroit.md index 42f31d49a..26f5c6916 100644 --- a/docs/configuring-playbook-bot-honoroit.md +++ b/docs/configuring-playbook-bot-honoroit.md @@ -14,6 +14,9 @@ Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars. ```yaml matrix_bot_honoroit_enabled: true +# Uncomment and adjust if you'd like to change the hostname +# matrix_bot_honoroit_hostname: "{{ matrix_server_fqn_matrix }}" + # Uncomment and adjust this part if you'd like to use a username different than the default # matrix_bot_honoroit_login: honoroit diff --git a/roles/custom/matrix-bot-honoroit/defaults/main.yml b/roles/custom/matrix-bot-honoroit/defaults/main.yml index ea93d55f2..666b40f0a 100644 --- a/roles/custom/matrix-bot-honoroit/defaults/main.yml +++ b/roles/custom/matrix-bot-honoroit/defaults/main.yml @@ -56,7 +56,6 @@ matrix_bot_honoroit_container_labels_traefik_docker_network: "{{ matrix_bot_hono matrix_bot_honoroit_container_labels_traefik_hostname: "{{ matrix_bot_honoroit_hostname }}" # The path prefix must either be `/` or not end with a slash (e.g. `/honoroit`). matrix_bot_honoroit_container_labels_traefik_path_prefix: "{{ matrix_bot_honoroit_path_prefix }}" -matrix_bot_honoroit_container_labels_traefik_rule: "Host(`{{ matrix_bot_honoroit_container_labels_traefik_hostname }}`){% if matrix_bot_honoroit_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_bot_honoroit_container_labels_traefik_path_prefix }}`){% endif %}" matrix_bot_honoroit_container_labels_traefik_metrics_path: "{{ matrix_bot_honoroit_metrics_path }}" matrix_bot_honoroit_container_labels_traefik_metrics_rule: "Host(`{{ matrix_bot_honoroit_container_labels_traefik_hostname }}`) && Path(`{{ matrix_bot_honoroit_container_labels_traefik_metrics_path }}`)" matrix_bot_honoroit_container_labels_traefik_priority: 0 diff --git a/roles/custom/matrix-bot-honoroit/templates/labels.j2 b/roles/custom/matrix-bot-honoroit/templates/labels.j2 index 7943e00f1..12409470d 100644 --- a/roles/custom/matrix-bot-honoroit/templates/labels.j2 +++ b/roles/custom/matrix-bot-honoroit/templates/labels.j2 @@ -31,21 +31,6 @@ traefik.http.middlewares.matrix-bot-honoroit-auth.basicauth.users={{ lookup('ans {% set middlewares_metrics = middlewares + ['matrix-bot-honoroit-auth'] %} {% endif %} -traefik.http.routers.matrix-bot-honoroit.rule={{ matrix_bot_honoroit_container_labels_traefik_rule }} -{% if matrix_bot_honoroit_container_labels_traefik_priority | int > 0 %} -traefik.http.routers.matrix-bot-honoroit.priority={{ matrix_bot_honoroit_container_labels_traefik_priority }} -{% endif %} -traefik.http.routers.matrix-bot-honoroit.service=matrix-bot-honoroit -{% if middlewares | length > 0 %} -traefik.http.routers.matrix-bot-honoroit.middlewares={{ middlewares | join(',') }} -{% endif %} -traefik.http.routers.matrix-bot-honoroit.entrypoints={{ matrix_bot_honoroit_container_labels_traefik_entrypoints }} -traefik.http.routers.matrix-bot-honoroit.tls={{ matrix_bot_honoroit_container_labels_traefik_tls | to_json }} -{% if matrix_bot_honoroit_container_labels_traefik_tls %} -traefik.http.routers.matrix-bot-honoroit.tls.certResolver={{ matrix_bot_honoroit_container_labels_traefik_tls_certResolver }} -{% endif %} -traefik.http.services.matrix-bot-honoroit.loadbalancer.server.port=8080 - {% if middlewares_metrics | length > 0 %} traefik.http.routers.matrix-bot-honoroit-metrics.rule={{ matrix_bot_honoroit_container_labels_traefik_metrics_rule }} {% if matrix_bot_honoroit_container_labels_traefik_priority | int > 0 %}