spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.64k stars 1.01k forks source link

Synapse setup with Mautrix Double puppeting bridges. No Bot Chats available. #3364

Open Spedswir opened 3 weeks ago

Spedswir commented 3 weeks ago

Playbook Configuration:

My vars.yml file looks like this:

---
# The bare domain name which represents your Matrix identity.
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
#
# Note: this playbook does not touch the server referenced here.
# Installation happens on another server ("matrix.<matrix-domain>").
#
# If you've deployed using the wrong domain, you'll have to run the Uninstalling step,
# because you can't change the Domain after deployment.
#
# Example value: example.com
matrix_domain: spedswir.com

# The Matrix homeserver software to install.
# See:
#  - `roles/custom/matrix-base/defaults/main.yml` for valid options
# - the `docs/configuring-playbook-IMPLEMENTATION_NAME.md` documentation page, if one is available for your implementation choice
matrix_homeserver_implementation: synapse

# A secret used as a base, for generating various other secrets.
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
matrix_homeserver_generic_secret_key: '<SECRET KEY>'

# By default, the playbook manages its own Traefik (https://doc.traefik.io/traefik/) reverse-proxy server.
# It will retrieve SSL certificates for you on-demand and forward requests to all other components.
# For alternatives, see `docs/configuring-playbook-own-webserver.md`.
matrix_playbook_reverse_proxy_type: playbook-managed-traefik

# This enables nginx to manage SSL certificates
matrix_playbook_ssl_enabled: true
devture_traefik_config_entrypoint_web_secure_enabled: false
devture_traefik_config_entrypoint_web_forwardedHeaders_trustedIPs: ['10.0.0.231']
devture_traefik_container_web_host_bind_port: '0.0.0.0:81'

devture_traefik_additional_entrypoints_auto:
  - name: matrix-federation
    port: 8448
    host_bind_port: '0.0.0.0:8448'
    config:
      forwardedHeaders:
        insecure: true
        trustedIPs: ['10.0.0.231']

# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
#
# In case SSL renewal fails at some point, you'll also get an email notification there.
#
# If you decide to use another method for managing SSL certificates (different than the default Let's Encrypt),
# you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`).
#
# Example value: someone@example.com
devture_traefik_config_certificatesResolvers_acme_email: 'spedswir@gmail.com'

# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
#
# The playbook creates additional Postgres users and databases (one for each enabled service)
# using this superuser account.
devture_postgres_connection_password: '<PASSWORD>'

matrix_dynamic_dns_domain_configurations:
  - provider: freedns.afraid.org
    protocol: dyndn2
    username: spedswir@gmail.com
    password: <PASSWORD>
    domain: "matrix.spedswir.com"

# By default, we configure Coturn's external IP address using the value specified for `ansible_host` in your `inventory/hosts` file.
# If this value is an external IP address, you can skip this section.
#
# If `ansible_host` is not the server's external IP address, you have 2 choices:
# 1. Uncomment the line below, to allow IP address auto-detection to happen (more on this below)
# 2. Uncomment and adjust the line below to specify an IP address manually
#
# By default, auto-detection will be attempted using the `https://ifconfig.co/json` API.
# Default values for this are specified in `matrix_coturn_turn_external_ip_address_auto_detection_*` variables in the Coturn role
# (see `roles/custom/matrix-coturn/defaults/main.yml`).
#
# If your server has multiple IP addresses, you may define them in another variable which allows a list of addresses.
# Example: `matrix_coturn_turn_external_ip_addresses: ['1.2.3.4', '4.5.6.7']`
#
# matrix_coturn_turn_external_ip_address: ''

ansible_ssh_common_args: '-o StrictHostKeyChecking=no'

# Jitsi Stuff
jitsi_enabled: true

jitsi_jvb_container_extra_arguments:
  - '--env "JVB_ADVERTISE_IPS=10.0.0.244"'

jitsi_web_custom_config_extension:
  config.enableLayerSuspension = true;
  config.disableAudioLevels = true;

# Other Options
matrix_registration_enabled: true
matrix_registration_admin_secret: "<MY SECRET>"

matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: <MY SECRET>

matrix_synapse_admin_enabled: true
matrix_client_element_themes_enabled: true
matrix_synapse_max_upload_size: 256M
media_retention:
  local_media_lifetime: 180d
  remote_media_lifetime: 14d

matrix_mautrix_discord_enabled: true
matrix_mautrix_discord_appservice_bot_username: "discordbot"

matrix_mautrix_facebook_enabled: true
matrix_mautrix_facebook_appservice_bot_username: "facebookbot"
matrix_mautrix_facebook_configuration_extension_yaml: |
  bridge:
    encryption:
      allow: true
      default: true
    permissions:
      '@spedswir:spedswir.com': admin

matrix_mautrix_whatsapp_enabled: true
matrix_mautrix_whatsapp_appservice_bot_username: "whatsappbot"
matrix_mautrix_whatsapp_bridge_relay_enabled: true

matrix_mautrix_instagram_enabled: true
matrix_mautrix_instagram_appservice_bot_username: "instagrambot"
matrix_mautrix_instagram_configuration_extension_yaml: |
  bridge:
    encryption:
      allow: true
      default: true
    permissions:
      '@spedswir:spedswir.com': admin

Matrix Server:

Ansible: Ansible is run on my desktop conencting to the VM over the network. Version: ansible [core 2.17.0]

Problem description:

I have successfully installed Synapse with this playbook, and have element web installed and it all runs and works. Federation works well and I have no problems with any of that.

However, when I tried to added the mautrix bots with double puppeting the docker containers get created and run, but no bot chats are available. If i try to start a chat with @discordbot:spedswir.com it tells me that no user exists, I have tried starting a chat anyway but there is no response when i send a message to create the room.

I have tried reinstalling on a fresh VM as I tried setting it up after my last server had been running for a while, I even tried adding a few of the other bots (facebook, instagram, and whatsapp) but they all seem to have the same issue. I even tried reinstalling once as dendrite instead of synapse with the same issue presenting.

This has happened both with the element electron app as well as the electron app running on my server at element.spedswir.com

Client (please complete the following information):

Additional context Add any other context about the problem here.

Spedswir commented 3 weeks ago

I got the output for "journalctl -u matrix-mautrix-discord" and this seems to be the main error: ERR Request failed error="request error: Get \"http://matrix-traefik:8008/_matrix/client/versions?user_id=%40discordbot%3Aspedswir.com\": dial tcp 172.23.0.2:8008: connect: connection refused" as_user_id=@discordbot:spedswir.com duration=2.322458 method=GET req_id=1 url=http://matrix-traefik:8008/_matrix/client/versions?user_id=%40discordbot%3Asped>

From some googling it looks like the bot's docker container isnt on the traefik network.

Spedswir commented 2 weeks ago

The issues was to do with devture_traefik_additional_entrypoints_auto: overwriting the traefik settings and causing the virtual network to fail.