From b3fcc641c48ee187315e06dec3848076a917b3f7 Mon Sep 17 00:00:00 2001 From: Hugues Morisset Date: Wed, 24 Oct 2018 18:12:24 +0200 Subject: [PATCH] Add documentation and fix templates --- docs/configuring-playbook-bridge-mautrix-telegram.md | 4 +++- docs/configuring-playbook-bridge-mautrix-whatsapp.md | 12 ++++++++++++ .../templates/mautrix-whatsapp/config.yaml.j2 | 5 +++-- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 docs/configuring-playbook-bridge-mautrix-whatsapp.md diff --git a/docs/configuring-playbook-bridge-mautrix-telegram.md b/docs/configuring-playbook-bridge-mautrix-telegram.md index 175a9b4b7..0886c60d8 100644 --- a/docs/configuring-playbook-bridge-mautrix-telegram.md +++ b/docs/configuring-playbook-bridge-mautrix-telegram.md @@ -2,7 +2,7 @@ The playbook can install and configure [mautrix-telegram](https://github.com/tulir/mautrix-telegram) for you. -See that project's [documentation](https://github.com/tulir/mautrix-telegram/wiki#usage) to learn what it does and why it might be useful to you. +See the project's [documentation](https://github.com/tulir/mautrix-telegram/wiki#usage) to learn what it does and why it might be useful to you. You'll need to obtain API keys from `https://my.telegram.org/apps` and then use the following playbook configuration: ``` @@ -10,3 +10,5 @@ matrix_mautrix_telegram_enabled: true matrix_mautrix_telegram_api_id: YOUR_TELEGRAM_APP_ID matrix_mautrix_telegram_api_hash: YOUR_TELEGRAM_API_HASH ``` + +You then need to start a chat with `@telegrambot:{{ hostname_identity }}` diff --git a/docs/configuring-playbook-bridge-mautrix-whatsapp.md b/docs/configuring-playbook-bridge-mautrix-whatsapp.md new file mode 100644 index 000000000..0d70043a9 --- /dev/null +++ b/docs/configuring-playbook-bridge-mautrix-whatsapp.md @@ -0,0 +1,12 @@ +# Setting up Mautrix Whatsapp + +The playbook can install and configure [mautrix-whatsapp](https://github.com/tulir/mautrix-whatsapp) for you. + +See the project's [documentation](https://github.com/tulir/mautrix-whatsapp/wiki) to learn what it does and why it might be useful to you. + +Use the following playbook configuration: +``` +matrix_mautrix_whatsapp_enabled: true +``` + +You then need to start a chat with `@whatsappbot:{{ hostname_identity }}` diff --git a/roles/matrix-server/templates/mautrix-whatsapp/config.yaml.j2 b/roles/matrix-server/templates/mautrix-whatsapp/config.yaml.j2 index 5f4943bac..a29117ccd 100644 --- a/roles/matrix-server/templates/mautrix-whatsapp/config.yaml.j2 +++ b/roles/matrix-server/templates/mautrix-whatsapp/config.yaml.j2 @@ -33,7 +33,7 @@ appservice: # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # to leave display name/avatar as-is. displayname: WhatsApp bridge bot - avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr + avatar: remove # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. as_token: "This value is generated when generating the registration" @@ -42,6 +42,7 @@ appservice: # Bridge config. Currently unused. bridge: # {% raw %} + # protecting the go templates inside the raw section. # Localpart template of MXIDs for WhatsApp users. # {{.}} is replaced with the phone number of the WhatsApp user. username_template: whatsapp_{{.}} @@ -51,8 +52,8 @@ bridge: # The following variables are also available, but will cause problems on multi-user instances: # {{.Name}} - display name from contact list # {{.Short}} - short display name from contact list + displayname_template: "{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)" # {% endraw %} - displayname_template: {% raw %}"{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)"{% endraw %} # The prefix for commands. Only required in non-management rooms. command_prefix: "!wa"