mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-01-31 08:53:25 +03:00
Compare commits
7 Commits
fba4ee598a
...
3c587f25af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c587f25af | ||
|
|
32eeab7c42 | ||
|
|
4f6293ecb8 | ||
|
|
2b7a0453eb | ||
|
|
4d465a9d92 | ||
|
|
d3858ed079 | ||
|
|
0579e14d6b |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,23 @@
|
||||
# 2025-11-05
|
||||
|
||||
## The MX Puppet bridges for Discord, Instagram, Slack, and Twitter have been removed from the playbook
|
||||
|
||||
The MX Puppet bridges for Discord, Instagram, Slack, and Twitter have been removed from the playbook, as they have been unmaintained for more than several years and do not support important features like authenticated media. See [this issue](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3867) for the context.
|
||||
|
||||
The playbook will let you know if you're using any variables for those bridges:
|
||||
|
||||
- `matrix_mx_puppet_discord_*`
|
||||
- `matrix_mx_puppet_instagram_*`
|
||||
- `matrix_mx_puppet_slack_*`
|
||||
- `matrix_mx_puppet_twitter_*`
|
||||
|
||||
You'll need to remove them from `vars.yml` and potentially uninstall them manually. Consult pages below for details:
|
||||
|
||||
- [Instruction for MX Puppet Discord bridge](./docs/configuring-playbook-bridge-mx-puppet-discord.md#uninstalling-the-bridge-manually)
|
||||
- [Instruction for MX Puppet Instagram bridge](./docs/configuring-playbook-bridge-mx-puppet-instagram.md#uninstalling-the-bridge-manually)
|
||||
- [Instruction for MX Puppet Slack bridge](./docs/configuring-playbook-bridge-mx-puppet-slack.md#uninstalling-the-bridge-manually)
|
||||
- [Instruction for MX Puppet Twitter bridge](./docs/configuring-playbook-bridge-mx-puppet-twitter.md#uninstalling-the-bridge-manually)
|
||||
|
||||
# 2025-11-04
|
||||
|
||||
## The Go Skype bridge has been removed from the playbook
|
||||
|
||||
@@ -135,10 +135,6 @@ Bridges can be used to connect your Matrix installation with third-party communi
|
||||
| [matrix-steam-bridge](https://github.com/jasonlaguidice/matrix-steam-bridge) | ❌ | Bridge to [Steam](https://steampowered.com/) | [Link](docs/configuring-playbook-bridge-steam.md) |
|
||||
| [matrix-wechat](https://github.com/duo/matrix-wechat) | ❌ | Bridge to [WeChat](https://www.wechat.com/) | [Link](docs/configuring-playbook-bridge-wechat.md) |
|
||||
| [Heisenbridge](https://github.com/hifi/heisenbridge) | ❌ | Bouncer-style bridge to [IRC](https://wikipedia.org/wiki/Internet_Relay_Chat) | [Link](docs/configuring-playbook-bridge-heisenbridge.md) |
|
||||
| [mx-puppet-slack](https://gitlab.com/mx-puppet/slack/mx-puppet-slack) | ❌ | Bridge to [Slack](https://slack.com) | [Link](docs/configuring-playbook-bridge-mx-puppet-slack.md) |
|
||||
| [mx-puppet-instagram](https://github.com/Sorunome/mx-puppet-instagram) | ❌ | Bridge for Instagram-DMs ([Instagram](https://www.instagram.com/)) | [Link](docs/configuring-playbook-bridge-mx-puppet-instagram.md) |
|
||||
| [mx-puppet-twitter](https://github.com/Sorunome/mx-puppet-twitter) | ❌ | Bridge for Twitter-DMs ([Twitter](https://twitter.com/)) | [Link](docs/configuring-playbook-bridge-mx-puppet-twitter.md) |
|
||||
| [mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord) | ❌ | Bridge to [Discord](https://discordapp.com/) | [Link](docs/configuring-playbook-bridge-mx-puppet-discord.md) |
|
||||
| [mx-puppet-groupme](https://gitlab.com/xangelix-pub/matrix/mx-puppet-groupme) | ❌ | Bridge to [GroupMe](https://groupme.com/) | [Link](docs/configuring-playbook-bridge-mx-puppet-groupme.md) |
|
||||
| [mx-puppet-steam](https://codeberg.org/icewind/mx-puppet-steam) | ❌ | Bridge to [Steam](https://steamapp.com/) | [Link](docs/configuring-playbook-bridge-mx-puppet-steam.md) |
|
||||
| [Postmoogle](https://github.com/etkecc/postmoogle) | ❌ | Email to Matrix bridge | [Link](docs/configuring-playbook-bridge-postmoogle.md) |
|
||||
|
||||
@@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Setting up Appservice Discord bridging (optional)
|
||||
|
||||
**Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [mx-puppet-discord](configuring-playbook-bridge-mx-puppet-discord.md) and [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridges supported by the playbook.
|
||||
**Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridge supported by the playbook.
|
||||
- For using as a Bot we are recommend the Appservice Discord bridge (the one being discussed here), because it supports plumbing.
|
||||
- For personal use we recommend the [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridge, because it is the most fully-featured and stable of the 3 Discord bridges supported by the playbook.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Setting up Appservice Slack bridging (optional)
|
||||
|
||||
**Notes**:
|
||||
- Bridging to [Slack](https://slack.com) can also happen via the [mx-puppet-slack](configuring-playbook-bridge-mx-puppet-slack.md) and [mautrix-slack](configuring-playbook-bridge-mautrix-slack.md) bridges supported by the playbook.
|
||||
- Bridging to [Slack](https://slack.com) can also happen via the [mautrix-slack](configuring-playbook-bridge-mautrix-slack.md) bridge supported by the playbook.
|
||||
- Currently (as of November, 2024) **this component is not available for new installation unless you have already created a classic Slack application** (which the bridge makes use of in order to enable bridging between Slack and Matrix), because the creation of classic Slack applications has been discontinued since June 4 2024. The author of the bridge claims [here](https://github.com/matrix-org/matrix-appservice-slack/issues/789#issuecomment-2172947787) that he plans to support the modern Slack application and until then "the best (and only) option for new installations is to use the webhook bridging".
|
||||
|
||||
The playbook can install and configure [matrix-appservice-slack](https://github.com/matrix-org/matrix-appservice-slack) for you.
|
||||
|
||||
@@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
<sup>Refer the common guide for configuring mautrix bridges: [Setting up a Generic Mautrix Bridge](configuring-playbook-bridge-mautrix-bridges.md)</sup>
|
||||
|
||||
**Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [mx-puppet-discord](configuring-playbook-bridge-mx-puppet-discord.md) and [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md) bridges supported by the playbook.
|
||||
**Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md) bridge supported by the playbook.
|
||||
- For using as a Bot we recommend the [Appservice Discord](configuring-playbook-bridge-appservice-discord.md), because it supports plumbing.
|
||||
- For personal use with a discord account we recommend the `mautrix-discord` bridge (the one being discussed here), because it is the most fully-featured and stable of the 3 Discord bridges supported by the playbook.
|
||||
|
||||
@@ -26,7 +26,7 @@ See the project's [documentation](https://docs.mau.fi/bridges/go/discord/index.h
|
||||
|
||||
There are 2 ways to login to discord using this bridge, either by [scanning a QR code](#method-1-login-using-qr-code-recommended) using the Discord mobile app **or** by using a [Discord token](#method-2-login-using-discord-token-not-recommended).
|
||||
|
||||
If this is a dealbreaker for you, consider using one of the other Discord bridges supported by the playbook: [mx-puppet-discord](configuring-playbook-bridge-mx-puppet-discord.md) or [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md). These come with their own complexity and limitations, however, so we recommend that you proceed with this one if possible.
|
||||
If this is a dealbreaker for you, consider using [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md). This comes with its own complexity and limitations, however, so we recommend that you proceed with this one if possible.
|
||||
|
||||
### Enable Appservice Double Puppet or Shared Secret Auth (optional)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
<sup>Refer the common guide for configuring mautrix bridges: [Setting up a Generic Mautrix Bridge](configuring-playbook-bridge-mautrix-bridges.md)</sup>
|
||||
|
||||
**Note**: bridging to [Slack](https://slack.com/) can also happen via the [mx-puppet-slack](configuring-playbook-bridge-mx-puppet-slack.md) and [matrix-appservice-slack](configuring-playbook-bridge-appservice-slack.md) bridges supported by the playbook.
|
||||
**Note**: bridging to [Slack](https://slack.com/) can also happen via the [matrix-appservice-slack](configuring-playbook-bridge-appservice-slack.md) bridge supported by the playbook.
|
||||
- For using as a Bot we recommend the [Appservice Slack](configuring-playbook-bridge-appservice-slack.md), because it supports plumbing. Note that it is not available for new installation unless you have already created a classic Slack application, because the creation of classic Slack applications, which this bridge makes use of, has been discontinued.
|
||||
- For personal use with a slack account we recommend the `mautrix-slack` bridge (the one being discussed here), because it is the most fully-featured and stable of the 3 Slack bridges supported by the playbook.
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
<sup>Refer the common guide for configuring mautrix bridges: [Setting up a Generic Mautrix Bridge](configuring-playbook-bridge-mautrix-bridges.md)</sup>
|
||||
|
||||
**Note**: bridging to [Twitter](https://twitter.com/) can also happen via the [mx-puppet-twitter](configuring-playbook-bridge-mx-puppet-twitter.md) bridge supported by the playbook.
|
||||
|
||||
The playbook can install and configure [mautrix-twitter](https://github.com/mautrix/twitter) for you.
|
||||
|
||||
See the project's [documentation](https://github.com/mautrix/twitter/blob/master/README.md) to learn what it does and why it might be useful to you.
|
||||
|
||||
@@ -1,51 +1,31 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2020 - 2022 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 Eduardo Beltrame
|
||||
SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
SPDX-FileCopyrightText: 2021 - 2022 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Dennis Ciba
|
||||
SPDX-FileCopyrightText: 2022 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Vladimir Panteleev
|
||||
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
# Setting up MX Puppet Discord bridging (optional)
|
||||
# Setting up MX Puppet Discord bridging (optional, removed)
|
||||
|
||||
**Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md)and [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridges supported by the playbook.
|
||||
- For using as a Bot we recommend the [Appservice Discord](configuring-playbook-bridge-appservice-discord.md), because it supports plumbing.
|
||||
- For personal use with a discord account we recommend the [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridge, because it is the most fully-featured and stable of the 3 Discord bridges supported by the playbook.
|
||||
🪦 The playbook used to be able to install and configure [mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord), but no longer includes this component, as it has been unmaintained for a long time.
|
||||
|
||||
The playbook can install and configure [mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord) for you.
|
||||
You may wish to use the [Mautrix Discord bridge](https://github.com/mautrix/discord) instead.
|
||||
|
||||
See the project's [documentation](https://gitlab.com/mx-puppet/discord/mx-puppet-discord/blob/master/README.md) to learn what it does and why it might be useful to you.
|
||||
## Uninstalling the bridge manually
|
||||
|
||||
## Adjusting the playbook configuration
|
||||
If you still have the MX Puppet Discord bridge installed on your Matrix server, the playbook can no longer help you uninstall it and you will need to do it manually. To uninstall manually, run these commands on the server:
|
||||
|
||||
To enable the [Discord](https://discordapp.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_mx_puppet_discord_enabled: true
|
||||
```
|
||||
|
||||
## Installing
|
||||
|
||||
After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below:
|
||||
|
||||
<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
|
||||
```sh
|
||||
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
|
||||
systemctl disable --now matrix-mx-puppet-discord.service
|
||||
|
||||
rm -rf /matrix/mx-puppet-discord
|
||||
|
||||
/matrix/postgres/bin/cli-non-interactive 'DROP DATABASE matrix_mx_puppet_discord;'
|
||||
```
|
||||
|
||||
The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`
|
||||
|
||||
`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.
|
||||
|
||||
## Usage
|
||||
|
||||
To use the bridge, you need to start a chat with `Discord Puppet Bridge` with the handle `@_discordpuppet_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
|
||||
|
||||
Three authentication methods are available, Legacy Token, OAuth and xoxc token. See mx-puppet-discord [documentation](https://gitlab.com/mx-puppet/discord/mx-puppet-discord) for more information about how to configure the bridge.
|
||||
|
||||
Once logged in, send `list` 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.
|
||||
|
||||
Send `help` to the bot to see the available commands.
|
||||
|
||||
@@ -1,51 +1,30 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 Eduardo Beltrame
|
||||
SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
SPDX-FileCopyrightText: 2021 - 2022 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Dennis Ciba
|
||||
SPDX-FileCopyrightText: 2022 Vladimir Panteleev
|
||||
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
# Setting up MX Puppet Instagram bridging (optional)
|
||||
# Setting up MX Puppet Instagram bridging (optional, removed)
|
||||
|
||||
The playbook can install and configure [mx-puppet-instagram](https://github.com/Sorunome/mx-puppet-instagram) for you.
|
||||
🪦 The playbook used to be able to install and configure [mx-puppet-instagram](https://gitlab.com/mx-puppet/instagram/mx-puppet-instagram), but no longer includes this component, as it has been unmaintained for a long time.
|
||||
|
||||
This allows you to bridge Instagram DirectMessages into Matrix.
|
||||
You may wish to use the [Mautrix Meta](https://github.com/mautrix/meta) Messenger/Instagram bridge instead.
|
||||
|
||||
## Adjusting the playbook configuration
|
||||
## Uninstalling the bridge manually
|
||||
|
||||
To enable the [Instagram](https://www.instagram.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
If you still have the MX Puppet Instagram bridge installed on your Matrix server, the playbook can no longer help you uninstall it and you will need to do it manually. To uninstall manually, run these commands on the server:
|
||||
|
||||
```yaml
|
||||
matrix_mx_puppet_instagram_enabled: true
|
||||
```
|
||||
|
||||
## Installing
|
||||
|
||||
After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below:
|
||||
|
||||
<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
|
||||
```sh
|
||||
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
|
||||
systemctl disable --now matrix-mx-puppet-instagram.service
|
||||
|
||||
rm -rf /matrix/mx-puppet-instagram
|
||||
|
||||
/matrix/postgres/bin/cli-non-interactive 'DROP DATABASE matrix_mx_puppet_instagram;'
|
||||
```
|
||||
|
||||
The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`
|
||||
|
||||
`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.
|
||||
|
||||
## Usage
|
||||
|
||||
To use the bridge, you need to start a chat with `Instagram Puppet Bridge` with the handle `@_instagrampuppet_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
|
||||
|
||||
Send `link <username> <password>` to the bridge bot to link your instagram account.
|
||||
|
||||
The `list` commands shows which accounts are linked and which `puppetId` is associated.
|
||||
|
||||
For double-puppeting, you probably want to issue these commands:
|
||||
|
||||
- `settype $puppetId puppet` to enable puppeting for the link (instead of relaying)
|
||||
- `setautoinvite $puppetId 1` to automatically invite you to chats
|
||||
- `setmatrixtoken $accessToken` to set the access token to enable puppeting from the other side (the "double" in double puppeting)
|
||||
|
||||
If you are linking only one Instagram account, your `$puppetId` is probably 1, but use the `list` command find out.
|
||||
|
||||
Send `help` to the bot to see the available commands. At the time of writing, not every command is fully implemented.
|
||||
|
||||
@@ -1,58 +1,33 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2020 - 2023 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 Eduardo Beltrame
|
||||
SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
SPDX-FileCopyrightText: 2021 Marcel Ackermann
|
||||
SPDX-FileCopyrightText: 2021 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Dennis Ciba
|
||||
SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
SPDX-FileCopyrightText: 2022 Vladimir Panteleev
|
||||
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
# Setting up MX Puppet Slack bridging (optional)
|
||||
# Setting up MX Puppet Slack bridging (optional, removed)
|
||||
|
||||
**Note**: bridging to [Slack](https://slack.com) can also happen via the [matrix-appservice-slack](configuring-playbook-bridge-appservice-slack.md) and [mautrix-slack](configuring-playbook-bridge-mautrix-slack.md) bridges supported by the playbook. Note that `matrix-appservice-slack` is not available for new installation unless you have already created a classic Slack application, because the creation of classic Slack applications, which this bridge makes use of, has been discontinued.
|
||||
🪦 The playbook used to be able to install and configure [mx-puppet-slack](https://gitlab.com/mx-puppet/slack/mx-puppet-slack), but no longer includes this component, as it has been unmaintained for a long time.
|
||||
|
||||
The playbook can install and configure [mx-puppet-slack](https://gitlab.com/mx-puppet/slack/mx-puppet-slack) for you.
|
||||
You may wish to use the [Mautrix Slack bridge](https://github.com/mautrix/slack) instead.
|
||||
|
||||
See the project's [documentation](https://gitlab.com/mx-puppet/slack/mx-puppet-slack/blob/master/README.md) to learn what it does and why it might be useful to you.
|
||||
## Uninstalling the bridge manually
|
||||
|
||||
## Prerequisite
|
||||
If you still have the MX Puppet Slack bridge installed on your Matrix server, the playbook can no longer help you uninstall it and you will need to do it manually. To uninstall manually, run these commands on the server:
|
||||
|
||||
Follow the [OAuth credentials](https://gitlab.com/mx-puppet/slack/mx-puppet-slack#option-2-oauth) instructions to create a new Slack app, setting the redirect URL to `https://matrix.example.com/slack/oauth`.
|
||||
|
||||
## Adjusting the playbook configuration
|
||||
|
||||
To enable the [Slack](https://slack.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_mx_puppet_slack_enabled: true
|
||||
# Client ID must be quoted so YAML does not parse it as a float.
|
||||
matrix_mx_puppet_slack_oauth_client_id: "<SLACK_APP_CLIENT_ID>"
|
||||
matrix_mx_puppet_slack_oauth_client_secret: "<SLACK_APP_CLIENT_SECRET>"
|
||||
```
|
||||
|
||||
## Installing
|
||||
|
||||
After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below:
|
||||
|
||||
<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
|
||||
```sh
|
||||
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
|
||||
systemctl disable --now matrix-mx-puppet-slack.service
|
||||
|
||||
rm -rf /matrix/mx-puppet-slack
|
||||
|
||||
/matrix/postgres/bin/cli-non-interactive 'DROP DATABASE matrix_mx_puppet_slack;'
|
||||
```
|
||||
|
||||
The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`
|
||||
|
||||
`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.
|
||||
|
||||
## Usage
|
||||
|
||||
To use the bridge, you need to start a chat with `Slack Puppet Bridge` with the handle `@_slackpuppet_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
|
||||
|
||||
Three authentication methods are available, Legacy Token, OAuth and xoxc token. See mx-puppet-slack [documentation](https://gitlab.com/mx-puppet/slack/mx-puppet-slack) for more information about how to configure the bridge.
|
||||
|
||||
Once logged in, send `list` 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.
|
||||
|
||||
Send `help` to the bot to see the available commands.
|
||||
|
||||
@@ -1,57 +1,29 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2019 Eduardo Beltrame
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
SPDX-FileCopyrightText: 2021 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2021 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Dennis Ciba
|
||||
SPDX-FileCopyrightText: 2022 Vladimir Panteleev
|
||||
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
# Setting up MX Puppet Twitter bridging (optional)
|
||||
# Setting up MX Puppet Twitter bridging (optional, removed)
|
||||
|
||||
**Note**: bridging to [Twitter](https://twitter.com/) can also happen via the [mautrix-twitter](configuring-playbook-bridge-mautrix-twitter.md) bridge supported by the playbook.
|
||||
🪦 The playbook used to be able to install and configure [mx-puppet-twitter](https://github.com/Sorunome/mx-puppet-twitter), but no longer includes this component, as it has been unmaintained for a long time.
|
||||
|
||||
The playbook can install and configure [mx-puppet-twitter](https://github.com/Sorunome/mx-puppet-twitter) for you.
|
||||
You may wish to use the [Mautrix Twitter bridge](https://github.com/mautrix/twitter) instead.
|
||||
|
||||
See the project's [documentation](https://github.com/Sorunome/mx-puppet-twitter/blob/master/README.md) to learn what it does and why it might be useful to you.
|
||||
## Uninstalling the bridge manually
|
||||
|
||||
## Prerequisite
|
||||
If you still have the MX Puppet Twitter bridge installed on your Matrix server, the playbook can no longer help you uninstall it and you will need to do it manually. To uninstall manually, run these commands on the server:
|
||||
|
||||
Make an app on [developer.twitter.com](https://developer.twitter.com/en/apps).
|
||||
|
||||
## Adjusting the playbook configuration
|
||||
|
||||
To enable the [Twitter](https://twitter.com) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_mx_puppet_twitter_enabled: true
|
||||
matrix_mx_puppet_twitter_consumer_key: ''
|
||||
matrix_mx_puppet_twitter_consumer_secret: ''
|
||||
matrix_mx_puppet_twitter_access_token: ''
|
||||
matrix_mx_puppet_twitter_access_token_secret: ''
|
||||
matrix_mx_puppet_twitter_environment: ''
|
||||
```
|
||||
|
||||
## Installing
|
||||
|
||||
After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below:
|
||||
|
||||
<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
|
||||
```sh
|
||||
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
|
||||
systemctl disable --now matrix-mx-puppet-twitter.service
|
||||
|
||||
rm -rf /matrix/mx-puppet-twitter
|
||||
|
||||
/matrix/postgres/bin/cli-non-interactive 'DROP DATABASE matrix_mx_puppet_twitter;'
|
||||
```
|
||||
|
||||
The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`
|
||||
|
||||
`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.
|
||||
|
||||
## Usage
|
||||
|
||||
To use the bridge, you need to start a chat with `Twitter Puppet Bridge` with the handle `@_twitterpuppet_bot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
|
||||
|
||||
To log in, use `link` and click the link.
|
||||
|
||||
Once logged in, send `list` 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.
|
||||
|
||||
Send `help` to the bot to see the available commands.
|
||||
|
||||
@@ -174,14 +174,6 @@ Bridges can be used to connect your Matrix installation with third-party communi
|
||||
|
||||
- [Setting up matrix-hookshot](configuring-playbook-bridge-hookshot.md) — a bridge between Matrix and multiple project management services, such as [GitHub](https://github.com), [GitLab](https://about.gitlab.com) and [JIRA](https://www.atlassian.com/software/jira).
|
||||
|
||||
- [Setting up MX Puppet Slack bridging](configuring-playbook-bridge-mx-puppet-slack.md)
|
||||
|
||||
- [Setting up MX Puppet Instagram bridging](configuring-playbook-bridge-mx-puppet-instagram.md)
|
||||
|
||||
- [Setting up MX Puppet Twitter bridging](configuring-playbook-bridge-mx-puppet-twitter.md)
|
||||
|
||||
- [Setting up MX Puppet Discord bridging](configuring-playbook-bridge-mx-puppet-discord.md)
|
||||
|
||||
- [Setting up MX Puppet GroupMe bridging](configuring-playbook-bridge-mx-puppet-groupme.md)
|
||||
|
||||
- [Setting up Steam bridging](configuring-playbook-bridge-steam.md)
|
||||
@@ -287,4 +279,12 @@ Various services that don't fit any other categories.
|
||||
|
||||
- [Setting up Mautrix Instagram bridging](configuring-playbook-bridge-mautrix-instagram.md) (deprecated in favor of the Messenger/Instagram bridge with [mautrix-meta-instagram](configuring-playbook-bridge-mautrix-meta-instagram.md))
|
||||
|
||||
- [Setting up MX Puppet Discord bridging](configuring-playbook-bridge-mx-puppet-discord.md) (removed; this component has been unmaintained for a long time, so it has been removed from the playbook. Consider [setting up Mautrix Discord bridging](configuring-playbook-bridge-mautrix-discord.md))
|
||||
|
||||
- [Setting up MX Puppet Instagram bridging](configuring-playbook-bridge-mx-puppet-instagram.md) (removed; this component has been unmaintained for a long time, so it has been removed from the playbook. Consider [setting up Instagram bridging via Mautrix Meta](configuring-playbook-bridge-mautrix-meta-instagram.md))
|
||||
|
||||
- [Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md) (removed; this component has been broken for a long time, so it has been removed from the playbook. Consider [setting up Go Skype Bridge bridging](configuring-playbook-bridge-go-skype-bridge.md))
|
||||
|
||||
- [Setting up MX Puppet Slack bridging](configuring-playbook-bridge-mx-puppet-slack.md) (removed; this component has been unmaintained for a long time, so it has been removed from the playbook. Consider [setting up Mautrix Slack bridging](configuring-playbook-bridge-mautrix-slack.md))
|
||||
|
||||
- [Setting up MX Puppet Twitter bridging](configuring-playbook-bridge-mx-puppet-twitter.md) (removed; this component has been unmaintained for a long time, so it has been removed from the playbook. Consider [setting up Mautrix Twitter bridging](configuring-playbook-bridge-mautrix-twitter.md))
|
||||
|
||||
@@ -108,10 +108,6 @@ Bridges can be used to connect your Matrix installation with third-party communi
|
||||
| [matrix-sms-bridge](configuring-playbook-bridge-matrix-bridge-sms.md) | [folivonet/matrix-sms-bridge](https://hub.docker.com/repository/docker/folivonet/matrix-sms-bridge) | ❌ | Bridge to SMS |
|
||||
| [matrix-wechat](configuring-playbook-bridge-wechat.md) | [lxduo/matrix-wechat](https://hub.docker.com/r/lxduo/matrix-wechat) | ❌ | Bridge to [WeChat](https://www.wechat.com/) |
|
||||
| [Heisenbridge](configuring-playbook-bridge-heisenbridge.md) | [hif1/heisenbridge](https://hub.docker.com/r/hif1/heisenbridge) | ❌ | Bouncer-style bridge to [IRC](https://wikipedia.org/wiki/Internet_Relay_Chat) |
|
||||
| [mx-puppet-slack](configuring-playbook-bridge-mx-puppet-slack.md) | [mx-puppet/slack/mx-puppet-slack](https://gitlab.com/mx-puppet/slack/mx-puppet-slack/container_registry) | ❌ | Bridge to [Slack](https://slack.com) |
|
||||
| [mx-puppet-instagram](configuring-playbook-bridge-mx-puppet-instagram.md) | [sorunome/mx-puppet-instagram](https://hub.docker.com/r/sorunome/mx-puppet-instagram) | ❌ | Bridge for Instagram-DMs ([Instagram](https://www.instagram.com/)) |
|
||||
| [mx-puppet-twitter](configuring-playbook-bridge-mx-puppet-twitter.md) | [sorunome/mx-puppet-twitter](https://hub.docker.com/r/sorunome/mx-puppet-twitter) | ❌ | Bridge for Twitter-DMs ([Twitter](https://twitter.com/)) |
|
||||
| [mx-puppet-discord](configuring-playbook-bridge-mx-puppet-discord.md) | [mx-puppet/discord/mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord/container_registry) | ❌ | Bridge to [Discord](https://discordapp.com/) |
|
||||
| [mx-puppet-groupme](configuring-playbook-bridge-mx-puppet-groupme.md) | [xangelix/mx-puppet-groupme](https://hub.docker.com/r/xangelix/mx-puppet-groupme) | ❌ | Bridge to [GroupMe](https://groupme.com/) |
|
||||
| [matrix-steam-bridge](configuring-playbook-bridge-steam.md) | [jasonlaguidice/matrix-steam-bridge](https://github.com/jasonlaguidice/matrix-steam-bridge/pkgs/container/matrix-steam-bridge) | ❌ | Bridge to [Steam](https://steampowered.com/) |
|
||||
| [mx-puppet-steam](configuring-playbook-bridge-mx-puppet-steam.md) | [icewind1991/mx-puppet-steam](https://hub.docker.com/r/icewind1991/mx-puppet-steam) | ❌ | Bridge to [Steam](https://steamapp.com/) |
|
||||
@@ -185,3 +181,7 @@ The list of the deprecated or unmaintained services is available [here](configur
|
||||
| [matrix-chatgpt-bot](configuring-playbook-bot-chatgpt.md) | [matrixgpt/matrix-chatgpt-bot](https://ghcr.io/matrixgpt/matrix-chatgpt-bot) | ❌ | Accessing ChatGPT via your favourite Matrix client |
|
||||
| [mautrix-facebook](configuring-playbook-bridge-mautrix-facebook.md) | [mautrix/facebook](https://mau.dev/mautrix/facebook/container_registry) | ❌ | Bridge to [Facebook](https://facebook.com/) |
|
||||
| [mautrix-instagram](configuring-playbook-bridge-mautrix-instagram.md) | [mautrix/instagram](https://mau.dev/mautrix/instagram/container_registry) | ❌ | Bridge to [Instagram](https://instagram.com/) |
|
||||
| [mx-puppet-discord](configuring-playbook-bridge-mx-puppet-discord.md) | [mx-puppet/discord/mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord/container_registry) | ❌ | Bridge to [Discord](https://discordapp.com/) |
|
||||
| [mx-puppet-instagram](configuring-playbook-bridge-mx-puppet-instagram.md) | [sorunome/mx-puppet-instagram](https://hub.docker.com/r/sorunome/mx-puppet-instagram) | ❌ | Bridge for Instagram-DMs ([Instagram](https://www.instagram.com/)) |
|
||||
| [mx-puppet-slack](configuring-playbook-bridge-mx-puppet-slack.md) | [mx-puppet/slack/mx-puppet-slack](https://gitlab.com/mx-puppet/slack/mx-puppet-slack/container_registry) | ❌ | Bridge to [Slack](https://slack.com) |
|
||||
| [mx-puppet-twitter](configuring-playbook-bridge-mx-puppet-twitter.md) | [sorunome/mx-puppet-twitter](https://hub.docker.com/r/sorunome/mx-puppet-twitter) | ❌ | Bridge for Twitter-DMs ([Twitter](https://twitter.com/)) |
|
||||
|
||||
@@ -146,18 +146,10 @@ matrix_homeserver_container_extra_arguments_auto: |
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mautrix_wsproxy_config_path + '/imessage-registration.yaml,dst=/matrix-mautrix-imessage-registration.yaml,ro'] if matrix_mautrix_wsproxy_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_discord_config_path + '/registration.yaml,dst=/matrix-mx-puppet-discord-registration.yaml,ro'] if matrix_mx_puppet_discord_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_groupme_config_path + '/registration.yaml,dst=/matrix-mx-puppet-groupme-registration.yaml,ro'] if matrix_mx_puppet_groupme_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_instagram_config_path + '/registration.yaml,dst=/matrix-mx-puppet-instagram-registration.yaml,ro'] if matrix_mx_puppet_instagram_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_slack_config_path + '/registration.yaml,dst=/matrix-mx-puppet-slack-registration.yaml,ro'] if matrix_mx_puppet_slack_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_steam_config_path + '/registration.yaml,dst=/matrix-mx-puppet-steam-registration.yaml,ro'] if matrix_mx_puppet_steam_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mx_puppet_twitter_config_path + '/registration.yaml,dst=/matrix-mx-puppet-twitter-registration.yaml,ro'] if matrix_mx_puppet_twitter_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_sms_bridge_config_path + '/registration.yaml,dst=/matrix-sms-bridge-registration.yaml,ro'] if matrix_sms_bridge_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_steam_bridge_config_path + '/registration.yaml,dst=/matrix-steam-bridge-registration.yaml,ro'] if matrix_steam_bridge_enabled else [])
|
||||
@@ -219,18 +211,10 @@ matrix_homeserver_app_service_config_files_auto: |
|
||||
+
|
||||
(['/matrix-mautrix-imessage-registration.yaml'] if matrix_mautrix_wsproxy_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-discord-registration.yaml'] if matrix_mx_puppet_discord_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-groupme-registration.yaml'] if matrix_mx_puppet_groupme_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-instagram-registration.yaml'] if matrix_mx_puppet_instagram_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-slack-registration.yaml'] if matrix_mx_puppet_slack_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-steam-registration.yaml'] if matrix_mx_puppet_steam_enabled else [])
|
||||
+
|
||||
(['/matrix-mx-puppet-twitter-registration.yaml'] if matrix_mx_puppet_twitter_enabled else [])
|
||||
+
|
||||
(['/matrix-sms-bridge-registration.yaml'] if matrix_sms_bridge_enabled else [])
|
||||
+
|
||||
(['/matrix-cactus-comments.yaml'] if matrix_cactus_comments_enabled else [])
|
||||
@@ -363,18 +347,10 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
+
|
||||
([{'name': 'matrix-mautrix-wsproxy-syncproxy.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-wsproxy-syncproxy']}] if matrix_mautrix_wsproxy_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-discord.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-discord']}] if matrix_mx_puppet_discord_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-groupme.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-groupme']}] if matrix_mx_puppet_groupme_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-instagram.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-instagram']}] if matrix_mx_puppet_instagram_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-slack.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-slack']}] if matrix_mx_puppet_slack_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-steam.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-steam']}] if matrix_mx_puppet_steam_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-mx-puppet-twitter.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-twitter']}] if matrix_mx_puppet_twitter_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-postmoogle.service', 'priority': 2200, 'groups': ['matrix', 'bridges', 'postmoogle']}] if matrix_postmoogle_enabled else [])
|
||||
+
|
||||
([{'name': 'matrix-sms-bridge.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'sms']}] if matrix_sms_bridge_enabled else [])
|
||||
@@ -2314,232 +2290,6 @@ matrix_hookshot_public_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
#
|
||||
######################################################################
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mx-puppet-slack
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_mx_puppet_slack_enabled: false
|
||||
|
||||
matrix_mx_puppet_slack_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
|
||||
matrix_mx_puppet_slack_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
+
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mx_puppet_slack_database_hostname == postgres_connection_hostname) else [])
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_slack_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mx_puppet_slack_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_mx_puppet_slack_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
|
||||
|
||||
matrix_mx_puppet_slack_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_mx_puppet_slack_container_additional_networks_auto: |-
|
||||
{{
|
||||
(
|
||||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
|
||||
+
|
||||
([postgres_container_network] if (postgres_enabled and matrix_mx_puppet_slack_database_hostname == postgres_connection_hostname and matrix_mx_puppet_slack_container_network != postgres_container_network) else [])
|
||||
+
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_mx_puppet_slack_container_labels_traefik_enabled) else [])
|
||||
) | unique
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_slack_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||
matrix_mx_puppet_slack_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
matrix_mx_puppet_slack_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
matrix_mx_puppet_slack_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
|
||||
matrix_mx_puppet_slack_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxslk.as.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_slack_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_mx_puppet_slack_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxslk.hs.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_slack_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
|
||||
|
||||
matrix_mx_puppet_slack_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}"
|
||||
|
||||
# Postgres is the default, except if not using internal Postgres server
|
||||
matrix_mx_puppet_slack_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_mx_puppet_slack_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_mx_puppet_slack_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxpup.slack.db', rounds=655555) | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-bridge-mx-puppet-slack
|
||||
#
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mx-puppet-twitter
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_mx_puppet_twitter_enabled: false
|
||||
|
||||
matrix_mx_puppet_twitter_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
|
||||
matrix_mx_puppet_twitter_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
+
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mx_puppet_twitter_database_hostname == postgres_connection_hostname) else [])
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_mx_puppet_twitter_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
|
||||
|
||||
matrix_mx_puppet_twitter_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '' ~ matrix_mx_puppet_twitter_appservice_port) if matrix_playbook_service_host_bind_interface_prefix else '' }}"
|
||||
|
||||
matrix_mx_puppet_twitter_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_mx_puppet_twitter_container_additional_networks_auto: |-
|
||||
{{
|
||||
(
|
||||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
|
||||
+
|
||||
([postgres_container_network] if (postgres_enabled and matrix_mx_puppet_twitter_database_hostname == postgres_connection_hostname and matrix_mx_puppet_twitter_container_network != postgres_container_network) else [])
|
||||
+
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_mx_puppet_twitter_container_labels_traefik_enabled) else [])
|
||||
) | unique
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
|
||||
matrix_mx_puppet_twitter_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxtwt.as.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_twitter_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_mx_puppet_twitter_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxtwt.hs.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_twitter_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
|
||||
|
||||
matrix_mx_puppet_twitter_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}"
|
||||
|
||||
# Postgres is the default, except if not using internal Postgres server
|
||||
matrix_mx_puppet_twitter_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_mx_puppet_twitter_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_mx_puppet_twitter_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxpup.twitter.db', rounds=655555) | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-bridge-mx-puppet-twitter
|
||||
#
|
||||
######################################################################
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mx-puppet-instagram
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_mx_puppet_instagram_enabled: false
|
||||
|
||||
matrix_mx_puppet_instagram_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
+
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mx_puppet_instagram_database_hostname == postgres_connection_hostname) else [])
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_mx_puppet_instagram_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
|
||||
|
||||
matrix_mx_puppet_instagram_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_mx_puppet_instagram_container_additional_networks_auto: |-
|
||||
{{
|
||||
(
|
||||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
|
||||
+
|
||||
([postgres_container_network] if (postgres_enabled and matrix_mx_puppet_instagram_database_hostname == postgres_connection_hostname and matrix_mx_puppet_instagram_container_network != postgres_container_network) else [])
|
||||
) | unique
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_instagram_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxig.as.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_instagram_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_mx_puppet_instagram_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxig.hs.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_instagram_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
|
||||
|
||||
matrix_mx_puppet_instagram_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}"
|
||||
|
||||
# Postgres is the default, except if not using internal Postgres server
|
||||
matrix_mx_puppet_instagram_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_mx_puppet_instagram_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_mx_puppet_instagram_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxpup.ig.db', rounds=655555) | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-bridge-mx-puppet-instagram
|
||||
#
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mx-puppet-discord
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_mx_puppet_discord_enabled: false
|
||||
|
||||
matrix_mx_puppet_discord_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
+
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mx_puppet_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_discord_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mx_puppet_discord_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_mx_puppet_discord_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
|
||||
|
||||
matrix_mx_puppet_discord_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_mx_puppet_discord_container_additional_networks_auto: |-
|
||||
{{
|
||||
(
|
||||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
|
||||
+
|
||||
([postgres_container_network] if (postgres_enabled and matrix_mx_puppet_discord_database_hostname == postgres_connection_hostname and matrix_mx_puppet_discord_container_network != postgres_container_network) else [])
|
||||
) | unique
|
||||
}}
|
||||
|
||||
matrix_mx_puppet_discord_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxdsc.as.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_discord_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_mx_puppet_discord_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxdsc.hs.tok', rounds=655555) | to_uuid }}"
|
||||
|
||||
matrix_mx_puppet_discord_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
|
||||
|
||||
matrix_mx_puppet_discord_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}"
|
||||
|
||||
# Postgres is the default, except if not using internal Postgres server
|
||||
matrix_mx_puppet_discord_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_mx_puppet_discord_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_mx_puppet_discord_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxpup.dsc.db', rounds=655555) | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-bridge-mx-puppet-discord
|
||||
#
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mx-puppet-steam
|
||||
@@ -4386,30 +4136,6 @@ postgres_managed_databases_auto: |
|
||||
'password': matrix_mautrix_slack_database_password,
|
||||
}] if (matrix_mautrix_slack_enabled and matrix_mautrix_slack_database_engine == 'postgres' and matrix_mautrix_slack_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mx_puppet_slack_database_name,
|
||||
'username': matrix_mx_puppet_slack_database_username,
|
||||
'password': matrix_mx_puppet_slack_database_password,
|
||||
}] if (matrix_mx_puppet_slack_enabled and matrix_mx_puppet_slack_database_engine == 'postgres' and matrix_mx_puppet_slack_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mx_puppet_twitter_database_name,
|
||||
'username': matrix_mx_puppet_twitter_database_username,
|
||||
'password': matrix_mx_puppet_twitter_database_password,
|
||||
}] if (matrix_mx_puppet_twitter_enabled and matrix_mx_puppet_twitter_database_engine == 'postgres' and matrix_mx_puppet_twitter_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mx_puppet_instagram_database_name,
|
||||
'username': matrix_mx_puppet_instagram_database_username,
|
||||
'password': matrix_mx_puppet_instagram_database_password,
|
||||
}] if (matrix_mx_puppet_instagram_enabled and matrix_mx_puppet_instagram_database_engine == 'postgres' and matrix_mx_puppet_instagram_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mx_puppet_discord_database_name,
|
||||
'username': matrix_mx_puppet_discord_database_username,
|
||||
'password': matrix_mx_puppet_discord_database_password,
|
||||
}] if (matrix_mx_puppet_discord_enabled and matrix_mx_puppet_discord_database_engine == 'postgres' and matrix_mx_puppet_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mx_puppet_steam_database_name,
|
||||
'username': matrix_mx_puppet_steam_database_username,
|
||||
@@ -5306,31 +5032,14 @@ matrix_synapse_admin_config_asManagedUsers_auto: |
|
||||
'^@imessage_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mautrix_wsproxy_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@_discordpuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_discord_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@_groupmepuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_groupme_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@_instagrampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_instagram_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@_slackpuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_slack_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@_steampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_steam_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@'+(matrix_mx_puppet_twitter_bot_localpart | default('') | regex_escape)+':'+ (matrix_domain | regex_escape)+'$',
|
||||
'^@'+(matrix_mx_puppet_twitter_namespace_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mx_puppet_twitter_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@smsbot:'+(matrix_domain | regex_escape)+'$',
|
||||
'^@sms_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
matrix_alertmanager_receiver_enabled: true
|
||||
|
||||
# renovate: datasource=docker depName=docker.io/metio/matrix-alertmanager-receiver
|
||||
matrix_alertmanager_receiver_version: 2025.10.22
|
||||
matrix_alertmanager_receiver_version: 2025.11.5
|
||||
|
||||
matrix_alertmanager_receiver_scheme: https
|
||||
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2021 Ahmad Haghighi
|
||||
# SPDX-FileCopyrightText: 2022 Daniel Sonck
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2023 Samuel Meenzen
|
||||
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
# Mx Puppet Discord is a Matrix <-> Discord bridge
|
||||
# Project source code URL: https://gitlab.com/mx-puppet/discord/mx-puppet-discord
|
||||
|
||||
matrix_mx_puppet_discord_enabled: true
|
||||
|
||||
matrix_mx_puppet_discord_container_image_self_build: false
|
||||
matrix_mx_puppet_discord_container_image_self_build_repo: "https://gitlab.com/mx-puppet/discord/mx-puppet-discord.git"
|
||||
matrix_mx_puppet_discord_container_image_self_build_version: "{{ 'main' if matrix_mx_puppet_discord_version == 'latest' else matrix_mx_puppet_discord_version }}"
|
||||
matrix_mx_puppet_discord_container_image_self_build_dockerfile_path: "Dockerfile"
|
||||
|
||||
# Controls whether the mx-puppet-discord container exposes its HTTP port (tcp/8432 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8432"), or empty string to not expose.
|
||||
matrix_mx_puppet_discord_container_http_host_bind_port: ''
|
||||
|
||||
# renovate: datasource=docker depName=registry.gitlab.com/mx-puppet/discord/mx-puppet-discord
|
||||
matrix_mx_puppet_discord_version: v0.1.1
|
||||
matrix_mx_puppet_discord_docker_image: "{{ matrix_mx_puppet_discord_docker_image_registry_prefix }}mx-puppet/discord/mx-puppet-discord:{{ matrix_mx_puppet_discord_version }}"
|
||||
matrix_mx_puppet_discord_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mx_puppet_discord_container_image_self_build else matrix_mx_puppet_discord_docker_image_registry_prefix_upstream }}"
|
||||
matrix_mx_puppet_discord_docker_image_registry_prefix_upstream: "{{ matrix_mx_puppet_discord_docker_image_registry_prefix_upstream_default }}"
|
||||
matrix_mx_puppet_discord_docker_image_registry_prefix_upstream_default: "registry.gitlab.com/"
|
||||
matrix_mx_puppet_discord_docker_image_force_pull: "{{ matrix_mx_puppet_discord_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mx_puppet_discord_base_path: "{{ matrix_base_data_path }}/mx-puppet-discord"
|
||||
matrix_mx_puppet_discord_config_path: "{{ matrix_mx_puppet_discord_base_path }}/config"
|
||||
matrix_mx_puppet_discord_data_path: "{{ matrix_mx_puppet_discord_base_path }}/data"
|
||||
matrix_mx_puppet_discord_docker_src_files_path: "{{ matrix_mx_puppet_discord_base_path }}/docker-src"
|
||||
|
||||
matrix_mx_puppet_discord_appservice_port: "8432"
|
||||
|
||||
matrix_mx_puppet_discord_homeserver_address: ""
|
||||
matrix_mx_puppet_discord_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mx_puppet_discord_appservice_address: 'http://matrix-mx-puppet-discord:{{ matrix_mx_puppet_discord_appservice_port }}'
|
||||
|
||||
matrix_mx_puppet_discord_bridge_mediaUrl: "{{ matrix_homeserver_url }}" # noqa var-naming
|
||||
|
||||
# "@alice:example.com" to allow a specific user
|
||||
# "@.*:example.com" to allow users on a specific homeserver
|
||||
# "@.*" to allow anyone
|
||||
matrix_mx_puppet_discord_provisioning_whitelist:
|
||||
- "@.*:{{ matrix_domain | regex_escape }}"
|
||||
|
||||
# Leave empty to disable blacklist
|
||||
# "@bob:example.com" to disallow a specific user
|
||||
# "@.*:example.com" to disallow users on a specific homeserver
|
||||
matrix_mx_puppet_discord_provisioning_blacklist: []
|
||||
|
||||
matrix_mx_puppet_discord_container_network: ""
|
||||
|
||||
matrix_mx_puppet_discord_container_additional_networks: "{{ matrix_mx_puppet_discord_container_additional_networks_auto + matrix_mx_puppet_discord_container_additional_networks_custom }}"
|
||||
matrix_mx_puppet_discord_container_additional_networks_auto: []
|
||||
matrix_mx_puppet_discord_container_additional_networks_custom: []
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mx_puppet_discord_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-puppet-discord.service depends on.
|
||||
matrix_mx_puppet_discord_systemd_required_services_list: "{{ matrix_mx_puppet_discord_systemd_required_services_list_default + matrix_mx_puppet_discord_systemd_required_services_list_auto + matrix_mx_puppet_discord_systemd_required_services_list_custom }}"
|
||||
matrix_mx_puppet_discord_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_mx_puppet_discord_systemd_required_services_list_auto: []
|
||||
matrix_mx_puppet_discord_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-puppet-discord.service wants
|
||||
matrix_mx_puppet_discord_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mx_puppet_discord_appservice_token: ''
|
||||
matrix_mx_puppet_discord_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_discord_login_shared_secret: ''
|
||||
|
||||
matrix_mx_puppet_discord_presence_enabled: true
|
||||
matrix_mx_puppet_discord_presence_interval: 5000
|
||||
|
||||
# Database configuration
|
||||
matrix_mx_puppet_discord_database_engine: 'sqlite'
|
||||
|
||||
matrix_mx_puppet_discord_sqlite_database_path_local: "{{ matrix_mx_puppet_discord_data_path }}/database.db"
|
||||
matrix_mx_puppet_discord_sqlite_database_path_in_container: "/data/database.db"
|
||||
|
||||
matrix_mx_puppet_discord_database_username: matrix_mx_puppet_discord
|
||||
matrix_mx_puppet_discord_database_password: ~
|
||||
matrix_mx_puppet_discord_database_hostname: ''
|
||||
matrix_mx_puppet_discord_database_port: 5432
|
||||
matrix_mx_puppet_discord_database_name: matrix_mx_puppet_discord
|
||||
matrix_mx_puppet_discord_database_sslmode: disable
|
||||
|
||||
matrix_mx_puppet_discord_database_connection_string: 'postgresql://{{ matrix_mx_puppet_discord_database_username }}:{{ matrix_mx_puppet_discord_database_password }}@{{ matrix_mx_puppet_discord_database_hostname }}:{{ matrix_mx_puppet_discord_database_port }}/{{ matrix_mx_puppet_discord_database_name }}?sslmode={{ matrix_mx_puppet_discord_database_sslmode }}'
|
||||
|
||||
# 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_discord_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mx_puppet_discord_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mx_puppet_discord_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mx_puppet_discord_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_discord_configuration_yaml`.
|
||||
|
||||
matrix_mx_puppet_discord_configuration_extension: "{{ matrix_mx_puppet_discord_configuration_extension_yaml | from_yaml if matrix_mx_puppet_discord_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_discord_configuration_yaml`.
|
||||
matrix_mx_puppet_discord_configuration: "{{ matrix_mx_puppet_discord_configuration_yaml | from_yaml | combine(matrix_mx_puppet_discord_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mx_puppet_discord_registration_yaml: |
|
||||
as_token: "{{ matrix_mx_puppet_discord_appservice_token }}"
|
||||
hs_token: "{{ matrix_mx_puppet_discord_homeserver_token }}"
|
||||
id: discord-puppet
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@_discordpuppet_.*:{{ matrix_mx_puppet_discord_homeserver_domain | regex_escape }}'
|
||||
rooms: []
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '#_discordpuppet_.*:{{ matrix_mx_puppet_discord_homeserver_domain | regex_escape }}'
|
||||
protocols: []
|
||||
rate_limited: false
|
||||
sender_localpart: _discordpuppet_bot
|
||||
url: {{ matrix_mx_puppet_discord_appservice_address }}
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
receive_ephemeral: true
|
||||
|
||||
matrix_mx_puppet_discord_registration: "{{ matrix_mx_puppet_discord_registration_yaml | from_yaml }}"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2022 - 2023 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-discord
|
||||
- install-all
|
||||
- install-mx-puppet-discord
|
||||
block:
|
||||
- when: matrix_mx_puppet_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_mx_puppet_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-discord
|
||||
block:
|
||||
- when: not matrix_mx_puppet_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2020 Stuart Mumford
|
||||
# SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2022 Sebastian Gumprich
|
||||
# SPDX-FileCopyrightText: 2024 David Mehren
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Ensure MX Puppet Discord paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_mx_puppet_discord_base_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_discord_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_discord_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_discord_docker_src_files_path }}", when: "{{ matrix_mx_puppet_discord_container_image_self_build }}"}
|
||||
when: matrix_mx_puppet_discord_enabled | bool and item.when | bool
|
||||
|
||||
- name: Check if an old database file already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_discord_base_path }}/database.db"
|
||||
register: matrix_mx_puppet_discord_stat_database
|
||||
|
||||
- when: "matrix_mx_puppet_discord_stat_database.stat.exists"
|
||||
block:
|
||||
- name: (Data relocation) Ensure matrix-mx-puppet-discord.service is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-discord
|
||||
state: stopped
|
||||
daemon_reload: true
|
||||
failed_when: false
|
||||
|
||||
- name: (Data relocation) Move mx-puppet-discord database file to ./data directory
|
||||
ansible.builtin.command:
|
||||
cmd: "mv {{ matrix_mx_puppet_discord_base_path }}/database.db {{ matrix_mx_puppet_discord_data_path }}/database.db"
|
||||
register: matrix_mx_puppet_discord_relocate_database_result
|
||||
changed_when: matrix_mx_puppet_discord_relocate_database_result.rc == 0
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_discord_requires_restart: false
|
||||
|
||||
- when: "matrix_mx_puppet_discord_database_engine == 'postgres'"
|
||||
block:
|
||||
- name: Check if an SQLite database already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_discord_sqlite_database_path_local }}"
|
||||
register: matrix_mx_puppet_discord_sqlite_database_path_local_stat_result
|
||||
|
||||
- when: "matrix_mx_puppet_discord_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
postgres_db_migration_request:
|
||||
src: "{{ matrix_mx_puppet_discord_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mx_puppet_discord_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mx_puppet_discord_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mx-puppet-discord.service']
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_discord_requires_restart: true
|
||||
|
||||
- name: Ensure MX Puppet Discord image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_discord_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mx_puppet_discord_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_discord_docker_image_force_pull }}"
|
||||
when: matrix_mx_puppet_discord_enabled | bool and not matrix_mx_puppet_discord_container_image_self_build
|
||||
register: result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure MX Puppet Discord repository is present on self build
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_mx_puppet_discord_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_mx_puppet_discord_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
version: "{{ matrix_mx_puppet_discord_container_image_self_build_version }}"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_name }}"
|
||||
register: matrix_mx_puppet_discord_git_pull_results
|
||||
when: "matrix_mx_puppet_discord_enabled | bool and matrix_mx_puppet_discord_container_image_self_build"
|
||||
|
||||
- name: Ensure MX Puppet Discord Docker image is built
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_discord_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mx_puppet_discord_git_pull_results.changed 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_discord_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: "{{ matrix_mx_puppet_discord_container_image_self_build_dockerfile_path }}"
|
||||
path: "{{ matrix_mx_puppet_discord_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_mx_puppet_discord_enabled | bool and matrix_mx_puppet_discord_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure mx-puppet-discord config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_discord_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_discord_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-discord discord-registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_discord_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_discord_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-discord container network is created
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_mx_puppet_discord_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-discord.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-discord.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-mx-puppet-discord.service"
|
||||
mode: 0644
|
||||
|
||||
- name: Ensure matrix-mx-puppet-discord.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mx-puppet-discord.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_mx_puppet_discord_requires_restart | bool"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2021 - 2022 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mx-puppet-discord service
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-discord.service"
|
||||
register: matrix_mx_puppet_discord_service_stat
|
||||
|
||||
- when: matrix_mx_puppet_discord_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mx-puppet-discord is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-discord
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-mx-puppet-discord.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-discord.service"
|
||||
state: absent
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Fail if required mx-puppet-discord settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_mx_puppet_discord_appservice_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_discord_homeserver_address', when: true}
|
||||
- {'name': 'matrix_mx_puppet_discord_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_discord_database_hostname', when: "{{ matrix_mx_puppet_discord_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mx_puppet_discord_container_network', when: true}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed mx-puppet-discord variables
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead.
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_mx_puppet_discord_docker_image_name_prefix', 'new': 'matrix_mx_puppet_discord_docker_image_registry_prefix'}
|
||||
@@ -1,125 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
bridge:
|
||||
# Port to host the bridge on
|
||||
# Used for communication between the homeserver and the bridge
|
||||
port: {{ matrix_mx_puppet_discord_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_discord_homeserver_domain }}
|
||||
# Reachable URL of the Matrix homeserver
|
||||
homeserverUrl: {{ matrix_mx_puppet_discord_homeserver_address }}
|
||||
# Optionally specify a different media URL used for the media store
|
||||
#
|
||||
# This is where Discord will download user profile pictures and media
|
||||
# from
|
||||
mediaUrl: {{ matrix_mx_puppet_discord_bridge_mediaUrl }}
|
||||
{% if matrix_mx_puppet_discord_login_shared_secret != '' %}
|
||||
loginSharedSecretMap:
|
||||
{{ matrix_domain }}: {{ matrix_mx_puppet_discord_login_shared_secret }}
|
||||
{% endif %}
|
||||
# Display name of the bridge bot
|
||||
displayname: Discord Puppet Bridge
|
||||
|
||||
presence:
|
||||
# Bridge Discord online/offline status
|
||||
enabled: {{ matrix_mx_puppet_discord_presence_enabled | to_json }}
|
||||
# How often to send status to the homeserver in milliseconds
|
||||
interval: {{ matrix_mx_puppet_discord_presence_interval | to_json }}
|
||||
|
||||
provisioning:
|
||||
# Regex of Matrix IDs allowed to use the puppet bridge
|
||||
whitelist: {{ matrix_mx_puppet_discord_provisioning_whitelist|to_json }}
|
||||
# Allow a specific user
|
||||
#- "@alice:example\\.com"
|
||||
# Allow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
# Allow anyone
|
||||
#- ".*"
|
||||
# Regex of Matrix IDs forbidden from using the puppet bridge
|
||||
#blacklist:
|
||||
# Disallow a specific user
|
||||
#- "@bob:example\\.com"
|
||||
# Disallow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
blacklist: {{ matrix_mx_puppet_discord_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 Discord bot account relays messages of
|
||||
# multiple Matrix users
|
||||
#
|
||||
# Same format as in provisioning
|
||||
whitelist: {{ matrix_mx_puppet_discord_provisioning_whitelist|to_json }}
|
||||
blacklist: {{ matrix_mx_puppet_discord_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_discord_provisioning_whitelist|to_json }}
|
||||
blacklist: {{ matrix_mx_puppet_discord_provisioning_blacklist|to_json }}
|
||||
|
||||
# Override the default name patterns for users, rooms and groups
|
||||
#
|
||||
# Variable names must be prefixed with a ':'
|
||||
namePatterns:
|
||||
# The default displayname for a bridged user
|
||||
#
|
||||
# Available variables:
|
||||
#
|
||||
# name: username of the user
|
||||
# discriminator: hashtag of the user (ex. #1234)
|
||||
user: :name
|
||||
|
||||
# A user's guild-specific displayname - if they've set a custom nick in
|
||||
# a guild
|
||||
#
|
||||
# Available variables:
|
||||
#
|
||||
# name: username of the user
|
||||
# discriminator: hashtag of the user (ex. #1234)
|
||||
# displayname: the user's custom group-specific nick
|
||||
# channel: the name of the channel
|
||||
# guild: the name of the guild
|
||||
userOverride: :name
|
||||
|
||||
# Room names for bridged Discord channels
|
||||
#
|
||||
# Available variables:
|
||||
#
|
||||
# name: name of the channel
|
||||
# guild: name of the guild
|
||||
room: :name
|
||||
|
||||
# Group names for bridged Discord servers
|
||||
#
|
||||
# Available variables:
|
||||
#
|
||||
# name: name of the guide
|
||||
group: :name
|
||||
|
||||
database:
|
||||
{% if matrix_mx_puppet_discord_database_engine == 'sqlite' %}
|
||||
# Use SQLite3 as a database backend
|
||||
# The name of the database file
|
||||
filename: {{ matrix_mx_puppet_discord_sqlite_database_path_in_container|to_json }}
|
||||
{% else %}
|
||||
# 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_discord_database_connection_string|to_json }}
|
||||
{% endif %}
|
||||
|
||||
logging:
|
||||
# Log level of console output
|
||||
# Allowed values starting with most verbose:
|
||||
# silly, debug, verbose, info, warn, error
|
||||
console: warn
|
||||
# Date and time formatting
|
||||
lineDateFormat: MMM-D HH:mm:ss.SSS
|
||||
# Logging files
|
||||
# Log files are rotated daily by default
|
||||
files: []
|
||||
@@ -1,6 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,48 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix Mx Puppet Discord bridge
|
||||
{% for service in matrix_mx_puppet_discord_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mx_puppet_discord_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-discord 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-discord 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-mx-puppet-discord \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_mx_puppet_discord_container_network }} \
|
||||
-e CONFIG_PATH=/config/config.yaml \
|
||||
-e REGISTRATION_PATH=/config/registration.yaml \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_discord_config_path }},dst=/config \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_discord_data_path }},dst=/data \
|
||||
{% for arg in matrix_mx_puppet_discord_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mx_puppet_discord_docker_image }}
|
||||
|
||||
{% for network in matrix_mx_puppet_discord_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-discord
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-discord
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-discord 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-discord 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mx-puppet-discord
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,5 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
SPDX-FileCopyrightText: 2020 Scott Crossen
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,132 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2021 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2021 Ahmad Haghighi
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2023 Samuel Meenzen
|
||||
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
# mx-puppet-instagram bridges instagram DMs
|
||||
# Project source code URL: https://github.com/Sorunome/mx-puppet-instagram
|
||||
|
||||
matrix_mx_puppet_instagram_enabled: true
|
||||
|
||||
matrix_mx_puppet_instagram_container_image_self_build: false
|
||||
matrix_mx_puppet_instagram_container_image_self_build_repo: "https://github.com/Sorunome/mx-puppet-instagram.git"
|
||||
matrix_mx_puppet_instagram_container_image_self_build_repo_version: "{{ 'master' if matrix_mx_puppet_instagram_version == 'latest' else matrix_mx_puppet_instagram_version }}"
|
||||
|
||||
# renovate: datasource=docker depName=sorunome/mx-puppet-instagram
|
||||
matrix_mx_puppet_instagram_version: latest
|
||||
matrix_mx_puppet_instagram_docker_image: "{{ matrix_mx_puppet_instagram_docker_image_registry_prefix }}sorunome/mx-puppet-instagram:{{ matrix_mx_puppet_instagram_version }}"
|
||||
matrix_mx_puppet_instagram_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mx_puppet_instagram_container_image_self_build else matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream }}"
|
||||
matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream: "{{ matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream_default }}"
|
||||
matrix_mx_puppet_instagram_docker_image_registry_prefix_upstream_default: "docker.io/"
|
||||
matrix_mx_puppet_instagram_docker_image_force_pull: "{{ matrix_mx_puppet_instagram_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mx_puppet_instagram_base_path: "{{ matrix_base_data_path }}/mx-puppet-instagram"
|
||||
matrix_mx_puppet_instagram_config_path: "{{ matrix_mx_puppet_instagram_base_path }}/config"
|
||||
matrix_mx_puppet_instagram_data_path: "{{ matrix_mx_puppet_instagram_base_path }}/data"
|
||||
matrix_mx_puppet_instagram_docker_src_files_path: "{{ matrix_mx_puppet_instagram_base_path }}/docker-src"
|
||||
|
||||
matrix_mx_puppet_instagram_appservice_port: "8440"
|
||||
matrix_mx_puppet_instagram_homeserver_address: ""
|
||||
matrix_mx_puppet_instagram_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mx_puppet_instagram_appservice_address: 'http://matrix-mx-puppet-instagram:{{ matrix_mx_puppet_instagram_appservice_port }}'
|
||||
|
||||
# "@alice:example.com" to allow a specific user
|
||||
# "@.*:example.com" to allow users on a specific homeserver
|
||||
# "@.*" to allow anyone
|
||||
matrix_mx_puppet_instagram_provisioning_whitelist:
|
||||
- "@.*:{{ matrix_domain | regex_escape }}"
|
||||
|
||||
# Leave empty to disable blacklist
|
||||
# "@bob:example.com" to disallow a specific user
|
||||
# "@.*:example.com" to disallow users on a specific homeserver
|
||||
matrix_mx_puppet_instagram_provisioning_blacklist: []
|
||||
|
||||
matrix_mx_puppet_instagram_container_network: ""
|
||||
|
||||
matrix_mx_puppet_instagram_container_additional_networks: "{{ matrix_mx_puppet_instagram_container_additional_networks_auto + matrix_mx_puppet_instagram_container_additional_networks_custom }}"
|
||||
matrix_mx_puppet_instagram_container_additional_networks_auto: []
|
||||
matrix_mx_puppet_instagram_container_additional_networks_custom: []
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mx_puppet_instagram_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-puppet-instagram.service depends on.
|
||||
matrix_mx_puppet_instagram_systemd_required_services_list: "{{ matrix_mx_puppet_instagram_systemd_required_services_list_default + matrix_mx_puppet_instagram_systemd_required_services_list_auto + matrix_mx_puppet_instagram_systemd_required_services_list_custom }}"
|
||||
matrix_mx_puppet_instagram_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_mx_puppet_instagram_systemd_required_services_list_auto: []
|
||||
matrix_mx_puppet_instagram_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-puppet-instagram.service wants
|
||||
matrix_mx_puppet_instagram_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mx_puppet_instagram_appservice_token: ''
|
||||
matrix_mx_puppet_instagram_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_instagram_login_shared_secret: ''
|
||||
|
||||
matrix_mx_puppet_instagram_presence_enabled: true
|
||||
matrix_mx_puppet_instagram_presence_interval: 5000
|
||||
|
||||
matrix_mx_puppet_instagram_database_engine: sqlite
|
||||
|
||||
matrix_mx_puppet_instagram_sqlite_database_path_local: "{{ matrix_mx_puppet_instagram_data_path }}/database.db"
|
||||
matrix_mx_puppet_instagram_sqlite_database_path_in_container: "/data/database.db"
|
||||
|
||||
matrix_mx_puppet_instagram_database_username: matrix_mx_puppet_instagram
|
||||
matrix_mx_puppet_instagram_database_password: ~
|
||||
matrix_mx_puppet_instagram_database_hostname: ''
|
||||
matrix_mx_puppet_instagram_database_port: 5432
|
||||
matrix_mx_puppet_instagram_database_name: matrix_mx_puppet_instagram
|
||||
matrix_mx_puppet_instagram_database_sslmode: disable
|
||||
|
||||
matrix_mx_puppet_instagram_database_connection_string: 'postgresql://{{ matrix_mx_puppet_instagram_database_username }}:{{ matrix_mx_puppet_instagram_database_password }}@{{ matrix_mx_puppet_instagram_database_hostname }}:{{ matrix_mx_puppet_instagram_database_port }}/{{ matrix_mx_puppet_instagram_database_name }}?sslmode={{ matrix_mx_puppet_instagram_database_sslmode }}'
|
||||
|
||||
# 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_instagram_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mx_puppet_instagram_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mx_puppet_instagram_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mx_puppet_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_mx_puppet_instagram_configuration_yaml`.
|
||||
|
||||
matrix_mx_puppet_instagram_configuration_extension: "{{ matrix_mx_puppet_instagram_configuration_extension_yaml | from_yaml if matrix_mx_puppet_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_mx_puppet_instagram_configuration_yaml`.
|
||||
matrix_mx_puppet_instagram_configuration: "{{ matrix_mx_puppet_instagram_configuration_yaml | from_yaml | combine(matrix_mx_puppet_instagram_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mx_puppet_instagram_registration_yaml: |
|
||||
as_token: "{{ matrix_mx_puppet_instagram_appservice_token }}"
|
||||
hs_token: "{{ matrix_mx_puppet_instagram_homeserver_token }}"
|
||||
id: instagram-puppet
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@_instagrampuppet_.*:{{ matrix_mx_puppet_instagram_homeserver_domain | regex_escape }}'
|
||||
rooms: []
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '#_instagrampuppet_.*:{{ matrix_mx_puppet_instagram_homeserver_domain | regex_escape }}'
|
||||
protocols: []
|
||||
rate_limited: false
|
||||
sender_localpart: _instagrampuppet_bot
|
||||
url: {{ matrix_mx_puppet_instagram_appservice_address }}
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
receive_ephemeral: true
|
||||
|
||||
matrix_mx_puppet_instagram_registration: "{{ matrix_mx_puppet_instagram_registration_yaml | from_yaml }}"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2021 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2022 - 2023 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-instagram
|
||||
- install-all
|
||||
- install-mx-puppet-instagram
|
||||
block:
|
||||
- when: matrix_mx_puppet_instagram_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_mx_puppet_instagram_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-instagram
|
||||
block:
|
||||
- when: not matrix_mx_puppet_instagram_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
@@ -1,124 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2021 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Stuart Mumford
|
||||
# SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2022 Sebastian Gumprich
|
||||
# SPDX-FileCopyrightText: 2024 David Mehren
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_instagram_requires_restart: false
|
||||
|
||||
- when: "matrix_mx_puppet_instagram_database_engine == 'postgres'"
|
||||
block:
|
||||
- name: Check if an SQLite database already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_instagram_sqlite_database_path_local }}"
|
||||
register: matrix_mx_puppet_instagram_sqlite_database_path_local_stat_result
|
||||
|
||||
- when: "matrix_mx_puppet_instagram_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
postgres_db_migration_request:
|
||||
src: "{{ matrix_mx_puppet_instagram_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mx_puppet_instagram_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mx_puppet_instagram_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mx-puppet-instagram.service']
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_instagram_requires_restart: true
|
||||
|
||||
- name: Ensure mx-puppet-instagram image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_instagram_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mx_puppet_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_mx_puppet_instagram_docker_image_force_pull }}"
|
||||
when: matrix_mx_puppet_instagram_enabled | bool and not matrix_mx_puppet_instagram_container_image_self_build
|
||||
register: result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure mx-puppet-instagram paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_mx_puppet_instagram_base_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_instagram_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_instagram_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}", when: "{{ matrix_mx_puppet_instagram_container_image_self_build }}"}
|
||||
when: matrix_mx_puppet_instagram_enabled | bool and item.when | bool
|
||||
|
||||
- name: Ensure mx-puppet-instagram repository is present on self build
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_mx_puppet_instagram_container_image_self_build_repo }}"
|
||||
version: "{{ matrix_mx_puppet_instagram_container_image_self_build_repo_version }}"
|
||||
dest: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_name }}"
|
||||
register: matrix_mx_puppet_instagram_git_pull_results
|
||||
when: "matrix_mx_puppet_instagram_enabled | bool and matrix_mx_puppet_instagram_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure mx-puppet-instagram Docker image is built
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_instagram_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mx_puppet_instagram_git_pull_results.changed 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_instagram_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_mx_puppet_instagram_enabled | bool and matrix_mx_puppet_instagram_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure mx-puppet-instagram config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_instagram_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_instagram_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-instagram-registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_instagram_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_instagram_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-instagram container network is created
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_mx_puppet_instagram_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-instagram.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-instagram.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-mx-puppet-instagram.service"
|
||||
mode: 0644
|
||||
|
||||
- name: Ensure matrix-mx-puppet-instagram.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mx-puppet-instagram.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_mx_puppet_instagram_requires_restart | bool"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2021 - 2022 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mx-puppet-instagram service
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-instagram.service"
|
||||
register: matrix_mx_puppet_instagram_service_stat
|
||||
|
||||
- when: matrix_mx_puppet_instagram_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mx-puppet-instagram is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-instagram
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-mx-puppet-instagram.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-instagram.service"
|
||||
state: absent
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Fail if required mx-puppet-instagram settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_mx_puppet_instagram_appservice_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_instagram_homeserver_address', when: true}
|
||||
- {'name': 'matrix_mx_puppet_instagram_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_instagram_database_hostname', when: "{{ matrix_mx_puppet_instagram_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mx_puppet_instagram_container_network', when: true}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed mx-puppet-instagram variables
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead.
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_mx_puppet_instagram_docker_image_name_prefix', 'new': 'matrix_mx_puppet_instagram_docker_image_registry_prefix'}
|
||||
@@ -1,69 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
bridge:
|
||||
# Port to host the bridge on
|
||||
# Used for communication between the homeserver and the bridge
|
||||
port: {{ matrix_mx_puppet_instagram_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_instagram_homeserver_domain }}
|
||||
# Reachable URL of the Matrix homeserver
|
||||
homeserverUrl: {{ matrix_mx_puppet_instagram_homeserver_address }}
|
||||
{% if matrix_mx_puppet_instagram_login_shared_secret != '' %}
|
||||
loginSharedSecretMap:
|
||||
{{ matrix_domain }}: {{ matrix_mx_puppet_instagram_login_shared_secret }}
|
||||
{% endif %}
|
||||
|
||||
presence:
|
||||
# Bridge Instagram online/offline status
|
||||
enabled: {{ matrix_mx_puppet_instagram_presence_enabled | to_json }}
|
||||
# How often to send status to the homeserver in milliseconds
|
||||
interval: {{ matrix_mx_puppet_instagram_presence_interval | to_json }}
|
||||
|
||||
provisioning:
|
||||
# Regex of Matrix IDs allowed to use the puppet bridge
|
||||
whitelist: {{ matrix_mx_puppet_instagram_provisioning_whitelist|to_json }}
|
||||
# Allow a specific user
|
||||
#- "@alice:example\\.com"
|
||||
# Allow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
# Allow anyone
|
||||
#- ".*"
|
||||
# Regex of Matrix IDs forbidden from using the puppet bridge
|
||||
#blacklist:
|
||||
# Disallow a specific user
|
||||
#- "@bob:example\\.com"
|
||||
# Disallow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
blacklist: {{ matrix_mx_puppet_instagram_provisioning_blacklist|to_json }}
|
||||
|
||||
# Shared secret for the provisioning API for use by integration managers.
|
||||
# If this is not set, the provisioning API will not be enabled.
|
||||
#sharedSecret: random string
|
||||
# Path prefix for the provisioning API. /v1 will be appended to the prefix automatically.
|
||||
apiPrefix: /_matrix/provision
|
||||
|
||||
database:
|
||||
{% if matrix_mx_puppet_instagram_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_instagram_database_connection_string|to_json }}
|
||||
{% else %}
|
||||
# Use SQLite3 as a database backend
|
||||
# The name of the database file
|
||||
filename: {{ matrix_mx_puppet_instagram_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: warn
|
||||
# Date and time formatting
|
||||
lineDateFormat: MMM-D HH:mm:ss.SSS
|
||||
# Logging files
|
||||
# Log files are rotated daily by default
|
||||
files: []
|
||||
@@ -1,5 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,48 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix Mx Puppet Instagram bridge
|
||||
{% for service in matrix_mx_puppet_instagram_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mx_puppet_instagram_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-instagram 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-instagram 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-mx-puppet-instagram \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_mx_puppet_instagram_container_network }} \
|
||||
-e CONFIG_PATH=/config/config.yaml \
|
||||
-e REGISTRATION_PATH=/config/registration.yaml \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_instagram_config_path }},dst=/config \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_instagram_data_path }},dst=/data \
|
||||
{% for arg in matrix_mx_puppet_instagram_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mx_puppet_instagram_docker_image }}
|
||||
|
||||
{% for network in matrix_mx_puppet_instagram_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-instagram
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-instagram
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-instagram 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-instagram 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mx-puppet-instagram
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,5 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2020 Scott Crossen
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,184 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2021 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
# SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
# SPDX-FileCopyrightText: 2021 Ahmad Haghighi
|
||||
# SPDX-FileCopyrightText: 2021 Marcel Ackermann
|
||||
# SPDX-FileCopyrightText: 2022 Daniel Sonck
|
||||
# SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2023 Samuel Meenzen
|
||||
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
# Mx Puppet Slack is a Matrix <-> Slack bridge
|
||||
# Project source code URL: https://gitlab.com/mx-puppet/slack/mx-puppet-slack
|
||||
|
||||
matrix_mx_puppet_slack_enabled: true
|
||||
|
||||
matrix_mx_puppet_slack_scheme: https
|
||||
matrix_mx_puppet_slack_hostname: ''
|
||||
matrix_mx_puppet_slack_path_prefix: /slack/oauth
|
||||
|
||||
matrix_mx_puppet_slack_oauth_client_id: ''
|
||||
matrix_mx_puppet_slack_oauth_client_secret: ''
|
||||
|
||||
matrix_mx_puppet_slack_container_image_self_build: false
|
||||
matrix_mx_puppet_slack_container_image_self_build_repo: "https://gitlab.com/mx-puppet/slack/mx-puppet-slack.git"
|
||||
matrix_mx_puppet_slack_container_image_self_build_version: "{{ 'main' if matrix_mx_puppet_slack_version == 'latest' else matrix_mx_puppet_slack_version }}"
|
||||
matrix_mx_puppet_slack_container_image_self_build_dockerfile_path: "Dockerfile"
|
||||
|
||||
# Controls whether the mx-puppet-slack container exposes its HTTP port (tcp/8432 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8432"), or empty string to not expose.
|
||||
matrix_mx_puppet_slack_container_http_host_bind_port: ''
|
||||
|
||||
# renovate: datasource=docker depName=registry.gitlab.com/mx-puppet/slack/mx-puppet-slack
|
||||
matrix_mx_puppet_slack_version: v0.1.2
|
||||
matrix_mx_puppet_slack_docker_image: "{{ matrix_mx_puppet_slack_docker_image_registry_prefix }}mx-puppet/slack/mx-puppet-slack:{{ matrix_mx_puppet_slack_version }}"
|
||||
matrix_mx_puppet_slack_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mx_puppet_slack_container_image_self_build else matrix_mx_puppet_slack_docker_image_registry_prefix_upstream }}"
|
||||
matrix_mx_puppet_slack_docker_image_registry_prefix_upstream: "{{ matrix_mx_puppet_slack_docker_image_registry_prefix_upstream_default }}"
|
||||
matrix_mx_puppet_slack_docker_image_registry_prefix_upstream_default: "registry.gitlab.com/"
|
||||
matrix_mx_puppet_slack_docker_image_force_pull: "{{ matrix_mx_puppet_slack_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mx_puppet_slack_base_path: "{{ matrix_base_data_path }}/mx-puppet-slack"
|
||||
matrix_mx_puppet_slack_config_path: "{{ matrix_mx_puppet_slack_base_path }}/config"
|
||||
matrix_mx_puppet_slack_data_path: "{{ matrix_mx_puppet_slack_base_path }}/data"
|
||||
matrix_mx_puppet_slack_docker_src_files_path: "{{ matrix_mx_puppet_slack_base_path }}/docker-src"
|
||||
|
||||
matrix_mx_puppet_slack_appservice_port: "8432"
|
||||
|
||||
matrix_mx_puppet_slack_homeserver_address: ""
|
||||
matrix_mx_puppet_slack_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mx_puppet_slack_appservice_address: 'http://matrix-mx-puppet-slack:{{ matrix_mx_puppet_slack_appservice_port }}'
|
||||
|
||||
matrix_mx_puppet_slack_oauth_enabled: true
|
||||
matrix_mx_puppet_slack_oauth_redirect_path: "{{ matrix_mx_puppet_slack_path_prefix }}"
|
||||
matrix_mx_puppet_slack_oauth_redirect_uri: '{{ matrix_mx_puppet_slack_scheme }}://{{ matrix_mx_puppet_slack_hostname }}{{ matrix_mx_puppet_slack_oauth_redirect_path }}'
|
||||
|
||||
# "@alice:example.com" to allow a specific user
|
||||
# "@.*:example.com" to allow users on a specific homeserver
|
||||
# "@.*" to allow anyone
|
||||
matrix_mx_puppet_slack_provisioning_whitelist:
|
||||
- "@.*:{{ matrix_domain | regex_escape }}"
|
||||
|
||||
# Leave empty to disable blacklist
|
||||
# "@bob:example.com" to disallow a specific user
|
||||
# "@.*:example.com" to disallow users on a specific homeserver
|
||||
matrix_mx_puppet_slack_provisioning_blacklist: []
|
||||
|
||||
matrix_mx_puppet_slack_container_network: ""
|
||||
|
||||
matrix_mx_puppet_slack_container_additional_networks: "{{ matrix_mx_puppet_slack_container_additional_networks_auto + matrix_mx_puppet_slack_container_additional_networks_custom }}"
|
||||
matrix_mx_puppet_slack_container_additional_networks_auto: []
|
||||
matrix_mx_puppet_slack_container_additional_networks_custom: []
|
||||
|
||||
# matrix_mx_puppet_slack_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# To inject your own other container labels, see `matrix_mx_puppet_slack_container_labels_additional_labels`.
|
||||
matrix_mx_puppet_slack_container_labels_traefik_enabled: true
|
||||
matrix_mx_puppet_slack_container_labels_traefik_docker_network: "{{ matrix_mx_puppet_slack_container_network }}"
|
||||
matrix_mx_puppet_slack_container_labels_traefik_entrypoints: web-secure
|
||||
matrix_mx_puppet_slack_container_labels_traefik_tls_certResolver: default # noqa var-naming
|
||||
|
||||
# Controls whether labels will be added that expose mx-puppet-slack's public endpoint
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_enabled: true
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_hostname: "{{ matrix_mx_puppet_slack_hostname }}"
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_path_prefix: "{{ matrix_mx_puppet_slack_path_prefix }}"
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_mx_puppet_slack_container_labels_public_endpoint_hostname }}`) && PathPrefix(`{{ matrix_mx_puppet_slack_container_labels_public_endpoint_path_prefix }}`)"
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_priority: 0
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_mx_puppet_slack_container_labels_traefik_entrypoints }}"
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_tls: "{{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_entrypoints != 'web' }}"
|
||||
matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_mx_puppet_slack_container_labels_traefik_tls_certResolver }}" # noqa var-naming
|
||||
|
||||
# matrix_mx_puppet_slack_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# Example:
|
||||
# matrix_mx_puppet_slack_container_labels_additional_labels: |
|
||||
# my.label=1
|
||||
# another.label="here"
|
||||
matrix_mx_puppet_slack_container_labels_additional_labels: ''
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mx_puppet_slack_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-puppet-slack.service depends on.
|
||||
matrix_mx_puppet_slack_systemd_required_services_list: "{{ matrix_mx_puppet_slack_systemd_required_services_list_default + matrix_mx_puppet_slack_systemd_required_services_list_auto + matrix_mx_puppet_slack_systemd_required_services_list_custom }}"
|
||||
matrix_mx_puppet_slack_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_mx_puppet_slack_systemd_required_services_list_auto: []
|
||||
matrix_mx_puppet_slack_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-puppet-slack.service wants
|
||||
matrix_mx_puppet_slack_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mx_puppet_slack_appservice_token: ''
|
||||
matrix_mx_puppet_slack_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_slack_login_shared_secret: ''
|
||||
|
||||
matrix_mx_puppet_slack_presence_enabled: true
|
||||
matrix_mx_puppet_slack_presence_interval: 5000
|
||||
|
||||
# Database configuration, role uses 'sqlite' per default but playbook sets up Postgres by default
|
||||
matrix_mx_puppet_slack_database_engine: sqlite
|
||||
|
||||
matrix_mx_puppet_slack_sqlite_database_path_local: "{{ matrix_mx_puppet_slack_data_path }}/database.db"
|
||||
matrix_mx_puppet_slack_sqlite_database_path_in_container: "/data/database.db"
|
||||
|
||||
matrix_mx_puppet_slack_database_username: matrix_mx_puppet_slack
|
||||
matrix_mx_puppet_slack_database_password: ~
|
||||
matrix_mx_puppet_slack_database_hostname: ''
|
||||
matrix_mx_puppet_slack_database_port: 5432
|
||||
matrix_mx_puppet_slack_database_name: matrix_mx_puppet_slack
|
||||
matrix_mx_puppet_slack_database_sslmode: disable
|
||||
|
||||
matrix_mx_puppet_slack_database_connection_string: 'postgresql://{{ matrix_mx_puppet_slack_database_username }}:{{ matrix_mx_puppet_slack_database_password }}@{{ matrix_mx_puppet_slack_database_hostname }}:{{ matrix_mx_puppet_slack_database_port }}/{{ matrix_mx_puppet_slack_database_name }}?sslmode={{ matrix_mx_puppet_slack_database_sslmode }}'
|
||||
|
||||
# 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_slack_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mx_puppet_slack_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mx_puppet_slack_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mx_puppet_slack_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_slack_configuration_yaml`.
|
||||
|
||||
matrix_mx_puppet_slack_configuration_extension: "{{ matrix_mx_puppet_slack_configuration_extension_yaml | from_yaml if matrix_mx_puppet_slack_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_slack_configuration_yaml`.
|
||||
matrix_mx_puppet_slack_configuration: "{{ matrix_mx_puppet_slack_configuration_yaml | from_yaml | combine(matrix_mx_puppet_slack_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mx_puppet_slack_registration_yaml: |
|
||||
as_token: "{{ matrix_mx_puppet_slack_appservice_token }}"
|
||||
hs_token: "{{ matrix_mx_puppet_slack_homeserver_token }}"
|
||||
id: slack-puppet
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@_slackpuppet_.*:{{ matrix_mx_puppet_slack_homeserver_domain | regex_escape }}'
|
||||
rooms: []
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '#_slackpuppet_.*:{{ matrix_mx_puppet_slack_homeserver_domain | regex_escape }}'
|
||||
protocols: []
|
||||
rate_limited: false
|
||||
sender_localpart: _slackpuppet_bot
|
||||
url: {{ matrix_mx_puppet_slack_appservice_address }}
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
receive_ephemeral: true
|
||||
|
||||
matrix_mx_puppet_slack_registration: "{{ matrix_mx_puppet_slack_registration_yaml | from_yaml }}"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
# SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-slack
|
||||
- install-all
|
||||
- install-mx-puppet-slack
|
||||
block:
|
||||
- when: matrix_mx_puppet_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_mx_puppet_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-slack
|
||||
block:
|
||||
- when: not matrix_mx_puppet_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
@@ -1,150 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
# SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Ensure MX Puppet Slack paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_mx_puppet_slack_base_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_slack_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_slack_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_slack_docker_src_files_path }}", when: "{{ matrix_mx_puppet_slack_container_image_self_build }}"}
|
||||
when: matrix_mx_puppet_slack_enabled | bool and item.when | bool
|
||||
|
||||
- name: Check if an old database file already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_slack_base_path }}/database.db"
|
||||
register: matrix_mx_puppet_slack_stat_database
|
||||
|
||||
- name: (Data relocation) Ensure matrix-mx-puppet-slack.service is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-slack
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
failed_when: false
|
||||
when: "matrix_mx_puppet_slack_stat_database.stat.exists"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_slack_requires_restart: false
|
||||
|
||||
- when: "matrix_mx_puppet_slack_database_engine == 'postgres'"
|
||||
block:
|
||||
- name: Check if an SQLite database already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_slack_sqlite_database_path_local }}"
|
||||
register: matrix_mx_puppet_slack_sqlite_database_path_local_stat_result
|
||||
|
||||
- when: "matrix_mx_puppet_slack_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
postgres_db_migration_request:
|
||||
src: "{{ matrix_mx_puppet_slack_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mx_puppet_slack_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mx_puppet_slack_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mx-puppet-slack.service']
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_slack_requires_restart: true
|
||||
|
||||
- name: Ensure MX Puppet Slack image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_slack_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mx_puppet_slack_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_slack_docker_image_force_pull }}"
|
||||
when: matrix_mx_puppet_slack_enabled | bool and not matrix_mx_puppet_slack_container_image_self_build
|
||||
register: result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure MX Puppet Slack repository is present on self build
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_mx_puppet_slack_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_mx_puppet_slack_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
version: "{{ matrix_mx_puppet_slack_container_image_self_build_version }}"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_name }}"
|
||||
register: matrix_mx_puppet_slack_git_pull_results
|
||||
when: "matrix_mx_puppet_slack_enabled | bool and matrix_mx_puppet_slack_container_image_self_build"
|
||||
|
||||
- name: Ensure MX Puppet Slack Docker image is built
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_slack_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mx_puppet_slack_git_pull_results.changed 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_slack_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: "{{ matrix_mx_puppet_slack_container_image_self_build_dockerfile_path }}"
|
||||
path: "{{ matrix_mx_puppet_slack_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_mx_puppet_slack_enabled | bool and matrix_mx_puppet_slack_container_image_self_build"
|
||||
|
||||
- name: (Data relocation) Move mx-puppet-slack database file to ./data directory
|
||||
ansible.builtin.command:
|
||||
cmd: "mv {{ matrix_mx_puppet_slack_base_path }}/database.db {{ matrix_mx_puppet_slack_data_path }}/database.db"
|
||||
creates: "{{ matrix_mx_puppet_slack_data_path }}/database.db"
|
||||
removes: "{{ matrix_mx_puppet_slack_base_path }}/database.db"
|
||||
when: "matrix_mx_puppet_slack_stat_database.stat.exists"
|
||||
|
||||
- name: Ensure mx-puppet-slack config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_slack_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_slack_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-slack slack-registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_slack_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_slack_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-slack support files installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/{{ item }}.j2"
|
||||
dest: "{{ matrix_mx_puppet_slack_base_path }}/{{ item }}"
|
||||
mode: 0640
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- labels
|
||||
|
||||
- name: Ensure mx-puppet-slack container network is created
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_mx_puppet_slack_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-slack.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-slack.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-mx-puppet-slack.service"
|
||||
mode: 0644
|
||||
|
||||
- name: Ensure matrix-mx-puppet-slack.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mx-puppet-slack.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_mx_puppet_slack_requires_restart | bool"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
# SPDX-FileCopyrightText: 2021 - 2022 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mx-puppet-slack service
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-slack.service"
|
||||
register: matrix_mx_puppet_slack_service_stat
|
||||
|
||||
- when: matrix_mx_puppet_slack_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mx-puppet-slack is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-slack
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-mx-puppet-slack.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-slack.service"
|
||||
state: absent
|
||||
@@ -1,32 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Fail if required mx-puppet-slack settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_mx_puppet_slack_hostname', when: true}
|
||||
- {'name': 'matrix_mx_puppet_slack_path_prefix', when: true}
|
||||
- {'name': 'matrix_mx_puppet_slack_appservice_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_slack_homeserver_address', when: true}
|
||||
- {'name': 'matrix_mx_puppet_slack_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_slack_database_hostname', when: "{{ matrix_mx_puppet_slack_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mx_puppet_slack_container_network', when: true}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed mx-puppet-slack settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_mx_puppet_slack_redirect_path', 'new': 'matrix_mx_puppet_slack_oauth_redirect_path, but setting matrix_mx_puppet_slack_path_prefix is better'}
|
||||
- {'old': 'matrix_mx_puppet_slack_redirect_uri', 'new': '<matrix_mx_puppet_slack_oauth_redirect_uri, but controlling matrix_mx_puppet_slack_scheme/matrix_mx_puppet_slack_hostname/matrix_mx_puppet_slack_path_prefix is better'}
|
||||
- {'old': 'matrix_mx_puppet_slack_docker_image_name_prefix', 'new': 'matrix_mx_puppet_slack_docker_image_registry_prefix'}
|
||||
@@ -1,83 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
bridge:
|
||||
# Port to host the bridge on
|
||||
# Used for communication between the homeserver and the bridge
|
||||
port: {{ matrix_mx_puppet_slack_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_slack_homeserver_domain }}
|
||||
# Reachable URL of the Matrix homeserver
|
||||
homeserverUrl: {{ matrix_mx_puppet_slack_homeserver_address }}
|
||||
{% if matrix_mx_puppet_slack_login_shared_secret != '' %}
|
||||
loginSharedSecretMap:
|
||||
{{ matrix_domain }}: {{ matrix_mx_puppet_slack_login_shared_secret }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
# Slack OAuth settings. Create a slack app at https://api.slack.com/apps
|
||||
oauth:
|
||||
enabled: {{ matrix_mx_puppet_slack_oauth_enabled | to_json }}
|
||||
# Slack app credentials.
|
||||
# N.B. This must be quoted so YAML does not parse it as a float.
|
||||
clientId: '{{ matrix_mx_puppet_slack_oauth_client_id }}'
|
||||
clientSecret: {{ matrix_mx_puppet_slack_oauth_client_secret|to_json }}
|
||||
# Path where to listen for OAuth redirect callbacks.
|
||||
redirectPath: {{ matrix_mx_puppet_slack_oauth_redirect_path | to_json }}
|
||||
# Set up proxying from https://your.domain/redirect_path to http://bindAddress:port/redirect_path,
|
||||
# then set this field and the Slack app redirect URI field to the former.
|
||||
redirectUri: {{ matrix_mx_puppet_slack_oauth_redirect_uri | to_json }}
|
||||
|
||||
presence:
|
||||
# Bridge Discord online/offline status
|
||||
enabled: {{ matrix_mx_puppet_slack_presence_enabled | to_json }}
|
||||
# How often to send status to the homeserver in milliseconds
|
||||
interval: {{ matrix_mx_puppet_slack_presence_interval | to_json }}
|
||||
|
||||
provisioning:
|
||||
# Regex of Matrix IDs allowed to use the puppet bridge
|
||||
whitelist: {{ matrix_mx_puppet_slack_provisioning_whitelist|to_json }}
|
||||
# Allow a specific user
|
||||
#- "@alice:example\\.com"
|
||||
# Allow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
# Allow anyone
|
||||
#- ".*"
|
||||
# Regex of Matrix IDs forbidden from using the puppet bridge
|
||||
#blacklist:
|
||||
# Disallow a specific user
|
||||
#- "@bob:example\\.com"
|
||||
# Disallow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
blacklist: {{ matrix_mx_puppet_slack_provisioning_blacklist|to_json }}
|
||||
|
||||
# Shared secret for the provisioning API for use by integration managers.
|
||||
# If this is not set, the provisioning API will not be enabled.
|
||||
#sharedSecret: random string
|
||||
# Path prefix for the provisioning API. /v1 will be appended to the prefix automatically.
|
||||
apiPrefix: /_matrix/provision
|
||||
|
||||
database:
|
||||
{% if matrix_mx_puppet_slack_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_slack_database_connection_string|to_json }}
|
||||
{% else %}
|
||||
# Use SQLite3 as a database backend
|
||||
# The name of the database file
|
||||
filename: {{ matrix_mx_puppet_slack_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: warn
|
||||
# Date and time formatting
|
||||
lineDateFormat: MMM-D HH:mm:ss.SSS
|
||||
# Logging files
|
||||
# Log files are rotated daily by default
|
||||
files: []
|
||||
@@ -1,8 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 Hugues Morisset
|
||||
SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2021 Marcel Ackermann
|
||||
SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,47 +0,0 @@
|
||||
{#
|
||||
SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
{% if matrix_mx_puppet_slack_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_mx_puppet_slack_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_mx_puppet_slack_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.matrix-mx-puppet-slack.loadbalancer.server.port={{ matrix_mx_puppet_slack_appservice_port }}
|
||||
|
||||
{% if matrix_mx_puppet_slack_container_labels_public_endpoint_enabled %}
|
||||
############################################################
|
||||
# #
|
||||
# Public #
|
||||
# #
|
||||
############################################################
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.rule={{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_rule }}
|
||||
|
||||
{% if matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.priority={{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_priority }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.service=matrix-mx-puppet-slack
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.entrypoints={{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_entrypoints }}
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.tls={{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_tls | to_json }}
|
||||
{% if matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_tls %}
|
||||
traefik.http.routers.matrix-mx-puppet-slack-public.tls.certResolver={{ matrix_mx_puppet_slack_container_labels_public_endpoint_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
############################################################
|
||||
# #
|
||||
# /Public #
|
||||
# #
|
||||
############################################################
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_mx_puppet_slack_container_labels_additional_labels }}
|
||||
@@ -1,52 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix Mx Puppet Slack bridge
|
||||
{% for service in matrix_mx_puppet_slack_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mx_puppet_slack_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-slack 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-slack 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-mx-puppet-slack \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_mx_puppet_slack_container_network }} \
|
||||
{% if matrix_mx_puppet_slack_container_http_host_bind_port %}
|
||||
-p {{ matrix_mx_puppet_slack_container_http_host_bind_port }}:{{ matrix_mx_puppet_slack_appservice_port }} \
|
||||
{% endif %}
|
||||
-e CONFIG_PATH=/config/config.yaml \
|
||||
-e REGISTRATION_PATH=/config/registration.yaml \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_slack_config_path }},dst=/config \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_slack_data_path }},dst=/data \
|
||||
--label-file={{ matrix_mx_puppet_slack_base_path }}/labels \
|
||||
{% for arg in matrix_mx_puppet_slack_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mx_puppet_slack_docker_image }}
|
||||
|
||||
{% for network in matrix_mx_puppet_slack_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-slack
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-slack
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-slack 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-slack 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mx-puppet-slack
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,6 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 Chris van Dijk
|
||||
SPDX-FileCopyrightText: 2020 Rodrigo Belem
|
||||
SPDX-FileCopyrightText: 2020 Scott Crossen
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,184 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2021 MDAD project contributors
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
# SPDX-FileCopyrightText: 2021 Ahmad Haghighi
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2023 Samuel Meenzen
|
||||
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
# Mx Puppet Twitter is a Matrix <-> Twitter bridge
|
||||
# Project source code URL: https://github.com/Sorunome/mx-puppet-twitter
|
||||
|
||||
matrix_mx_puppet_twitter_enabled: true
|
||||
|
||||
matrix_mx_puppet_twitter_scheme: https
|
||||
matrix_mx_puppet_twitter_hostname: ''
|
||||
matrix_mx_puppet_twitter_path_prefix: /twitter/webhook
|
||||
|
||||
matrix_mx_puppet_twitter_container_image_self_build: false
|
||||
matrix_mx_puppet_twitter_container_image_self_build_repo: "https://github.com/Sorunome/mx-puppet-twitter.git"
|
||||
|
||||
# Controls whether the mx-puppet-twitter container exposes its HTTP port (tcp/8432 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8432"), or empty string to not expose.
|
||||
matrix_mx_puppet_twitter_container_http_host_bind_port: ''
|
||||
|
||||
# renovate: datasource=docker depName=sorunome/mx-puppet-twitter
|
||||
matrix_mx_puppet_twitter_version: latest
|
||||
matrix_mx_puppet_twitter_docker_image: "{{ matrix_mx_puppet_twitter_docker_image_registry_prefix }}sorunome/mx-puppet-twitter:{{ matrix_mx_puppet_twitter_version }}"
|
||||
matrix_mx_puppet_twitter_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mx_puppet_twitter_container_image_self_build else matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream }}"
|
||||
matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream: "{{ matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream_default }}"
|
||||
matrix_mx_puppet_twitter_docker_image_registry_prefix_upstream_default: "docker.io/"
|
||||
matrix_mx_puppet_twitter_docker_image_force_pull: "{{ matrix_mx_puppet_twitter_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mx_puppet_twitter_base_path: "{{ matrix_base_data_path }}/mx-puppet-twitter"
|
||||
matrix_mx_puppet_twitter_config_path: "{{ matrix_mx_puppet_twitter_base_path }}/config"
|
||||
matrix_mx_puppet_twitter_data_path: "{{ matrix_mx_puppet_twitter_base_path }}/data"
|
||||
matrix_mx_puppet_twitter_docker_src_files_path: "{{ matrix_mx_puppet_twitter_base_path }}/docker-src"
|
||||
|
||||
matrix_mx_puppet_twitter_appservice_port: "8432"
|
||||
|
||||
matrix_mx_puppet_twitter_homeserver_address: ""
|
||||
matrix_mx_puppet_twitter_homeserver_domain: '{{ matrix_domain }}'
|
||||
matrix_mx_puppet_twitter_appservice_address: 'http://matrix-mx-puppet-twitter:{{ matrix_mx_puppet_twitter_appservice_port }}'
|
||||
|
||||
matrix_mx_puppet_twitter_consumer_key: ''
|
||||
matrix_mx_puppet_twitter_consumer_secret: ''
|
||||
matrix_mx_puppet_twitter_access_token: ''
|
||||
matrix_mx_puppet_twitter_access_token_secret: ''
|
||||
matrix_mx_puppet_twitter_environment: ''
|
||||
matrix_mx_puppet_twitter_server_path: "{{ matrix_mx_puppet_twitter_path_prefix }}"
|
||||
matrix_mx_puppet_twitter_server_url: '{{ matrix_homeserver_url }}{{ matrix_mx_puppet_twitter_server_path }}'
|
||||
|
||||
# "@alice:example.com" to allow a specific user
|
||||
# "@.*:example.com" to allow users on a specific homeserver
|
||||
# "@.*" to allow anyone
|
||||
matrix_mx_puppet_twitter_provisioning_whitelist:
|
||||
- "@.*:{{ matrix_domain | regex_escape }}"
|
||||
|
||||
# Leave empty to disable blacklist
|
||||
# "@bob:example.com" to disallow a specific user
|
||||
# "@.*:example.com" to disallow users on a specific homeserver
|
||||
matrix_mx_puppet_twitter_provisioning_blacklist: []
|
||||
|
||||
matrix_mx_puppet_twitter_container_network: ""
|
||||
|
||||
matrix_mx_puppet_twitter_container_additional_networks: "{{ matrix_mx_puppet_twitter_container_additional_networks_auto + matrix_mx_puppet_twitter_container_additional_networks_custom }}"
|
||||
matrix_mx_puppet_twitter_container_additional_networks_auto: []
|
||||
matrix_mx_puppet_twitter_container_additional_networks_custom: []
|
||||
|
||||
# matrix_mx_puppet_twitter_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# To inject your own other container labels, see `matrix_mx_puppet_twitter_container_labels_additional_labels`.
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_enabled: true
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_docker_network: "{{ matrix_mx_puppet_twitter_container_network }}"
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_entrypoints: web-secure
|
||||
matrix_mx_puppet_twitter_container_labels_traefik_tls_certResolver: default # noqa var-naming
|
||||
|
||||
# Controls whether labels will be added that expose mx-puppet-twitter's public endpoint
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_enabled: true
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_hostname: "{{ matrix_mx_puppet_twitter_hostname }}"
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_path_prefix: "{{ matrix_mx_puppet_twitter_path_prefix }}"
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_mx_puppet_twitter_container_labels_public_endpoint_hostname }}`) && PathPrefix(`{{ matrix_mx_puppet_twitter_container_labels_public_endpoint_path_prefix }}`)"
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_priority: 0
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_mx_puppet_twitter_container_labels_traefik_entrypoints }}"
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_tls: "{{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_entrypoints != 'web' }}"
|
||||
matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_mx_puppet_twitter_container_labels_traefik_tls_certResolver }}" # noqa var-naming
|
||||
|
||||
# matrix_mx_puppet_twitter_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# Example:
|
||||
# matrix_mx_puppet_twitter_container_labels_additional_labels: |
|
||||
# my.label=1
|
||||
# another.label="here"
|
||||
matrix_mx_puppet_twitter_container_labels_additional_labels: ''
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mx_puppet_twitter_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that mx-puppet-twitter.service depends on.
|
||||
matrix_mx_puppet_twitter_systemd_required_services_list: "{{ matrix_mx_puppet_twitter_systemd_required_services_list_default + matrix_mx_puppet_twitter_systemd_required_services_list_auto + matrix_mx_puppet_twitter_systemd_required_services_list_custom }}"
|
||||
matrix_mx_puppet_twitter_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_mx_puppet_twitter_systemd_required_services_list_auto: []
|
||||
matrix_mx_puppet_twitter_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that mx-puppet-twitter.service wants
|
||||
matrix_mx_puppet_twitter_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mx_puppet_twitter_appservice_token: ''
|
||||
matrix_mx_puppet_twitter_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_twitter_login_shared_secret: ''
|
||||
|
||||
matrix_mx_puppet_twitter_presence_enabled: true
|
||||
matrix_mx_puppet_twitter_presence_interval: 5000
|
||||
|
||||
# Database configuration
|
||||
matrix_mx_puppet_twitter_database_engine: sqlite
|
||||
|
||||
matrix_mx_puppet_twitter_sqlite_database_path_local: "{{ matrix_mx_puppet_twitter_data_path }}/database.db"
|
||||
matrix_mx_puppet_twitter_sqlite_database_path_in_container: "/data/database.db"
|
||||
|
||||
matrix_mx_puppet_twitter_database_username: mx_puppet_twitter
|
||||
matrix_mx_puppet_twitter_database_password: ~
|
||||
matrix_mx_puppet_twitter_database_hostname: ''
|
||||
matrix_mx_puppet_twitter_database_port: 5432
|
||||
matrix_mx_puppet_twitter_database_name: matrix_mx_puppet_twitter
|
||||
matrix_mx_puppet_twitter_database_sslmode: disable
|
||||
|
||||
matrix_mx_puppet_twitter_database_connection_string: 'postgresql://{{ matrix_mx_puppet_twitter_database_username }}:{{ matrix_mx_puppet_twitter_database_password }}@{{ matrix_mx_puppet_twitter_database_hostname }}:{{ matrix_mx_puppet_twitter_database_port }}/{{ matrix_mx_puppet_twitter_database_name }}?sslmode={{ matrix_mx_puppet_twitter_database_sslmode }}'
|
||||
|
||||
# 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_twitter_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mx_puppet_twitter_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mx_puppet_twitter_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mx_puppet_twitter_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_twitter_configuration_yaml`.
|
||||
|
||||
matrix_mx_puppet_twitter_configuration_extension: "{{ matrix_mx_puppet_twitter_configuration_extension_yaml | from_yaml if matrix_mx_puppet_twitter_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_twitter_configuration_yaml`.
|
||||
matrix_mx_puppet_twitter_configuration: "{{ matrix_mx_puppet_twitter_configuration_yaml | from_yaml | combine(matrix_mx_puppet_twitter_configuration_extension, recursive=True) }}"
|
||||
|
||||
# The prefix for user IDs and aliases
|
||||
matrix_mx_puppet_twitter_namespace_prefix: _twitterpuppet_
|
||||
matrix_mx_puppet_twitter_bot_localpart: _twitterpuppet_bot
|
||||
|
||||
matrix_mx_puppet_twitter_registration_yaml: |
|
||||
as_token: "{{ matrix_mx_puppet_twitter_appservice_token }}"
|
||||
hs_token: "{{ matrix_mx_puppet_twitter_homeserver_token }}"
|
||||
id: twitter-puppet
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@{{ matrix_mx_puppet_twitter_namespace_prefix | regex_escape }}.*:{{ matrix_mx_puppet_twitter_homeserver_domain | regex_escape }}'
|
||||
rooms: []
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '#{{ matrix_mx_puppet_twitter_namespace_prefix | regex_escape }}.*:{{ matrix_mx_puppet_twitter_homeserver_domain | regex_escape }}'
|
||||
protocols: []
|
||||
rate_limited: false
|
||||
sender_localpart: "{{ matrix_mx_puppet_twitter_bot_localpart }}"
|
||||
url: {{ matrix_mx_puppet_twitter_appservice_address }}
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
receive_ephemeral: true
|
||||
|
||||
matrix_mx_puppet_twitter_registration: "{{ matrix_mx_puppet_twitter_registration_yaml | from_yaml }}"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
# SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-twitter
|
||||
- install-all
|
||||
- install-mx-puppet-twitter
|
||||
block:
|
||||
- when: matrix_mx_puppet_twitter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_mx_puppet_twitter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mx-puppet-twitter
|
||||
block:
|
||||
- when: not matrix_mx_puppet_twitter_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
@@ -1,155 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2020 Stuart Mumford
|
||||
# SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
# SPDX-FileCopyrightText: 2022 Jim Myhrberg
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
# SPDX-FileCopyrightText: 2022 Nikita Chernyi
|
||||
# SPDX-FileCopyrightText: 2022 Sebastian Gumprich
|
||||
# SPDX-FileCopyrightText: 2024 David Mehren
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Ensure MX Puppet Twitter paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_mx_puppet_twitter_base_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_twitter_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_twitter_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}", when: "{{ matrix_mx_puppet_twitter_container_image_self_build }}"}
|
||||
when: matrix_mx_puppet_twitter_enabled | bool and item.when | bool
|
||||
|
||||
- name: Check if an old database file already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_twitter_base_path }}/database.db"
|
||||
register: matrix_mx_puppet_twitter_stat_database
|
||||
|
||||
- name: (Data relocation) Ensure matrix-mx-puppet-twitter.service is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-twitter
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
failed_when: false
|
||||
when: "matrix_mx_puppet_twitter_stat_database.stat.exists"
|
||||
|
||||
- name: (Data relocation) Move mx-puppet-twitter database file to ./data directory
|
||||
ansible.builtin.command:
|
||||
cmd: "mv {{ matrix_mx_puppet_twitter_base_path }}/database.db {{ matrix_mx_puppet_twitter_data_path }}/database.db"
|
||||
creates: "{{ matrix_mx_puppet_twitter_data_path }}/database.db"
|
||||
removes: "{{ matrix_mx_puppet_twitter_base_path }}/database.db"
|
||||
when: "matrix_mx_puppet_twitter_stat_database.stat.exists"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_twitter_requires_restart: false
|
||||
|
||||
- when: "matrix_mx_puppet_twitter_database_engine == 'postgres'"
|
||||
block:
|
||||
- name: Check if an SQLite database already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mx_puppet_twitter_sqlite_database_path_local }}"
|
||||
register: matrix_mx_puppet_twitter_sqlite_database_path_local_stat_result
|
||||
|
||||
- when: "matrix_mx_puppet_twitter_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
postgres_db_migration_request:
|
||||
src: "{{ matrix_mx_puppet_twitter_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mx_puppet_twitter_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mx_puppet_twitter_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mx-puppet-twitter.service']
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mx_puppet_twitter_requires_restart: true
|
||||
|
||||
- name: Ensure MX Puppet Twitter image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_twitter_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mx_puppet_twitter_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_twitter_docker_image_force_pull }}"
|
||||
when: matrix_mx_puppet_twitter_enabled | bool and not matrix_mx_puppet_twitter_container_image_self_build
|
||||
register: result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure MX Puppet Twitter repository is present on self build
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_mx_puppet_twitter_container_image_self_build_repo }}"
|
||||
version: master
|
||||
dest: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_name }}"
|
||||
register: matrix_mx_puppet_twitter_git_pull_results
|
||||
when: "matrix_mx_puppet_twitter_enabled | bool and matrix_mx_puppet_twitter_container_image_self_build"
|
||||
|
||||
- name: Ensure MX Puppet Twitter Docker image is built
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_mx_puppet_twitter_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_mx_puppet_twitter_git_pull_results.changed 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_twitter_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_mx_puppet_twitter_enabled | bool and matrix_mx_puppet_twitter_container_image_self_build"
|
||||
|
||||
- name: Ensure mx-puppet-twitter config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_twitter_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_twitter_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-twitter twitter-registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mx_puppet_twitter_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mx_puppet_twitter_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
|
||||
- name: Ensure mx-puppet-twitter support files installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/{{ item }}.j2"
|
||||
dest: "{{ matrix_mx_puppet_twitter_base_path }}/{{ item }}"
|
||||
mode: 0640
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- labels
|
||||
|
||||
- name: Ensure mx-puppet-twitter container network is created
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_mx_puppet_twitter_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
- name: Ensure matrix-mx-puppet-twitter.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-twitter.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-mx-puppet-twitter.service"
|
||||
mode: 0644
|
||||
|
||||
- name: Ensure matrix-mx-puppet-twitter.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mx-puppet-twitter.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_mx_puppet_twitter_requires_restart | bool"
|
||||
@@ -1,26 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
# SPDX-FileCopyrightText: 2021 - 2022 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2022 Marko Weltzer
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mx-puppet-twitter service
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-twitter.service"
|
||||
register: matrix_mx_puppet_twitter_service_stat
|
||||
|
||||
- when: matrix_mx_puppet_twitter_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mx-puppet-twitter is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-mx-puppet-twitter
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-mx-puppet-twitter.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/system/matrix-mx-puppet-twitter.service"
|
||||
state: absent
|
||||
@@ -1,32 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
|
||||
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
---
|
||||
|
||||
- name: Fail if required mx-puppet-twitter settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_mx_puppet_twitter_hostname', when: true}
|
||||
- {'name': 'matrix_mx_puppet_twitter_path_prefix', when: true}
|
||||
- {'name': 'matrix_mx_puppet_twitter_appservice_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_twitter_homeserver_address', when: true}
|
||||
- {'name': 'matrix_mx_puppet_twitter_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mx_puppet_twitter_database_hostname', when: "{{ matrix_mx_puppet_twitter_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mx_puppet_twitter_container_network', when: true}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed mx-puppet-twitter settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_mx_puppet_twitter_webhook_path', 'new': '<matrix_mx_puppet_twitter_server_path, but setting matrix_mx_puppet_twitter_path_prefix is better'}
|
||||
- {'old': 'matrix_mx_puppet_twitter_webhook_url', 'new': 'matrix_mx_puppet_twitter_server_url, but controlling matrix_mx_puppet_twitter_scheme/matrix_mx_puppet_twitter_hostname/matrix_mx_puppet_twitter_path_prefix is better'}
|
||||
- {'old': 'matrix_mx_puppet_twitter_docker_image_name_prefix', 'new': 'matrix_mx_puppet_twitter_docker_image_registry_prefix'}
|
||||
@@ -1,79 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
bridge:
|
||||
# Port to host the bridge on
|
||||
# Used for communication between the homeserver and the bridge
|
||||
port: {{ matrix_mx_puppet_twitter_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_twitter_homeserver_domain }}
|
||||
# Reachable URL of the Matrix homeserver
|
||||
homeserverUrl: {{ matrix_mx_puppet_twitter_homeserver_address }}
|
||||
{% if matrix_mx_puppet_twitter_login_shared_secret != '' %}
|
||||
loginSharedSecretMap:
|
||||
{{ matrix_domain }}: {{ matrix_mx_puppet_twitter_login_shared_secret }}
|
||||
{% endif %}
|
||||
|
||||
twitter:
|
||||
consumerKey: {{ matrix_mx_puppet_twitter_consumer_key | to_json }}
|
||||
consumerSecret: {{ matrix_mx_puppet_twitter_consumer_secret | to_json }}
|
||||
accessToken: {{ matrix_mx_puppet_twitter_access_token | to_json }}
|
||||
accessTokenSecret: {{ matrix_mx_puppet_twitter_access_token_secret | to_json }}
|
||||
environment: {{ matrix_mx_puppet_twitter_environment | to_json }}
|
||||
server:
|
||||
url: {{ matrix_mx_puppet_twitter_server_url | to_json }}
|
||||
path: {{ matrix_mx_puppet_twitter_server_path | to_json }}
|
||||
|
||||
presence:
|
||||
# Bridge Twitter online/offline status
|
||||
enabled: {{ matrix_mx_puppet_twitter_presence_enabled | to_json }}
|
||||
# How often to send status to the homeserver in milliseconds
|
||||
interval: {{ matrix_mx_puppet_twitter_presence_interval | to_json }}
|
||||
|
||||
provisioning:
|
||||
# Regex of Matrix IDs allowed to use the puppet bridge
|
||||
whitelist: {{ matrix_mx_puppet_twitter_provisioning_whitelist|to_json }}
|
||||
# Allow a specific user
|
||||
#- "@alice:example\\.com"
|
||||
# Allow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
# Allow anyone
|
||||
#- ".*"
|
||||
# Regex of Matrix IDs forbidden from using the puppet bridge
|
||||
#blacklist:
|
||||
# Disallow a specific user
|
||||
#- "@bob:example\\.com"
|
||||
# Disallow users on a specific homeserver
|
||||
#- "@.*:example\\.com"
|
||||
blacklist: {{ matrix_mx_puppet_twitter_provisioning_blacklist|to_json }}
|
||||
|
||||
# Shared secret for the provisioning API for use by integration managers.
|
||||
# If this is not set, the provisioning API will not be enabled.
|
||||
#sharedSecret: random string
|
||||
# Path prefix for the provisioning API. /v1 will be appended to the prefix automatically.
|
||||
apiPrefix: /_matrix/provision
|
||||
|
||||
database:
|
||||
{% if matrix_mx_puppet_twitter_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_twitter_database_connection_string|to_json }}
|
||||
{% else %}
|
||||
# Use SQLite3 as a database backend
|
||||
# The name of the database file
|
||||
filename: {{ matrix_mx_puppet_twitter_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: warn
|
||||
# Date and time formatting
|
||||
lineDateFormat: MMM-D HH:mm:ss.SSS
|
||||
# Logging files
|
||||
# Log files are rotated daily by default
|
||||
files: []
|
||||
@@ -1,5 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 MDAD project contributors
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -1,47 +0,0 @@
|
||||
{#
|
||||
SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
{% if matrix_mx_puppet_twitter_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_mx_puppet_twitter_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_mx_puppet_twitter_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.martix-mx-puppet-twitter.loadbalancer.server.port={{ matrix_mx_puppet_twitter_appservice_port }}
|
||||
|
||||
{% if matrix_mx_puppet_twitter_container_labels_public_endpoint_enabled %}
|
||||
############################################################
|
||||
# #
|
||||
# Public #
|
||||
# #
|
||||
############################################################
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.rule={{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_rule }}
|
||||
|
||||
{% if matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.priority={{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_priority }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.service=martix-mx-puppet-twitter
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.entrypoints={{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_entrypoints }}
|
||||
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.tls={{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_tls | to_json }}
|
||||
{% if matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_tls %}
|
||||
traefik.http.routers.matrix-mx-puppet-twitter-public.tls.certResolver={{ matrix_mx_puppet_twitter_container_labels_public_endpoint_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
############################################################
|
||||
# #
|
||||
# /Public #
|
||||
# #
|
||||
############################################################
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_mx_puppet_twitter_container_labels_additional_labels }}
|
||||
@@ -1,51 +0,0 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix Mx Puppet Twitter bridge
|
||||
{% for service in matrix_mx_puppet_twitter_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mx_puppet_twitter_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-twitter 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-twitter 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-mx-puppet-twitter \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_mx_puppet_twitter_container_network }} \
|
||||
{% if matrix_mx_puppet_twitter_container_http_host_bind_port %}
|
||||
-p {{ matrix_mx_puppet_twitter_container_http_host_bind_port }}:{{ matrix_mx_puppet_twitter_appservice_port }} \
|
||||
{% endif %}
|
||||
-e CONFIG_PATH=/config/config.yaml \
|
||||
-e REGISTRATION_PATH=/config/registration.yaml \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_twitter_config_path }},dst=/config \
|
||||
--mount type=bind,src={{ matrix_mx_puppet_twitter_data_path }},dst=/data \
|
||||
{% for arg in matrix_mx_puppet_twitter_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mx_puppet_twitter_docker_image }}
|
||||
|
||||
{% for network in matrix_mx_puppet_twitter_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-twitter
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-twitter
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mx-puppet-twitter 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mx-puppet-twitter 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mx-puppet-twitter
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,5 +0,0 @@
|
||||
SPDX-FileCopyrightText: 2020 - 2024 Slavi Pantaleev
|
||||
SPDX-FileCopyrightText: 2020 Scott Crossen
|
||||
SPDX-FileCopyrightText: 2020 Tulir Asokan
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -17,7 +17,7 @@ matrix_client_cinny_container_image_self_build: false
|
||||
matrix_client_cinny_container_image_self_build_repo: "https://github.com/ajbura/cinny.git"
|
||||
|
||||
# renovate: datasource=docker depName=ajbura/cinny
|
||||
matrix_client_cinny_version: v4.10.1
|
||||
matrix_client_cinny_version: v4.10.2
|
||||
matrix_client_cinny_docker_image: "{{ matrix_client_cinny_docker_image_registry_prefix }}ajbura/cinny:{{ matrix_client_cinny_version }}"
|
||||
matrix_client_cinny_docker_image_registry_prefix: "{{ 'localhost/' if matrix_client_cinny_container_image_self_build else matrix_client_cinny_docker_image_registry_prefix_upstream }}"
|
||||
matrix_client_cinny_docker_image_registry_prefix_upstream: "{{ matrix_client_cinny_docker_image_registry_prefix_upstream_default }}"
|
||||
|
||||
@@ -547,6 +547,54 @@
|
||||
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mautrix_hangouts_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mautrix_hangouts_.+', wantlist=True) | length > 0"
|
||||
|
||||
- name: (Deprecation) Catch and report mx-puppet-discord variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
The MX Puppet Discord bridge was completely removed from the playbook in November 2025.
|
||||
|
||||
Please remove all `matrix_mx_puppet_discord_*` variables from your configuration file (vars.yml).
|
||||
|
||||
You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mx-puppet-discord.md` for more information.
|
||||
|
||||
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mx_puppet_discord_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mx_puppet_discord_.+', wantlist=True) | length > 0"
|
||||
|
||||
- name: (Deprecation) Catch and report mx-puppet-instagram variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
The MX Puppet Instagram bridge was completely removed from the playbook in November 2025.
|
||||
|
||||
Please remove all `matrix_mx_puppet_instagram_*` variables from your configuration file (vars.yml).
|
||||
|
||||
You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mx-puppet-instagram.md` for more information.
|
||||
|
||||
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mx_puppet_instagram_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mx_puppet_instagram_.+', wantlist=True) | length > 0"
|
||||
|
||||
- name: (Deprecation) Catch and report mx-puppet-slack variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
The MX Puppet Slack bridge was completely removed from the playbook in November 2025.
|
||||
|
||||
Please remove all `matrix_mx_puppet_slack_*` variables from your configuration file (vars.yml).
|
||||
|
||||
You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mx-puppet-slack.md` for more information.
|
||||
|
||||
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mx_puppet_slack_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mx_puppet_slack_.+', wantlist=True) | length > 0"
|
||||
|
||||
- name: (Deprecation) Catch and report mx-puppet-twitter variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
The MX Puppet Twitter bridge was completely removed from the playbook in November 2025.
|
||||
|
||||
Please remove all `matrix_mx_puppet_twitter_*` variables from your configuration file (vars.yml).
|
||||
|
||||
You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mx-puppet-twitter.md` for more information.
|
||||
|
||||
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mx_puppet_twitter_.+', wantlist=True) | join(', ') }}
|
||||
when: "lookup('ansible.builtin.varnames', '^matrix_mx_puppet_twitter_.+', wantlist=True) | length > 0"
|
||||
|
||||
- name: (Deprecation) Catch and report Email2Matrix variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
|
||||
@@ -75,12 +75,8 @@
|
||||
- custom/matrix-bridge-mautrix-discord
|
||||
- custom/matrix-bridge-mautrix-slack
|
||||
- custom/matrix-bridge-mautrix-bluesky
|
||||
- custom/matrix-bridge-mx-puppet-discord
|
||||
- custom/matrix-bridge-mx-puppet-groupme
|
||||
- custom/matrix-bridge-mx-puppet-steam
|
||||
- custom/matrix-bridge-mx-puppet-slack
|
||||
- custom/matrix-bridge-mx-puppet-twitter
|
||||
- custom/matrix-bridge-mx-puppet-instagram
|
||||
- custom/matrix-bridge-postmoogle
|
||||
- custom/matrix-bridge-sms
|
||||
- custom/matrix-bridge-steam
|
||||
|
||||
Reference in New Issue
Block a user