From 9528145378da6ad18273fed61c298bb535c1a37f Mon Sep 17 00:00:00 2001
From: jasonlaguidice <19523621+jasonlaguidice@users.noreply.github.com>
Date: Fri, 19 Jun 2026 09:14:41 -0700
Subject: [PATCH] PR response update
---
docs/configuring-playbook-bridge-rustpush.md | 18 +++-------
.../matrix-bridge-rustpush/defaults/main.yml | 17 ++++-----
.../tasks/setup_install.yml | 36 +++++++++----------
.../systemd/matrix-rustpush-bridge.service.j2 | 2 +-
4 files changed, 32 insertions(+), 41 deletions(-)
diff --git a/docs/configuring-playbook-bridge-rustpush.md b/docs/configuring-playbook-bridge-rustpush.md
index 8cd9ca5c5..1649c6596 100644
--- a/docs/configuring-playbook-bridge-rustpush.md
+++ b/docs/configuring-playbook-bridge-rustpush.md
@@ -6,9 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Setting up RustPush (iMessage) bridging (optional)
-## \*\*\* THIS BRIDGE IS IN EARLY DEVELOPMENT \*\*\*
-Be warned, here be ~~dragons~~ bugs. Your use, testing, and feedback of this bridge is appreciated. It may not be desirable to deploy this to a large number of users due to possible stability issues
-
+
+> **Note:** This bridge is in early development and may have stability issues. It may not be desirable to deploy this to a large number of users. Your testing and feedback is appreciated.
+
Refer the common guide for configuring mautrix bridges: [Setting up a Generic Mautrix Bridge](configuring-playbook-bridge-mautrix-bridges.md)
The playbook can install and configure [rustpush bridge to iMessage](https://github.com/jasonlaguidice/imessage) for you using Apple's push notification service.
@@ -74,20 +74,10 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
## Usage
-To use the bridge, you need to start a chat with `@imessagebot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
+To use the bridge, you need to start a chat with `@rustpushbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
After logging in, the bridge will start receiving iMessages and creating portal rooms.
-## Interference With Mautrix-iMessage & WSproxy
-
-By default, this bridge uses the same bot user name (`@imessagebot:example.com`) and same localpart for puppet users (`imessage_{{.}}`) as the mautrix-imessage bridge. If you use this bridge on your homeserver have a few options:
-
-1. Change the bot and appservice name templates:
-
- Set `matrix_rustpush_bridge_appservice_bot_username` and to a non-default value `matrix_rustpush_bridge_appservice_username_template`
-
-2. After deactivating mautrix-imessage, delete the bot user and all its portal rooms from the database, then re-start the server (more difficult)
-
## Troubleshooting
As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-rustpush-bridge`.
diff --git a/roles/custom/matrix-bridge-rustpush/defaults/main.yml b/roles/custom/matrix-bridge-rustpush/defaults/main.yml
index 757d1de89..83a5c0fde 100644
--- a/roles/custom/matrix-bridge-rustpush/defaults/main.yml
+++ b/roles/custom/matrix-bridge-rustpush/defaults/main.yml
@@ -15,14 +15,15 @@ matrix_rustpush_bridge_container_image_self_build_repo_version: "{{ 'master' if
# Adjust to pin to releases
matrix_rustpush_bridge_version: v0.0.1
-matrix_rustpush_bridge_docker_image: "{{ matrix_rustpush_bridge_docker_image_registry_prefix }}jasonlaguidice/imessage:{{ matrix_rustpush_bridge_version }}"
-matrix_rustpush_bridge_docker_image_registry_prefix: "ghcr.io/"
-matrix_rustpush_bridge_docker_image_force_pull: "{{ matrix_rustpush_bridge_docker_image.endswith(':latest') }}"
+matrix_rustpush_bridge_container_image: "{{ matrix_rustpush_bridge_container_image_registry_prefix }}jasonlaguidice/imessage:{{ matrix_rustpush_bridge_version }}"
+matrix_rustpush_bridge_container_image_registry_prefix: "{{ 'localhost/' if matrix_rustpush_bridge_container_image_self_build else matrix_rustpush_bridge_container_image_registry_prefix_upstream }}"
+matrix_rustpush_bridge_container_image_registry_prefix_upstream: "{{ matrix_rustpush_bridge_container_image_registry_prefix_upstream_default }}"
+matrix_rustpush_bridge_container_image_registry_prefix_upstream_default: "ghcr.io/"
matrix_rustpush_bridge_base_path: "{{ matrix_base_data_path }}/matrix-rustpush-bridge"
matrix_rustpush_bridge_config_path: "{{ matrix_rustpush_bridge_base_path }}/config"
matrix_rustpush_bridge_data_path: "{{ matrix_rustpush_bridge_base_path }}/data"
-matrix_rustpush_bridge_docker_src_files_path: "{{ matrix_rustpush_bridge_base_path }}/docker-src"
+matrix_rustpush_bridge_container_src_files_path: "{{ matrix_rustpush_bridge_base_path }}/docker-src"
matrix_rustpush_bridge_homeserver_address: ""
# Whether asynchronous uploads via MSC2246 should be enabled for media.
@@ -148,13 +149,13 @@ matrix_rustpush_bridge_double_puppet_secrets: "{{ matrix_rustpush_bridge_double_
matrix_rustpush_bridge_double_puppet_secrets_auto: {}
matrix_rustpush_bridge_double_puppet_secrets_custom: {}
-matrix_rustpush_bridge_appservice_bot_username: imessagebot
-matrix_rustpush_bridge_appservice_bot_displayname: iMessage bridge bot
+matrix_rustpush_bridge_appservice_bot_username: rustpushbot
+matrix_rustpush_bridge_appservice_bot_displayname: RustPush bridge bot
matrix_rustpush_bridge_appservice_bot_avatar: ''
# Localpart template for MXIDs of remote (iMessage) users.
# The `{{.}}` placeholder expands to the iMessage handle (phone/email).
-matrix_rustpush_bridge_appservice_username_template: "{% raw %}imessage_{{.}}{% endraw %}"
+matrix_rustpush_bridge_appservice_username_template: "{% raw %}rustpush_{{.}}{% endraw %}"
# Backfill is disabled by default because Linux Docker cannot access chat.db.
# On macOS with Full Disk Access, this can be set to true.
@@ -216,7 +217,7 @@ matrix_rustpush_bridge_registration_yaml: |
namespaces:
users:
- exclusive: true
- regex: '^@imessage_.+:{{ matrix_rustpush_bridge_homeserver_domain | regex_escape }}$'
+ regex: '^@rustpush_.+:{{ matrix_rustpush_bridge_homeserver_domain | regex_escape }}$'
- exclusive: true
regex: '^@{{ matrix_rustpush_bridge_appservice_bot_username | regex_escape }}:{{ matrix_rustpush_bridge_homeserver_domain | regex_escape }}$'
url: {{ matrix_rustpush_bridge_appservice_address }}
diff --git a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml
index 95d794cab..658559f9b 100644
--- a/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml
+++ b/roles/custom/matrix-bridge-rustpush/tasks/setup_install.yml
@@ -16,14 +16,14 @@
- {path: "{{ matrix_rustpush_bridge_base_path }}", when: true}
- {path: "{{ matrix_rustpush_bridge_config_path }}", when: true}
- {path: "{{ matrix_rustpush_bridge_data_path }}", when: true}
- - {path: "{{ matrix_rustpush_bridge_docker_src_files_path }}", when: "{{ matrix_rustpush_bridge_container_image_self_build }}"}
+ - {path: "{{ matrix_rustpush_bridge_container_src_files_path }}", when: "{{ matrix_rustpush_bridge_container_image_self_build }}"}
when: item.when | bool
- name: Ensure RustPush repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_rustpush_bridge_container_image_self_build_repo }}"
version: "{{ matrix_rustpush_bridge_container_image_self_build_repo_version }}"
- dest: "{{ matrix_rustpush_bridge_docker_src_files_path }}"
+ dest: "{{ matrix_rustpush_bridge_container_src_files_path }}"
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
@@ -33,34 +33,34 @@
- name: Ensure RustPush Dockerfile is installed
ansible.builtin.template:
src: "{{ role_path }}/templates/Dockerfile.j2"
- dest: "{{ matrix_rustpush_bridge_docker_src_files_path }}/Dockerfile"
+ dest: "{{ matrix_rustpush_bridge_container_src_files_path }}/Dockerfile"
mode: 0640
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
when: "matrix_rustpush_bridge_enabled | bool and matrix_rustpush_bridge_container_image_self_build | bool"
- name: Ensure RustPush Docker image is built
- community.docker.docker_image:
- name: "{{ matrix_rustpush_bridge_docker_image }}"
- source: build
- force_source: "{{ matrix_rustpush_bridge_git_pull_results.changed if matrix_rustpush_bridge_git_pull_results is defined else true }}"
- build:
- 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' }}"
+ community.docker.docker_image_build:
+ name: "{{ matrix_rustpush_bridge_container_image }}"
+ dockerfile: Dockerfile
+ path: "{{ matrix_rustpush_bridge_container_src_files_path }}"
+ pull: true
+ rebuild: "{{ 'always' if matrix_rustpush_bridge_git_pull_results.changed | bool else 'never' }}"
+ build_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"
- name: Ensure RustPush container image is pulled
- community.docker.docker_image:
- name: "{{ matrix_rustpush_bridge_docker_image }}"
- source: pull
- force_source: "{{ matrix_rustpush_bridge_container_image_force_pull if matrix_rustpush_bridge_container_image_force_pull is defined else true }}"
+ community.docker.docker_image_pull:
+ name: "{{ matrix_rustpush_bridge_container_image }}"
+ pull: always
register: matrix_rustpush_bridge_container_image_pull_result
when: "matrix_rustpush_bridge_enabled | bool and not matrix_rustpush_bridge_container_image_self_build | bool"
+ retries: "{{ devture_playbook_help_container_retries_count }}"
+ delay: "{{ devture_playbook_help_container_retries_delay }}"
+ until: matrix_rustpush_bridge_container_image_pull_result is not failed
ignore_errors: "{{ ansible_check_mode }}"
- name: Ensure rustpush-bridge config.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 dc7a1679b..02adc73b0 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
@@ -32,7 +32,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{% for arg in matrix_rustpush_bridge_container_extra_arguments %}
{{ arg }} \
{% endfor %}
- {{ matrix_rustpush_bridge_docker_image }} \
+ {{ matrix_rustpush_bridge_container_image }} \
-c /config/config.yaml -r /config/registration.yaml
{% for network in matrix_rustpush_bridge_container_additional_networks %}