Based on mautrix-whatsapp, as that's what the bridge software is based on.development
parent
bc4d29bbb0
commit
a3d19ad318
@ -0,0 +1,23 @@
|
|||||||
|
# Setting up Go Skype Bridge (optional)
|
||||||
|
|
||||||
|
The playbook can install and configure
|
||||||
|
[go-skype-bridge](https://github.com/Sorunome/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 Puppet Bridge`
|
||||||
|
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.
|
@ -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'
|
@ -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
|
@ -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
|
@ -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"
|
@ -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
|
Loading…
Reference in new issue