mautrix / imessage

A Matrix-iMessage puppeting bridge
https://go.mau.fi/mautrix-imessage/
GNU Affero General Public License v3.0
353 stars 37 forks source link

BlueBubbles Mautrix-iMessage Documentation #216

Open lvfh3078 opened 3 months ago

lvfh3078 commented 3 months ago

Hi,

I see Bluebubbles listed with full features on your roadmap for Mautrix iMessage. However, I couldn't find any documentation on integrating the two. Is it possible to use Bluebubbles with the Mautrix Matrix bridge? If so, is there any documentation available on how to set it up?

joshuafhiggins commented 3 months ago

There's is documentation but it should be updated and made more prominent: https://github.com/mautrix/imessage/blob/master/imessage/bluebubbles/README.md

Ignore the part about downing the latest bridge release, instead just run bbctl run --param 'imessage_platform=bluebubbles' sh-imessage. Note that bbctl is a filler for the actual file you download for your system type (so either bbctl-macos-amd64 or bbctl-macos-arm64). If you're running BlueBubbles on the same machine as the bridge, put http://localhost:1234 as the server address and whatever password you set in BlueBubbles for the password.

lvfh3078 commented 3 months ago

Hey,

Brilliant! Thanks so much for the info. I will give it a go tomorrow. I’ll be running the bridge on the same machine as my Matrix server, so hopefully I can get it working that way.

lvfh3078 commented 3 months ago

I’m trying to set this up and have reached the step where I need to run the command bbctl run --param 'imessage_platform=bluebubbles' sh-imessage. However, it prompts me to log in to a Beeper account. Can I bridge BlueBubbles to my Matrix server without Beeper?

jasonlaguidice commented 3 months ago

I’m trying to set this up and have reached the step where I need to run the command bbctl run --param 'imessage_platform=bluebubbles' sh-imessage. However, it prompts me to log in to a Beeper account. Can I bridge BlueBubbles to my Matrix server without Beeper?

This is covered in the docs for the bridge: https://docs.mau.fi/bridges/go/imessage/mac/setup.html#configuring-and-running

The bridge doesn't necessarily have to run on a Mac if using the BlueBubbles connector.

The documentation that joshua listed is definitely Beeper-centric as most people are using this with Beeper.

itsthejb commented 2 months ago

Hi everyone,

I've recently been playing with setting this bridge up, and today tried out the Blue Bubbles mode, which I hadn't done previously due to lack of docs. It seems rather trivial and seemingly the best way, so posting here in case it's helpful to others:

Then that's it, and it works as per other bridges. In theory with many more features, although I haven't tested it too much yet

Hope that's helpful

PS. Perhaps I should make a quick PR to disambiguate that stuff in at least the config file itself?

lvfh3078 commented 2 months ago

Hi,

Thank you for sharing! Could you please send an example of your config.yaml file for the iMessage bridge? I'm trying to set it up without the WebSocket proxy and am having trouble with the 'appservice' section.

itsthejb commented 2 months ago

Below:

homeserver:
    address: http://synapse:8008
    websocket_proxy: null
    ping_interval_seconds: 0
    domain: <..>
    software: standard
    async_media: true

appservice:
    hostname: imessage
    port: 29319
    tls_key: null
    tls_cert: null
    database:
        type: sqlite3-fk-wal
        uri: file:mautrix-imessage.db?_txlock=immediate

    id: imessage
    bot:
        username: imessagebot
        displayname: iMessage bridge bot
        avatar: mxc://maunium.net/tManJEpANASZvDVzvRvhILdX
    ephemeral_events: true

    as_token: "<...>"
    hs_token: "<...>"

imessage:
    platform: bluebubbles
    imessage_rest_path: darwin-barcelona-mautrix
    imessage_rest_args: []
    contacts_mode: mac
    log_ipc_payloads: false
    hacky_set_locale: null
    environment: []
    unix_socket: mautrix-imessage.sock
    ping_interval_seconds: 15
    delete_media_after_upload: true
    bluebubbles_url: http://<blue bubbles host>:<port>
    bluebubbles_password: <bb password>
segment:
    key: null
    user_id: null
hacky_startup_test:
    identifier: null
    message: null
    response_message: null
    key: null
    echo_mode: false
    send_on_startup: false
    periodic_resolve: -1

bridge:
    user: "<..>"

    username_template: imessage_{{.}}
    displayname_template: "{{.}}"
    personal_filtering_spaces: true

    delivery_receipts: true
    message_status_events: true
    send_error_notices: true
    max_handle_seconds: 0
    device_id: null
    sync_direct_chat_list: true
    login_shared_secret: "<...>
    double_puppet_server_url: null
    backfill:
        enable: true
        initial_limit: 100
        initial_sync_max_age: 7
        unread_hours_threshold: 720
        only_backfill: false
        immediate:
            max_events: 25
        deferred:
            - start_days_ago: 7
              max_batch_events: 50
              batch_delay: 5
            - start_days_ago: 30
              max_batch_events: 100
              batch_delay: 10
            - start_days_ago: 90
              max_batch_events: 250
              batch_delay: 10
            - start_days_ago: -1
              max_batch_events: 500
              batch_delay: 10
    periodic_sync: true
    find_portals_if_db_empty: false
    media_viewer:
        url: null
        homeserver: null
        sms_min_size: 409600
        imessage_min_size: 52428800
        template: "Full size attachment: %s"
    convert_heif: false
    convert_tiff: true
    convert_video:
        enabled: false
        ffmpeg_args: ["-c:v", "libx264", "-preset", "faster", "-crf", "22", "-c:a", "copy"]
        extension: "mp4"
        mime_type: "video/mp4"
    command_prefix: "!im"
    force_uniform_dm_senders: true
    disable_sms_portals: true
    reroute_mms_group_replies: false
    federate_rooms: false
    caption_in_message: false
    private_chat_portal_meta: always

    encryption:
        allow: true
        default: false
        appservice: false
        require: false
        allow_key_sharing: false
        delete_keys:
            delete_outbound_on_ack: false
            dont_store_outbound: false
            ratchet_on_decrypt: false
            delete_fully_used_on_decrypt: false
            delete_prev_on_new_session: false
            delete_on_device_delete: false
            periodically_delete_expired: false
        verification_levels:
            receive: unverified
            send: unverified
            share: cross-signed-tofu
        rotation:
            enable_custom: false
            milliseconds: 604800000
            messages: 100
            disable_device_change_key_rotation: false

    relay:
        enabled: false
        whitelist: []
        message_formats:
            m.text: "{{ .Sender.Displayname }}: {{ .Message }}"
            m.notice: "{{ .Sender.Displayname }}: {{ .Message }}"
            m.emote: "* {{ .Sender.Displayname }} {{ .Message }}"
            m.file: "{{ .Sender.Displayname }} sent a file: {{ .FileName }}"
            m.image: "{{ .Sender.Displayname }} sent an image: {{ .FileName }}"
            m.audio: "{{ .Sender.Displayname }} sent an audio file: {{ .FileName }}"
            m.video: "{{ .Sender.Displayname }} sent a video: {{ .FileName }}"

logging:
    min_level: info
    writers:
        - type: stdout
          format: pretty-colored

revision: 0
lvfh3078 commented 2 months ago

Hi,

Thanks for that!

When starting the bridge, did you come across the following error at all?

ERR Failed to connect to homeserver, retrying in 10 seconds... error="failed to GET /_matrix/client/versions: M_FORBIDDEN (HTTP 403): Application service has not registered this user (@imessagebot:domain)"

itsthejb commented 2 months ago

Is it definitely @imessagebot:domain? The domain part suggests you haven't filled out that part of the config.

Otherwise I seem to recall I had to manually create the bot user on the server. Unlike the other bridges, the bridge failed to create the user itself

lvfh3078 commented 2 months ago

Hi,

The domain is my @matrix domain. It looks like I might need to create the bot user manually then. Like you, the other bridges I set up automatically created the users for me