ActivityPub Viewer

A small tool to view real-world ActivityPub objects as JSON! Enter a URL or username from Mastodon or a similar service below, and we'll send a request with the right Accept header to the server to view the underlying object.

Open in browser →
{ "@context": [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", { "Hashtag": "as:Hashtag", "sensitive": "as:sensitive", "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" }, "movedTo": { "@id": "as:movedTo", "@type": "@id" }, "toot": "http://joinmastodon.org/ns#", "featured": { "@id": "toot:featured", "@type": "@id" }, "Emoji": "toot:Emoji", "blurhash": "toot:blurhash", "votersCount": "toot:votersCount", "schema": "http://schema.org#", "PropertyValue": "schema:PropertyValue", "value": "schema:value", "ostatus": "http://ostatus.org#", "conversation": "ostatus:conversation" } ], "type": "Article", "id": "https://chrichri.ween.de/o/90536838e120432e9129097794a04000", "attributedTo": "https://chrichri.ween.de", "content": "<p>I started running a WhatsApp Mautrix Bridge to connect an otherwise unused phones WhatsApp to my conduit matrix server.</p>\n<h2>Why</h2>\n<p><a href=\"https://chrichri.ween.de/o/500f45ff9cae465e8660f1a1febb4efd\">Read the background here.</a></p>\n<p>My goal has been to offer to my family a way to take part in WhatsApp communications without the need to share their numbers or even have a phone.</p>\n<h2>How</h2>\n<p>An old Sony Z1 with Carbon ROM <a href=\"https://chrichri.ween.de/o/ba934349acb6458b94e8f9ca1ae396ff\">didn&#x27;t work and I switched to an also old Sony Z3c with broken touch</a> to use a phone with a stock rom.</p>\n<h2>Mautrix Bridge documentation</h2>\n<p>Reading the <a href=\"https://docs.mau.fi/bridges/index.html\">documentation</a> I had the feeling it describes something I was supposed to know already.</p>\n<p>I found it difficult to understand the terms <em>puppeting</em> and <em>relay</em> and searched around the web to find information about them.</p>\n<h2>Terms</h2>\n<h3>puppeting</h3>\n<p>Imagine your Matrix server is the player and uses a puppet to tell you a story. This puppet is the WhatsApp you connect your bridge to.</p>\n<p>Actually the Bridge is puppeting and does get its story from the Matrix server: When there&#x27;s a message in a bridged room it takes it, uses its WhatsApp puppet and tells it to the connected WhatsApp contact or group.</p>\n<h4>double it - double puppeting</h4>\n<p>The other way around the player is the WhatsApp side and it plays stuff back.</p>\n<p>When <em>bridging</em> I&#x27;d think that everything works in both ways anyway, but it&#x27;s not like that.</p>\n<p>The Bridge needs permissions to remote controll the WhatsApp side (the <em>single</em> puppeting that is standard for the bridge) <strong>and</strong> it needs for <a href=\"https://docs.mau.fi/bridges/general/double-puppeting.html#double-puppeting\">some actions</a> permissions to manipulate the Matrix side (the other direction - the <strong>double</strong>).</p>\n<p>Configuring double puppeting means to give the Bridge additional permissions on the matrix side to be able to do stuff there.</p>\n<p>This is achived through a second, different app service that needs to be registered to the matrix server.</p>\n<h3>interlude</h3>\n<p>With puppeting the bridge has the ability to relay messages between a WhatsApp group or contact and a matrix room that is a direct chat.</p>\n<p>It is meant to relay messages for one matrix account that is joined into that room.</p>\n<p>Inviting other matrix accounts to such a bridged room is not possible.</p>\n<p>To do that you&#x27;ll need a…</p>\n<h3>relay</h3>\n<p>If <a href=\"https://docs.mau.fi/bridges/general/relay-mode.html#relay-mode\">relay mode</a> is configured it&#x27;s possible to invite other matrix accounts into a room that is bridged to WhatsApp.</p>\n<p>The bridged matrix account becomes a bot: it will take any message from the room, prepend it with whatever is configured in the <a href=\"https://github.com/mautrix/whatsapp/blob/c72d7cb8d51f22a92b6b41821888490417f718ac/example-config.yaml#L459\">bridge configuration</a> and send it to the WhatsApp side of the bridge.</p>\n<p>To make use of this it is recommended to create its own matrix account for the relay bot. When sharing a family WhatsApp account this makes it possible for different persons to participate in different groups or chat with different contacts.</p>\n<h2>Howto</h2>\n<p>After understanding a bit of the context and terms I found it quite easy to follow the setup instructions.</p>\n<p>In my setup I use <a href=\"https://chrichri.ween.de/t/conduit\" class=\"mention hashtag\" rel=\"tag\">#<span>conduit</span></a> on a <a href=\"https://chrichri.ween.de/t/yunhost\" class=\"mention hashtag\" rel=\"tag\">#<span>yunhost</span></a> as a matrix server.</p>\n<p>The <a href=\"https://apps.yunohost.org/app/mautrix_whatsapp\">yunohost app</a> showed that I&#x27;d need more memory than I have left on my yunohost so I installed on a small SBC and used the docker image.</p>\n<p>It is a good idea to start with creating the matrix account for the user that is supposed to relay if relaying should be used.</p>\n<p>Throughout the installation instructions this account should be used on the matrix side.</p>\n<h2>pitfalls</h2>\n<h3>double_puppet_server_map</h3>\n<p>In my setup the bridge connects to <code>http://&lt;private-IP&gt;:&lt;port&gt;</code>, because it can&#x27;t reach my matrix server by its name.</p>\n<p>Both hosts (conduit-host and mautrix-bridge-host, two different computers) are on a private subnet of their own and the secure in https didn&#x27;t make sense.</p>\n<p>I could have opted for hairpinning or to let the resolver on the bridge-host find the internal IP of the matrix server, but I wanted to avoid complexity and unnecessary encryption/decryption.</p>\n<p>For <em>homeserver</em> this is explained <a href=\"https://docs.mau.fi/bridges/general/initial-config.html#mandatory-fields\">in the manual</a>.</p>\n<p>When I configured <a href=\"https://github.com/mautrix/whatsapp/blob/c72d7cb8d51f22a92b6b41821888490417f718ac/example-config.yaml#L248\">double puppeting</a> I didn&#x27;t understand what the url and domain is used for and put the domain and url containing the hostname there.</p>\n<p>Later I found that I&#x27;d need to change the url to the same settings as under <em>homeserver</em>. On the <a href=\"https://matrix.to/#/#whatsapp:maunium.net\">matrix channel about the bridge</a> someone told me that they hadn&#x27;t configured the setting at all and it worked (maybe it falls back to the homeserver settings).</p>\n<h3>needed to change the matrix account</h3>\n<p>When I realized how relay mode works I needed to change the matrix account from my own one to a <em>relay</em> account.</p>\n<p>To get stuff working again I had to:</p>\n<ul>\n<li>logout with the other user from the WhatsApp session</li>\n<li>delete the association with the bridge in WhatsApp</li>\n<li>stop the bridge, delete the database and start the bridge</li>\n<li>login using the new relay account to my WhatsApp</li>\n</ul>\n<p>After doing all this history of groups got loaded again and all the contacts opened appeared for the relay account automatically.</p>\n", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "cc": [ "https://chrichri.ween.de/followers" ], "published": "2024-06-26T17:43:31Z", "context": "https://chrichri.ween.de/contexts/3d44ab785c214949824b4747cdcac79e", "conversation": "https://chrichri.ween.de/contexts/3d44ab785c214949824b4747cdcac79e", "url": "https://chrichri.ween.de/articles/9053683/whatsapp-mautrix-bridge", "tag": [ { "href": "https://chrichri.ween.de/t/conduit", "name": "#conduit", "type": "Hashtag" }, { "href": "https://chrichri.ween.de/t/yunhost", "name": "#yunhost", "type": "Hashtag" } ], "summary": null, "inReplyTo": null, "sensitive": false, "attachment": [ { "type": "Document", "mediaType": "image/png", "name": "screenshot of fractal connected with an account 'relay' and the welcome message of the WhatsApp bridge bot: \"Hello, I'm a WhatsApp bridge bot. This room has been registered as your bridge management/status room. Use `help` for help or `login` to log in.\"", "url": "https://chrichri.ween.de/attachments/f57ae4a0d893054b8105deac11d28b3f0f251e1c6cb7095c5a358a4dc6c1e4dd/whatsapp.png", "blurhash": "LER:HG00IAD%xuofRjWUxZn%spaK", "height": 340, "width": 612 } ], "name": "WhatsApp Mautrix Bridge" }