Commit graph

41 commits

Author SHA1 Message Date
Slavi Pantaleev 4d267dad40 Upgrade mautrix-whatsapp (0.7.0 -> 0.7.1) and sync bridge config with upstream 2022-10-16 18:24:55 +03:00
Shaleen Jain b77907f2d4
whatsapp: do not turn on synapse only options 2022-09-24 09:45:26 +05:30
Slavi Pantaleev b45cd7495c Upgrade mautrix-whatsapp (0.6.1 -> 0.7.0) and change some defaults
`ephemeral_events`` and `sync_with_custom_puppets` have been flipped
to keep up with the default upstream config:
b33bd9c4a7
2022-09-17 09:39:42 +03:00
Aine e637db348a
mautrix-whatsapp config adjustements 2022-08-09 23:45:10 +03:00
Slavi Pantaleev ac72879bf5 Make bridge permissions more easily configurable
Not doing {% if matrix_admin %} checks in the YAML also fixes some issues
with indentation being incorrect sometimes.

This should be backward compatible, except for mautrix-signal's case
where `matrix_mautrix_signal_bridge_permissions` previously existed
as a string, not a dictionary. `tasks/validate_config.yml` will catch
the problem an even provide a quick fix.
2022-07-25 15:57:16 +03:00
Aine e3ff6ca01b
mautrix-whatsapp - fix more vars 2022-07-17 14:16:57 +03:00
Aine 88cff139ed
fix mautrix-whatsapp config 2022-07-17 10:29:45 +03:00
Slavi Pantaleev fa9b34b983
Try to make Jinja not trip up over syntax 2022-07-16 23:25:05 +03:00
Aine 91cbc8b2ff
Update mautrix whatsapp 0.5.0 -> 0.6.0 2022-07-16 22:28:53 +03:00
ThellraAK 95959ff20b
Changed whatsapp logging variable name to match (#1920)
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1912

Co-authored-by: ThellraAK <ThellraAK@pop-os.localdomain>
Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2022-07-07 07:54:03 +03:00
3hhh 097c23c0b6
bots: make command_prefix configurable 2022-07-04 22:53:43 +02:00
Aine 44f2234c99
define matrix_admin in matrix-base 2022-06-27 10:34:04 +03:00
Aine 55d8e3dfdd
mautrix-based bridges: add matrix_admin 2022-06-26 21:03:21 +03:00
3hhh 6b94ccbcff
whatsapp bridge: add matrix_mautrix_whatsapp_log_level
Fixes #1873
2022-06-11 08:09:57 +02:00
3hhh 39914881a7
whatsapp bridge: disable logging to external files
The same logs still go to the systemd journal.
2022-06-11 07:56:22 +02:00
roughnecks c05e78fc9a Fix string null in status_endpoint 2022-06-02 16:52:15 +02:00
Paul B e1e83353b4
bridge-whatsapp: add variable to enable end-to-bridge encryption 2022-05-18 13:14:22 +02:00
Slavi Pantaleev 0364c6c634 Suppress old container cleanup (kill/rm) failures
People often report and ask about these "failures".
More-so previously, when the `docker kill/rm` output was collected,
but it still happens now when people do `systemctl status
matrix-something` and notice that it says "FAILURE".

Suppressing to avoid further time being wasted on saying "this is
expected".
2022-04-11 09:05:33 +03:00
László Várady 338b4cebd2 bridge-mautrix-whatsapp: add option for creating non-federated rooms 2022-03-07 15:01:06 +01:00
Slavi Pantaleev 86c36523df Replace ExecStopPost with ExecStop
Reverts b1b4ba501f, 90c9801c56, a3c84f78ca, ..

I haven't really traced it (yet), but on some servers, I'm observing
`ansible-playbook ... --tags=start` completing very slowly, waiting
to stop services. I can't reproduce this on all Matrix servers I manage.
I suspect that either the systemd version is to blame or that some
specific service is not responding well to some `docker kill/rm` command.

`ExecStop` seems to work great in all cases and it's what we've been
using for a very long time, so I'm reverting to that.
2022-02-05 12:13:36 +02:00
Slavi Pantaleev b1b4ba501f Replace ExecStop with ExecStopPost
ExecStopPost should allow us to clean up (docker kill + docker rm)
even if the ExecStart (docker run ..) command failed, and not just after
a graceful service stop was initiated.

Source: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStopPost=
2022-01-04 17:27:25 +02:00
iucca 949ae80117 added server_map variable and renamed secret_map 2021-11-16 14:22:06 +01:00
iucca b272e6147a Resolved server_map 2021-11-16 13:37:11 +01:00
iucca 3535c97117 updated whatsapp config 2021-11-15 19:25:08 +01:00
iucca ae122466fc updated whatsapp config 2021-11-15 19:23:28 +01:00
iucca 4ff8fddd72 updated whatsapp config, backfill doesn't work 2021-11-14 23:57:52 +01:00
iucca 1d0e594def updated whatsapp config, backfill doesn't work 2021-11-14 23:45:07 +01:00
Slavi Pantaleev f6097fbba1 E2BE not working for mautrix bridges
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/806
2021-01-27 15:43:33 +02:00
Slavi Pantaleev 512f42aa76 Do not report docker kill/rm attempts as errors
These are just defensive cleanup tasks that we run.
In the good case, there's nothing to kill or remove, so they trigger an
error like this:

> Error response from daemon: Cannot kill container: something: No such container: something

and:

> Error: No such container: something

People often ask us if this is a problem, so instead of always having to
answer with "no, this is to be expected", we'd rather eliminate it now
and make logs cleaner.

In the event that:
- a container is really stuck and needs cleanup using kill/rm
- and cleanup fails, and we fail to report it because of error
suppression (`2>/dev/null`)

.. we'd still get an error when launching ("container name already in use .."),
so it shouldn't be too hard to investigate.
2021-01-27 10:22:46 +02:00
Slavi Pantaleev 1692a28fe4 Work around annoying Docker warning about undefined $HOME
> WARNING: Error loading config file: .dockercfg: $HOME is not defined

.. which appeared in Docker 20.10.
2021-01-15 00:23:01 +02:00
Slavi Pantaleev 6c77eae969 Add (Postgres + SQLite) support to matrix-mautrix-whatsapp bridge
I don't use this bridge, so this is completely untested.
2020-12-14 12:24:37 +02:00
transcaffeine d9f4914e0d
WIP: postgres: create databases for all services
If a service is enabled, a database for it is created in postgres with a uniqque password. The service can then use this database for data storage instead of relying on sqlite.
2020-12-10 18:26:22 +01:00
Slavi Pantaleev d08b27784f Fix systemd services autostart problem with Docker 20.10
The Docker 19.04 -> 20.10 upgrade contains the following change
in `/usr/lib/systemd/system/docker.service`:

```
-BindsTo=containerd.service
-After=network-online.target firewalld.service containerd.service
+After=network-online.target firewalld.service containerd.service multi-user.target
-Requires=docker.socket
+Requires=docker.socket containerd.service
Wants=network-online.target
```

The `multi-user.target` requirement in `After` seems to be in conflict
with our `WantedBy=multi-user.target` and `After=docker.service` /
`Requires=docker.service` definitions, causing the following error on
startup for all of our systemd services:

> Job matrix-synapse.service/start deleted to break ordering cycle starting with multi-user.target/start

A workaround which appears to work is to add `DefaultDependencies=no`
to all of our services.
2020-12-10 11:43:20 +02:00
Scott Crossen fa5d85426b Renamed systemd descriptions for all bridges 2020-10-13 16:40:30 -07:00
Slavi Pantaleev 5da31ba579 Move configuration templates outside of defaults/main.yml files 2020-06-03 09:33:28 +03:00
Chris van Dijk 6334f6c1ea Remove hardcoded command paths in systemd unit files
Depending on the distro, common commands like sleep and chown may either
be located in /bin or /usr/bin.

Systemd added path lookup to ExecStart in v239, allowing only the
command name to be put in unit files and not the full path as
historically required. At least Ubuntu 18.04 LTS is however still on
v237 so we should maintain portability for a while longer.
2020-05-27 23:14:54 +02:00
Slavi Pantaleev 62509e4849
Fix indentation consistency 2019-06-24 07:42:39 +03:00
Thomas Kuehne 4797469383 Make WhatsApp bridge configuration playbook-managed
- following spantaleev transition of the telegram brigde
- adding a validate_config task
2019-06-24 00:16:04 +02:00
Slavi Pantaleev d6d6c152a3 Delay bridge startup to ensure Synapse is up
Bridges start matrix-synapse.service as a dependency, but
Synapse is sometimes slow to start, while bridges are quick to
hit it and die (if unavailable).

They'll auto-restart later, but .. this still breaks `--tags=start`,
which doesn't wait long enough for such a restart to happen.

This attempts to slow down bridge startup enough to ensure Synapse
is up and no failures happen at all.
2019-06-07 12:15:37 +03:00
Slavi Pantaleev 13c4e7e5b6 Merge branch 'master' into separate-bridge-roles 2019-05-16 09:45:06 +09:00
Slavi Pantaleev bb816df557 Move mautrix telegram and whatsapp into separate roles
The goal is to move each bridge into its own separate role.
This commit starts off the work on this with 2 bridges:
- mautrix-telegram
- mautrix-whatsapp

Each bridge's role (including these 2) is meant to:

- depend only on the matrix-base role

- integrate nicely with the matrix-synapse role (if available)

- integrate nicely with the matrix-nginx-proxy role (if available and if
required). mautrix-telegram bridge benefits from integrating with
it.

- not break if matrix-synapse or matrix-nginx-proxy are not used at all

This has been provoked by #174 (Github Issue).
2019-05-14 23:47:22 +09:00