diff --git a/roles/custom/matrix-bridge-rustpush/defaults/main.yml b/roles/custom/matrix-bridge-rustpush/defaults/main.yml index 26ee09c95..330723c29 100644 --- a/roles/custom/matrix-bridge-rustpush/defaults/main.yml +++ b/roles/custom/matrix-bridge-rustpush/defaults/main.yml @@ -38,7 +38,7 @@ matrix_rustpush_bridge_appservice_public_address: '' # Displayname template for iMessage contacts. # Available variables: {{.FirstName}}, {{.LastName}}, {{.Nickname}}, # {{.Phone}}, {{.Email}}, {{.ID}} -matrix_rustpush_bridge_network_displayname_template: "{% raw %}{{if .FirstName}}{{.FirstName}}{{if .LastName}} {{.LastName}}{{end}}{{else if .Nickname}}{{.Nickname}}{{else if .Phone}}{{.Phone}}{{else if .Email}}{{.Email}}{{else}}{{.ID}}{{end}}{% endraw %}" +matrix_rustpush_bridge_network_displayname_template: "{% raw %}{{if .FirstName}}{{.FirstName}}{{if .LastName}} {{.LastName}}{{end}}{{else if .Nickname}}{{.Nickname}}{{else if .Phone}}{{.Phone}}{{else if .Email}}{{.Email}}{{else}}{{.ID}}{{end}} (iMessage){% endraw %}" matrix_rustpush_bridge_cloudkit_backfill: true matrix_rustpush_bridge_video_transcoding: true diff --git a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml index 918e79051..45c56dc50 100644 --- a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml @@ -64,11 +64,22 @@ - name: Ensure rustpush-bridge config.yaml installed ansible.builtin.copy: - content: "{{ matrix_rustpush_bridge_configuration | to_nice_yaml(indent=2, width=999999) }}" + content: >- + {{ + matrix_rustpush_bridge_configuration + | combine({ + 'network': { + 'displayname_template': matrix_rustpush_bridge_network_displayname_template_effective, + }, + }, recursive=True) + | to_nice_yaml(indent=2, width=999999) + }} dest: "{{ matrix_rustpush_bridge_config_path }}/config.yaml" mode: 0644 owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" + vars: + matrix_rustpush_bridge_network_displayname_template_effective: "{{ (matrix_rustpush_bridge_configuration.network | default({}, true)).displayname_template | default(matrix_rustpush_bridge_network_displayname_template) }}" register: matrix_rustpush_bridge_config_result - name: Ensure rustpush-bridge registration.yaml installed 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 c52fbae84..dc7a1679b 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,8 +24,8 @@ 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 \ +{% 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 \ --entrypoint /usr/local/bin/matrix-rustpush \