mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-11-06 10:08:55 +01:00
Remove MX Puppet Discord bridge
Reuse c399992542
Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>
This commit is contained in:
committed by
Slavi Pantaleev
parent
0579e14d6b
commit
d3858ed079
@@ -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
|
||||
@@ -547,6 +547,18 @@
|
||||
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-twitter variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
|
||||
Reference in New Issue
Block a user