Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
matrix:whatsapp [2025/03/11 08:16] – willy | matrix:whatsapp [2025/03/12 07:20] (current) – [Bridge setup] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Installing the Whatsapp Bridge ===== | + | ===== Matrix |
+ | [[https:// | ||
+ | |||
+ | Unfortunately, | ||
+ | |||
+ | Using the Matrix bridge, you can remove all your whatsapp client permissions, | ||
+ | |||
+ | You could install Whatsapp on an Android Virtual Emulator and fake your phone numnber on it, but it's strongly discouraged because it can get your whatsapp acocunt permanently banned. You have been warned. | ||
+ | |||
+ | Whatsapp can be easily and fully bridged with Matrix using the Mautrix-Whatsapp bridge [[https:// | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | I asusme you are installing the bridge directly together with the Matrix server, as user // | ||
+ | |||
+ | Create a subfolder to install the bridge: | ||
<code bash> | <code bash> | ||
su - conduwuit | su - conduwuit | ||
Line 7: | Line 22: | ||
wget -O mautrix-whatsapp.zip ' | wget -O mautrix-whatsapp.zip ' | ||
unzip mautrix-whatsapp.zip | unzip mautrix-whatsapp.zip | ||
+ | chmod +x mautrix-whatsapp | ||
</ | </ | ||
- | Generate config | + | |
+ | ===== Bridge setup ===== | ||
+ | |||
+ | Let the bridge generate the basic configuration file, and move it to the / | ||
<code bash> | <code bash> | ||
./ | ./ | ||
Line 15: | Line 34: | ||
</ | </ | ||
- | edit it... | + | Now edit it. You should take a good look at it, the following are only hints and pointers to what you aboslutely need to change: |
< | < | ||
network: | network: | ||
- | displayname_template: | + | |
+ | | ||
| | ||
database: | database: | ||
Line 27: | Line 47: | ||
address: https:// | address: https:// | ||
domain: chat.mydomain.com | domain: chat.mydomain.com | ||
- | | + | |
+ | appservice: | ||
+ | hostname: 127.0.0.1 | ||
+ | | ||
permissions: | permissions: | ||
" | " | ||
Line 40: | Line 63: | ||
allow: true | allow: true | ||
- | + double puppeting | + | double_puppet: |
+ | # Servers to always allow double puppeting | ||
+ | # This is only for other servers and should NOT contain the server the bridge is on. | ||
+ | servers: | ||
+ | anotherserver.example.org: | ||
+ | # Whether to allow client API URL discovery for other servers. When using this option, | ||
+ | # users on other servers can use double puppeting even if their server URLs aren' | ||
+ | # explicitly added to the servers map above. | ||
+ | allow_discovery: | ||
+ | # Shared secrets for automatic double puppeting. | ||
+ | # See https:// | ||
+ | secrets: | ||
+ | chat.mydomain.com: | ||
+ | |||
+ | logging: | ||
+ | | ||
</ | </ | ||
Note that backfill is disabled by default, you need to enable it to see older messages. Also note that messages **cannot** be backfilled for already created rooms, so don't forget to enable backfill before the first start! | Note that backfill is disabled by default, you need to enable it to see older messages. Also note that messages **cannot** be backfilled for already created rooms, so don't forget to enable backfill before the first start! | ||
- | Generate | + | Since my server will have just a few users, i decided to use an SQLite database. |
+ | |||
+ | |||
+ | ===== Bridge Registration ===== | ||
+ | |||
+ | At this point you need to register | ||
+ | |||
+ | First of all, generate the // | ||
<code bash> | <code bash> | ||
./ | ./ | ||
</ | </ | ||
- | This step will create a **registration.yaml** file that you need to perform the registration | + | Then perform the actual appservice |
- | < | + | |
- | !admin | + | |
- | ``` << shift+enter >> | + | |
- | id: whatsapp | + | |
- | [ ... copy the content of the appservice.yaml .. ] | + | |
- | ``` << enter >> | + | |
- | </ | + | |
- | When you see **<< shift enter >>** you need to press those two keys in order to create a new line in the same command. The three **```** (backthicks) are the markdown token to create a code block. | ||
- | |||
- | The chat should reply with a message like: | ||
- | < | ||
- | Appservice registered with ID: whatsapp | ||
- | </ | ||
- | More details on registering the appservice can be found [[https:// | + | ===== Usage ===== |
The **whatsappbot** user should have been created automatically. | The **whatsappbot** user should have been created automatically. | ||
Line 78: | Line 109: | ||
If all is well, your bridge should be up and running now. | If all is well, your bridge should be up and running now. | ||
+ | |||
+ | ===== Login ===== | ||
To login into whatsapp you need to: | To login into whatsapp you need to: | ||
* Start a chat with whatsappbot: | * Start a chat with whatsappbot: | ||
Line 86: | Line 119: | ||
**Note:** if your usernames do not get popupated, you should do a //search username// in the whatsappbot chat. | **Note:** if your usernames do not get popupated, you should do a //search username// in the whatsappbot chat. | ||
- | |||