From 3a70e8c6026afdf3c1101ef8b757e200e2f0bf3e Mon Sep 17 00:00:00 2001 From: jasonlaguidice <19523621+jasonlaguidice@users.noreply.github.com> Date: Sat, 30 May 2026 20:43:33 -0700 Subject: [PATCH] Add rust logging variable --- .../custom/matrix-bridge-rustpush/defaults/main.yml | 13 +++++++++++++ .../matrix-bridge-rustpush/tasks/setup_install.yml | 3 +++ .../systemd/matrix-rustpush-bridge.service.j2 | 1 + 3 files changed, 17 insertions(+) diff --git a/roles/custom/matrix-bridge-rustpush/defaults/main.yml b/roles/custom/matrix-bridge-rustpush/defaults/main.yml index 57c674b47..26ee09c95 100644 --- a/roles/custom/matrix-bridge-rustpush/defaults/main.yml +++ b/roles/custom/matrix-bridge-rustpush/defaults/main.yml @@ -93,6 +93,19 @@ matrix_rustpush_bridge_container_labels_additional_labels: '' # A list of extra arguments to pass to the container matrix_rustpush_bridge_container_extra_arguments: [] +# Override the Rust log filter passed to the bridge container via RUST_LOG. +# Leave empty to use the bridge's built-in default +# ("warn,rustpush=warn,rustpushgo=info,open_absinthe=info"). +# +# Useful values: +# "warn,rustpushgo=info,open_absinthe=debug" # NAC emulator diagnostics (_enc field sizes, etc.) +# "warn,rustpushgo=info,open_absinthe=debug,rustpush=info" # + upstream rustpush internals +# "debug" # everything (very chatty) +# +# The open_absinthe crate logs NAC hardware-key diagnostics at INFO and emulator +# state at DEBUG. These are suppressed by default to reduce log noise. +matrix_rustpush_bridge_rust_log: "" + # List of systemd services that matrix-rustpush-bridge.service depends on. matrix_rustpush_bridge_systemd_required_services_list: "{{ matrix_rustpush_bridge_systemd_required_services_list_default + matrix_rustpush_bridge_systemd_required_services_list_auto + matrix_rustpush_bridge_systemd_required_services_list_custom }}" matrix_rustpush_bridge_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" diff --git a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml index ebd9d28e0..918e79051 100644 --- a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml @@ -47,6 +47,9 @@ dockerfile: Dockerfile path: "{{ matrix_rustpush_bridge_docker_src_files_path }}" pull: true + args: + BUILD_VERSION: "{{ matrix_rustpush_bridge_container_image_self_build_repo_version }}" + BUILD_COMMIT: "{{ matrix_rustpush_bridge_git_pull_results.after[:8] if matrix_rustpush_bridge_git_pull_results is defined and matrix_rustpush_bridge_git_pull_results.after is defined else 'unknown' }}" register: matrix_rustpush_bridge_container_image_build_result when: "matrix_rustpush_bridge_enabled | bool and matrix_rustpush_bridge_container_image_self_build | bool" diff --git a/roles/custom/matrix-bridge-rustpush/templates/systemd/matrix-rustpush-bridge.service.j2 b/roles/custom/matrix-bridge-rustpush/templates/systemd/matrix-rustpush-bridge.service.j2 index 8cc393ba2..c52fbae84 100644 --- a/roles/custom/matrix-bridge-rustpush/templates/systemd/matrix-rustpush-bridge.service.j2 +++ b/roles/custom/matrix-bridge-rustpush/templates/systemd/matrix-rustpush-bridge.service.j2 @@ -24,6 +24,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --cap-drop=ALL \ --network={{ matrix_rustpush_bridge_container_network }} \ --env HOME=/data \ + {% if matrix_rustpush_bridge_rust_log %}--env RUST_LOG={{ matrix_rustpush_bridge_rust_log }} \{% endif %} --mount type=bind,src={{ matrix_rustpush_bridge_config_path }},dst=/config \ --mount type=bind,src={{ matrix_rustpush_bridge_data_path }},dst=/data \ --label-file={{ matrix_rustpush_bridge_base_path }}/labels \