commit
7d2f42cd22
@ -0,0 +1,17 @@
|
||||
# Setting up Mautrix Instagram (optional)
|
||||
|
||||
The playbook can install and configure [mautrix-instagram](https://github.com/tulir/mautrix-instagram) for you.
|
||||
|
||||
See the project's [documentation](https://docs.mau.fi/bridges/python/instagram/index.html) to learn what it does and why it might be useful to you.
|
||||
|
||||
```yaml
|
||||
matrix_mautrix_instagram_enabled: true
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You then need to start a chat with `@instagrambot:YOUR_DOMAIN` (where `YOUR_DOMAIN` 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.
|
||||
|
||||
You can learn more here about authentication from the bridge's [official documentation on Authentication](https://docs.mau.fi/bridges/python/instagram/authentication.html).
|
@ -0,0 +1,38 @@
|
||||
# Setting up MX Puppet GroupMe (optional)
|
||||
|
||||
The playbook can install and configure
|
||||
[mx-puppet-groupme](https://gitlab.com/robintown/mx-puppet-groupme) for you.
|
||||
|
||||
See the project page to learn what it does and why it might be useful to you.
|
||||
|
||||
To enable the [GroupMe](https://groupme.com/) bridge just use the following
|
||||
playbook configuration:
|
||||
|
||||
|
||||
```yaml
|
||||
matrix_mx_puppet_groupme_enabled: true
|
||||
matrix_mx_puppet_groupme_client_id: ""
|
||||
matrix_mx_puppet_groupme_client_secret: ""
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Once the bot is enabled you need to start a chat with `GroupMe Puppet Bridge` with
|
||||
the handle `@_groupmepuppet_bot:YOUR_DOMAIN` (where `YOUR_DOMAIN` is your base
|
||||
domain, not the `matrix.` domain).
|
||||
|
||||
One authentication method is available.
|
||||
|
||||
To link your GroupMe account, go to [dev.groupme.com](https://dev.groupme.com/), sign in, and select "Access Token" from the top menu. Copy the token and message the bridge with:
|
||||
|
||||
```
|
||||
link <access token>
|
||||
```
|
||||
|
||||
Once logged in, send `listrooms` to the bot user to list the available rooms.
|
||||
|
||||
Clicking rooms in the list will result in you receiving an invitation to the
|
||||
bridged room.
|
||||
|
||||
Also send `help` to the bot to see the commands available.
|
@ -0,0 +1,31 @@
|
||||
# Setting up Etherpad (optional)
|
||||
|
||||
[Etherpad](https://etherpad.org) is is an open source collaborative text editor that can be embedded in a Matrix chat room using the [Dimension integrations manager](https://dimension.t2bot.io)
|
||||
|
||||
When enabled together with the Jitsi audio/video conferencing system (see [our docs on Jitsi](configuring-playbook-jitsi.md)), it will be made available as an option during the conferences.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
For the self-hosted Etherpad instance to be available to your users, you must first enable and configure the **Dimension integrations manager** as described in [the playbook documentation](configuring-playbook-dimension.md)
|
||||
|
||||
## Installing
|
||||
|
||||
[Etherpad](https://etherpad.org) installation is disabled by default. You can enable it in your configuration file (`inventory/host_vars/matrix.<your-domain>/vars.yml`):
|
||||
|
||||
```yaml
|
||||
matrix_etherpad_enabled: true
|
||||
```
|
||||
|
||||
## Set Dimension default to the self-hosted Etherpad
|
||||
|
||||
The Dimension administrator users can configure the default URL template. The Dimension configuration menu can be accessed with the sprocket icon as you begin to add a widget to a room in Element. There you will find the Etherpad Widget Configuration action beneath the _Widgets_ tab. Replace `scalar.vector.im` with your own Dimension domain.
|
||||
|
||||
### Removing the integrated Etherpad chat
|
||||
|
||||
If you wish to disable the Etherpad chat button, you can do it by appending `?showChat=false` to the end of the pad URL, or the template.
|
||||
Example: `https://dimension.<your-domain>/etherpad/p/$roomId_$padName?showChat=false`
|
||||
|
||||
## Known issues
|
||||
|
||||
If your Etherpad widget fails to load, this might be due to Dimension generating a Pad name so long, the Etherpad app rejects it.
|
||||
`$roomId_$padName` can end up being longer than 50 characters. You can avoid having this problem by altering the template so it only contains the three word random identifier `$padName`.
|
@ -0,0 +1,66 @@
|
||||
# Enabling metrics and graphs for your Matrix server (optional)
|
||||
|
||||
It can be useful to have some (visual) insight into the performance of your homeserver.
|
||||
|
||||
You can enable this with the following settings in your configuration file (`inventory/host_vars/matrix.<your-domain>/vars.yml`):
|
||||
|
||||
```yaml
|
||||
matrix_prometheus_enabled: true
|
||||
|
||||
matrix_prometheus_node_exporter_enabled: true
|
||||
|
||||
matrix_grafana_enabled: true
|
||||
|
||||
matrix_grafana_anonymous_access: false
|
||||
|
||||
# This has no relation to your Matrix user id. It can be any username you'd like.
|
||||
# Changing the username subsequently won't work.
|
||||
matrix_grafana_default_admin_user: some_username_chosen_by_you
|
||||
|
||||
# Passwords containing special characters may be troublesome.
|
||||
# Changing the password subsequently won't work.
|
||||
matrix_grafana_default_admin_password: some_strong_password_chosen_by_you
|
||||
```
|
||||
|
||||
By default, a [Grafana](https://grafana.com/) web user-interface will be available at `https://stats.<your-domain>`.
|
||||
|
||||
|
||||
## What does it do?
|
||||
|
||||
Name | Description
|
||||
-----|----------
|
||||
`matrix_prometheus_enabled`|[Prometheus](https://prometheus.io) is a time series database. It holds all the data we're going to talk about.
|
||||
`matrix_prometheus_node_exporter_enabled`|[Node Exporter](https://prometheus.io/docs/guides/node-exporter/) is an addon of sorts to Prometheus that collects generic system information such as CPU, memory, filesystem, and even system temperatures
|
||||
`matrix_grafana_enabled`|[Grafana](https://grafana.com/) is the visual component. It shows (on the `stats.<your-domain>` subdomain) the dashboards with the graphs that we're interested in
|
||||
`matrix_grafana_anonymous_access`|By default you need to log in to see graphs. If you want to publicly share your graphs (e.g. when asking for help in [`#synapse:matrix.org`](https://matrix.to/#/#synapse:matrix.org?via=matrix.org&via=privacytools.io&via=mozilla.org)) you'll want to enable this option.
|
||||
`matrix_grafana_default_admin_user`<br>`matrix_grafana_default_admin_password`|By default Grafana creates a user with `admin` as the username and password. If you feel this is insecure and you want to change it beforehand, you can do that here
|
||||
|
||||
|
||||
## Security and privacy
|
||||
|
||||
Metrics and resulting graphs can contain a lot of information. This includes system specs but also usage patterns. This applies especially to small personal/family scale homeservers. Someone might be able to figure out when you wake up and go to sleep by looking at the graphs over time. Think about this before enabling anonymous access. And you should really not forget to change your Grafana password.
|
||||
|
||||
Most of our docker containers run with limited system access, but the `prometheus-node-exporter` has access to the host network stack and (readonly) root filesystem. This is required to report on them. If you don't like that, you can set `matrix_prometheus_node_exporter_enabled: false` (which is actually the default). You will still get Synapse metrics with this container disabled. Both of the dashboards will always be enabled, so you can still look at historical data after disabling either source.
|
||||
|
||||
|
||||
## Collecting metrics to an external Prometheus server
|
||||
|
||||
If you wish, you could expose homeserver metrics without enabling (installing) Prometheus and Grafana via the playbook. This may be useful for hooking Matrix services to an external Prometheus/Grafana installation.
|
||||
|
||||
To do this, you may be interested in the following variables:
|
||||
|
||||
Name | Description
|
||||
-----|----------
|
||||
`matrix_synapse_metrics_enabled`|Set this to `true` to make Synapse expose metrics (locally, on the container network)
|
||||
`matrix_nginx_proxy_proxy_synapse_metrics`|Set this to `true` to make matrix-nginx-proxy expose the Synapse metrics at `https://matrix.DOMAIN/_synapse/metrics`
|
||||
`matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_enabled`|Set this to `true` to password-protect (using HTTP Basic Auth) `https://matrix.DOMAIN/_synapse/metrics` (the username is always `prometheus`, the password is defined in `matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_key`)
|
||||
`matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_key`|Set this to a password to use for HTTP Basic Auth for protecting `https://matrix.DOMAIN/_synapse/metrics` (the username is always `prometheus` - it's not configurable)
|
||||
|
||||
|
||||
## More inforation
|
||||
|
||||
- [Understanding Synapse Performance Issues Through Grafana Graphs](https://github.com/matrix-org/synapse/wiki/Understanding-Synapse-Performance-Issues-Through-Grafana-Graphs) at the Synapse Github Wiki
|
||||
- [The Prometheus scraping rules](https://github.com/matrix-org/synapse/tree/master/contrib/prometheus) (we use v2)
|
||||
- [The Synapse Grafana dashboard](https://github.com/matrix-org/synapse/tree/master/contrib/grafana)
|
||||
- [The Node Exporter dashboard](https://github.com/rfrail3/grafana-dashboards) (for generic non-synapse performance graphs)
|
||||
|
@ -0,0 +1,97 @@
|
||||
# Container Images used by the playbook
|
||||
|
||||
This page summarizes the container ([Docker](https://www.docker.com/)) images used by the playbook when setting up your server.
|
||||
|
||||
We try to stick to official images (provided by their respective projects) as much as possible.
|
||||
|
||||
|
||||
## Container images used by default
|
||||
|
||||
These services are enabled and used by default, but you can turn them off, if you wish.
|
||||
|
||||
- [matrixdotorg/synapse](https://hub.docker.com/r/matrixdotorg/synapse/) - the official [Synapse](https://github.com/matrix-org/synapse) Matrix homeserver (optional)
|
||||
|
||||
- [instrumentisto/coturn](https://hub.docker.com/r/instrumentisto/coturn/) - the [Coturn](https://github.com/coturn/coturn) STUN/TURN server (optional)
|
||||
|
||||
- [vectorim/element-web](https://hub.docker.com/r/vectorim/element-web/) - the [Element](https://element.io/) web client (optional)
|
||||
|
||||
- [ma1uta/ma1sd](https://hub.docker.com/r/ma1uta/ma1sd/) - the [ma1sd](https://github.com/ma1uta/ma1sd) Matrix Identity server (optional)
|
||||
|
||||
- [postgres](https://hub.docker.com/_/postgres/) - the [Postgres](https://www.postgresql.org/) database server (optional)
|
||||
|
||||
- [devture/exim-relay](https://hub.docker.com/r/devture/exim-relay/) - the [Exim](https://www.exim.org/) email server (optional)
|
||||
|
||||
- [nginx](https://hub.docker.com/_/nginx/) - the [nginx](http://nginx.org/) web server (optional)
|
||||
|
||||
- [certbot/certbot](https://hub.docker.com/r/certbot/certbot/) - the [certbot](https://certbot.eff.org/) tool for obtaining SSL certificates from [Let's Encrypt](https://letsencrypt.org/) (optional)
|
||||
|
||||
|
||||
## Optional other container images we may use
|
||||
|
||||
These services are not part of our default installation, but can be enabled by [configuring the playbook](configuring-playbook.md) (either before the initial installation or any time later):
|
||||
|
||||
- [ewoutp/goofys](https://hub.docker.com/r/ewoutp/goofys/) - the [Goofys](https://github.com/kahing/goofys) Amazon [S3](https://aws.amazon.com/s3/) file-system-mounting program (optional)
|
||||
|
||||
- [etherpad/etherpad](https://hub.docker.com/r/etherpad/etherpad/) - the [Etherpad](https://etherpad.org) realtime collaborative text editor that can be used in a Jitsi audio/video call or integrated as a widget into Matrix chat rooms via the Dimension integration manager (optional)
|
||||
|
||||
- [devture/email2matrix](https://hub.docker.com/r/devture/email2matrix/) - the [Email2Matrix](https://github.com/devture/email2matrix) email server, which can relay email messages to Matrix rooms (optional)
|
||||
|
||||
- [devture/matrix-corporal](https://hub.docker.com/r/devture/matrix-corporal/) - [Matrix Corporal](https://github.com/devture/matrix-corporal): reconciliator and gateway for a managed Matrix server (optional)
|
||||
|
||||
- [zeratax/matrix-registration](https://hub.docker.com/r/devture/zeratax-matrix-registration/) - [matrix-registration](https://github.com/ZerataX/matrix-registration): a simple python application to have a token based matrix registration (optional)
|
||||
|
||||
- [tulir/mautrix-telegram](https://mau.dev/tulir/mautrix-telegram/container_registry) - the [mautrix-telegram](https://github.com/tulir/mautrix-telegram) bridge to [Telegram](https://telegram.org/) (optional)
|
||||
|
||||
- [tulir/mautrix-whatsapp](https://mau.dev/tulir/mautrix-whatsapp/container_registry) - the [mautrix-whatsapp](https://github.com/tulir/mautrix-whatsapp) bridge to [Whatsapp](https://www.whatsapp.com/) (optional)
|
||||
|
||||
- [tulir/mautrix-facebook](https://mau.dev/tulir/mautrix-facebook/container_registry) - the [mautrix-facebook](https://github.com/tulir/mautrix-facebook) bridge to [Facebook](https://facebook.com/) (optional)
|
||||
|
||||
- [tulir/mautrix-hangouts](https://mau.dev/tulir/mautrix-hangouts/container_registry) - the [mautrix-hangouts](https://github.com/tulir/mautrix-hangouts) bridge to [Google Hangouts](https://en.wikipedia.org/wiki/Google_Hangouts) (optional)
|
||||
|
||||
- [tulir/mautrix-instagram](https://mau.dev/tulir/mautrix-instagram/container_registry) - the [mautrix-instagram](https://github.com/tulir/mautrix-instagram) bridge to [Instagram](https://instagram.com/) (optional)
|
||||
|
||||
- [tulir/mautrix-signal](https://mau.dev/tulir/mautrix-signal/container_registry) - the [mautrix-signal](https://github.com/tulir/mautrix-signal) bridge to [Signal](https://www.signal.org/) (optional)
|
||||
|
||||
- [matrixdotorg/matrix-appservice-irc](https://hub.docker.com/r/matrixdotorg/matrix-appservice-irc) - the [matrix-appservice-irc](https://github.com/matrix-org/matrix-appservice-irc) bridge to [IRC](https://wikipedia.org/wiki/Internet_Relay_Chat) (optional)
|
||||
|
||||
- [halfshot/matrix-appservice-discord](https://hub.docker.com/r/halfshot/matrix-appservice-discord) - the [matrix-appservice-discord](https://github.com/Half-Shot/matrix-appservice-discord) bridge to [Discord](https://discordapp.com/) (optional)
|
||||
|
||||
- [cadair/matrix-appservice-slack](https://hub.docker.com/r/cadair/matrix-appservice-slack) - the [matrix-appservice-slack](https://github.com/matrix-org/matrix-appservice-slack) bridge to [Slack](https://slack.com/) (optional)
|
||||
|
||||
- [turt2live/matrix-appservice-webhooks](https://hub.docker.com/r/turt2live/matrix-appservice-webhooks) - the [Appservice Webhooks](https://github.com/turt2live/matrix-appservice-webhooks) bridge (optional)
|
||||
|
||||
- [folivonet/matrix-sms-bridge](https://hub.docker.com/repository/docker/folivonet/matrix-sms-bridge) - the [matrix-sms-bridge](https://github.com/benkuly/matrix-sms-bridge) (optional)
|
||||
|
||||
- [sorunome/mx-puppet-skype](https://hub.docker.com/r/sorunome/mx-puppet-skype) - the [mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) bridge to [Skype](https://www.skype.com) (optional)
|
||||
|
||||
- [sorunome/mx-puppet-slack](https://hub.docker.com/r/sorunome/mx-puppet-slack) - the [mx-puppet-slack](https://github.com/Sorunome/mx-puppet-slack) bridge to [Slack](https://slack.com) (optional)
|
||||
|
||||
- [sorunome/mx-puppet-instagram](https://hub.docker.com/r/sorunome/mx-puppet-instagram) - the [mx-puppet-instagram](https://github.com/Sorunome/mx-puppet-instagram) bridge to [Instagram](https://www.instagram.com) (optional)
|
||||
|
||||
- [sorunome/mx-puppet-twitter](https://hub.docker.com/r/sorunome/mx-puppet-twitter) - the [mx-puppet-twitter](https://github.com/Sorunome/mx-puppet-twitter) bridge to [Twitter](https://twitter.com) (optional)
|
||||
|
||||
- [sorunome/mx-puppet-discord](https://hub.docker.com/r/sorunome/mx-puppet-discord) - the [mx-puppet-discord](https://github.com/matrix-discord/mx-puppet-discord) bridge to [Discord](https://discordapp.com) (optional)
|
||||
|
||||
- [xangelix/mx-puppet-groupme](https://hub.docker.com/r/xangelix/mx-puppet-groupme) - the [mx-puppet-groupme](https://gitlab.com/robintown/mx-puppet-groupme) bridge to [GroupMe](https://groupme.com/) (optional)
|
||||
|
||||
- [icewind1991/mx-puppet-steam](https://hub.docker.com/r/icewind1991/mx-puppet-steam) - the [mx-puppet-steam](https://github.com/icewind1991/mx-puppet-steam) bridge to [Steam](https://steampowered.com) (optional)
|
||||
|
||||
- [turt2live/matrix-dimension](https://hub.docker.com/r/turt2live/matrix-dimension) - the [Dimension](https://dimension.t2bot.io/) integrations manager (optional)
|
||||
|
||||
- [jitsi/web](https://hub.docker.com/r/jitsi/web) - the [Jitsi](https://jitsi.org/) web UI (optional)
|
||||
|
||||
- [jitsi/jicofo](https://hub.docker.com/r/jitsi/jicofo) - the [Jitsi](https://jitsi.org/) Focus component (optional)
|
||||
|
||||
- [jitsi/prosody](https://hub.docker.com/r/jitsi/prosody) - the [Jitsi](https://jitsi.org/) Prosody XMPP server component (optional)
|
||||
|
||||
- [jitsi/jvb](https://hub.docker.com/r/jitsi/jvb) - the [Jitsi](https://jitsi.org/) Video Bridge component (optional)
|
||||
|
||||
- [anoa/matrix-reminder-bot](https://hub.docker.com/r/anoa/matrix-reminder-bot) - the [matrix-reminder-bot](https://github.com/anoadragon453/matrix-reminder-bot) bot for one-off & recurring reminders and alarms (optional)
|
||||
|
||||
- [awesometechnologies/synapse-admin](https://hub.docker.com/r/awesometechnologies/synapse-admin) - the [synapse-admin](https://github.com/Awesome-Technologies/synapse-admin) web UI tool for administrating users and rooms on your Matrix server (optional)
|
||||
|
||||
- [prom/prometheus](https://hub.docker.com/r/prom/prometheus/) - [Prometheus](https://github.com/prometheus/prometheus/) is a systems and service monitoring system
|
||||
|
||||
- [prom/node-exporter](https://hub.docker.com/r/prom/node-exporter/) - [Prometheus Node Exporter](https://github.com/prometheus/node_exporter/) is an addon for Prometheus that gathers standard system metrics
|
||||
|
||||
- [grafana/grafana](https://hub.docker.com/r/grafana/grafana/) - [Grafana](https://github.com/grafana/grafana/) is a graphing tool that works well with the above two images. Our playbook also adds two dashboards for [Synapse](https://github.com/matrix-org/synapse/tree/master/contrib/grafana) and [Node Exporter](https://github.com/rfrail3/grafana-dashboards)
|
@ -0,0 +1,460 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
This documentation page tries to answer various Frequently Asked Questions about all things [Matrix](https://matrix.org/), with a focus on this [Ansible](https://www.ansible.com/) playbook ([What is Ansible? How does it work?](#what-is-ansible-how-does-it-work)).
|
||||
|
||||
This FAQ page does not intend to replace the [matrix.org FAQ](https://matrix.org/faq/) (please see that one too).
|
||||
|
||||
We've only started this FAQ recently, so it's still somewhat empty.
|
||||
|
||||
Also, we encourage you to not dig yourself into a hole by reading way too much. When you've heard enough, proceed to [Prerequisites](prerequisites.md) to get guided into installing Matrix.
|
||||
|
||||
|
||||
## Introductory
|
||||
|
||||
## Where do I find more questions and answers about Matrix?
|
||||
|
||||
This is a Frequently Asked Questions page focused on this [Ansible](https://www.ansible.com/) playbook ([What is Ansible? How does it work?](#what-is-ansible-how-does-it-work)) for deploying a [Matrix](https://matrix.org/) server.
|
||||
|
||||
For a lot more generic questions and answers, see the [matrix.org FAQ](https://matrix.org/faq/).
|
||||
|
||||
## What is Matrix? What is Element? What is Synapse? Why are you confusing me with so many terms?
|
||||
|
||||
[Matrix](https://matrix.org/) is a new type of realtime communication (chat) network, the closest analogy to which is probably "email".
|
||||
|
||||
You don't just use the "email" protocols (SMTP, POP3, IMAP) directly though. There's a *server* somewhere which stores your data (`@gmail.com`, `@yahoo.com`, `@hotmail.com`, `@your-company.com`) and you access it by using these "email" protocols via some *client* program (Outlook, Thunderbird, some website, etc).
|
||||
|
||||
In the world of the Matrix chat protocol, there are various client programs. The first and currently most full-featured one is called [Element](https://element.io/) (used to be called Riot.im and Vector.im in the past). There are [many other clients](https://matrix.org/clients/). You can switch clients as much as you want until you find the one that is right for you on a given platform (you may use Element on your desktop, but Fluffychat on your phone, etc).
|
||||
|
||||
Matrix is also like email due to the fact that there are many servers around the world which can all talk to each other (you can send email from `@gmail.com` addresses to `@yahoo.com` and `@hotmail.com` addresses). It's the same with Matrix (`@bob:his-domain.com` can talk to `@alice:her-domain.org`).
|
||||
|
||||
If someone else is hosting your Matrix server (you being `@user:matrix.org` or some other public server like this), all you need is a Matrix client program, like Element.
|
||||
|
||||
If you'd like to host your own server (you being `@user:your-own-domain.com`), you'd need to set up a Matrix server program, like Synapse.
|
||||
|
||||
In short:
|
||||
|
||||
- Matrix is the protocol - a set of rules about how the chat network operates
|
||||
- Element is a client program you can use to participate on the Matrix chat network via some server (yours or someone else's). There are also [many other client programs](https://matrix.org/clients/).
|
||||
- Synapse is a server program you can use to host your very own Matrix server.
|
||||
|
||||
This FAQ here mostly focuses on installing various Matrix services using the Ansible automation tool. You can learn much more about Matrix in the [matrix.org FAQ](https://matrix.org/faq/).
|
||||
|
||||
## People I wish to talk to are not on Matrix. Can I talk to them?
|
||||
|
||||
You most likely can. Besides Matrix-native chats, Matrix also supports the concept of "bridging", which allows you to plug other networks into it.
|
||||
|
||||
This Ansible playbook can help you install [tens of bridges for various networks](configuring-playbook.md#bridging-other-networks).
|
||||
|
||||
Besides setting up your own bridges (preferable), you can also use some [public bridges hosted by others](https://publiclist.anchel.nl/#bridges).
|
||||
|
||||
## How do I get started with Matrix?
|
||||
|
||||
One of [Matrix](https://matrix.org/)'s distinguishing strengths (compared to other chat networks) is its decentralized nature. There's not just one entity (company, organization) controlling the servers. Rather there's thousands of servers operated by different people - one server being insecure, slow or disrespective toward its users does not affect the rest of the network. To participate in that decentralization in its fullest, consider hosting your own server or using some public server other than the largest/default one (`matrix.org`).
|
||||
|
||||
There are 3 ways to get into Martix, depending on your technical ability and needs:
|
||||
|
||||
- **using the existing default server** - the easiest way is to use an existing server. The largest public Matrix server is `matrix.org` and it's configured as a default server in clients such as [Element](https://element.io) and many others. Just use Element on the browser via that link (or download the Element app on a smartphone), create an account and start chatting.
|
||||
|
||||
- **using some other server** - instead of using the largest public server (`matrix.org`), you can use another public one. Here's a [list of public Matrix servers](https://publiclist.anchel.nl/) to choose from. Again, you download [Element](https://element.io) or [some other client](https://matrix.org/clients/) of your choosing and adjust the homeserver URL during login.
|
||||
|
||||
- **using your own server** - running your own server puts you in ultimate control of your data. It also lets you have your own user identifiers (e.g. `@bob:your-domain.com`). See [How do I set up my own Matrix server](#how-do-i-set-up-my-own-matrix-server).
|
||||
|
||||
### How do I set up my own Matrix server?
|
||||
|
||||
Normally, you'd first choose the [Matrix](https://matrix.org/) server software you'd like to run. At the time of this writing (January/2021), there's only one fully-featured server program, so there's only one reasonable choice. That's [Synapse](https://github.com/matrix-org/synapse).
|
||||
|
||||
There are [many guides about installing Synapse](https://matrix.org/docs/guides/#installing-synapse). Using this Ansible playbook is just one way of doing it.
|
||||
|
||||
Naturally, we're biased, so our usual recommendation is to go with this [Ansible](https://www.ansible.com/) playbook, instead of installing Synapse (and many many other things around it) manually.
|
||||
To get started with the playbook, start at the [Prerequisites](prerequisites.md) page.
|
||||
|
||||
### What is Ansible? How does it work?
|
||||
|
||||
[Ansible](https://www.ansible.com/) is an automation program. This "playbook" is a collection of tasks/scripts that will set up a [Matrix](https://matrix.org/) server for you, so you don't have to perform these tasks manually.
|
||||
|
||||
We have written these automated tasks for you and all you need to do is execute them using the Ansible program.
|
||||
|
||||
You can install Ansible and this playbook code repository on your own computer and tell it to install Matrix services at the server living at `matrix.DOMAIN`. We recommend installing Ansible on your own computer.
|
||||
|
||||
Alternatively, you can download Ansible and the playbook itself directly on the `matrix.DOMAIN` server.
|
||||
|
||||
To learn more, see our [dedicated Ansible documentation page](ansible.md).
|
||||
|
||||
### Why use this playbook and not install Synapse and other things manually?
|
||||
|
||||
There are various guides telling you how easy it is to install [Synapse](https://github.com/matrix-org/synapse).
|
||||
|
||||
Reading the documentation of this Ansible playbook, you may also be thinking:
|
||||
|
||||
> I don't know what [Ansible](https://www.ansible.com/) is. I don't know what [Docker](https://www.docker.com/) is. This looks more complicated.
|
||||
|
||||
.. so you may be leaning toward [installing Synapse manually](https://github.com/matrix-org/synapse/blob/master/INSTALL.md).
|
||||
|
||||
The problem with a manual installation is:
|
||||
|
||||
- Synapse is written in Python. If not packaged for your distribution, you'd need to install various Python modules, etc., and keep them updated.
|
||||
- Synapse requires a [Postgres](https://www.postgresql.org/) database (it can run on SQLite, but that's very much discouraged). So you'd need to install Postgres as well.
|
||||
- you may also need a reverse-proxy server in front of it (nginx, Apache), so you'd need to be familiar with that
|
||||
- SSL is required, so you'd need to obtain Let's Encrypt (or other free or non-free) certificates for one or more domain names. You'd need to be familiar with [certbot](https://certbot.eff.org/) (when using Let's Encrypt) or similar software.
|
||||
- for each additional component you'd like to add (client like [Element](https://element.io), bridge to some other chat network, Integration Manager (sitckers, other services), Identity Manager, etc.), you'll need to spend extra time installing and wiring it with the rest of the system in a way that works.
|
||||
- you'll likely get slower updates for all of these components, depending on your distro packaging or your own time and ability
|
||||
|
||||
The playbook, on the other hand, installs a bunch of components for you by default, obtains SSL certificates for you, etc. If you'd like, you can enable various bridges and other services with very little effort. All the components are wired to work together.
|
||||
|
||||
All services run in Docker containers (most being officially provided by each component's developers), so we're not at the mercy of distro packaging.
|
||||
|
||||
### Why use this playbook and not just use the Docker image directly?
|
||||
|
||||
Reasons are similar to the reasons for not installing manually.
|
||||
|
||||
Besides Synapse, you'd need other things - a Postgres database, likely the [Element](https://element.io) client, etc., etc.
|
||||
|
||||
Using the playbook, you get all these components in a way that works well together out of the box.
|
||||
|
||||
### What's different about this Ansible playbook compared to [EMnify/matrix-synapse-auto-deploy](https://github.com/EMnify/matrix-synapse-auto-deploy)?
|
||||
|
||||
This is similar to the [EMnify/matrix-synapse-auto-deploy](https://github.com/EMnify/matrix-synapse-auto-deploy) Ansible deployment, but:
|
||||
|
||||
- this one is a complete Ansible playbook (instead of just a role), so it's **easier to run** - especially for folks not familiar with Ansible
|
||||
|
||||
- this one installs and hooks together **a lot more Matrix-related services** for you (see above)
|
||||
|
||||
- this one **can be executed more than once** without causing trouble
|
||||
|
||||
- works on various distros: **CentOS** (7.0+), Debian-based distributions (**Debian** 9/Stretch+, **Ubuntu** 16.04+), **Archlinux**
|
||||
|
||||
- this one installs everything in a single directory (`/matrix` by default) and **doesn't "contaminate" your server** with files all over the place
|
||||
|
||||
- this one **doesn't necessarily take over** ports 80 and 443. By default, it sets up nginx for you there, but you can also [use your own webserver](configuring-playbook-own-webserver.md)
|
||||
|
||||
- this one **runs everything in Docker containers**, so it's likely more predictable and less fragile (see [Docker images used by this playbook](container-images.md))
|
||||
|
||||
- this one retrieves and automatically renews free [Let's Encrypt](https://letsencrypt.org/) **SSL certificates** for you
|
||||
|
||||
- this one optionally can store the `media_store` content repository files on [Amazon S3](https://aws.amazon.com/s3/) (but defaults to storing files on the server's filesystem)
|
||||
|
||||
- this one optionally **allows you to use an external PostgreSQL server** for Synapse's database (but defaults to running one in a container)
|
||||
|
||||
- helps you **import data from a previous installation** (so you can migrate your manual virtualenv/Docker setup to a more managed one)
|
||||
|
||||
- this one is actually **maintained**
|
||||
|
||||
## Server-related
|
||||
|
||||
### What kind of server do I need to install Matrix using this Ansible playbook?
|
||||
|
||||
We list our server requirements in [Prerequisites](prerequisites.md).
|
||||
|
||||
### Why not run Matrix on Kubernetes?
|
||||
|
||||
There's no reason not to run Matrix on [Kubernetes](https://kubernetes.io/).
|
||||
|
||||
However, that's overly complicated for thousands of us who just want to run a single small (and sometimes not so small) Matrix server, either using "cloud" servers or even a [Raspberry Pi](https://www.raspberrypi.org/) at home.
|
||||
|
||||
For us, a Kubernetes-based setup which requires a cluster of multiple computers and is more technically-involved is a no-go.
|
||||
|
||||
There are others working on automating a Matrix-on-Kubernetes setup, such as this [Helm](https://helm.sh/) chart: https://github.com/dacruz21/matrix-chart.
|
||||
|
||||
### Why don't you use Podman instead of Docker?
|
||||
|
||||
We like the philosophy of a daemonless container runtime, but [Podman](https://podman.io) is just not ready for our use case yet.
|
||||
|
||||
Learn more about our past experiences/attempts to give Podman a chance, by reading [this issue](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/520).
|
||||
|
||||
In short, `alias podman=docker` is a lie (for us).
|
||||
|
||||
### Why use Docker?
|
||||
|
||||
[Docker](https://www.docker.com/) is one of our 2 hard dependencies (the other one being [systemd](https://systemd.io/)).
|
||||
|
||||
It lets us run services in an isolated manner and independently of the (usually old) packages available for distributions.
|
||||
|
||||
It also lets us have a unified setup which runs the same across various supported distros (see them on [Prerequisites](prerequisites.md)).
|
||||
|
||||
### Is Docker a hard requirement?
|
||||
|
||||
Yes. See [Why don't you use Podman instead of Docker?](#why-dont-you-use-podman-instead-of-docker) for why we're not using another container runtime.
|
||||
|
||||
All of our services run in containers. It's how we achieve predictability and also how we support tens of different services across lots of distros.
|
||||
|
||||
The only thing we need on the distro is systemd and Python (we install Docker ourselves, unless you ask us not to).
|
||||
|
||||
### Why don't you use docker-compose?
|
||||
|
||||
Instead of using [docker-compose](https://docs.docker.com/compose/), we prefer installing systemd services and scheduling those independently.
|
||||
|
||||
There are people who have worked on turning this setup into a docker-compose-based one. See these experiments [here](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/64#issuecomment-603164625).
|
||||
|
||||
### Can I run this on a distro without systemd?
|
||||
|
||||
No. [systemd](https://systemd.io/) is one of our 2 hard dependencies (the other one being [Docker](https://www.docker.com/)).
|
||||
|
||||
### Can I install this on a Raspberry Pi?
|
||||
|
||||
Yes, you can. See our [Alternative Architectures](alternative-architectures.md) documentation page.
|
||||
|
||||
Whether a Raspberry Pi has enough power to give you a good experience is another question. It depends on your use case.
|
||||
|
||||
Also see: [What kind of server specs do I need?](#what-kind-of-server-specs-do-i-need).
|
||||
|
||||
### What kind of server specs do I need?
|
||||
|
||||
This largely depends on your use case. It's not so much the number of users that you plan to host, but rather the number of large rooms they will join.
|
||||
|
||||
Federated rooms with lots of history and containing hundreds of other servers are very heavy CPU-wise and memory-wise.
|
||||
|
||||
You can probably use a 1 CPU + 1GB memory server to host hundreds of local users just fine, but as soon as one of them joins a federated room like `#matrix:matrix.org` (Matrix HQ) or some IRC-bridged room (say `##linux`), your server will get the need for a lot more power (at least 2GB RAM, etc).
|
||||
|
||||
Running Matrix on a server with 1GB of memory is possible (especially if you disable some not-so-important services). See [How do I optimize this setup for a low-power server?](#how-do-i-optimize-this-setup-for-a-low-power-server).
|
||||
|
||||
**We recommend starting with a server having at least 2GB of memory** and even then using it sparingly. If you know for sure you'll be joining various large rooms, etc., then going for 4GB of memory or more is a good idea.
|
||||
|
||||
Besides the regular Matrix stuff, we also support things like video-conferencing using [Jitsi](configuring-playbook-jitsi.md) and other additional services which (when installed) may use up a lot of memory. Things do add up. Besides the Synapse Matrix server, Jitsi is especially notorious for consuming a lot of resources. If you plan on running Jitsi, we recommend a server with at least 2GB of memory (preferrably more). See our [Jitsi documentation page](configuring-playbook-jitsi.md) to learn how to optimize its memory/CPU usage.
|
||||
|
||||
### Can I run this in an LXC container?
|
||||
|
||||
If your distro runs within an [LXC container](https://linuxcontainers.org/), you may hit [this issue](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/703). It can be worked around, if absolutely necessary, but we suggest that you avoid running from within an LXC container.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
### Why install my server at matrix.DOMAIN and not at the base DOMAIN?
|
||||
|
||||
It's the same with email servers. Your email address is likely `name@company.com`, not `name@mail.company.com`, even though it's `mail.company.com` that is really handling your data for `@company.com` email to work.
|
||||
|
||||
Using a separate domain name is easier to manage (although it's a little hard to get right at first) and keeps your Matrix server isolated from your website (if you have one), from your email server (if you have one), etc.
|
||||
|
||||
We allow `matrix.DOMAIN` to be the Matrix server handling Matrix stuff for `DOMAIN` by [Server Delegation](howto-server-delegation.md). During the installation procedure, we recommend that you set up server delegation using the [.well-known](configuring-well-known.md) method.
|
||||
|
||||
If you'd really like to install Matrix services directly on the base domain, see [How do I install on matrix.DOMAIN without involving the base DOMAIN?](#how-do-i-install-on-matrixdomain-without-involving-the-base-domain).
|
||||
|
||||
### I don't control anything on the base domain and can't set up delegation to matrix.DOMAIN. What do I do?
|
||||
|
||||
If you're not in control of your base domain (or the server handling it) at all, you can take a look at [How do I install on matrix.DOMAIN without involving the base DOMAIN?](#how-do-i-install-on-matrixdomain-without-involving-the-base-domain)
|
||||
|
||||
### I can't set up HTTPS on the base domain. How will I get Matrix federating?
|
||||
|
||||
If you really can't obtain an HTTPS certificate for your base domain, you can take a look at [How do I install on matrix.DOMAIN without involving the base DOMAIN?](#how-do-i-install-on-matrixdomain-without-involving-the-base-domain)
|
||||
|
||||
### How do I install on matrix.DOMAIN without involving the base DOMAIN?
|
||||
|
||||
This Ansible playbook guides you into installing a server for `DOMAIN` (user identifiers are like this: `@user:DOMAIN`), while the server is at `matrix.DOMAIN`.
|
||||
|
||||
We allow `matrix.DOMAIN` to be the Matrix server handling Matrix stuff for `DOMAIN` by [Server Delegation](howto-server-delegation.md). During the installation procedure, we recommend that you set up server delegation using the [.well-known](configuring-well-known.md) method.
|
||||
|
||||
If you're fine with uglier identifiers (`@user:matrix.DOMAIN`, which is the equivalent of having an email address like `bob@mail.company.com`, instead of just `bob@company.com`), you can do that as well using the following configuration in your `vars.yml` file:
|
||||
|
||||
```yaml
|
||||
# This is what your identifiers are like (e.g. `@bob:matrix.YOUR_BASE_DOMAIN`).
|
||||
matrix_domain: "matrix.YOUR_BASE_DOMAIN"
|
||||
|
||||
# This is where Matrix services
|
||||
matrix_server_fqn_matrix: "matrix.YOUR_BASE_DOMAIN"
|
||||
|
||||
# This is where you access the Element web UI from (if enabled via `matrix_client_element_enabled: true`; enabled by default).
|
||||
# This and the Matrix FQN (see above) are expected to be on the same server.
|
||||
#
|
||||
# Feel free to use `element.matrix.YOUR_BASE_DOMAIN`, if you'd prefer that.
|
||||
matrix_server_fqn_element: "element.YOUR_BASE_DOMAIN"
|
||||
|
||||
# This is where you access Dimension (if enabled via `matrix_dimension_enabled: true`; NOT enabled by default).
|
||||
#
|
||||
# Feel free to use `dimension.matrix.YOUR_BASE_DOMAIN`, if you'd prefer that.
|
||||
matrix_server_fqn_dimension: "dimension.YOUR_BASE_DOMAIN"
|
||||
|
||||
# This is where you access Jitsi (if enabled via `matrix_jitsi_enabled: true`; NOT enabled by default).
|
||||
#
|
||||
# Feel free to use `jitsi.matrix.YOUR_BASE_DOMAIN`, if you'd prefer that.
|
||||
matrix_server_fqn_jitsi: "jitsi.YOUR_BASE_DOMAIN"
|
||||
```
|
||||
|
||||
### I don't use the base domain for anything. How am I supposed to set up Server Delegation for Matrix services?
|
||||
|
||||
If you don't use your base domain for anything, then it's hard for you to "serve files over HTTPS" on it -- something we ask you to do for the [.well-known](configuring-well-known.md) setup (needed for [Server Delegation](howto-server-delegation.md)).
|
||||
|
||||
Luckily, the playbook can set up your Matrix server (at `matrix.DOMAIN`) to also handle traffic for the base domain (`DOMAIN`).
|
||||
|
||||
See [Serving the base domain](configuring-playbook-base-domain-serving.md).
|
||||
|
||||
### How do I optimize this setup for a low-power server?
|
||||
|
||||
You can disable some not-so-important services to save on memory.
|
||||
|
||||
```yaml
|
||||
# An identity server is not a must.
|
||||
matrix_ma1sd_enabled: false
|
||||
|
||||
# Disabling this will prevent email-notifications and other such things from working.
|
||||
matrix_mailer_enabled: false
|
||||
|
||||
# You can also disable this to save more RAM,
|
||||
# at the expense of audio/video calls being unreliable.
|
||||
matrix_coturn_enabled: true
|
||||
|
||||
# This makes Synapse not keep track of who is online/offline.
|
||||
#
|
||||
# Keeping track of this and announcing such online-status in federated rooms with
|
||||
# hundreds of servers inside is insanely heavy (https://github.com/matrix-org/synapse/issues/3971).
|
||||
#
|
||||
# If your server does not federate with hundreds of others, enabling this doesn't hurt much.
|
||||
matrix_synapse_use_presence: false
|
||||
```
|
||||
|
||||
You can also consider implementing a restriction on room complexity, in order to prevent users from joining very heavy rooms:
|
||||
|
||||
```yaml
|
||||
matrix_synapse_configuration_extension_yaml: |
|
||||
limit_remote_rooms:
|
||||
enabled: true
|
||||
complexity: 1.0 # this limits joining complex (~large) rooms, can be
|
||||
# increased, but larger values can require more RAM
|
||||
```
|
||||
|
||||
If you've installed [Jitsi](configuring-playbook-jitsi.md) (not installed by default), there are additional optimizations listed on its documentation page that you can perform.
|
||||
|
||||
### I already have Docker on my server. Can you stop installing Docker via the playbook?
|
||||
|
||||
Yes, we can stop installing Docker ourselves. Just use this in your `vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_docker_installation_enabled: true
|
||||
```
|
||||
|
||||
### I run another webserver on the same server where I wish to install Matrix. What now?
|
||||
|
||||
By default, we install a webserver for you (nginx), but you can also use [your own webserver](configuring-playbook-own-webserver.md).
|
||||
|
||||
### How is the effective configuration determined?
|
||||
|
||||
Configuration variables are defined in multiple places in this playbook and are considered in this order:
|
||||
|
||||
- there are defaults coming from each role's defaults file (`role/matrix*/defaults/main.yml`). These variable values aim to be good defaults for when the role is used standalone (outside of this collection of roles, also called playbook).
|
||||
|
||||
- then, there are overrides in `group_vars/matrix_servers`, which aim to adjust these "standalone role defaults" to something which better fits the playbook in its entirety.
|
||||
|
||||
- finally, there's your `inventory/host_vars/matrix.DOMAIN/vars.yml` file, which is the ultimate override
|
||||
|
||||
### What configuration variables are available?
|
||||
|
||||
You can discover the variables you can override in each role (`role/matrix*/defaults/main.yml`).
|
||||
|
||||
As described in [How is the effective configuration determined?](#how-is-the-effective-configuration-determined), these role-defaults may be overriden by values defined in `group_vars/matrix_servers`.
|
||||
|
||||
Refer to both of these for inspiration. Still, as mentioned in [Configuring the playbook](configuring-playbook.md), you're only ever supposed to edit your own `inventory/host_vars/matrix.DOMAIN/vars.yml` file and nothing else inside the playbook (unless you're meaning to contribute new features).
|
||||
|
||||
### I'd like to adjust some configuration which doesn't have a corresponding variable. How do I do it?
|
||||
|
||||
The playbook doesn't aim to expose all configuration settings for all services using variables.
|
||||
Doing so would amount to hundreds of variables that we have to create and maintain.
|
||||
|
||||
Instead, we only try to make some important basics configurable using dedicated variables you can see in each role.
|
||||
See [What configuration variables are available?](#what-configuration-variables-are-available).
|
||||
|
||||
Besides that, each role (component) aims to provide a `matrix_SOME_COMPONENT_configuration_extension_yaml` (or `matrix_SOME_COMPONENT_configuration_extension_json`) variable, which can be used to override the configuration.
|
||||
|
||||
Check each role's `role/matrix*/defaults/main.yml` for the corresponding variable and an example for how use it.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### How do I run the installation?
|
||||
|
||||
See [Installing](installing.md) to learn how to use Ansible to install Matrix services.
|
||||
|
||||
Of course, don't just jump straight to Installing. Rather, start at [Prerequisites](prerequisites.md) and get guided from there (into [setting up DNS](configuring-dns.md), [configuring the playbook](configuring-playbook.md), etc).
|
||||
|
||||
### I installed Synapse some other way. Can I migrate such a setup to the playbook?
|
||||
|
||||
Yes, you can.
|
||||
|
||||
You generally need to do a playbook installation (start at the [Prerequisites](prerequisites.md) page), followed by importing your existing data into it.
|
||||
|
||||
This Ansible playbook guides you into installing a server for `DOMAIN` (user identifiers are like this: `@user:DOMAIN`), while the server is at `matrix.DOMAIN`. If your existing setup has a server name (`server_name` configuration setting in Synapse's `homeserver.yaml` file) other than the base `DOMAIN`, you may need to tweak some additional variables. This FAQ entry may be of use if you're dealing with a more complicated setup - [How do I install on matrix.DOMAIN without involving the base DOMAIN?](#how-do-i-install-on-matrixdomain-without-involving-the-base-domain)
|
||||
|
||||
After configuring the playbook and installing and **before starting** services (done with `ansible-playbook ... --tags=start`) you'd import [your SQLite](importing-synapse-sqlite.md) (or [Postgres](importing-postgres.md)) database and also [import your media store](importing-synapse-media-store.md).
|
||||
|
||||
### I've downloaded Ansible and the playbook on the server. It can't connect using SSH.
|
||||
|
||||
If you're using the playbook directly on the server, then Ansible doesn't need to connect using SSH.
|
||||
|
||||
It can perform a local connection instead. Just set `ansible_connection=local` at the end of the server line in `inventory/hosts` and re-run the playbook.
|
||||
|
||||
If you're running Ansible from within a container (one of the possibilities we list on our [dedicated Ansible documentation page](ansible.md)), then using `ansible_connection=local` is not possible.
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### I get "Error response from daemon: configured logging driver does not support reading" when I do `docker logs matrix-synapse`.
|
||||
|
||||
See [How can I see the logs?](#how-can-i-see-the-logs).
|
||||
|
||||
### How can I see the logs?
|
||||
|
||||
We utilize [systemd/journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html#Description) for logging.
|
||||
|
||||
To see logs for Synapse, run `journalctl -fu matrix-synapse.service`. You may wish to see the [manual page for journalctl](https://www.commandlinux.com/man-page/man1/journalctl.1.html).
|
||||
|
||||
Available service names can be seen by doing `ls /etc/systemd/system/matrix*.service` on the server.
|
||||
|
||||
Some services also log to files in `/matrix/*/data/..`, but we're slowly moving away from that.
|
||||
|
||||
We also disable Docker logging, so you can't use `docker logs matrix-*` either. We do this to prevent useless double (or even triple) logging and to avoid having to rotate log files.
|
||||
|
||||
We just simply delegate logging to journald and it takes care of persistence and expiring old data.
|
||||
|
||||
Also see: [How long do systemd/journald logs persist for?](#how-long-do-systemdjournald-logs-persist-for)
|
||||
|
||||
### How long do systemd/journald logs persist for?
|
||||
|
||||
On some distros, the journald logs are just in-memory and not persisted to disk.
|
||||
|
||||
Consult (and feel free to adjust) your distro's journald logging configuration in `/etc/systemd/journald.conf`.
|
||||
|
||||
To enable persistence and put some limits on how large the journal log files can become, adjust your configuration like this:
|
||||
|
||||
```ini
|
||||
[Journal]
|
||||
RuntimeMaxUse=200M
|
||||
SystemMaxUse=1G
|
||||
RateLimitInterval=0
|
||||
RateLimitBurst=0
|
||||
Storage=persistent
|
||||
```
|
||||
|
||||
|
||||
## Maintenance
|
||||
|
||||
### Do I need to do anything to keep my Matrix server updated?
|
||||
|
||||
Yes. We don't update anything for you automatically.
|
||||
|
||||
See our [documentation page about upgrading services](maintenance-upgrading-services.md).
|
||||
|
||||
### How do I move my existing installation to another (VM) server?
|
||||
|
||||
If you have an existing installation done using this Ansible playbook, you can easily migrate that to another server using [our dedicated server migration guide](maintenance-migrating.md).
|
||||
|
||||
If your previous installation is done in some other way (not using this Ansible playbook), see [I installed Synapse some other way. Can I migrate such a setup to the playbook?](#i-installed-synapse-some-other-way-can-i-migrate-such-a-setup-to-the-playbook).
|
||||
|
||||
### How do I back up the data on my server?
|
||||
|
||||
We haven't documented this properly yet, but the general advice is to:
|
||||
|
||||
- back up Postgres by making a database dump. See [Backing up PostgreSQL](maintenance-postgres.md#backing-up-postgresql)
|
||||
|
||||
- back up all `/matrix` files, except for `/matrix/postgres/data` (you already have a dump) and `/matrix/postgres/data-auto-upgrade-backup` (this directory may exist and contain your old data if you've [performed a major Postgres upgrade](maintenance-postgres.md#upgrading-postgresql)).
|
||||
|
||||
You can later restore these roughly like this:
|
||||
|
||||
- restore the `/matrix` directory and files on the new server manually
|
||||
- run the playbook again (see [Installing](installing.md)), but **don't** start services yet (**don't run** `... --tags=start`). This step will fix any file permission mismatches and will also set up additional software (Docker, etc.) and files on the server (systemd service, etc.).
|
||||
- perform a Postgres database import (see [Importing Postgres](importing-postgres.md)) to restore your database backup
|
||||
- start services (see [Starting the services](installing.md#starting-the-services))
|
||||
|
||||
If your server's IP address has changed, you may need to [set up DNS](configuring-dns.md) again.
|
||||
|
||||
### What is this `/matrix/postgres/data-auto-upgrade-backup` directory that is taking up so much space?
|
||||
|
||||
When you [perform a major Postgres upgrade](maintenance-postgres.md#upgrading-postgresql), we save the the old data files in `/matrix/postgres/data-auto-upgrade-backup`, just so you could easily restore them should something have gone wrong.
|
||||
|
||||
After verifying that everything still works after the Postgres upgrade, you can safely delete `/matrix/postgres/data-auto-upgrade-backup`
|
@ -1,118 +1,124 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
66633865333931323532653061623366633536306531613738666236333563383462393236393565
|
||||
3030643933643865303563613966663935616632306163380a353739306336386239346262373736
|
||||
66353963373834393465363763643335623563303236366239643062366132623433623639643431
|
||||
3432313830613565610a383938386133623966386631306530313865323234386534613665616262
|
||||
35383266663431353736393337313631663739363634396364393135646562633432623330303434
|
||||
32623238366437333237376437636333386130326636346462663165366465303232353937646161
|
||||
36396466626630333963323131303336663337333061613531346563316666626461646138353931
|
||||
65346135396266623434333362376162616166373163303734303033303634353031303762393338
|
||||
32353833646439303233343230323131323765623863366663666337316332613339393337353634
|
||||
62383131653363613938363834376235316330343064623234393062626134396365393761383339
|
||||
35343035646133343733373339353763646562343765363135346233393466666239306333346264
|
||||
37353962626132653032343332633936326166323138643134326563306263613234643636393938
|
||||
30343566663135343037663138633566653762323037373936336663376132663266663731613731
|
||||
64623237326563366439353065326531326136666564396537383462633132373530393131396666
|
||||
37356132333764383239306261643163616164383466616463643135326365663763393437623837
|
||||
61353134623336666233636563373538623562623132636264663930643661336561346535326262
|
||||
34643832303365653839626161633162666565636536656338346332623461373935313030663964
|
||||
64323366613130333264313136343135396562643561383235376130666334363536333265616361
|
||||
31656165653838313964313864396439323266303439383838323931363161343132326163643264
|
||||
31333933386164663438343739616138313064353338616366353237393131353234663634643964
|
||||
31336437343261356636396162386434313332356461646561306435363734306634336264653839
|
||||
39366138373162393163656437626634373533656137353266313633316239616337633066343863
|
||||
32396138393731386131653131633566616161326363613638623635646136633234623664656631
|
||||
65633063663330386330343461336133663165323337303534303435646330333066306230636464
|
||||
36373061393663646262303832376235366635353535613730633835663236656138653534353134
|
||||
31313334623530326534376332616562643139303265623761666438616362613134663533383230
|
||||
64653961306565333337353731323135393965656232626630666431633435333531626431633832
|
||||
33393138653431613830353635323165383265636661316430336461353034353536623164653764
|
||||
39303332323066343266643966336633353561386234643139663539653435653036646665666163
|
||||
38636261393361366437336535666563393632316332623366363536373564356238353436326639
|
||||
61393533343936613531333439386162386162313138386536663037663936646135643765396664
|
||||
34393533363137613039306335313462643437623861396566356338653734356361656233323332
|
||||
63353163653162646131356439306662376266636438393435663961303239666339616266383864
|
||||
66393837363739353665353234336534333965333735353335316531383963336233623430393432
|
||||
66316531663661363362383965643461303339666436376637633233303733333636346365353239
|
||||
64363433366135303530636461656165396530353134623536323631646564656236666161303065
|
||||
65393438313864623633303365356430626133363165323433353837646139646566316431666233
|
||||
35393562316137346331353637626134376138373266373233346136643336356238393065303265
|
||||
38396432346539373066313763643137643165613563346536663164363635326635623835373736
|
||||
62623231376562343138383563633266303733323937633738303330353436653434353838303563
|
||||
34383963323331303932666566666137383366663364646334326632366136663763386138666461
|
||||
36653764363931386465313134343638373935323061303063323262626133346562326535663330
|
||||
64333662663837333931373038663165633730636332366235636364363335376233373565303330
|
||||
61663432363233626236643130303135386334613464343861363338626632613731373231653337
|
||||
61353933313935623965333461333662346364343639333362616165656634373031363532373764
|
||||
38373139633038623934663639653430633564303830633864366134323835643039386439323961
|
||||
37373733626534303764393362633561363933326366323265373335653135653432633664383838
|
||||
39613964646361303761663535363837326263396432656565326232313135643335386239653030
|
||||
38326562333533363738366161343936303732346439363266626365363833663036323065313563
|
||||
33306435353632613862356531636331356538613633393932643165386361376361373434616630
|
||||
33623431343031623336386136386661303166343838666330383036653462623339613962616266
|
||||
33303536666237376135326139376236616138346231383932326566343537656530396464633963
|
||||
37626239623230326137323061343961336561303434343963363530613263633466383232613364
|
||||
61366263383434633139613831623738653434303162643738663836373931636136613631356237
|
||||
64326133313833336364353164363032363539323630616337336663633238336636633130376138
|
||||
37623933646230643439323934666564663132393233363135353630646630633065653839316665
|
||||
30386439313965633061366232333764393538323862643130633937363239363338663034623333
|
||||
37326564373538623661616637373434633961393361383965383439383065316462373763346465
|
||||
64626662646538326532643839333435313066333462656634373832396439393236323865646239
|
||||
33313032376166633861336366393036333431313565663266643133366631303034666464333566
|
||||
37333631393639646438666665323937656262396665336561623866613766656363353762386265
|
||||
30396533653231666439613239316564626236303635646538353335383534666339666566633837
|
||||
35653961386135353735636434333830323564656466306365663763346633396530646536396135
|
||||
36346133666665343334623536383931373435333562653634303538326136363062613732653832
|
||||
31373239616337386332346434393339316563366365653933616161316130626639396134306636
|
||||
64613037623539343061313961646263316134613632626165623532306563653639373263633032
|
||||
39353864393734396537386134633561386262353837653931653362306139323538623639356539
|
||||
61623131626662656531366433333363633766636662376366313537383930373434353865306562
|
||||
37383462346264323936396461336365646663653732333765666364386331343339633366393835
|
||||
34626533613736323962636236306265323665366163306430336261306130663464323931656133
|
||||
34653538376439313036316632366231663264323739373032623332343038383364303335366562
|
||||
34656133373465333665643238663665643137626261303938646466343463353562363330323638
|
||||
61383232383038363961393636316161303366373237626665303532633336336436626662363733
|
||||
34356466333330626337643437656239396566666362353130303836353262336534376564363830
|
||||
30313737373730636130383363323737313531663961343438343061393138353765393830653566
|
||||
39303439383738613662336663353764323932306632633932643165633431623063346166613966
|
||||
62326438383037376435613861623530336161386535303566626461393737303263643932343862
|
||||
65386537306235363837653139353130643638626662363166636463633030656339613865313738
|
||||
36306365616334363933343165386265386163303432303233633333303134633566643561346661
|
||||
38386436633061376437313464336333386332376337383136396638643261613832656133313366
|
||||
63343134333030646331663466316331643432386363646134306462303664393165383563353264
|
||||
37336465323638656664343830383431376361383535663632393363383234663462393332633438
|
||||
36383134366236393834663237666138353661306564303631336330396634366338643034346331
|
||||
37393962636165616462653632626333346537313131393261346632613166343663393265356537
|
||||
39316633633633396236373532313338386536316337373037666661303030356564383632343065
|
||||
62373438396666356336383963356263316531333032653666646162363139303336646431303430
|
||||
65363662376130616436316435313464353038313338636239383665663432343930396238393764
|
||||
38363734386662313061643139626335336462653635373861663633636364363964316162646235
|
||||
62336238653337303863303761303262333666366237626464666666666230613863343631386464
|
||||
37313234333561633534313564393932363865363635303434653236393036363033666431376261
|
||||
63373234376361386166316238646462343765633331366166383864656130613466633435646338
|
||||
38656438616238323638663636626430633766623538343735313631303963306663386331396331
|
||||
36393333323938356433316132303637373165323532373363323837643866373034356133393832
|
||||
34653437623333323835643865633865626663633362303535336565386636316232376164336432
|
||||
65333839646264323939636662373035323231663733623034386135653436663261363634613439
|
||||
34646331666633376461323430623862393736633635323266343334646135636434373235643263
|
||||
63373733346537633662613832373566396163663864346630313766336166373733303565316534
|
||||
62373832323433653464653133363764633565326435663230613966383562313638306235336433
|
||||
65666636353331323865386437303035376264316633376637663562373739343636633235393232
|
||||
33396534623036323831323065393236366662313263633339333034633231313434323238393834
|
||||
37636433376465343334396632666636356665383163323236313633383530663632366232613763
|
||||
32326134353936343233306262636163393734366631623861626266393765396230653662393434
|
||||
66623335363232643933326333646364616532323434353464366138636335333138613636393435
|
||||
34643534653766356539396536656336663537346637313437623835306132653532323963393337
|
||||
65626462653939336335623262633262383636316565663661663538383330393233396634363531
|
||||
65303331663662633236393664633166666661633735376263346235343362363662626232363232
|
||||
66373661393031353064323932613361363734373638623531643863396361323232373265643361
|
||||
62323033383431323431633235333535663262353938353064303765336139356134656364343433
|
||||
39356232316436633165643361383135373962626536633662663230366662333262626530663633
|
||||
66376630633036313537326634616337346466616333396665663063316334636436636438633938
|
||||
66393934306562663431396665323238633761383333316665316535656161393862346535393436
|
||||
36316462323636623539346666636639626438343539646230653934373764316539366465383135
|
||||
36306664623039316336646135633530343235356630613161623638616339306262373466323830
|
||||
35666531626530653435326333383831363239383564633531383437376566666232366431343865
|
||||
37353430623138393664346237623839656666316638366532633933383534313734373166336464
|
||||
37613139313338323962633735636332373265356132643437663137383035646332366330366163
|
||||
32623538336565663061326237643763663637643735633431333232356330646533
|
||||
34346166323534643061393764656165333234303064313338623564303233666666323136666331
|
||||
3331353237396233323933373433343962356231346461370a383835396234396636343961663932
|
||||
66383935653634633465383831636538653331393030323639306265333065376461323932396639
|
||||
3537383434303562610a373930363836636262623031393561326135323738393033336239623831
|
||||
66646563393232353738633539323664646635313961353534353238343866646139386634626562
|
||||
38326239386539386362393532666434323561316437633464626465343936356138326664316662
|
||||
34643133306639653237343135313835643236636631643034366263653164383535393037326365
|
||||
31663166623737356430386665303236343333316362356361306339363664303166316134343834
|
||||
35303064666163663431663432316366653961666464383965613837366666366638666262653237
|
||||
32366338393966386661623734643633363532636135623330323835313064333962333066343033
|
||||
62396362613564393035663063393038643238663263323464333333306538353634636663383962
|
||||
61616331393034623365353636613030303037663663386663656237663263386334393730393964
|
||||
62623433346264633332363764303964343836306365646466346137383031366261333065383162
|
||||
63633039313932656363613632613839316437373634316462326136373537386461623064343565
|
||||
33386161373764636661663166613339313438356232336466366230336237653931386562663535
|
||||
64646630613738646666303663656132366537336563626265303230326662623366613138383436
|
||||
64323431333139373639356438623832363335323632306661386436366562313732613135653439
|
||||
66653337366263666433653837373761616365303435363366623661616464353736643365303962
|
||||
39313836633839316461323837373232636639376438316338383039313931646130663831306333
|
||||
38663039306464653863636437323730663731623535653239316266656561646639383561626337
|
||||
31393131316463636266303537663135323238316262346435343437343635363932623738316466
|
||||
63366364643534653365373565613038306230346131623061616263323035346139333836643439
|
||||
37316565303262643762633765666163376663666137356431313963353639313738643932363166
|
||||
62313837646164326133616362313238633334366238613136396165366635323564363434303130
|
||||
64323532393234613461393436613364366331633364333265386532353062373338663563323033
|
||||
35346332623762386430626238333830393339353766383663306632333639396139393834326239
|
||||
32333965373861363232316162306132646435336562346563653361356139376539343266613264
|
||||
33303765316137613232623136343938633534396235393936356664613864333961656536333636
|
||||
39383730366439633861633166383830376134633835643435333039313237333862666665373136
|
||||
33646330386434663539366135643132383333316531346264653731323536333464623133383835
|
||||
34373936653033333565386335363538623930373539666236376362376433396337643762356535
|
||||
37383039373334343230663338623339666365343865643137316531373839623035353937333562
|
||||
34373439353761386230393936626164346437613565653835366438313732666466303131666638
|
||||
39663664333362626163366339623738636133373262626366636364333735393730643231613061
|
||||
34666434626461643837633861613736303239343133663663656265363465663038356165323562
|
||||
64353731613931633536373262623137313535323262373532653233326564623264663032636666
|
||||
36663537303930363132353463393735666438396131613536353938643039636238653465323066
|
||||
65633261396433333332633465643239343930366631613436366361613366326434353534336165
|
||||
39663535653638323334376333383031343832653132343162326137356435616262346330353462
|
||||
39663266633235353831326462623333626631383364303039336631323131393265346335613036
|
||||
61333430303837323135393631653233633066343264636439636561633465326333313838333737
|
||||
38316364643262356535366438353830666364386635353835656539383434666633343831393331
|
||||
61613132363062633133663631623134393465393561346235653763326631343935373330373832
|
||||
39613935326535386463653563316331313638356165646461353931653439313163393166366463
|
||||
38623262373939373066626239656130666164373837303665356566313636323830356539613339
|
||||
66616263363738653138393532653539643766633162343838376362636362616335383365366633
|
||||
33303038303332386239396534663164386564653637333338383838323232336337646330373761
|
||||
62626562306239396163323934383566373831323933383231333365626436383135653431336364
|
||||
39343637666638613438376162633365613365343837633863373931346664366163346335353333
|
||||
30613265323034653461376461313231663731343438623331393739323961363862326233653931
|
||||
36353739346134363261303536616235363331623539313432623062326433346238393663316139
|
||||
61656530373164616564626236656232343036363337333362353532363132303066303032656630
|
||||
61303431643763373839656135383730653533396434626166666365656262373231383265303564
|
||||
34613065356538636339626137663964343462633135376463366262636338373666383861383035
|
||||
65313139316430316533396365616138653536656561346636316565616636363434303762333364
|
||||
30366331393566663436343839323562323432393631383939633631366435666363303037336536
|
||||
66623736316539303836353935303738666366383533653863323733636365613233363634306438
|
||||
35353332653134646663633838316264313434303639643937333531386335613537626161663035
|
||||
33323935323035386364613238336335616532626462656265643531656464626232666133343439
|
||||
39376263353764613033326363386134386338303734373761396361613266316466333663346636
|
||||
38393136666333336437313731336533633133663631643837313366396531353164313264386238
|
||||
39306532303161643864643434656538343030366334663737643036643565303534663130613566
|
||||
38393661336637396433346166633731663265393864323565353464613337363238646532353765
|
||||
61666633313235613839363762663737333234316562643837636164373536306435383634646161
|
||||
35663134333837663964366237613035663733666463396132396533623833383663386532313830
|
||||
61326436363431653934383234353034346434643433363933646538636636663661363362663662
|
||||
62306636303139616138323365646437643135386131396237396132643362346566626463323937
|
||||
39623731303766626431313062356335633135373031643266333438373964653538386265326637
|
||||
35613730346137366664636433353062613735303035636265313566343131643834613861343762
|
||||
61356237626533613366333462323632363731363066616361393536383064663566386536373533
|
||||
62376631303666323031313666363631326636313938346564363137656532626330666362663065
|
||||
35346662373164363031356430383838356136663764336336393532363561353535373838626135
|
||||
65633339653837336238386331653030613362376133643038373839643361633036653039356235
|
||||
37656136313839656264616637386538373734343962643261323031666366643837633863353433
|
||||
39306236376230613566323562356631613763366130623964336364666132363863303032363863
|
||||
63613138303735666539306464303564356234643266636432396561373566386265633531316363
|
||||
64373334323837386531386233363935393035316362303661343535303033643739343235303563
|
||||
36343064383337306534396565393164306436303861396639343937366330326536633935323136
|
||||
36323633363634356265353333396166376634663161366438333035613162366366636239336366
|
||||
63336635366438396534366234643332343231626466636464653761333763383062626234336635
|
||||
37346332323363313138656539653264363531633331623435353666303536616561623863363962
|
||||
35653732353239306437626265356434393930316534393365383931396337303166613237613433
|
||||
39376531303862343630336461373839323436626236313535663339636638386566356535356430
|
||||
35663331633137323166623864373437383265613030336261306563326232383839623965346239
|
||||
37666135646631663763333035616637616661623034633530333033323266663234336130383632
|
||||
30613437323365333938313364363331393364636435306231313535363237643735303539633036
|
||||
34313833336661616334366265383565393332396131303866333462356638646139343739663838
|
||||
30366630343233393161643431356339323565653431313166613836636635363764313261343066
|
||||
35653934323030633262323333613265393461383034303266323934353334663832616461393564
|
||||
36646663613062333137666635623137336163666363663237363064646437643835646164623665
|
||||
65656465393133663663646536663332633732343635393637646634663632613864343334353933
|
||||
61393238383336353635633334616530363831396431393337666438663163383538613137636238
|
||||
39303261306339303633396166363838316330643238613939656335643431323065623764336465
|
||||
30636330363036343164306564323732393331653465343038663466643031303235643130323339
|
||||
37343334646435376564663030653032393165313337363165356466323035343530343261623632
|
||||
33353533626635346433306130613862653061323438306439303664376563306565623736643034
|
||||
63623432363031346639363234303866346462353536346431303539396632636332643739653934
|
||||
33313836666637383363353166663363353535316535343334346164653939323632396263306637
|
||||
39653663643238636633313736336236333531343362353430623964646366346261633663353930
|
||||
32636364376436303264383562373462393461393432333366623834333164646136666133306337
|
||||
31663733636162653466363134393163343035393533386132346235626435363336323163663863
|
||||
31303435323032613462303163663836623135373330393631356334623730643266373063616133
|
||||
35393862643738626530616365636665636462663235336337613339313431616435313535303365
|
||||
66383332336662623964333434356333393636393134663034306432633638616439383739366634
|
||||
61373864646634383563623632326131626430653334323362363637343238663836343136353930
|
||||
63363239343539636365386566303933393431353064313064346663613930373737336632363935
|
||||
38616131383034643363346236396564303936303437363133613432656239356463646130316438
|
||||
66333739356565666433323839646436666630613132373164303933303431363231653630356262
|
||||
38313766623133613837633232323137626164333138643834316431313666396462373532633338
|
||||
62616561626236633136313261326563316662306632633438336139653338386361386632386362
|
||||
65333933313832616562623739633037616634343333393731336265636266333934653638663039
|
||||
35396334633932636163346662623961613463376135323938353333653631613064316539656164
|
||||
32653833623965366135656635343465373935333534366466396132336561663831613661643862
|
||||
61373037323766633539306161303234373539626133323763386664306261386634366136623832
|
||||
64633266333634356132343462336236623637633539626531363866336230373138333836653566
|
||||
62656231366234626561636564666331313863326266313630623734363132363663663365643666
|
||||
33333033356334333061613539366163653731306639653664336635386130303339303737626338
|
||||
38643630356666363065373734333031633033666530303763663461326135363336653334363933
|
||||
38363336333164363633333431303935333336323237303536363062656237353262383739323063
|
||||
31303662633033353639306634336338616539333932343164383732303437353766623532663232
|
||||
36333961323232663661323439343330393061666661306130633738633331363935396363353533
|
||||
63313965333435633865373137383031333738353263346538363236636639373265306634326266
|
||||
363532356361373037656632383034323936
|
||||
|
@ -0,0 +1,103 @@
|
||||
# mautrix-instagram is a Matrix <-> Instagram bridge
|
||||
# See: https://github.com/tulir/mautrix-instagram
|
||||
|
||||
matrix_mautrix_instagram_enabled: true
|
||||
|
||||
matrix_mautrix_instagram_container_image_self_build: false
|
||||
matrix_mautrix_instagram_container_image_self_build_repo: "https://github.com/tulir/mautrix-instagram.git"
|
||||
|
||||
# See: https://mau.dev/tulir/mautrix-instagram/container_registry
|
||||
matrix_mautrix_instagram_docker_image: "{{ matrix_mautrix_instagram_docker_image_name_prefix }}tulir/mautrix-instagram:latest"
|
||||
matrix_mautrix_instagram_docker_image_name_prefix: "{{ 'localhost/' if matrix_mautrix_instagram_container_image_self_build else 'dock.mau.dev/' }}"
|
||||
matrix_mautrix_instagram_docker_image_force_pull: "{{ matrix_mautrix_instagram_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mautrix_instagram_base_path: "{{ matrix_base_data_path }}/mautrix-instagram"
|
||||
matrix_mautrix_instagram_config_path: "{{ matrix_mautrix_instagram_base_path }}/config"
|
||||
matrix_mautrix_instagram_data_path: "{{ matrix_mautrix_instagram_base_path }}/data"
|
||||
matrix_mautrix_instagram_docker_src_files_path: "{{ matrix_mautrix_instagram_base_path }}/docker-src"
|
||||
|
||||
matrix_mautrix_instagram_homeserver_address: 'http://matrix-synapse:8008'
|
||||
matrix_mautrix_instagram_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mautrix_instagram_appservice_address: 'http://matrix-mautrix-instagram:29330'
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mautrix_instagram_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-mautrix-instagram.service depends on.
|
||||
matrix_mautrix_instagram_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# List of systemd services that matrix-mautrix-instagram.service wants
|
||||
matrix_mautrix_instagram_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mautrix_instagram_appservice_token: ''
|
||||
matrix_mautrix_instagram_homeserver_token: ''
|
||||
|
||||
|
||||
# Database-related configuration fields.
|
||||
#
|
||||
# To use Postgres:
|
||||
# - adjust your database credentials via the `matrix_mautrix_instagram_postgres_*` variables
|
||||
matrix_mautrix_instagram_database_engine: 'postgres'
|
||||
|
||||
matrix_mautrix_instagram_database_username: 'matrix_mautrix_instagram'
|
||||
matrix_mautrix_instagram_database_password: 'some-password'
|
||||
matrix_mautrix_instagram_database_hostname: 'matrix-postgres'
|
||||
matrix_mautrix_instagram_database_port: 5432
|
||||
matrix_mautrix_instagram_database_name: 'matrix_mautrix_instagram'
|
||||
|
||||
matrix_mautrix_instagram_database_connection_string: 'postgres://{{ matrix_mautrix_instagram_database_username }}:{{ matrix_mautrix_instagram_database_password }}@{{ matrix_mautrix_instagram_database_hostname }}:{{ matrix_mautrix_instagram_database_port }}/{{ matrix_mautrix_instagram_database_name }}'
|
||||
|
||||
matrix_mautrix_instagram_appservice_database: "{{
|
||||
{
|
||||
'postgres': matrix_mautrix_instagram_database_connection_string,
|
||||
}[matrix_mautrix_instagram_database_engine]
|
||||
}}"
|
||||
|
||||
|
||||
# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
|
||||
matrix_mautrix_instagram_login_shared_secret: ''
|
||||
|
||||
matrix_mautrix_instagram_bridge_login_shared_secret_map: "{{ {matrix_mautrix_instagram_homeserver_domain: matrix_mautrix_instagram_login_shared_secret} if matrix_mautrix_instagram_login_shared_secret else {} }}"
|
||||
|
||||
matrix_mautrix_instagram_appservice_bot_username: instagrambot
|
||||
|
||||
matrix_mautrix_instagram_bridge_presence: true
|
||||
|
||||
# Default configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
#
|
||||
# For a more advanced customization, you can extend the default (see `matrix_mautrix_instagram_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mautrix_instagram_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mautrix_instagram_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mautrix_instagram_configuration_yaml`).
|
||||
#
|
||||
# You can override individual variables from the default configuration, or introduce new ones.
|
||||
#
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_mautrix_instagram_configuration_yaml`.
|
||||
|
||||
matrix_mautrix_instagram_configuration_extension: "{{ matrix_mautrix_instagram_configuration_extension_yaml|from_yaml if matrix_mautrix_instagram_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_mautrix_instagram_configuration_yaml`.
|
||||
matrix_mautrix_instagram_configuration: "{{ matrix_mautrix_instagram_configuration_yaml|from_yaml|combine(matrix_mautrix_instagram_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mautrix_instagram_registration_yaml: |
|
||||
id: instagram
|
||||
as_token: "{{ matrix_mautrix_instagram_appservice_token }}"
|
||||
hs_token: "{{ matrix_mautrix_instagram_homeserver_token }}"
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '^@instagram_.+:{{ matrix_mautrix_instagram_homeserver_domain|regex_escape }}$'
|
||||
- exclusive: true
|
||||
regex: '^@{{ matrix_mautrix_instagram_appservice_bot_username|regex_escape }}:{{ matrix_mautrix_instagram_homeserver_domain|regex_escape }}$'
|
||||
url: {{ matrix_mautrix_instagram_appservice_address }}
|
||||
# See https://github.com/tulir/mautrix-signal/issues/43
|
||||
sender_localpart: _bot_{{ matrix_mautrix_instagram_appservice_bot_username }}
|
||||
rate_limited: false
|
||||
|
||||
matrix_mautrix_instagram_registration: "{{ matrix_mautrix_instagram_registration_yaml|from_yaml }}"
|
@ -0,0 +1,23 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-instagram.service'] }}"
|
||||
when: matrix_mautrix_instagram_enabled|bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{ matrix_synapse_container_extra_arguments|default([]) }}
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_mautrix_instagram_config_path }}/registration.yaml,dst=/matrix-mautrix-instagram-registration.yaml,ro"]
|
||||
|
||||
matrix_synapse_app_service_config_files: >
|
||||
{{ matrix_synapse_app_service_config_files|default([]) }}
|
||||
+
|
||||
{{ ["/matrix-mautrix-instagram-registration.yaml"] }}
|
||||
when: matrix_mautrix_instagram_enabled|bool
|
||||
|
||||
# ansible lower than 2.8, does not support docker_image build parameters
|
||||
# for self buildig it is explicitly needed, so we rather fail here
|
||||
- name: Fail if running on Ansible lower than 2.8 and trying self building
|
||||
fail:
|
||||
msg: "To self build Mautrix instagram image, you should usa ansible 2.8 or higher. E.g. pip contains such packages."
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_mautrix_instagram_container_image_self_build"
|
@ -0,0 +1,21 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_instagram_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-instagram
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_instagram_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-instagram
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_mautrix_instagram_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-instagram
|
@ -0,0 +1,80 @@
|
||||
---
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
msg: >-
|
||||
The matrix-bridge-mautrix-instagram role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- name: Ensure Mautrix instagram image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_mautrix_instagram_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mautrix_instagram_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_instagram_docker_image_force_pull }}"
|
||||
when: matrix_mautrix_instagram_enabled|bool and not matrix_mautrix_instagram_container_image_self_build
|
||||
|
||||
- name: Ensure Mautrix instagram paths exist
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- { path: "{{ matrix_mautrix_instagram_base_path }}", when: true }
|
||||
- { path: "{{ matrix_mautrix_instagram_config_path }}", when: true }
|
||||
- { path: "{{ matrix_mautrix_instagram_data_path }}", when: true }
|
||||
- {
|
||||
path: "{{ matrix_mautrix_instagram_docker_src_files_path }}",
|
||||
when: "{{ matrix_mautrix_instagram_container_image_self_build }}",
|
||||
}
|
||||
when: item.when|bool
|
||||
|
||||
- name: Ensure Mautrix instagram repository is present on self-build
|
||||
git:
|
||||
repo: "{{ matrix_mautrix_instagram_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
register: matrix_mautrix_instagram_git_pull_results
|
||||
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build"
|
||||
|
||||
- name: Ensure Mautrix instagram Docker image is built
|
||||
docker_image:
|
||||
name: "{{ matrix_mautrix_instagram_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mautrix_instagram_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
|
||||
pull: yes
|
||||
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure mautrix-instagram config.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mautrix_instagram_configuration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mautrix_instagram_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure mautrix-instagram registration.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mautrix_instagram_registration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mautrix_instagram_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-mautrix-instagram.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mautrix-instagram.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-mautrix-instagram.service"
|
||||
mode: 0644
|
||||
register: matrix_mautrix_instagram_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mautrix-instagram.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_instagram_systemd_service_result.changed"
|
@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Check existence of matrix-mautrix-instagram service
|
||||
stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-instagram.service"
|
||||
register: matrix_mautrix_instagram_service_stat
|
||||
|
||||
- name: Ensure matrix-mautrix-instagram is stopped
|
||||
service:
|
||||
name: matrix-mautrix-instagram
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_instagram_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-mautrix-instagram.service doesn't exist
|
||||
file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-instagram.service"
|
||||
state: absent
|
||||
when: "matrix_mautrix_instagram_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mautrix-instagram.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_instagram_service_stat.stat.exists"
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Fail if required settings not defined
|
||||
fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
with_items:
|
||||
- "matrix_mautrix_instagram_appservice_token"
|
||||
- "matrix_mautrix_instagram_homeserver_token"
|
@ -0,0 +1,234 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
# Homeserver details
|
||||
homeserver:
|
||||
# The address that this appservice can use to connect to the homeserver.
|
||||
address: {{ matrix_mautrix_instagram_homeserver_address }}
|
||||
# The domain of the homeserver (for MXIDs, etc).
|
||||
domain: {{ matrix_mautrix_instagram_homeserver_domain }}
|
||||
# Whether or not to verify the SSL certificate of the homeserver.
|
||||
# Only applies if address starts with https://
|
||||
verify_ssl: true
|
||||
# Whether or not the homeserver supports asmux-specific endpoints,
|
||||
# such as /_matrix/client/unstable/net.maunium.asmux/dms for atomically
|
||||
# updating m.direct.
|
||||
asmux: false
|
||||
|
||||
# Application service host/registration related details
|
||||
# Changing these values requires regeneration of the registration.
|
||||
appservice:
|
||||
# The address that the homeserver can use to connect to this appservice.
|
||||
address: {{ matrix_mautrix_instagram_appservice_address }}
|
||||
# When using https:// the TLS certificate and key files for the address.
|
||||
tls_cert: false
|
||||
tls_key: false
|
||||
|
||||
# The hostname and port where this appservice should listen.
|
||||
hostname: 0.0.0.0
|
||||
port: 29330
|
||||
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
|
||||
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
|
||||
max_body_size: 1
|
||||
|
||||
# The full URI to the database. Only Postgres is currently supported.
|
||||
database: {{ matrix_mautrix_instagram_appservice_database|to_json }}
|
||||
# Additional arguments for asyncpg.create_pool()
|
||||
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
|
||||
database_opts:
|
||||
min_size: 5
|
||||
max_size: 10
|
||||
|
||||
# The unique ID of this appservice.
|
||||
id: instagram
|
||||
# Username of the appservice bot.
|
||||
bot_username: {{ matrix_mautrix_instagram_appservice_bot_username|to_json }}
|
||||
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
|
||||
# to leave display name/avatar as-is.
|
||||
bot_displayname: instagram bridge bot
|
||||
bot_avatar: mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv
|
||||
|
||||
# Community ID for bridged users (changes registration file) and rooms.
|
||||
# Must be created manually.
|
||||
#
|
||||
# Example: "+instagram:example.com". Set to false to disable.
|
||||
community_id: false
|
||||
|
||||
# Whether or not to receive ephemeral events via appservice transactions.
|
||||
# Requires MSC2409 support (i.e. Synapse 1.22+).
|
||||
# You should disable bridge -> sync_with_custom_puppets when this is enabled.
|
||||
ephemeral_events: false
|
||||
|
||||
# Authentication tokens for AS <-> HS communication.
|
||||
as_token: "{{ matrix_mautrix_instagram_appservice_token }}"
|
||||
hs_token: "{{ matrix_mautrix_instagram_homeserver_token }}"
|
||||
|
||||
# Prometheus telemetry config. Requires prometheus-client to be installed.
|
||||
metrics:
|
||||
enabled: false
|
||||
listen_port: 8000
|
||||
|
||||
instagram:
|
||||
# Seed for generating devices. This is secret because the seed is used to generate
|
||||
# device IDs, which can apparently be used to bypass two-factor authentication after
|
||||
# logging out, because Instagram is insecure.
|
||||
device_seed: generate
|
||||
|
||||
# Bridge config
|
||||
bridge:
|
||||
# Localpart template of MXIDs for Instagram users.
|
||||
# {userid} is replaced with the user ID of the Instagram user.
|
||||
username_template: "instagram_{userid}"
|
||||
# Displayname template for Instagram users.
|
||||
# {displayname} is replaced with the display name of the Instagram user.
|
||||
# {username} is replaced with the username of the Instagram user.
|
||||
displayname_template: "{username} (Instagram)"
|
||||
|
||||
# Maximum length of displayname
|
||||
displayname_max_length: 100
|
||||
|
||||
# Maximum number of seconds since the last activity in a chat to automatically create portals.
|
||||
portal_create_max_age: 86400
|
||||
# Maximum number of chats to fetch for startup sync
|
||||
chat_sync_limit: 100
|
||||
# Whether or not to use /sync to get read receipts and typing notifications
|
||||
# when double puppeting is enabled
|
||||
sync_with_custom_puppets: true
|
||||
# Whether or not to update the m.direct account data event when double puppeting is enabled.
|
||||
# Note that updating the m.direct event is not atomic (except with mautrix-asmux)
|
||||
# and is therefore prone to race conditions.
|
||||
sync_direct_chat_list: false
|
||||
# Allow using double puppeting from any server with a valid client .well-known file.
|
||||
double_puppet_allow_discovery: false
|
||||
# Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
|
||||
double_puppet_server_map: {}
|
||||
# example.com: https://example.com
|
||||
# Allow using double puppeting from any server with a valid client .well-known file.
|
||||
double_puppet_allow_discovery: false
|
||||
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
|
||||
#
|
||||
# If set, custom puppets will be enabled automatically for local users
|
||||
# instead of users having to find an access token and run `login-matrix`
|
||||
# manually.
|
||||
# If using this for other servers than the bridge's server,
|
||||
# you must also set the URL in the double_puppet_server_map.
|
||||
login_shared_secret_map:
|
||||
{{ matrix_mautrix_instagram_bridge_login_shared_secret_map|to_json }}
|
||||
# Whether or not to update avatars when syncing all contacts at startup.
|
||||
update_avatar_initial_sync: true
|
||||
# Whether or not created rooms should have federation enabled.
|
||||
# If false, created portal rooms will never be federated.
|
||||
federate_rooms: true
|
||||
# Settings for backfilling messages from Instagram.
|
||||
backfill:
|
||||
# Whether or not the Instagram users of logged in Matrix users should be
|
||||
# invited to private chats when backfilling history from Instagram. This is
|
||||
# usually needed to prevent rate limits and to allow timestamp massaging.
|
||||
invite_own_puppet: true
|
||||
# Maximum number of messages to backfill initially.
|
||||
# Set to 0 to disable backfilling when creating portal.
|
||||
initial_limit: 0
|
||||
# Maximum number of messages to backfill if messages were missed while
|
||||
# the bridge was disconnected.
|
||||
# Set to 0 to disable backfilling missed messages.
|
||||
missed_limit: 1000
|
||||
# If using double puppeting, should notifications be disabled
|
||||
# while the initial backfill is in progress?
|
||||
disable_notifications: false
|
||||
periodic_reconnect:
|
||||
# Interval in seconds in which to automatically reconnect all users.
|
||||
# This can be used to automatically mitigate the bug where Instagram stops sending messages.
|
||||
# Set to -1 to disable periodic reconnections entirely.
|
||||
interval: -1
|
||||
# Whether or not the bridge should backfill chats when reconnecting.
|
||||
resync: true
|
||||
# Should even disconnected users be reconnected?
|
||||
always: false
|
||||
# End-to-bridge encryption support options. These require matrix-nio to be installed with pip
|
||||
# and login_shared_secret to be configured in order to get a device for the bridge bot.
|
||||
#
|
||||
# Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
|
||||
# application service.
|
||||
encryption:
|
||||
# Allow encryption, work in group chat rooms with e2ee enabled
|
||||
allow: false
|
||||
# Default to encryption, force-enable encryption in all portals the bridge creates
|
||||
# This will cause the bridge bot to be in private chats for the encryption to work properly.
|
||||
default: false
|
||||
# Options for automatic key sharing.
|
||||
key_sharing:
|
||||
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
|
||||
# You must use a client that supports requesting keys from other users to use this feature.
|
||||
allow: false
|
||||
# Require the requesting device to have a valid cross-signing signature?
|
||||
# This doesn't require that the bridge has verified the device, only that the user has verified it.
|
||||
# Not yet implemented.
|
||||
require_cross_signing: false
|
||||
# Require devices to be verified by the bridge?
|
||||
# Verification by the bridge is not yet implemented.
|
||||
require_verification: true
|
||||
# Whether or not to explicitly set the avatar and room name for private
|
||||
# chat portal rooms. This will be implicitly enabled if encryption.default is true.
|
||||
private_chat_portal_meta: false
|
||||
# Whether or not the bridge should send a read receipt from the bridge bot when a message has
|
||||
# been sent to Instagram.
|
||||
delivery_receipts: false
|
||||
# Whether or not delivery errors should be reported as messages in the Matrix room.
|
||||
delivery_error_reports: false
|
||||
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
|
||||
# This field will automatically be changed back to false after it,
|
||||
# except if the config file is not writable.
|
||||
resend_bridge_info: false
|
||||
# Whether or not unimportant bridge notices should be sent to the user.
|
||||
# (e.g. connected, disconnected but will retry)
|
||||
unimportant_bridge_notices: true
|
||||
|
||||
# The prefix for commands. Only required in non-management rooms.
|
||||
command_prefix: "!ig"
|
||||
# Permissions for using the bridge.
|
||||
# Permitted values:
|
||||
# user - Use the bridge with puppeting.
|
||||
# admin - Use and administrate the bridge.
|
||||
# Permitted keys:
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
permissions:
|
||||
"{{ matrix_mautrix_instagram_homeserver_domain }}": user
|
||||
# Provisioning API part of the web server for automated portal creation and fetching information.
|
||||
# Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
|
||||
provisioning:
|
||||
# Whether or not the provisioning API should be enabled.
|
||||
enabled: true
|
||||
# The prefix to use in the provisioning API endpoints.
|
||||
prefix: /_matrix/provision/v1
|
||||
# The shared secret to authorize users of the API.
|
||||
# Set to "generate" to generate and save a new token.
|
||||
shared_secret: generate
|
||||
|
||||
# Python logging configuration.
|
||||
#
|
||||
# See section 16.7.2 of the Python documentation for more info:
|
||||
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
|
||||
logging:
|
||||
version: 1
|
||||
formatters:
|
||||
colored:
|
||||
(): mautrix_instagram.util.ColorFormatter
|
||||
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
|
||||
normal:
|
||||
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
|
||||
handlers:
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
formatter: colored
|
||||
loggers:
|
||||
mau:
|
||||
level: DEBUG
|
||||
mauigpapi:
|
||||
level: DEBUG
|
||||
paho:
|
||||
level: INFO
|
||||
aiohttp:
|
||||
level: INFO
|
||||
root:
|
||||
level: DEBUG
|
||||
handlers: [console]
|
@ -0,0 +1,42 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix Mautrix Instagram bridge
|
||||
{% for service in matrix_mautrix_instagram_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mautrix_instagram_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mautrix-instagram 2>/dev/null'
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-instagram 2>/dev/null'
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre={{ matrix_host_command_sleep }} 5
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-instagram \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-v {{ matrix_mautrix_instagram_config_path }}:/config:z \
|
||||
-v {{ matrix_mautrix_instagram_data_path }}:/data:z \
|
||||
{% for arg in matrix_mautrix_instagram_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mautrix_instagram_docker_image }} \
|
||||
python3 -m mautrix_instagram -c /config/config.yaml --no-update
|
||||
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mautrix-instagram 2>/dev/null'
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-instagram 2>/dev/null'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mautrix-instagram
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,110 @@
|
||||
# Mx Puppet GroupMe is a Matrix <-> GroupMe bridge
|
||||
# See: https://gitlab.com/robintown/mx-puppet-groupme
|
||||
|
||||
matrix_mx_puppet_groupme_enabled: true
|
||||
|
||||
matrix_mx_puppet_groupme_container_image_self_build: false
|
||||
matrix_mx_puppet_groupme_container_image_self_build_repo: "https://gitlab.com/robintown/mx-puppet-groupme"
|
||||
|
||||
# Controls whether the mx-puppet-groupme container exposes its HTTP port (tcp/8437 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8437"), or empty string to not expose.
|
||||
matrix_mx_puppet_groupme_container_http_host_bind_port: ''
|
||||
|
||||
matrix_mx_puppet_groupme_docker_image: "{{ matrix_mx_puppet_groupme_docker_image_name_prefix }}xangelix/mx-puppet-groupme:latest"
|
||||
matrix_mx_puppet_groupme_docker_image_name_prefix: "{{ 'localhost/' if matrix_mx_puppet_groupme_container_image_self_build else 'docker.io/' }}"
|
||||
matrix_mx_puppet_groupme_docker_image_force_pull: "{{ matrix_mx_puppet_groupme_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mx_puppet_groupme_base_path: "{{ matrix_base_data_path }}/mx-puppet-groupme"
|
||||
matrix_mx_puppet_groupme_config_path: "{{ matrix_mx_puppet_groupme_base_path }}/config"
|
||||
matrix_mx_puppet_groupme_data_path: "{{ matrix_mx_puppet_groupme_base_path }}/data"
|
||||
matrix_mx_puppet_groupme_docker_src_files_path: "{{ matrix_mx_puppet_groupme_base_path }}/docker-src"
|
||||
|
||||
matrix_mx_puppet_groupme_appservice_port: "8437"
|
||||
|
||||
matrix_mx_puppet_groupme_homeserver_address: 'http://matrix-synapse:8008'
|
||||
matrix_mx_puppet_groupme_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mx_puppet_groupme_appservice_address: 'http://matrix-mx-puppet-groupme:{{ matrix_mx_puppet_groupme_appservice_port }}'
|
||||
|
||||
matrix_mx_puppet_groupme_client_id: ''
|
||||
matrix_mx_puppet_groupme_client_secret: ''
|
||||
|
||||
# "@user:server.com" to allow specific user
|
||||
# "@.*:yourserver.com" to allow users on a specific homeserver
|
||||
# "@.*" to allow anyone
|
||||
matrix_mx_puppet_groupme_provisioning_whitelist:
|
||||
- "@.*:{{ matrix_domain|regex_escape }}"
|
||||
|
||||
# Leave empty to disable blacklist
|
||||
# "@user:server.com" disallow a specific user
|
||||
# "@.*:yourserver.com" disallow users on a specific homeserver
|
||||
matrix_mx_puppet_groupme_provisioning_blacklist: []
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mx_puppet_groupme_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-puppet-groupme.service depends on.
|
||||
matrix_mx_puppet_groupme_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# List of systemd services that matrix-puppet-groupme.service wants
|
||||
matrix_mx_puppet_groupme_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mx_puppet_groupme_appservice_token: ''
|
||||
matrix_mx_puppet_groupme_homeserver_token: ''
|
||||
|
||||
# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
|
||||
matrix_mx_puppet_groupme_login_shared_secret: ''
|
||||
|
||||
matrix_mx_puppet_groupme_database_engine: sqlite
|
||||
|
||||
matrix_mx_puppet_groupme_sqlite_database_path_local: "{{ matrix_mx_puppet_groupme_data_path }}/database.db"
|
||||
matrix_mx_puppet_groupme_sqlite_database_path_in_container: "/data/database.db"
|
||||
|
||||
matrix_mx_puppet_groupme_database_username: matrix_mx_puppet_groupme
|
||||
matrix_mx_puppet_groupme_database_password: ~
|
||||
matrix_mx_puppet_groupme_database_hostname: 'matrix-postgres'
|
||||
matrix_mx_puppet_groupme_database_port: 5432
|
||||
matrix_mx_puppet_groupme_database_name: matrix_mx_puppet_groupme
|
||||
|
||||
matrix_mx_puppet_groupme_database_connection_string: 'postgresql://{{ matrix_mx_puppet_groupme_database_username }}:{{ matrix_mx_puppet_groupme_database_password }}@{{ matrix_mx_puppet_groupme_database_hostname }}:{{ matrix_mx_puppet_groupme_database_port }}/{{ matrix_mx_puppet_groupme_database_name }}?sslmode=disable'
|
||||
|
||||
# Default configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
#
|
||||
# For a more advanced customization, you can extend the default (see `matrix_mx_puppet_groupme_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mx_puppet_groupme_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mx_puppet_groupme_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mx_puppet_groupme_configuration_yaml`).
|
||||
#
|
||||
# You can override individual variables from the default configuration, or introduce new ones.
|
||||
#
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_mx_puppet_groupme_configuration_yaml`.
|
||||
|
||||
matrix_mx_puppet_groupme_configuration_extension: "{{ matrix_mx_puppet_groupme_configuration_extension_yaml|from_yaml if matrix_mx_puppet_groupme_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_mx_puppet_groupme_configuration_yaml`.
|
||||
matrix_mx_puppet_groupme_configuration: "{{ matrix_mx_puppet_groupme_configuration_yaml|from_yaml|combine(matrix_mx_puppet_groupme_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mx_puppet_groupme_registration_yaml: |
|
||||
as_token: "{{ matrix_mx_puppet_groupme_appservice_token }}"
|
||||
hs_token: "{{ matrix_mx_puppet_groupme_homeserver_token }}"
|
||||
id: groupme-puppet
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@_groupmepuppet_.*:{{ matrix_mx_puppet_groupme_homeserver_domain|regex_escape }}'
|
||||
rooms: []
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '#_groupmepuppet_.*:{{ matrix_mx_puppet_groupme_homeserver_domain|regex_escape }}'
|
||||
protocols: []
|
||||
rate_limited: false
|
||||
sender_localpart: _groupmepuppet_bot
|
||||
url: {{ matrix_mx_puppet_groupme_appservice_address }}
|
||||
|
||||
matrix_mx_puppet_groupme_registration: "{{ matrix_mx_puppet_groupme_registration_yaml|from_yaml }}"
|
@ -0,0 +1,23 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mx-puppet-groupme.service'] }}"
|
||||
when: matrix_mx_puppet_groupme_enabled|bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{ matrix_synapse_container_extra_arguments|default([]) }}
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_mx_puppet_groupme_config_path }}/registration.yaml,dst=/matrix-mx-puppet-groupme-registration.yaml,ro"]
|
||||
|
||||
matrix_synapse_app_service_config_files: >
|
||||
{{ matrix_synapse_app_service_config_files|default([]) }}
|
||||
+
|
||||
{{ ["/matrix-mx-puppet-groupme-registration.yaml"] }}
|
||||
when: matrix_mx_puppet_groupme_enabled|bool
|
||||
|
||||
# ansible lower than 2.8, does not support docker_image build parameters
|
||||
# for self buildig it is explicitly needed, so we rather fail here
|
||||
- name: Fail if running on Ansible lower than 2.8 and trying self building
|
||||
fail:
|
||||
msg: "To self build Puppet Slack image, you should usa ansible 2.8 or higher. E.g. pip contains such packages."
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_mx_puppet_groupme_container_image_self_build"
|
@ -0,0 +1,21 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_mx_puppet_groupme_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-groupme
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_mx_puppet_groupme_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-groupme
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_mx_puppet_groupme_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-groupme
|
@ -0,0 +1,127 @@
|
||||
---
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
msg: >-
|
||||
The matrix-bridge-mx-puppet-groupme role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- name: Ensure MX Puppet Groupme paths exist
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- { path: "{{ matrix_mx_puppet_groupme_base_path }}", when: true }
|
||||
- { path: "{{ matrix_mx_puppet_groupme_config_path }}", when: true }
|
||||
- { path: "{{ matrix_mx_puppet_groupme_data_path }}", when: true }
|
||||
- { path: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}", when: "{{ matrix_mx_puppet_groupme_container_image_self_build }}" }
|
||||
when: matrix_mx_puppet_groupme_enabled|bool and item.when|bool
|
||||
|
||||
- name: Check if an old database file already exists
|
||||
stat:
|
||||
path: "{{ matrix_mx_puppet_groupme_base_path }}/database.db"
|
||||
register: matrix_mx_puppet_groupme_stat_database
|
||||
|
||||
- name: (Data relocation) Ensure matrix-mx-puppet-groupme.service is stopped
|
||||
service:
|
||||
name: matrix-mx-puppet-groupme
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
failed_when: false
|
||||
when: "matrix_mx_puppet_groupme_stat_database.stat.exists"
|
||||
|
||||
- name: (Data relocation) Move mx-puppet-groupme database file to ./data directory
|
||||
command: "mv {{ matrix_mx_puppet_groupme_base_path }}/database.db {{ matrix_mx_puppet_groupme_data_path }}/database.db"
|
||||
when: "matrix_mx_puppet_groupme_stat_database.stat.exists"
|
||||
|
||||
- set_fact:
|
||||
matrix_mx_puppet_groupme_requires_restart: false
|
||||
|
||||
- block:
|
||||
- name: Check if an SQLite database already exists
|
||||
stat:
|
||||
path: "{{ matrix_mx_puppet_groupme_sqlite_database_path_local }}"
|
||||
register: matrix_mx_puppet_groupme_sqlite_database_path_local_stat_result
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_mx_puppet_groupme_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mx_puppet_groupme_database_connection_string }}"
|
||||
caller: "{{ role_path|basename }}"
|
||||
engine_variable_name: 'matrix_mx_puppet_groupme_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mx-puppet-groupme.service']
|
||||
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
|
||||
- set_fact:
|
||||
matrix_mx_puppet_groupme_requires_restart: true
|
||||
when: "matrix_mx_puppet_groupme_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_mx_puppet_groupme_database_engine == 'postgres'"
|
||||
|
||||
- name: Ensure MX Puppet Groupme image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_mx_puppet_groupme_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mx_puppet_groupme_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mx_puppet_groupme_docker_image_force_pull }}"
|
||||
when: matrix_mx_puppet_groupme_enabled|bool and not matrix_mx_puppet_groupme_container_image_self_build
|
||||
|
||||
- name: Ensure MX Puppet Groupme repository is present on self build
|
||||
git:
|
||||
repo: "{{ matrix_mx_puppet_groupme_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
register: matrix_mx_puppet_groupme_git_pull_results
|
||||
when: "matrix_mx_puppet_groupme_enabled|bool and matrix_mx_puppet_groupme_container_image_self_build"
|
||||
|
||||
- name: Ensure MX Puppet Groupme Docker image is built
|
||||
docker_image:
|
||||
name: "{{ matrix_mx_puppet_groupme_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mx_puppet_groupme_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}"
|
||||
pull: yes
|
||||
when: "matrix_mx_puppet_groupme_enabled|bool and matrix_mx_puppet_groupme_container_image_self_build"
|
||||
|
||||
- name: Ensure mx-puppet-groupme config.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mx_puppet_groupme_configuration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mx_puppet_groupme_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure mx-puppet-groupme groupme-registration.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mx_puppet_groupme_registration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mx_puppet_groupme_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-groupme.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-groupme.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-mx-puppet-groupme.service"
|
||||
mode: 0644
|
||||
register: matrix_mx_puppet_groupme_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mx-puppet-groupme.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mx_puppet_groupme_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-groupme.service restarted, if necessary
|
||||
service:
|
||||
name: "matrix-mx-puppet-groupme.service"
|
||||
state: restarted
|
||||
when: "matrix_mx_puppet_groupme_requires_restart|bool"
|
@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mx-puppet-groupme service
|
||||
stat:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-groupme.service"
|
||||
register: matrix_mx_puppet_groupme_service_stat
|
||||
|
||||
- name: Ensure matrix-mx-puppet-groupme is stopped
|
||||
service:
|
||||
name: matrix-mx-puppet-groupme
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
when: "matrix_mx_puppet_groupme_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-groupme.service doesn't exist
|
||||
file:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-groupme.service"
|
||||
state: absent
|
||||
when: "matrix_mx_puppet_groupme_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mx-puppet-groupme.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mx_puppet_groupme_service_stat.stat.exists"
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
with_items:
|
||||
- "matrix_mx_puppet_groupme_appservice_token"
|
||||
- "matrix_mx_puppet_groupme_homeserver_token"
|
@ -0,0 +1,86 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
bridge:
|
||||
# Port to host the bridge on
|
||||
# Used for communication between the homeserver and the bridge
|
||||
port: {{ matrix_mx_puppet_groupme_appservice_port }}
|
||||
# The host connections to the bridge's webserver are allowed from
|
||||
bindAddress: 0.0.0.0
|
||||
# Public domain of the homeserver
|
||||
domain: {{ matrix_mx_puppet_groupme_homeserver_domain }}
|
||||
# Reachable URL of the Matrix homeserver
|
||||
homeserverUrl: {{ matrix_mx_puppet_groupme_homeserver_address }}
|
||||
{% if matrix_mx_puppet_groupme_login_shared_secret != '' %}
|
||||
loginSharedSecretMap:
|
||||
{{ matrix_domain }}: {{ matrix_mx_puppet_groupme_login_shared_secret }}
|
||||
{% endif %}
|
||||
# Display name of the bridge bot
|
||||
displayname: GroupMe Puppet Bridge
|
||||
# Optionally specify a different media URL used for the media store
|
||||
#
|
||||
# This is where GroupMe will download user profile pictures and media
|
||||
# from
|
||||
#mediaUrl: https://external-url.org
|
||||
|
||||
presence:
|
||||
# Bridge GroupMe online/offline status
|
||||
enabled: true
|
||||
# How often to send status to the homeserver in milliseconds
|
||||
interval: 5000
|
||||
|
||||
provisioning:
|
||||
# Regex of Matrix IDs allowed to use the puppet bridge
|
||||
whitelist: {{ matrix_mx_puppet_groupme_provisioning_whitelist|to_json }}
|
||||
# Allow a specific user
|
||||
#- "@user:server\\.com"
|
||||
# Allow users on a specific homeserver
|
||||
#- "@.*:yourserver\\.com"
|
||||
# Allow anyone
|
||||
#- ".*"
|
||||
# Regex of Matrix IDs forbidden from using the puppet bridge
|
||||
#blacklist:
|
||||
# Disallow a specific user
|
||||
#- "@user:server\\.com"
|
||||
# Disallow users on a specific homeserver
|
||||
#- "@.*:yourserver\\.com"
|
||||
blacklist: {{ matrix_mx_puppet_groupme_provisioning_blacklist|to_json }}
|
||||
|
||||
relay:
|
||||
# Regex of Matrix IDs who are allowed to use the bridge in relay mode.
|
||||
# Relay mode is when a single GroupMe bot account relays messages of
|
||||
# multiple Matrix users
|
||||
#
|
||||
# Same format as in provisioning
|
||||
whitelist: {{ matrix_mx_puppet_groupme_provisioning_whitelist|to_json }}
|
||||
blacklist: {{ matrix_mx_puppet_groupme_provisioning_blacklist|to_json }}
|
||||
|
||||
selfService:
|
||||
# Regex of Matrix IDs who are allowed to use bridge self-servicing (plumbed rooms)
|
||||
#
|
||||
# Same format as in provisioning
|
||||
whitelist: {{ matrix_mx_puppet_groupme_provisioning_whitelist|to_json }}
|
||||
blacklist: {{ matrix_mx_puppet_groupme_provisioning_blacklist|to_json }}
|
||||
|
||||
database:
|
||||
{% if matrix_mx_puppet_groupme_database_engine == 'postgres' %}
|
||||
# Use Postgres as a database backend
|
||||
# If set, will be used instead of SQLite3
|
||||
# Connection string to connect to the Postgres instance
|
||||
# with username "user", password "pass", host "localhost" and database name "dbname".
|
||||
# Modify each value as necessary
|
||||
connString: {{ matrix_mx_puppet_groupme_database_connection_string|to_json }}
|
||||
{% else %}
|
||||
# Use SQLite3 as a database backend
|
||||
# The name of the database file
|
||||
filename: {{ matrix_mx_puppet_groupme_sqlite_database_path_in_container|to_json }}
|
||||
{% endif %}
|
||||
|
||||
logging:
|
||||
# Log level of console output
|
||||
# Allowed values starting with most verbose:
|
||||
# silly, debug, verbose, info, warn, error
|
||||
console: info
|
||||
# Date and time formatting
|
||||
lineDateFormat: MMM-D HH:mm:ss.SSS
|
||||
# Logging files
|
||||
# Log files are rotated daily by default
|
||||
files: []
|
@ -0,0 +1,43 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix Mx Puppet Groupme bridge
|
||||
{% for service in matrix_mx_puppet_groupme_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mx_puppet_groupme_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mx-puppet-groupme 2>/dev/null'
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mx-puppet-groupme 2>/dev/null'
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre={{ matrix_host_command_sleep }} 5
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mx-puppet-groupme \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-e CONFIG_PATH=/config/config.yaml \
|
||||
-e REGISTRATION_PATH=/config/registration.yaml \
|
||||
-v {{ matrix_mx_puppet_groupme_config_path }}:/config:z \
|
||||
-v {{ matrix_mx_puppet_groupme_data_path }}:/data:z \
|
||||
{% for arg in matrix_mx_puppet_groupme_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mx_puppet_groupme_docker_image }}
|
||||
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mx-puppet-groupme 2>/dev/null'
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mx-puppet-groupme 2>/dev/null'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mx-puppet-groupme
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue