Compare commits
33 Commits
d6df8a9136
...
b685f33ad7
Author | SHA1 | Date | |
---|---|---|---|
b685f33ad7 | |||
55f392c53b | |||
d2b0f941c9 | |||
5ca8dc1080 | |||
8324789ac6 | |||
|
38027e72f6 | ||
|
7440dd34fb | ||
|
5987589436 | ||
|
323f5aa60d | ||
|
5eff67371d | ||
|
2edbabe652 | ||
|
7b0e5ef995 | ||
|
6a573399ae | ||
|
37b584ef58 | ||
|
56d130b8cb | ||
|
b2f9ede87c | ||
|
fe0b60c40b | ||
|
d6a3881092 | ||
|
e539774d9b | ||
|
5e9e8f9e29 | ||
|
a3d19ad318 | ||
|
bc4d29bbb0 | ||
|
cebbe0beec | ||
|
6b94ccbcff | ||
|
39914881a7 | ||
|
99c24ef0e8 | ||
|
f3924d15cd | ||
|
8cc39c5eb5 | ||
|
c05f47666f | ||
|
959a6ac0b1 | ||
|
12b28a4749 | ||
|
4a72c90a6b | ||
|
d9d392a0b1 |
18
CHANGELOG.md
18
CHANGELOG.md
@ -1,3 +1,21 @@
|
||||
# 2022-06-13
|
||||
|
||||
## go-skype-bridge bridging support
|
||||
|
||||
Thanks to [CyberShadow](https://github.com/CyberShadow), the playbook can now install the [go-skype-bridge](https://github.com/kelaresg/go-skype-bridge) bridge for bridging Matrix to [Skype](https://www.skype.com/).
|
||||
|
||||
See our [Setting up Go Skype Bridge](docs/configuring-playbook-bridge-go-skype-bridge.md) documentation to get started.
|
||||
|
||||
The playbook has supported [mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) bridging (see [Setting up MX Puppet Skype bridging](docs/configuring-playbook-bridge-mx-puppet-skype.md)) since [2020-04-09](#2020-04-09), but `mx-puppet-skype` is reportedly broken.
|
||||
|
||||
|
||||
# 2022-06-09
|
||||
|
||||
## Running Ansible in a container can now happen on the Matrix server itself
|
||||
|
||||
If you're tired of being on an old and problematic Ansible version, you can now run [run Ansible in a container on the Matrix server itself](docs/ansible.md#running-ansible-in-a-container-on-the-matrix-server-itself).
|
||||
|
||||
|
||||
# 2022-05-31
|
||||
|
||||
## Synapse v1.60 upgrade may cause trouble and require manual intervention
|
||||
|
@ -30,7 +30,7 @@ Depending on your distribution, you may be able to upgrade Ansible in a few diff
|
||||
|
||||
- by using an additional repository (PPA, etc.), which provides newer Ansible versions. See instructions for [CentOS](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-rhel-centos-or-fedora), [Debian](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-debian), or [Ubuntu](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu) on the Ansible website.
|
||||
|
||||
- by removing the Ansible package (`yum remove ansible` or `apt-get remove ansible`) and installing via [pip](https://pip.pypa.io/en/stable/installing/) (`pip install ansible`).
|
||||
- by removing the Ansible package (`yum remove ansible` or `apt-get remove ansible`) and installing via [pip](https://pip.pypa.io/en/stable/installation/) (`pip install ansible`).
|
||||
|
||||
If using the `pip` method, do note that the `ansible-playbook` binary may not be on the `$PATH` (https://linuxconfig.org/linux-path-environment-variable), but in some more special location like `/usr/local/bin/ansible-playbook`. You may need to invoke it using the full path.
|
||||
|
||||
@ -41,9 +41,50 @@ If you find yourself needing to resort to such hacks, please consider reporting
|
||||
|
||||
## Using Ansible via Docker
|
||||
|
||||
Alternatively, you can run Ansible on your computer from inside a Docker container (powered by the [devture/ansible](https://hub.docker.com/r/devture/ansible/) Docker image).
|
||||
Alternatively, you can run Ansible inside a Docker container (powered by the [devture/ansible](https://hub.docker.com/r/devture/ansible/) Docker image).
|
||||
|
||||
Here's a sample command to get you started (run this from the playbook's directory):
|
||||
This ensures that you're using a very recent Ansible version, which is less likely to be incompatible with the playbook.
|
||||
|
||||
There are 2 ways to go about it:
|
||||
|
||||
- [Running Ansible in a container on the Matrix server itself](#running-ansible-in-a-container-on-the-matrix-server-itself)
|
||||
- [Running Ansible in a container on another computer (not the Matrix server)](#running-ansible-in-a-container-on-another-computer-not-the-matrix-server)
|
||||
|
||||
|
||||
### Running Ansible in a container on the Matrix server itself
|
||||
|
||||
To run Ansible in a (Docker) container on the Matrix server itself, you need to have a working Docker installation.
|
||||
Docker is normally installed by the playbook, so this may be a bit of a chicken and egg problem. To solve it:
|
||||
|
||||
- you **either** need to install Docker manually first. Follow [the upstream instructions](https://docs.docker.com/engine/install/) for your distribution and consider setting `matrix_docker_installation_enabled: false` in your `vars.yml` file, to prevent the playbook from installing Docker
|
||||
- **or** you need to run the playbook in another way (e.g. [Running Ansible in a container on another computer (not the Matrix server)](#running-ansible-in-a-container-on-another-computer-not-the-matrix-server)) at least the first time around
|
||||
|
||||
Once you have a working Docker installation on the server, **clone the playbook** somewhere on the server and configure it as per usual (`inventory/hosts`, `inventory/host_vars/..`, etc.), as described in [configuring the playbook](configuring-playbook.md).
|
||||
|
||||
You would then need to add `ansible_connection=community.docker.nsenter` to the host line in `inventory/hosts`. This tells Ansible to connect to the "remote" machine by switching Linux namespaces with [nsenter](https://man7.org/linux/man-pages/man1/nsenter.1.html), instead of using SSH.
|
||||
Alternatively, you can leave your `inventory/hosts` as is and specify the connection type in **each** `ansible-playbook` call you do later, like this: `ansible-playbook --connection=community.docker.nsenter ...`
|
||||
|
||||
Run this from the playbook's directory:
|
||||
|
||||
```bash
|
||||
docker run -it --rm \
|
||||
--privileged \
|
||||
--pid=host \
|
||||
-w /work \
|
||||
-v `pwd`:/work \
|
||||
--entrypoint=/bin/sh \
|
||||
docker.io/devture/ansible:2.13.0-r0
|
||||
```
|
||||
|
||||
Once you execute the above command, you'll be dropped into a `/work` directory inside a Docker container.
|
||||
The `/work` directory contains the playbook's code.
|
||||
|
||||
You can execute `ansible-playbook ...` (or `ansible-playbook --connection=community.docker.nsenter ...`) commands as per normal now.
|
||||
|
||||
|
||||
### Running Ansible in a container on another computer (not the Matrix server)
|
||||
|
||||
Run this from the playbook's directory:
|
||||
|
||||
```bash
|
||||
docker run -it --rm \
|
||||
@ -51,7 +92,7 @@ docker run -it --rm \
|
||||
-v `pwd`:/work \
|
||||
-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
|
||||
--entrypoint=/bin/sh \
|
||||
docker.io/devture/ansible:2.11.6-r1
|
||||
docker.io/devture/ansible:2.13.0-r0
|
||||
```
|
||||
|
||||
The above command tries to mount an SSH key (`$HOME/.ssh/id_rsa`) into the container (at `/root/.ssh/id_rsa`).
|
||||
@ -60,9 +101,9 @@ If your SSH key is at a different path (not in `$HOME/.ssh/id_rsa`), adjust that
|
||||
Once you execute the above command, you'll be dropped into a `/work` directory inside a Docker container.
|
||||
The `/work` directory contains the playbook's code.
|
||||
|
||||
You can execute `ansible-playbook` commands as per normal now.
|
||||
You can execute `ansible-playbook ...` commands as per normal now.
|
||||
|
||||
### If you don't use SSH keys for authentication
|
||||
#### If you don't use SSH keys for authentication
|
||||
|
||||
If you don't use SSH keys for authentication, simply remove that whole line (`-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro`).
|
||||
To authenticate at your server using a password, you need to add a package. So, when you are in the shell of the ansible docker container (the previously used `docker run -it ...` command), run:
|
||||
|
23
docs/configuring-playbook-bridge-go-skype-bridge.md
Normal file
23
docs/configuring-playbook-bridge-go-skype-bridge.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Setting up Go Skype Bridge (optional)
|
||||
|
||||
The playbook can install and configure
|
||||
[go-skype-bridge](https://github.com/kelaresg/go-skype-bridge) for you.
|
||||
|
||||
See the project page to learn what it does and why it might be useful to you.
|
||||
|
||||
To enable the [Skype](https://www.skype.com/) bridge just use the following
|
||||
playbook configuration:
|
||||
|
||||
|
||||
```yaml
|
||||
matrix_go_skype_bridge_enabled: true
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Once the bot is enabled, you need to start a chat with `Skype bridge bot`
|
||||
with the handle `@skypebridgebot:YOUR_DOMAIN` (where `YOUR_DOMAIN` is your base
|
||||
domain, not the `matrix.` domain).
|
||||
|
||||
Send `help` to the bot to see the commands available.
|
@ -1,5 +1,7 @@
|
||||
# Setting up MX Puppet Skype (optional)
|
||||
|
||||
**Note**: bridging to [Skype](https://www.skype.com/) can also happen via the [go-skype-bridge](configuring-playbook-bridge-go-skype-bridge.md) bridge supported by the playbook. In fact, bridging via `mx-puppet-skype` has often been reported as broken, so we recommend that you go directly for `go-skype-bridge`, instead of this.
|
||||
|
||||
The playbook can install and configure
|
||||
[mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) for you.
|
||||
|
||||
|
@ -120,7 +120,7 @@ When you're done with all the configuration you'd like to do, continue with [Ins
|
||||
|
||||
- [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). (optional)
|
||||
|
||||
- [Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md) (optional)
|
||||
- [Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md) (optional) - often reported as broken; see **Go Skype Bridge** (below) as an alternative
|
||||
|
||||
- [Setting up MX Puppet Slack bridging](configuring-playbook-bridge-mx-puppet-slack.md) (optional)
|
||||
|
||||
@ -134,6 +134,8 @@ When you're done with all the configuration you'd like to do, continue with [Ins
|
||||
|
||||
- [Setting up MX Puppet Steam bridging](configuring-playbook-bridge-mx-puppet-steam.md) (optional)
|
||||
|
||||
- [Setting up Go Skype Bridge bridging](configuring-playbook-bridge-go-skype-bridge.md) (optional)
|
||||
|
||||
- [Setting up Email2Matrix](configuring-playbook-email2matrix.md) (optional)
|
||||
|
||||
- [Setting up Matrix SMS bridging](configuring-playbook-bridge-matrix-bridge-sms.md) (optional)
|
||||
|
@ -252,6 +252,44 @@ matrix_beeper_linkedin_database_password: "{{ '%s' | format(matrix_homeserver_ge
|
||||
#
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-go-skype-bridge
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_go_skype_bridge_enabled: false
|
||||
|
||||
matrix_go_skype_bridge_container_image_self_build: true
|
||||
|
||||
matrix_go_skype_bridge_systemd_required_services_list: |
|
||||
{{
|
||||
['docker.service']
|
||||
+
|
||||
['matrix-' + matrix_homeserver_implementation + '.service']
|
||||
+
|
||||
(['matrix-postgres.service'] if matrix_postgres_enabled else [])
|
||||
+
|
||||
(['matrix-nginx-proxy.service'] if matrix_nginx_proxy_enabled else [])
|
||||
}}
|
||||
|
||||
matrix_go_skype_bridge_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'skype.as.token') | to_uuid }}"
|
||||
|
||||
matrix_go_skype_bridge_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'skype.hs.token') | to_uuid }}"
|
||||
|
||||
matrix_go_skype_bridge_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
|
||||
|
||||
# Postgres is the default, except if not using `matrix_postgres` (internal postgres)
|
||||
matrix_go_skype_bridge_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
|
||||
matrix_go_skype_bridge_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'goskype.db') | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-bridge-go-skype-bridge
|
||||
#
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# matrix-bridge-mautrix-facebook
|
||||
@ -1770,6 +1808,12 @@ matrix_postgres_additional_databases: |
|
||||
'password': matrix_beeper_linkedin_database_password,
|
||||
}] if (matrix_beeper_linkedin_enabled and matrix_beeper_linkedin_database_engine == 'postgres' and matrix_beeper_linkedin_database_hostname == 'matrix-postgres') else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_go_skype_bridge_database_name,
|
||||
'username': matrix_go_skype_bridge_database_username,
|
||||
'password': matrix_go_skype_bridge_database_password,
|
||||
}] if (matrix_go_skype_bridge_enabled and matrix_go_skype_bridge_database_engine == 'postgres' and matrix_go_skype_bridge_database_hostname == 'matrix-postgres') else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mautrix_facebook_database_name,
|
||||
'username': matrix_mautrix_facebook_database_username,
|
||||
|
132
roles/matrix-bridge-go-skype-bridge/defaults/main.yml
Normal file
132
roles/matrix-bridge-go-skype-bridge/defaults/main.yml
Normal file
@ -0,0 +1,132 @@
|
||||
---
|
||||
# Go Skype Bridge is a Matrix <-> Skype bridge
|
||||
# See: https://github.com/kelaresg/go-skype-bridge
|
||||
|
||||
matrix_go_skype_bridge_enabled: true
|
||||
|
||||
matrix_go_skype_bridge_container_image_self_build: true
|
||||
matrix_go_skype_bridge_container_image_self_build_repo: "https://github.com/kelaresg/go-skype-bridge.git"
|
||||
matrix_go_skype_bridge_container_image_self_build_branch: "{{ 'master' if matrix_go_skype_bridge_version == 'latest' else matrix_go_skype_bridge_version }}"
|
||||
|
||||
matrix_go_skype_bridge_version: latest
|
||||
matrix_go_skype_bridge_docker_image: "{{ matrix_go_skype_bridge_docker_image_name_prefix }}kelaresg/go-skype-bridge:{{ matrix_go_skype_bridge_version }}"
|
||||
matrix_go_skype_bridge_docker_image_name_prefix: "localhost/"
|
||||
matrix_go_skype_bridge_docker_image_force_pull: "{{ matrix_go_skype_bridge_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_go_skype_bridge_base_path: "{{ matrix_base_data_path }}/go-skype-bridge"
|
||||
matrix_go_skype_bridge_config_path: "{{ matrix_go_skype_bridge_base_path }}/config"
|
||||
matrix_go_skype_bridge_data_path: "{{ matrix_go_skype_bridge_base_path }}/data"
|
||||
matrix_go_skype_bridge_docker_src_files_path: "{{ matrix_go_skype_bridge_base_path }}/docker-src"
|
||||
|
||||
matrix_go_skype_bridge_homeserver_address: "{{ matrix_homeserver_container_url }}"
|
||||
matrix_go_skype_bridge_homeserver_domain: "{{ matrix_domain }}"
|
||||
matrix_go_skype_bridge_appservice_address: 'http://matrix-go-skype-bridge:8080'
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_go_skype_bridge_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-go-skype-bridge.service depends on.
|
||||
matrix_go_skype_bridge_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# List of systemd services that matrix-go-skype-bridge.service wants
|
||||
matrix_go_skype_bridge_systemd_wanted_services_list: []
|
||||
|
||||
matrix_go_skype_bridge_appservice_token: ''
|
||||
matrix_go_skype_bridge_homeserver_token: ''
|
||||
|
||||
matrix_go_skype_bridge_appservice_bot_username: skypebridgebot
|
||||
|
||||
# Whether or not created rooms should have federation enabled.
|
||||
# If false, created portal rooms will never be federated.
|
||||
matrix_go_skype_bridge_federate_rooms: true
|
||||
|
||||
# Database-related configuration fields.
|
||||
#
|
||||
# To use SQLite, stick to these defaults.
|
||||
#
|
||||
# To use Postgres:
|
||||
# - change the engine (`matrix_go_skype_bridge_database_engine: 'postgres'`)
|
||||
# - adjust your database credentials via the `matrix_go_skype_bridge_database_*` variables
|
||||
matrix_go_skype_bridge_database_engine: 'sqlite'
|
||||
|
||||
matrix_go_skype_bridge_sqlite_database_path_local: "{{ matrix_go_skype_bridge_data_path }}/go-skype-bridge.db"
|
||||
matrix_go_skype_bridge_sqlite_database_path_in_container: "/data/go-skype-bridge.db"
|
||||
|
||||
matrix_go_skype_bridge_database_username: 'matrix_go_skype_bridge'
|
||||
matrix_go_skype_bridge_database_password: 'some-password'
|
||||
matrix_go_skype_bridge_database_hostname: 'matrix-postgres'
|
||||
matrix_go_skype_bridge_database_port: 5432
|
||||
matrix_go_skype_bridge_database_name: 'matrix_go_skype_bridge'
|
||||
|
||||
matrix_go_skype_bridge_database_connection_string: 'postgresql://{{ matrix_go_skype_bridge_database_username }}:{{ matrix_go_skype_bridge_database_password }}@{{ matrix_go_skype_bridge_database_hostname }}:{{ matrix_go_skype_bridge_database_port }}/{{ matrix_go_skype_bridge_database_name }}?sslmode=disable'
|
||||
|
||||
matrix_go_skype_bridge_appservice_database_type: "{{
|
||||
{
|
||||
'sqlite': 'sqlite3',
|
||||
'postgres':'postgres',
|
||||
}[matrix_go_skype_bridge_database_engine]
|
||||
}}"
|
||||
|
||||
matrix_go_skype_bridge_appservice_database_uri: "{{
|
||||
{
|
||||
'sqlite': matrix_go_skype_bridge_sqlite_database_path_in_container,
|
||||
'postgres': matrix_go_skype_bridge_database_connection_string,
|
||||
}[matrix_go_skype_bridge_database_engine]
|
||||
}}"
|
||||
|
||||
# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
|
||||
matrix_go_skype_bridge_login_shared_secret: ''
|
||||
matrix_go_skype_bridge_bridge_login_shared_secret_map:
|
||||
"{{ {matrix_go_skype_bridge_homeserver_domain: matrix_go_skype_bridge_login_shared_secret} if matrix_go_skype_bridge_login_shared_secret else {} }}"
|
||||
|
||||
# Servers to always allow double puppeting from
|
||||
matrix_go_skype_bridge_bridge_double_puppet_server_map:
|
||||
"{{ matrix_go_skype_bridge_homeserver_domain : matrix_go_skype_bridge_homeserver_address }}"
|
||||
|
||||
# Default go-skype-bridge 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_go_skype_bridge_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_go_skype_bridge_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_go_skype_bridge_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_go_skype_bridge_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_go_skype_bridge_configuration_yaml`.
|
||||
|
||||
matrix_go_skype_bridge_configuration_extension: "{{ matrix_go_skype_bridge_configuration_extension_yaml|from_yaml if matrix_go_skype_bridge_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_go_skype_bridge_configuration_yaml`.
|
||||
matrix_go_skype_bridge_configuration: "{{ matrix_go_skype_bridge_configuration_yaml|from_yaml|combine(matrix_go_skype_bridge_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_go_skype_bridge_registration_yaml: |
|
||||
id: skype
|
||||
url: {{ matrix_go_skype_bridge_appservice_address }}
|
||||
as_token: "{{ matrix_go_skype_bridge_appservice_token }}"
|
||||
hs_token: "{{ matrix_go_skype_bridge_homeserver_token }}"
|
||||
# See https://github.com/mautrix/signal/issues/43
|
||||
sender_localpart: _bot_{{ matrix_go_skype_bridge_appservice_bot_username }}
|
||||
rate_limited: false
|
||||
namespaces:
|
||||
users:
|
||||
- regex: '^@skype-(.*):{{ matrix_go_skype_bridge_homeserver_domain|regex_escape }}$'
|
||||
exclusive: true
|
||||
- exclusive: true
|
||||
regex: '^@{{ matrix_go_skype_bridge_appservice_bot_username|regex_escape }}:{{ matrix_go_skype_bridge_homeserver_domain|regex_escape }}$'
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
|
||||
matrix_go_skype_bridge_registration: "{{ matrix_go_skype_bridge_registration_yaml|from_yaml }}"
|
||||
|
||||
# Enable End-to-bridge encryption
|
||||
matrix_go_skype_bridge_bridge_encryption_allow: false
|
||||
matrix_go_skype_bridge_bridge_encryption_default: "{{ matrix_go_skype_bridge_bridge_encryption_allow }}"
|
||||
|
||||
# Minimum severity of journal log messages.
|
||||
# Options: debug, info, warn, error, fatal
|
||||
matrix_go_skype_bridge_log_level: 'warn'
|
21
roles/matrix-bridge-go-skype-bridge/tasks/init.yml
Normal file
21
roles/matrix-bridge-go-skype-bridge/tasks/init.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-go-skype-bridge.service'] }}"
|
||||
when: matrix_go_skype_bridge_enabled|bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{
|
||||
matrix_synapse_container_extra_arguments|default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_go_skype_bridge_config_path }}/registration.yaml,dst=/matrix-go-skype-bridge-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_synapse_app_service_config_files: >
|
||||
{{
|
||||
matrix_synapse_app_service_config_files|default([])
|
||||
+
|
||||
["/matrix-go-skype-bridge-registration.yaml"]
|
||||
}}
|
||||
when: matrix_go_skype_bridge_enabled|bool
|
23
roles/matrix-bridge-go-skype-bridge/tasks/main.yml
Normal file
23
roles/matrix-bridge-go-skype-bridge/tasks/main.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_go_skype_bridge_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-go-skype-bridge
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_go_skype_bridge_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-go-skype-bridge
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_go_skype_bridge_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-go-skype-bridge
|
147
roles/matrix-bridge-go-skype-bridge/tasks/setup_install.yml
Normal file
147
roles/matrix-bridge-go-skype-bridge/tasks/setup_install.yml
Normal file
@ -0,0 +1,147 @@
|
||||
---
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
msg: >-
|
||||
The matrix-bridge-go-skype-bridge role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- set_fact:
|
||||
matrix_go_skype_bridge_requires_restart: false
|
||||
|
||||
- block:
|
||||
- name: Check if an SQLite database already exists
|
||||
stat:
|
||||
path: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}"
|
||||
register: matrix_go_skype_bridge_sqlite_database_path_local_stat_result
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_go_skype_bridge_database_connection_string }}"
|
||||
caller: "{{ role_path|basename }}"
|
||||
engine_variable_name: 'matrix_go_skype_bridge_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-go-skype-bridge.service']
|
||||
pgloader_options: ['--with "quote identifiers"']
|
||||
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
|
||||
- set_fact:
|
||||
matrix_go_skype_bridge_requires_restart: true
|
||||
when: "matrix_go_skype_bridge_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_go_skype_bridge_database_engine == 'postgres'"
|
||||
|
||||
|
||||
- name: Ensure Go Skype Bridge paths exists
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_go_skype_bridge_base_path }}", when: true}
|
||||
- {path: "{{ matrix_go_skype_bridge_config_path }}", when: true}
|
||||
- {path: "{{ matrix_go_skype_bridge_data_path }}", when: true}
|
||||
- {path: "{{ matrix_go_skype_bridge_docker_src_files_path }}", when: "{{ matrix_go_skype_bridge_container_image_self_build }}"}
|
||||
when: item.when|bool
|
||||
|
||||
- name: Ensure Go Skype Bridge image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_go_skype_bridge_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_go_skype_bridge_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_go_skype_bridge_docker_image_force_pull }}"
|
||||
when: not matrix_go_skype_bridge_container_image_self_build
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure Go Skype Bridge repository is present on self-build
|
||||
git:
|
||||
repo: "{{ matrix_go_skype_bridge_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_go_skype_bridge_docker_src_files_path }}"
|
||||
version: "{{ matrix_go_skype_bridge_container_image_self_build_branch }}"
|
||||
force: "yes"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_go_skype_bridge_git_pull_results
|
||||
when: "matrix_go_skype_bridge_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Go Skype Bridge Docker image is built
|
||||
docker_image:
|
||||
name: "{{ matrix_go_skype_bridge_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_go_skype_bridge_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_go_skype_bridge_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_go_skype_bridge_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_go_skype_bridge_container_image_self_build|bool"
|
||||
|
||||
- name: Check if an old database file exists
|
||||
stat:
|
||||
path: "{{ matrix_go_skype_bridge_base_path }}/go-skype-bridge.db"
|
||||
register: matrix_go_skype_bridge_stat_database
|
||||
|
||||
- name: Check if an old matrix state file exists
|
||||
stat:
|
||||
path: "{{ matrix_go_skype_bridge_base_path }}/mx-state.json"
|
||||
register: matrix_go_skype_bridge_stat_mx_state
|
||||
|
||||
- name: (Data relocation) Ensure matrix-go-skype-bridge.service is stopped
|
||||
service:
|
||||
name: matrix-go-skype-bridge
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
failed_when: false
|
||||
when: "matrix_go_skype_bridge_stat_database.stat.exists"
|
||||
|
||||
- name: (Data relocation) Move go-skype-bridge database file to ./data directory
|
||||
command: "mv {{ matrix_go_skype_bridge_base_path }}/go-skype-bridge.db {{ matrix_go_skype_bridge_data_path }}/go-skype-bridge.db"
|
||||
when: "matrix_go_skype_bridge_stat_database.stat.exists"
|
||||
|
||||
- name: (Data relocation) Move go-skype-bridge mx-state file to ./data directory
|
||||
command: "mv {{ matrix_go_skype_bridge_base_path }}/mx-state.json {{ matrix_go_skype_bridge_data_path }}/mx-state.json"
|
||||
when: "matrix_go_skype_bridge_stat_mx_state.stat.exists"
|
||||
|
||||
- name: Ensure go-skype-bridge config.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_go_skype_bridge_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_go_skype_bridge_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure go-skype-bridge registration.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_go_skype_bridge_registration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_go_skype_bridge_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-go-skype-bridge.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-go-skype-bridge.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-go-skype-bridge.service"
|
||||
mode: 0644
|
||||
register: matrix_go_skype_bridge_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-go-skype-bridge.service installation
|
||||
service:
|
||||
daemon_reload: true
|
||||
when: "matrix_go_skype_bridge_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure matrix-go-skype-bridge.service restarted, if necessary
|
||||
service:
|
||||
name: "matrix-go-skype-bridge.service"
|
||||
state: restarted
|
||||
when: "matrix_go_skype_bridge_requires_restart|bool"
|
@ -0,0 +1,25 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-go-skype-bridge service
|
||||
stat:
|
||||
path: "/etc/systemd/system/matrix-go-skype-bridge.service"
|
||||
register: matrix_go_skype_bridge_service_stat
|
||||
|
||||
- name: Ensure matrix-go-skype-bridge is stopped
|
||||
service:
|
||||
name: matrix-go-skype-bridge
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_go_skype_bridge_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-go-skype-bridge.service doesn't exist
|
||||
file:
|
||||
path: "/etc/systemd/system/matrix-go-skype-bridge.service"
|
||||
state: absent
|
||||
when: "matrix_go_skype_bridge_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-go-skype-bridge.service removal
|
||||
service:
|
||||
daemon_reload: true
|
||||
when: "matrix_go_skype_bridge_service_stat.stat.exists"
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
with_items:
|
||||
- "matrix_go_skype_bridge_appservice_token"
|
||||
- "matrix_go_skype_bridge_homeserver_token"
|
238
roles/matrix-bridge-go-skype-bridge/templates/config.yaml.j2
Normal file
238
roles/matrix-bridge-go-skype-bridge/templates/config.yaml.j2
Normal file
@ -0,0 +1,238 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
# Homeserver details.
|
||||
homeserver:
|
||||
# The address that this appservice can use to connect to the homeserver.
|
||||
address: {{ matrix_go_skype_bridge_homeserver_address }}
|
||||
# The domain of the homeserver (for MXIDs, etc).
|
||||
domain: {{ matrix_go_skype_bridge_homeserver_domain }}
|
||||
# If you don’t know what this is, no need to modify(for parse "mention user/reply message, etc")
|
||||
server_name: matrix.to
|
||||
|
||||
# Application service host/registration related details.
|
||||
# Changing these values requires regeneration of the registration.
|
||||
appservice:
|
||||
# The address that the homeserver can use to connect to this appservice.
|
||||
address: {{ matrix_go_skype_bridge_appservice_address }}
|
||||
|
||||
# The hostname and port where this appservice should listen.
|
||||
hostname: 0.0.0.0
|
||||
port: 8080
|
||||
|
||||
# Database config.
|
||||
database:
|
||||
# The database type. "sqlite3" and "postgres" are supported.
|
||||
type: {{ matrix_go_skype_bridge_appservice_database_type|to_json }}
|
||||
# The database URI.
|
||||
# SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
|
||||
# Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
|
||||
uri: {{ matrix_go_skype_bridge_appservice_database_uri|to_json }}
|
||||
# Maximum number of connections. Mostly relevant for Postgres.
|
||||
max_open_conns: 20
|
||||
max_idle_conns: 2
|
||||
|
||||
# Settings for provisioning API
|
||||
provisioning:
|
||||
# Prefix for the provisioning API paths.
|
||||
prefix: /_matrix/provision/v1
|
||||
# Shared secret for authentication. If set to "disable", the provisioning API will be disabled.
|
||||
shared_secret: disable
|
||||
|
||||
# The unique ID of this appservice.
|
||||
id: skype
|
||||
# Appservice bot details.
|
||||
bot:
|
||||
# Username of the appservice bot.
|
||||
username: skypebridgebot
|
||||
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
|
||||
# to leave display name/avatar as-is.
|
||||
displayname: Skype bridge bot
|
||||
avatar: mxc://matrix.org/kGQUDQyPiwbRXPFkjoBrPyhC
|
||||
|
||||
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
|
||||
as_token: "{{ matrix_go_skype_bridge_appservice_token }}"
|
||||
hs_token: "{{ matrix_go_skype_bridge_homeserver_token }}"
|
||||
|
||||
# Bridge config
|
||||
bridge:
|
||||
# Localpart template of MXIDs for Skype users.
|
||||
# {{ '{{.}}' }} is replaced with the phone number of the Skype user.
|
||||
username_template: {{ 'skype-{{.}}' }}
|
||||
# Displayname template for Skype users.
|
||||
# {{ '{{.Notify}}' }} - nickname set by the Skype user
|
||||
# {{ '{{.Jid}}' }} - phone number (international format)
|
||||
# The following variables are also available, but will cause problems on multi-user instances:
|
||||
# {{ '{{.Name}}' }} - display name from contact list
|
||||
# {{ '{{.Short}}' }} - short display name from contact list
|
||||
# To use multiple if's, you need to use: {{ '{{else if .Name}}' }}, for example:
|
||||
# "{{ '{{if .Notify}}' }}{{ '{{.Notify}}' }}{{ '{{else if .Name}}' }}{{ '{{.Name}}' }}{{ '{{else}}' }}{{ '{{.Jid}}' }}{{ '{{end}}' }} (WA)"
|
||||
displayname_template: "{{ '{{if .DisplayName}}' }}{{ '{{.DisplayName}}' }}{{ '{{else}}' }}{{ '{{.PersonId}}' }}{{ '{{end}}' }} (Skype)"
|
||||
# Localpart template for per-user room grouping community IDs.
|
||||
# On startup, the bridge will try to create these communities, add all of the specific user's
|
||||
# portals to the community, and invite the Matrix user to it.
|
||||
# (Note that, by default, non-admins might not have your homeserver's permission to create
|
||||
# communities.)
|
||||
# {{ '{{.Localpart}}' }} is the MXID localpart and {{ '{{.Server}}' }} is the MXID server part of the user.
|
||||
community_template: skype-{{ '{{.Localpart}}' }}={{ '{{.Server}}' }}
|
||||
|
||||
# Skype connection timeout in seconds.
|
||||
connection_timeout: 20
|
||||
# If Skype doesn't respond within connection_timeout, should the bridge try to fetch the message
|
||||
# to see if it was actually bridged? Use this if you have problems with sends timing out but actually
|
||||
# succeeding.
|
||||
fetch_message_on_timeout: false
|
||||
# Whether or not the bridge should send a read receipt from the bridge bot when a message has been
|
||||
# sent to Skype. If fetch_message_on_timeout is enabled, a successful post-timeout fetch will
|
||||
# trigger a read receipt too.
|
||||
delivery_receipts: false
|
||||
# Number of times to regenerate QR code when logging in.
|
||||
# The regenerated QR code is sent as an edit and essentially multiplies the login timeout (20 seconds)
|
||||
login_qr_regen_count: 2
|
||||
# Maximum number of times to retry connecting on connection error.
|
||||
max_connection_attempts: 3
|
||||
# Number of seconds to wait between connection attempts.
|
||||
# Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
|
||||
connection_retry_delay: -1
|
||||
# Whether or not the bridge should send a notice to the user's management room when it retries connecting.
|
||||
# If false, it will only report when it stops retrying.
|
||||
report_connection_retry: true
|
||||
# Maximum number of seconds to wait for chats to be sent at startup.
|
||||
# If this is too low and you have lots of chats, it could cause backfilling to fail.
|
||||
chat_list_wait: 30
|
||||
# Maximum number of seconds to wait to sync portals before force unlocking message processing.
|
||||
# If this is too low and you have lots of chats, it could cause backfilling to fail.
|
||||
portal_sync_wait: 600
|
||||
|
||||
# Whether or not to send call start/end notices to Matrix.
|
||||
call_notices:
|
||||
start: true
|
||||
end: true
|
||||
|
||||
# Number of chats to sync for new users.
|
||||
# Since some of the obtained conversations are not the conversations that the user needs to see,
|
||||
# the actual number of conversations displayed on the matrix client will be slightly less than the set value
|
||||
initial_chat_sync_count: 10
|
||||
# Number of old messages to fill when creating new portal rooms.
|
||||
initial_history_fill_count: 20
|
||||
# Whether or not notifications should be turned off while filling initial history.
|
||||
# Only applicable when using double puppeting.
|
||||
initial_history_disable_notifications: false
|
||||
# Maximum number of chats to sync when recovering from downtime.
|
||||
# Set to -1 to sync all new chats during downtime.
|
||||
recovery_chat_sync_limit: -1
|
||||
# Whether or not to sync history when recovering from downtime.
|
||||
recovery_history_backfill: true
|
||||
# Maximum number of seconds since last message in chat to skip
|
||||
# syncing the chat in any case. This setting will take priority
|
||||
# over both recovery_chat_sync_limit and initial_chat_sync_count.
|
||||
# Default is 3 days = 259200 seconds
|
||||
sync_max_chat_age: 259200
|
||||
|
||||
# sync contact, Non-martix-standard parameter, defaults to false
|
||||
sync_contact: false
|
||||
|
||||
# Whether or not to sync with custom puppets to receive EDUs that
|
||||
# are not normally sent to appservices.
|
||||
sync_with_custom_puppets: true
|
||||
|
||||
# Servers to always allow double puppeting from
|
||||
double_puppet_server_map:
|
||||
"{{ matrix_go_skype_bridge_homeserver_domain }}": {{ matrix_go_skype_bridge_homeserver_address }}
|
||||
# Allow using double puppeting from any server with a valid client .well-known file.
|
||||
double_puppet_allow_discovery: false
|
||||
# Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
|
||||
#
|
||||
# If set, custom puppets will be enabled automatically for local users
|
||||
# instead of users having to find an access token and run `login-matrix`
|
||||
# manually.
|
||||
login_shared_secret_map: {{ matrix_go_skype_bridge_bridge_login_shared_secret_map|to_json }}
|
||||
|
||||
# Whether or not to invite own Skype user's Matrix puppet into private
|
||||
# chat portals when backfilling if needed.
|
||||
# This always uses the default puppet instead of custom puppets due to
|
||||
# rate limits and timestamp massaging.
|
||||
invite_own_puppet_for_backfilling: true
|
||||
# Whether or not to explicitly set the avatar and room name for private
|
||||
# chat portal rooms. This can be useful if the previous field works fine,
|
||||
# but causes room avatar/name bugs.
|
||||
private_chat_portal_meta: true
|
||||
|
||||
# Whether or not thumbnails from Skype should be sent.
|
||||
# They're disabled by default due to very low resolution.
|
||||
Skype_thumbnail: false
|
||||
|
||||
# Allow invite permission for user. User can invite any bots to room with Skype
|
||||
# users (private chat and groups)
|
||||
allow_user_invite: false
|
||||
|
||||
# The prefix for commands. Only required in non-management rooms.
|
||||
command_prefix: "!wa"
|
||||
|
||||
# End-to-bridge encryption support options. This requires login_shared_secret to be configured
|
||||
# in order to get a device for the bridge bot.
|
||||
#
|
||||
# Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
|
||||
# application service.
|
||||
encryption:
|
||||
# Allow encryption, work in group chat rooms with e2ee enabled
|
||||
allow: {{ matrix_go_skype_bridge_bridge_encryption_allow|to_json }}
|
||||
# Default to encryption, force-enable encryption in all portals the bridge creates
|
||||
# This will cause the bridge bot to be in private chats for the encryption to work properly.
|
||||
# It is recommended to also set private_chat_portal_meta to true when using this.
|
||||
default: {{ matrix_go_skype_bridge_bridge_encryption_default|to_json }}
|
||||
|
||||
puppet_id:
|
||||
# when set to true, the matrixid of the contact (puppet) from the bridge to the matrix will be encrypted into another string
|
||||
allow: false
|
||||
# 8 characters
|
||||
key: '12dsf323'
|
||||
# Use the username_template prefix. (Warning: At present, username_template cannot be too complicated, otherwise this function may cause unknown errors)
|
||||
username_template_prefix: 'skype-'
|
||||
|
||||
# Permissions for using the bridge.
|
||||
# Permitted values:
|
||||
# relaybot - Talk through the relaybot (if enabled), no access otherwise
|
||||
# user - Access to use the bridge to chat with a Skype account.
|
||||
# admin - User level and some additional administration tools
|
||||
# Permitted keys:
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
permissions:
|
||||
"{{ matrix_go_skype_bridge_homeserver_domain }}": user
|
||||
|
||||
relaybot:
|
||||
# Whether or not relaybot support is enabled.
|
||||
enabled: false
|
||||
# The management room for the bot. This is where all status notifications are posted and
|
||||
# in this room, you can use `!wa <command>` instead of `!wa relaybot <command>`. Omitting
|
||||
# the command prefix completely like in user management rooms is not possible.
|
||||
management: '!foo:example.com'
|
||||
# List of users to invite to all created rooms that include the relaybot.
|
||||
invites: []
|
||||
# The formats to use when sending messages to Skype via the relaybot.
|
||||
message_formats:
|
||||
m.text: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: {{ '{{ .Message }}' }}"
|
||||
m.notice: "<b>{{ '{{ .Sender.Displayname }}' }}</b>:: {{ '{{ .Message }}' }}"
|
||||
m.emote: "* <b>{{ '{{ .Sender.Displayname }}' }}</b>: {{ '{{ .Message }}' }}"
|
||||
m.file: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a file"
|
||||
m.image: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent an image"
|
||||
m.audio: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent an audio file"
|
||||
m.video: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a video"
|
||||
m.location: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a location"
|
||||
|
||||
# Logging config.
|
||||
logging:
|
||||
# The directory for log files. Will be created if not found.
|
||||
directory: ./logs
|
||||
# Available variables: .Date for the file date and .Index for different log files on the same day.
|
||||
# empy/null = journal logging only
|
||||
file_name_format:
|
||||
# Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
|
||||
file_date_format: "2006-01-02"
|
||||
# Log file permissions.
|
||||
file_mode: 0600
|
||||
# Timestamp format for log entries in the Go time format.
|
||||
timestamp_format: "Jan _2, 2006 15:04:05"
|
||||
# Minimum severity for log messages.
|
||||
# Options: debug, info, warn, error, fatal
|
||||
print_level: {{ matrix_go_skype_bridge_log_level }}
|
@ -0,0 +1,43 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix Go Skype Bridge bridge
|
||||
{% for service in matrix_go_skype_bridge_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_go_skype_bridge_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-go-skype-bridge 2>/dev/null || true'
|
||||
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-go-skype-bridge 2>/dev/null || true'
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre={{ matrix_host_command_sleep }} 5
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-go-skype-bridge \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-v {{ matrix_go_skype_bridge_config_path }}:/config:z \
|
||||
-v {{ matrix_go_skype_bridge_data_path }}:/data:z \
|
||||
--workdir=/data \
|
||||
{% for arg in matrix_go_skype_bridge_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_go_skype_bridge_docker_image }} \
|
||||
/usr/bin/matrix-skype -c /config/config.yaml -r /config/registration.yaml
|
||||
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-go-skype-bridge 2>/dev/null || true'
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-go-skype-bridge 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-go-skype-bridge
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -10,7 +10,7 @@ matrix_hookshot_container_image_self_build: false
|
||||
matrix_hookshot_container_image_self_build_repo: "https://github.com/matrix-org/matrix-hookshot.git"
|
||||
matrix_hookshot_container_image_self_build_branch: "{{ 'main' if matrix_hookshot_version == 'latest' else matrix_hookshot_version }}"
|
||||
|
||||
matrix_hookshot_version: 1.7.0
|
||||
matrix_hookshot_version: 1.7.3
|
||||
|
||||
matrix_hookshot_docker_image: "{{ matrix_hookshot_docker_image_name_prefix }}halfshot/matrix-hookshot:{{ matrix_hookshot_version }}"
|
||||
matrix_hookshot_docker_image_name_prefix: "{{ 'localhost/' if matrix_hookshot_container_image_self_build else matrix_container_global_registry_prefix }}"
|
||||
|
@ -8,7 +8,7 @@ matrix_mautrix_whatsapp_container_image_self_build: false
|
||||
matrix_mautrix_whatsapp_container_image_self_build_repo: "https://mau.dev/mautrix/whatsapp.git"
|
||||
matrix_mautrix_whatsapp_container_image_self_build_branch: "{{ 'master' if matrix_mautrix_whatsapp_version == 'latest' else matrix_mautrix_whatsapp_version }}"
|
||||
|
||||
matrix_mautrix_whatsapp_version: v0.4.0
|
||||
matrix_mautrix_whatsapp_version: v0.5.0
|
||||
# See: https://mau.dev/mautrix/whatsapp/container_registry
|
||||
matrix_mautrix_whatsapp_docker_image: "{{ matrix_mautrix_whatsapp_docker_image_name_prefix }}mautrix/whatsapp:{{ matrix_mautrix_whatsapp_version }}"
|
||||
matrix_mautrix_whatsapp_docker_image_name_prefix: "{{ 'localhost/' if matrix_mautrix_whatsapp_container_image_self_build else 'dock.mau.dev/' }}"
|
||||
@ -128,3 +128,7 @@ matrix_mautrix_whatsapp_registration: "{{ matrix_mautrix_whatsapp_registration_y
|
||||
matrix_mautrix_whatsapp_bridge_encryption_allow: false
|
||||
matrix_mautrix_whatsapp_bridge_encryption_default: "{{ matrix_mautrix_whatsapp_bridge_encryption_allow }}"
|
||||
matrix_mautrix_whatsapp_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_whatsapp_bridge_encryption_allow }}"
|
||||
|
||||
# Minimum severity of journal log messages.
|
||||
# Options: debug, info, warn, error, fatal
|
||||
matrix_mautrix_whatsapp_log_level: 'warn'
|
||||
|
@ -211,7 +211,8 @@ logging:
|
||||
# The directory for log files. Will be created if not found.
|
||||
directory: ./logs
|
||||
# Available variables: .Date for the file date and .Index for different log files on the same day.
|
||||
file_name_format: "{{ '{{.Date}}-{{.Index}}.log' }}"
|
||||
# empy/null = journal logging only
|
||||
file_name_format:
|
||||
# Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
|
||||
file_date_format: "2006-01-02"
|
||||
# Log file permissions.
|
||||
@ -220,4 +221,4 @@ logging:
|
||||
timestamp_format: "Jan _2, 2006 15:04:05"
|
||||
# Minimum severity for log messages.
|
||||
# Options: debug, info, warn, error, fatal
|
||||
print_level: debug
|
||||
print_level: {{ matrix_mautrix_whatsapp_log_level }}
|
||||
|
@ -9,7 +9,7 @@ matrix_client_element_container_image_self_build_repo: "https://github.com/vecto
|
||||
# - https://github.com/vector-im/element-web/issues/19544
|
||||
matrix_client_element_container_image_self_build_low_memory_system_patch_enabled: "{{ ansible_memtotal_mb < 4096 }}"
|
||||
|
||||
matrix_client_element_version: v1.10.13
|
||||
matrix_client_element_version: v1.10.15
|
||||
matrix_client_element_docker_image: "{{ matrix_client_element_docker_image_name_prefix }}vectorim/element-web:{{ matrix_client_element_version }}"
|
||||
matrix_client_element_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_element_container_image_self_build else matrix_container_global_registry_prefix }}"
|
||||
matrix_client_element_docker_image_force_pull: "{{ matrix_client_element_docker_image.endswith(':latest') }}"
|
||||
|
@ -23,7 +23,7 @@ matrix_corporal_container_extra_arguments: []
|
||||
# List of systemd services that matrix-corporal.service depends on
|
||||
matrix_corporal_systemd_required_services_list: ['docker.service']
|
||||
|
||||
matrix_corporal_version: 2.2.3
|
||||
matrix_corporal_version: 2.3.0
|
||||
matrix_corporal_docker_image: "{{ matrix_corporal_docker_image_name_prefix }}devture/matrix-corporal:{{ matrix_corporal_docker_image_tag }}"
|
||||
matrix_corporal_docker_image_name_prefix: "{{ 'localhost/' if matrix_corporal_container_image_self_build else matrix_container_global_registry_prefix }}"
|
||||
matrix_corporal_docker_image_tag: "{{ matrix_corporal_version }}" # for backward-compatibility
|
||||
|
@ -9,7 +9,7 @@ matrix_synapse_container_image_self_build_repo: "https://github.com/matrix-org/s
|
||||
|
||||
matrix_synapse_docker_image: "{{ matrix_synapse_docker_image_name_prefix }}matrixdotorg/synapse:{{ matrix_synapse_docker_image_tag }}"
|
||||
matrix_synapse_docker_image_name_prefix: "{{ 'localhost/' if matrix_synapse_container_image_self_build else matrix_container_global_registry_prefix }}"
|
||||
matrix_synapse_version: v1.60.0
|
||||
matrix_synapse_version: v1.61.0
|
||||
matrix_synapse_docker_image_tag: "{{ matrix_synapse_version }}"
|
||||
matrix_synapse_docker_image_force_pull: "{{ matrix_synapse_docker_image.endswith(':latest') }}"
|
||||
|
||||
@ -86,6 +86,14 @@ matrix_synapse_form_secret: "{{ matrix_synapse_macaroon_secret_key }}"
|
||||
|
||||
matrix_synapse_max_upload_size_mb: 50
|
||||
|
||||
# Controls whether local media should be removed under certain conditions, typically for the purpose of saving space.
|
||||
# should be empty to disable
|
||||
matrix_synapse_media_retention_local_media_lifetime:
|
||||
# Controls whether remote media cache (media that is downloaded from other homeservers)
|
||||
# should be removed under certain conditions, typically for the purpose of saving space.
|
||||
# should be empty to disable
|
||||
matrix_synapse_media_retention_remote_media_lifetime:
|
||||
|
||||
# The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
|
||||
matrix_synapse_tmp_directory_size_mb: "{{ matrix_synapse_max_upload_size_mb * 50 }}"
|
||||
|
||||
@ -215,9 +223,6 @@ matrix_synapse_recaptcha_private_key: ''
|
||||
# Disabling this option will not delete any tokens previously generated.
|
||||
matrix_synapse_registration_requires_token: false
|
||||
|
||||
# Allows non-server-admin users to create groups on this server
|
||||
matrix_synapse_enable_group_creation: false
|
||||
|
||||
# A list of 3PID types which users must supply when registering (possible values: email, msisdn).
|
||||
matrix_synapse_registrations_require_3pid: []
|
||||
|
||||
|
@ -60,6 +60,7 @@
|
||||
- {'old': 'matrix_synapse_trusted_third_party_id_servers', 'new': '<deprecated in Synapse v0.99.4 and removed in Synapse v1.19.0>'}
|
||||
- {'old': 'matrix_synapse_use_presence', 'new': 'matrix_synapse_presence_enabled'}
|
||||
- {'old': 'matrix_synapse_version_arm64', 'new': '<superseded by matrix_synapse_version - see https://github.com/matrix-org/synapse/pull/11810>'}
|
||||
- {'old': 'matrix_synapse_enable_group_creation', 'new': '<removed in Synapse v1.61.0 - use the new Spaces feature instead>'}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings in matrix_synapse_configuration_extension_yaml
|
||||
fail:
|
||||
|
@ -1048,6 +1048,14 @@ media_store_path: "/matrix-media-store-parent/{{ matrix_synapse_media_store_dire
|
||||
#
|
||||
max_upload_size: "{{ matrix_synapse_max_upload_size_mb }}M"
|
||||
|
||||
media_retention:
|
||||
{% if matrix_synapse_media_retention_local_media_lifetime %}
|
||||
local_media_lifetime: {{ matrix_synapse_media_retention_local_media_lifetime|to_json }}
|
||||
{% endif %}
|
||||
{% if matrix_synapse_media_retention_remote_media_lifetime %}
|
||||
remote_media_lifetime: {{ matrix_synapse_media_retention_remote_media_lifetime|to_json }}
|
||||
{% endif %}
|
||||
|
||||
# Maximum number of pixels that will be thumbnailed
|
||||
#
|
||||
#max_image_pixels: 32M
|
||||
@ -2600,16 +2608,6 @@ spam_checker: {{ matrix_synapse_spam_checker|to_json }}
|
||||
encryption_enabled_by_default_for_room_type: {{ matrix_synapse_encryption_enabled_by_default_for_room_type|to_json }}
|
||||
|
||||
|
||||
# Uncomment to allow non-server-admin users to create groups on this server
|
||||
#
|
||||
enable_group_creation: {{ matrix_synapse_enable_group_creation|to_json }}
|
||||
|
||||
# If enabled, non server admins can only create groups with local parts
|
||||
# starting with this prefix
|
||||
#
|
||||
#group_creation_prefix: "unofficial_"
|
||||
|
||||
|
||||
|
||||
# User Directory configuration
|
||||
#
|
||||
|
@ -29,9 +29,8 @@ matrix_synapse_workers_generic_worker_endpoints:
|
||||
- ^/_matrix/federation/v1/event_auth/
|
||||
- ^/_matrix/federation/v1/exchange_third_party_invite/
|
||||
- ^/_matrix/federation/v1/user/devices/
|
||||
- ^/_matrix/federation/v1/get_groups_publicised$
|
||||
- ^/_matrix/key/v2/query
|
||||
- ^/_matrix/federation/(v1|unstable/org.matrix.msc2946)/hierarchy/
|
||||
- ^/_matrix/federation/v1/hierarchy/
|
||||
|
||||
# Inbound federation transaction request
|
||||
- ^/_matrix/federation/v1/send/
|
||||
@ -43,15 +42,14 @@ matrix_synapse_workers_generic_worker_endpoints:
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
|
||||
- ^/_matrix/client/(v1|unstable/org.matrix.msc2946)/rooms/.*/hierarchy$
|
||||
- ^/_matrix/client/v1/rooms/.*/hierarchy$
|
||||
- ^/_matrix/client/unstable/org.matrix.msc2716/rooms/.*/batch_send$
|
||||
- ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/account/3pid$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/account/whoami$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/devices$
|
||||
- ^/_matrix/client/versions$
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/joined_groups$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/publicised_groups$
|
||||
- ^/_matrix/client/(r0|v3|unstable)/publicised_groups/
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/search$
|
||||
@ -75,31 +73,27 @@ matrix_synapse_workers_generic_worker_endpoints:
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/join/
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/
|
||||
|
||||
# These appear to be conditional and should not be enabled by default.
|
||||
# We need to fix up our workers-doc-to-yaml.awk parsing script to exclude them.
|
||||
# For now, they've been commented out manually.
|
||||
#
|
||||
# # Device requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/sendToDevice/
|
||||
|
||||
# # Account data requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/.*/tags
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
|
||||
|
||||
# # Receipts requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
|
||||
|
||||
# # Presence requests
|
||||
# - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
|
||||
# These appear to be conditional and should not be enabled by default.
|
||||
# We need to fix up our workers-doc-to-yaml.awk parsing script to exclude them.
|
||||
# For now, they've been commented out manually.
|
||||
# # Account data requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/.*/tags
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
|
||||
#
|
||||
# # Receipts requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
|
||||
#
|
||||
# # Presence requests
|
||||
# - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
|
||||
|
||||
# User directory search requests
|
||||
- ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
|
||||
|
||||
# Additionally, the following REST endpoints can be handled for GET requests:
|
||||
|
||||
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
|
||||
# ^/_matrix/federation/v1/groups/
|
||||
# ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
|
||||
# ^/_matrix/client/(r0|v3|unstable)/groups/
|
||||
|
||||
# Pagination requests can also be handled, but all requests for a given
|
||||
# room must be routed to the same instance. Additionally, care must be taken to
|
||||
@ -301,6 +295,15 @@ matrix_synapse_workers_generic_worker_endpoints:
|
||||
# This work cannot be load-balanced; please ensure the main process is restarted
|
||||
# after setting this option in the shared configuration!
|
||||
|
||||
# User directory updates allow REST endpoints matching the following regular
|
||||
# expressions to work:
|
||||
|
||||
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
|
||||
# ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
|
||||
|
||||
# The above endpoints can be routed to any worker, though you may choose to route
|
||||
# it to the chosen user directory worker.
|
||||
|
||||
# This style of configuration supersedes the legacy `synapse.app.user_dir`
|
||||
# worker application type.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user