diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 1c7ead382..f7624be6d 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -3477,13 +3477,15 @@ matrix_nginx_proxy_access_log_syslog_integration_server_port: "{{ (matrix_promet matrix_homeserver_proxy_enabled: true matrix_homeserver_proxy_access_log_syslog_integration_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}" -matrix_homeserver_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_container_hostname | string + ':' + matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}" +matrix_homeserver_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_identifier | string +':'+ matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}" matrix_homeserver_proxy_container_additional_networks: | {{ ( ([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else []) + + ([matrix_prometheus_nginxlog_exporter_container_network] if (matrix_prometheus_nginxlog_exporter_enabled and matrix_prometheus_nginxlog_exporter_container_network != matrix_homeserver_proxy_container_network) else []) + + ([ { 'synapse': matrix_synapse_container_network, @@ -3526,9 +3528,6 @@ matrix_homeserver_proxy_systemd_wanted_services_list_auto: | ([(matrix_media_repo_identifier + '.service')] if matrix_media_repo_enabled else []) }} -# matrix_nginx_proxy_access_log_syslog_integration_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}" -# matrix_nginx_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_container_hostname | string +':'+ matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}" - ###################################################################### # # # /matrix-homeserver-proxy # @@ -4332,6 +4331,8 @@ matrix_synapse_reverse_proxy_companion_container_additional_networks: | ( ([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network else []) + + ([matrix_prometheus_nginxlog_exporter_container_network] if (matrix_prometheus_nginxlog_exporter_enabled and matrix_prometheus_nginxlog_exporter_container_network != matrix_synapse_reverse_proxy_companion_container_network) else []) + + ([] if matrix_homeserver_container_network in ['', matrix_synapse_reverse_proxy_companion_container_network] else [matrix_homeserver_container_network]) ) | unique }} diff --git a/roles/custom/matrix-homeserver-proxy/defaults/main.yml b/roles/custom/matrix-homeserver-proxy/defaults/main.yml index d1003db2a..d8c4db627 100644 --- a/roles/custom/matrix-homeserver-proxy/defaults/main.yml +++ b/roles/custom/matrix-homeserver-proxy/defaults/main.yml @@ -71,6 +71,12 @@ matrix_homeserver_proxy_container_federation_api_host_bind_port: '' # Option to disable the access log matrix_homeserver_proxy_access_log_enabled: true +# Controls whether to send access logs to a remote syslog-compatible server +matrix_homeserver_proxy_access_log_syslog_integration_enabled: false +matrix_homeserver_proxy_access_log_syslog_integration_server_port: '' +# This is intentionally different. The maximum allowed length is 32 characters and dashes are not allowed. +matrix_homeserver_proxy_access_log_syslog_integration_tag: matrix_homeserver_proxy + # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads. matrix_homeserver_proxy_tmp_directory_size_mb: "{{ (matrix_homeserver_proxy_federation_api_client_max_body_size_mb | int) * 50 }}" matrix_homeserver_proxy_tmp_cache_directory_size_mb: "{{ (matrix_homeserver_proxy_cache_max_size_mb | int) * 2 }}" diff --git a/roles/custom/matrix-homeserver-proxy/templates/nginx/nginx.conf.j2 b/roles/custom/matrix-homeserver-proxy/templates/nginx/nginx.conf.j2 index 28272b564..d13bbb08f 100644 --- a/roles/custom/matrix-homeserver-proxy/templates/nginx/nginx.conf.j2 +++ b/roles/custom/matrix-homeserver-proxy/templates/nginx/nginx.conf.j2 @@ -47,7 +47,7 @@ http { '$status "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log syslog:server={{ matrix_homeserver_proxy_access_log_syslog_integration_server_port }},tag=matrix_nginx_proxy_companion prometheus_fmt; + access_log syslog:server={{ matrix_homeserver_proxy_access_log_syslog_integration_server_port }},tag={{ matrix_homeserver_proxy_access_log_syslog_integration_tag }} prometheus_fmt; {% endif %} {% if not matrix_homeserver_proxy_access_log_enabled and not matrix_homeserver_proxy_access_log_syslog_integration_enabled %}