Skip to content

Commit

Permalink
Merge pull request #3862 from luixxiul/fix
Browse files Browse the repository at this point in the history
Use common expressions for user IDs, bridge usage, etc.
  • Loading branch information
spantaleev authored Dec 12, 2024
2 parents 65e65f3 + 4578c0b commit 81c1a52
Show file tree
Hide file tree
Showing 70 changed files with 134 additions and 132 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This [Ansible](https://www.ansible.com/) playbook is meant to help you run your own [Matrix](http://matrix.org/) homeserver, along with the [various services](#supported-services) related to that.

That is, it lets you join the Matrix network using your own `@<username>:example.com` identifier, all hosted on your own server (see [prerequisites](docs/prerequisites.md)).
That is, it lets you join the Matrix network using your own user ID like `@alice:example.com`, all hosted on your own server (see [prerequisites](docs/prerequisites.md)).

We run all [supported services](#-supported-services) in [Docker](https://www.docker.com/) containers (see [the container images we use](docs/container-images.md)), which lets us have a predictable and up-to-date setup, across multiple supported distros (see [prerequisites](docs/prerequisites.md)) and [architectures](docs/alternative-architectures.md) (x86/amd64 being recommended).

Expand Down
4 changes: 2 additions & 2 deletions docs/configuring-dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ To set up Matrix on your domain, you'd need to do some DNS configuration.

## DNS setting for server delegation (optional)

In the sample `vars.yml` ([`examples/vars.yml`](../examples/vars.yml)), we recommend to use a short user identifier like `@<username>:example.com`.
In the sample `vars.yml` ([`examples/vars.yml`](../examples/vars.yml)), we recommend to use a short user ID like `@alice:example.com` instead of `@alice:matrix.example.com`.

To use such an identifier, you don't need to install anything on the actual `example.com` server. Instead, you need to instruct the Matrix network that Matrix services for `example.com` are redirected over to `matrix.example.com`. This redirection is also known as "delegation".
To use such an ID, you don't need to install anything on the actual `example.com` server. Instead, you need to instruct the Matrix network that Matrix services for `example.com` are redirected over to `matrix.example.com`. This redirection is also known as "delegation".

As we discuss in [Server Delegation](howto-server-delegation.md), server delegation can be configured in either of these ways:

Expand Down
4 changes: 2 additions & 2 deletions docs/configuring-playbook-bot-draupnir.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You will need to prevent Synapse from rate limiting the bot's account. This is n

If your Synapse Admin API is exposed to the internet for some reason like running the Synapse Admin Role [Link](configuring-playbook-synapse-admin.md) or running `matrix_synapse_container_labels_public_client_synapse_admin_api_enabled: true` in your playbook config. If your API is not externally exposed you should still be able to on the local host for your synapse run these commands.

The following command works on semi up to date Windows 10 installs and All Windows 11 installations and other systems that ship curl. `curl --header "Authorization: Bearer <access_token>" -X POST https://matrix.example.com/_synapse/admin/v1/users/@example:example.com/override_ratelimit` Replace `@example:example.com` with the MXID of your Draupnir and example.com with your homeserver domain. You can easily obtain an access token for a homeserver admin account the same way you can obtain an access token for Draupnir itself. If you made Draupnir Admin you can just use the Draupnir token.
The following command works on semi up to date Windows 10 installs and All Windows 11 installations and other systems that ship curl. `curl --header "Authorization: Bearer <access_token>" -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.draupnir:example.com/override_ratelimit` Replace `@bot.draupnir:example.com` with the MXID of your Draupnir and example.com with your homeserver domain. You can easily obtain an access token for a homeserver admin account the same way you can obtain an access token for Draupnir itself. If you made Draupnir Admin you can just use the Draupnir token.

## Create a management room

Expand Down Expand Up @@ -170,7 +170,7 @@ The simplest and most useful entity to target is `user`. Below are a few example

To create rules, you run commands in the Management Room (**not** in the policy list room).

- (ban a single user on a given homeserver): `!draupnir ban @someone:example.com my-bans Rude to others`
- (ban a single user on a given homeserver): `!draupnir ban @charles:example.com my-bans Rude to others`
- (ban all users on a given homeserver by using a [wildcard](https://the-draupnir-project.github.io/draupnir-documentation/moderator/managing-users#wildcards)): `!draupnir ban @*:example.org my-bans Spam server - all users are fake`

As a result of running these commands, you may observe:
Expand Down
8 changes: 4 additions & 4 deletions docs/configuring-playbook-bot-go-neb.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Go-NEB is a Matrix bot written in Go. It is the successor to Matrix-NEB, the ori

See the project's [documentation](https://github.com/matrix-org/go-neb) to learn what it does and why it might be useful to you.

## Registering the bot user
## Registering the bot account

The playbook does not automatically create users for you. The bot requires at least 1 access token to be able to connect to your homeserver.

Expand Down Expand Up @@ -62,7 +62,7 @@ matrix_bot_go_neb_realms:
matrix_bot_go_neb_sessions:
- SessionID: "your_github_session"
RealmID: "github_realm"
UserID: "@YOUR_USER_ID:{{ matrix_domain }}" # This needs to be the username of the person that's allowed to use the !github commands
UserID: "@alice:{{ matrix_domain }}" # This needs to be the username of the person that's allowed to use the !github commands
Config:
# Populate these fields by generating a "Personal Access Token" on github.com
AccessToken: "YOUR_GITHUB_ACCESS_TOKEN"
Expand Down Expand Up @@ -149,7 +149,7 @@ matrix_bot_go_neb_services:
UserID: "@another_goneb:{{ matrix_domain }}"
Config:
RealmID: "github_realm"
ClientUserID: "@YOUR_USER_ID:{{ matrix_domain }}" # needs to be an authenticated user so Go-NEB can create webhooks. Check the UserID field in the github_realm in matrix_bot_go_neb_sessions.
ClientUserID: "@alice:{{ matrix_domain }}" # needs to be an authenticated user so Go-NEB can create webhooks. Check the UserID field in the github_realm in matrix_bot_go_neb_sessions.
Rooms:
"!qporfwt:example.com":
Repos:
Expand Down Expand Up @@ -234,7 +234,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

To use the bot, invite it to any existing Matrix room (`/invite @whatever_you_chose:example.com` where `example.com` is your base domain, not the `matrix.` domain, make sure you have permission from the room owner if that's not you).
To use the bot, invite it to any existing Matrix room (`/invite @bot.go-neb:example.com` where `example.com` is your base domain, not the `matrix.` domain). Make sure you are granted with the sufficient permission if you are not the room owner.

Basic usage is like this: `!echo hi` or `!imgur puppies` or `!giphy matrix`

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bot-mjolnir.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You will need to prevent Synapse from rate limiting the bot's account. This is n

If your Synapse Admin API is exposed to the internet for some reason like running the Synapse Admin Role [Link](configuring-playbook-synapse-admin.md) or running `matrix_synapse_container_labels_public_client_synapse_admin_api_enabled: true` in your playbook config. If your API is not externally exposed you should still be able to on the local host for your synapse run these commands.

The following command works on semi up to date Windows 10 installs and All Windows 11 installations and other systems that ship curl. `curl --header "Authorization: Bearer <access_token>" -X POST https://matrix.example.com/_synapse/admin/v1/users/@example:example.com/override_ratelimit` Replace `@example:example.com` with the MXID of your Mjolnir and example.com with your homeserver domain. You can easily obtain an access token for a homeserver admin account the same way you can obtain an access token for Mjolnir itself. If you made Mjolnir Admin you can just use the Mjolnir token.
The following command works on semi up to date Windows 10 installs and All Windows 11 installations and other systems that ship curl. `curl --header "Authorization: Bearer <access_token>" -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.mjolnir:example.com/override_ratelimit` Replace `@bot.mjolnir:example.com` with the MXID of your Mjolnir and example.com with your homeserver domain. You can easily obtain an access token for a homeserver admin account the same way you can obtain an access token for Mjolnir itself. If you made Mjolnir Admin you can just use the Mjolnir token.

## Create a management room

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-appservice-discord.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ There's the Discord bridge's guide for [setting privileges on bridge managed roo

```sh
docker exec -it matrix-appservice-discord \
/bin/sh -c 'cp /cfg/registration.yaml /tmp/discord-registration.yaml && cd /tmp && node /build/tools/adminme.js -c /cfg/config.yaml -m "!qporfwt:example.com" -u "@USER:example.com" -p 100'
/bin/sh -c 'cp /cfg/registration.yaml /tmp/discord-registration.yaml && cd /tmp && node /build/tools/adminme.js -c /cfg/config.yaml -m "!qporfwt:example.com" -u "@alice:example.com" -p 100'
```
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-appservice-irc.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

You then need to start a chat with `@irc_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@irc_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-appservice-kakaotalk.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Start a chat with `@kakaotalkbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@kakaotalkbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login --save EMAIL_OR_PHONE_NUMBER` to the bridge bot to enable bridging for your Kakaotalk account. The `--save` flag may be omitted, if you'd rather not save your password.

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-appservice-slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Send `/invite @slackbot:example.com` to invite the bridge bot user into the admin room.
To use the bridge, you need to send `/invite @slackbot:example.com` to invite the bridge bot user into the admin room.

If Team Sync is not enabled, for each channel you would like to bridge, perform the following steps:

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-appservice-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Invite the bridge bot user to your room in either way.
To use the bridge, you need to invite the bridge bot user to your room in either way.

- Send `/invite @_webhook:example.com` (**Note**: Make sure you have administration permissions in your room)
- Add the bridge bot to a private channel (personal channels imply you being an administrator)
Expand Down
4 changes: 2 additions & 2 deletions docs/configuring-playbook-bridge-beeper-linkedin.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you would like to be able to administrate the bridge from your account it can
matrix_beeper_linkedin_configuration_extension_yaml: |
bridge:
permissions:
'@YOUR_USERNAME:example.com': admin
'@alice:{{ matrix_domain }}': admin
```

You may wish to look at `roles/custom/matrix-bridge-beeper-linkedin/templates/config.yaml.j2` to find other things you would like to configure.
Expand Down Expand Up @@ -59,7 +59,7 @@ Enabling double puppeting by enabling the [Shared Secret Auth](configuring-playb

## Usage

You then need to start a chat with `@linkedinbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@linkedinbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login YOUR_LINKEDIN_EMAIL_ADDRESS` to the bridge bot to enable bridging for your LinkedIn account.

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-go-skype-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Once the bot is enabled, you need to start a chat with `Skype bridge bot` with the handle `@skypebridgebot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `Skype bridge bot` with the handle `@skypebridgebot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `help` to the bot to see the commands available.
4 changes: 2 additions & 2 deletions docs/configuring-playbook-bridge-heisenbridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ matrix_heisenbridge_enabled: true

# Setting the owner is optional as the first local user to DM `@heisenbridge:example.com` will be made the owner.
# If you are not using a local user you must set it as otherwise you can't DM it at all.
matrix_heisenbridge_owner: "@you:example.com"
matrix_heisenbridge_owner: "@alice:{{ matrix_domain }}"

# Uncomment to enable identd on host port 113/TCP (optional)
# matrix_heisenbridge_identd_enabled: true
Expand Down Expand Up @@ -66,7 +66,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

After the bridge is successfully running just DM `@heisenbridge:example.com` to start setting it up. If the bridge ignores you and a DM is not accepted then the owner setting may be wrong.
To use the bridge, you need to start a chat with `@heisenbridge:example.com` (where `example.com` is your base domain, not the `matrix.` domain). If the bridge ignores you and a DM is not accepted then the owner setting may be wrong.

Help is available for all commands with the `-h` switch.

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-hookshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Should the crypto store be corrupted, you can reset it by executing this Ansible

## Usage

Create a room and invite the Hookshot bot (`@hookshot:example.com`) to it.
To use the bridge, you need to create a room and invite the Hookshot bot (`@hookshot:example.com`) to it.

Make sure the bot is able to send state events (usually the Moderator power level in clients).

Expand Down
6 changes: 3 additions & 3 deletions docs/configuring-playbook-bridge-mautrix-facebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you would like to be able to administrate the bridge from your account it can
matrix_mautrix_facebook_configuration_extension_yaml: |
bridge:
permissions:
'@YOUR_USERNAME:{{ matrix_domain }}': admin
'@alice:{{ matrix_domain }}': admin
```

Using both would look like
Expand All @@ -47,7 +47,7 @@ Using both would look like
matrix_mautrix_facebook_configuration_extension_yaml: |
bridge:
permissions:
'@YOUR_USERNAME:{{ matrix_domain }}': admin
'@alice:{{ matrix_domain }}': admin
encryption:
allow: true
default: true
Expand All @@ -74,7 +74,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

You then need to start a chat with `@facebookbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@facebookbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login YOUR_FACEBOOK_EMAIL_ADDRESS` to the bridge bot to enable bridging for your Facebook Messenger account. You can learn more here about authentication from the bridge's [official documentation on Authentication](https://docs.mau.fi/bridges/python/facebook/authentication.html).

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-mautrix-gmessages.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

You then need to start a chat with `@gmessagesbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@gmessagesbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

### 💡 Set up Double Puppeting

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-mautrix-googlechat.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Once the bot is enabled you need to start a chat with `googlechat bridge bot` with handle `@googlechatbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `googlechat bridge bot` with handle `@googlechatbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login` to the bridge bot to receive a link to the portal from which you can enable the bridging. Open the link sent by the bot and follow the instructions.

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bridge-mautrix-hangouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

Once the bot is enabled you need to start a chat with `Hangouts bridge bot` with handle `@hangoutsbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `Hangouts bridge bot` with handle `@hangoutsbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login` to the bridge bot to receive a link to the portal from which you can enable the bridging. Open the link sent by the bot and follow the instructions.

Expand Down
6 changes: 3 additions & 3 deletions docs/configuring-playbook-bridge-mautrix-instagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ If you would like to be able to administrate the bridge from your account it can

```yaml
# The easy way. The specified Matrix user ID will be made an admin of all bridges
matrix_admin: "@YOUR_USERNAME:{{ matrix_domain }}"
matrix_admin: "@alice:{{ matrix_domain }}"
# OR:
# The more verbose way. Applies to this bridge only. You may define multiple Matrix users as admins.
matrix_mautrix_instagram_configuration_extension_yaml: |
bridge:
permissions:
'@YOUR_USERNAME:example.com': admin
'@alice:{{ matrix_domain }}': admin
```

You may wish to look at `roles/custom/matrix-bridge-mautrix-instagram/templates/config.yaml.j2` and `roles/custom/matrix-bridge-mautrix-instagram/defaults/main.yml` to find other things you would like to configure.
Expand All @@ -61,7 +61,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

You then need to start a chat with `@instagrambot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@instagrambot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

Send `login YOUR_INSTAGRAM_EMAIL_ADDRESS YOUR_INSTAGRAM_PASSWORD` to the bridge bot to enable bridging for your instagram/Messenger account.

Expand Down
6 changes: 3 additions & 3 deletions docs/configuring-playbook-bridge-mautrix-meta-instagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ matrix_mautrix_meta_instagram_bridge_permissions_default:
'{{ matrix_admin }}': admin
```

If you don't define the `matrix_admin` in your configuration (e.g. `matrix_admin: @user:example.com`), then there's no admin by default.
If you don't define the `matrix_admin` in your configuration (e.g. `matrix_admin: @alice:example.com`), then there's no admin by default.

You may redefine `matrix_mautrix_meta_instagram_bridge_permissions_default` any way you see fit, or add extra permissions using `matrix_mautrix_meta_instagram_bridge_permissions_custom` like this:

```yaml
matrix_mautrix_meta_instagram_bridge_permissions_custom:
'@YOUR_USERNAME:example.com': admin
'@alice:{{ matrix_domain }}': admin
```

You may wish to look at `roles/custom/matrix-bridge-mautrix-meta-instagram/templates/config.yaml.j2` to find more information on the permissions settings and other options you would like to configure.
Expand All @@ -86,7 +86,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use

## Usage

You then need to start a chat with `@instagrambot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
To use the bridge, you need to start a chat with `@instagrambot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).

### 💡 Set up Double Puppeting

Expand Down
Loading

0 comments on commit 81c1a52

Please sign in to comment.