From 1895b0181082fd31416330bf08f0fc3191ccd4e3 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 10 Mar 2022 11:28:25 +0200 Subject: [PATCH 1/4] Move matrix_container_global_registry_prefix to matrix-base Various roles depend on this. It makes sense to make it part of the `matrix-base` role. --- group_vars/matrix_servers | 2 -- roles/matrix-base/defaults/main.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 4301ae7e..8858a054 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -9,8 +9,6 @@ # You can also override ANY variable (seen here or in any given role), # by re-defining it in your own configuration file (`inventory/host_vars/matrix.`). -matrix_container_global_registry_prefix: "docker.io/" - ###################################################################### # # matrix-base diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index e83b6c95..983a29a0 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -65,6 +65,8 @@ matrix_architecture: amd64 # We just remap from our `matrix_architecture` values to what Debian and possibly other distros call things. matrix_debian_arch: "{{ 'armhf' if matrix_architecture == 'arm32' else matrix_architecture }}" +matrix_container_global_registry_prefix: "docker.io/" + matrix_user_username: "matrix" matrix_user_groupname: "matrix" From 69d2da4d4484f730c9b3eb86672b6d054b2e36d0 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 10 Mar 2022 11:41:41 +0200 Subject: [PATCH 2/4] Fix whitespace inconsistency --- group_vars/matrix_servers | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 8858a054..c1974500 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -710,7 +710,7 @@ matrix_hookshot_generic_urlprefix: "http{{ 's' if matrix_nginx_proxy_https_enabl # We don't enable bridges by default. matrix_mx_puppet_skype_enabled: false -matrix_mx_puppet_skype_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_skype_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_skype_systemd_required_services_list: | {{ @@ -749,7 +749,7 @@ matrix_mx_puppet_skype_database_password: "{{ '%s' | format(matrix_homeserver_ge # We don't enable bridges by default. matrix_mx_puppet_slack_enabled: false -matrix_mx_puppet_slack_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_slack_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_slack_systemd_required_services_list: | {{ @@ -787,7 +787,7 @@ matrix_mx_puppet_slack_database_password: "{{ '%s' | format(matrix_homeserver_ge # We don't enable bridges by default. matrix_mx_puppet_twitter_enabled: false -matrix_mx_puppet_twitter_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_twitter_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_twitter_systemd_required_services_list: | {{ @@ -828,7 +828,7 @@ matrix_mx_puppet_twitter_database_password: "{{ '%s' | format(matrix_homeserver_ # We don't enable bridges by default. matrix_mx_puppet_instagram_enabled: false -matrix_mx_puppet_instagram_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_instagram_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_instagram_systemd_required_services_list: | {{ @@ -866,7 +866,7 @@ matrix_mx_puppet_instagram_database_password: "{{ '%s' | format(matrix_homeserve # We don't enable bridges by default. matrix_mx_puppet_discord_enabled: false -matrix_mx_puppet_discord_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_discord_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_discord_systemd_required_services_list: | {{ @@ -904,7 +904,7 @@ matrix_mx_puppet_discord_database_password: "{{ '%s' | format(matrix_homeserver_ # We don't enable bridges by default. matrix_mx_puppet_steam_enabled: false -matrix_mx_puppet_steam_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_steam_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_steam_systemd_required_services_list: | {{ @@ -942,7 +942,7 @@ matrix_mx_puppet_steam_database_password: "{{ '%s' | format(matrix_homeserver_ge # We don't enable bridges by default. matrix_mx_puppet_groupme_enabled: false -matrix_mx_puppet_groupme_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_mx_puppet_groupme_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_mx_puppet_groupme_systemd_required_services_list: | {{ @@ -1070,7 +1070,7 @@ matrix_bot_go_neb_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_en # We don't enable bots by default. matrix_bot_mjolnir_enabled: false -matrix_bot_mjolnir_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_bot_mjolnir_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_bot_mjolnir_systemd_required_services_list: | {{ @@ -1136,7 +1136,7 @@ matrix_corporal_matrix_registration_shared_secret: "{{ matrix_synapse_registrati matrix_coturn_enabled: true -matrix_coturn_container_image_self_build: "{{ matrix_architecture != 'amd64'}}" +matrix_coturn_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" matrix_coturn_turn_external_ip_address: "{{ ansible_host }}" From d8a19e5bf9526e7eb2cc0f1247c877aab7c19e1f Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 10 Mar 2022 12:27:53 +0200 Subject: [PATCH 3/4] Switch to the Beeper-maintained fork of mx-puppet-discord Building mx-puppet-discord appears to have been broken for a while. Related to: - https://github.com/matrix-discord/mx-puppet-discord/issues/201 - https://github.com/matrix-discord/mx-puppet-discord/issues/202 - https://github.com/matrix-discord/mx-puppet-discord/issues/203 We'd rather use a fork that is maintained better and by someone who cares about whether their software works or not, so we'll be using the Beeper-maintained for from now on. In the future, we should probably do the same for the Slack bridge which is also part of the same monorepo (https://gitlab.com/beeper/mx-puppet-monorepo). --- ...figuring-playbook-bridge-mx-puppet-discord.md | 2 ++ .../defaults/main.yml | 16 ++++++++++++---- .../tasks/setup_install.yml | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/configuring-playbook-bridge-mx-puppet-discord.md b/docs/configuring-playbook-bridge-mx-puppet-discord.md index 1a48f05b..2be7f206 100644 --- a/docs/configuring-playbook-bridge-mx-puppet-discord.md +++ b/docs/configuring-playbook-bridge-mx-puppet-discord.md @@ -7,6 +7,8 @@ The playbook can install and configure See the project page to learn what it does and why it might be useful to you. +**Note**: we actually use the [Beeper](https://www.beeper.com/)-maintained [fork of mx-puppet-discord](https://gitlab.com/beeper/mx-puppet-monorepo), because `matrix-discord/mx-puppet-discord` is a low-quality and poorly maintained project. + To enable the [Discord](https://discordapp.com/) bridge just use the following playbook configuration: diff --git a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml index 80734c25..34b03e03 100644 --- a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml @@ -1,11 +1,19 @@ --- # Mx Puppet Discord is a Matrix <-> Discord bridge -# See: https://github.com/matrix-discord/mx-puppet-discord +# See: https://gitlab.com/beeper/mx-puppet-monorepo (originally based on https://github.com/matrix-discord/mx-puppet-discord) +# +# We use the Beeper-maintained fork, because https://github.com/matrix-discord/mx-puppet-discord is horribly broken often. See: +# - https://github.com/matrix-discord/mx-puppet-discord/issues/201 +# - https://github.com/matrix-discord/mx-puppet-discord/issues/202 +# - https://github.com/matrix-discord/mx-puppet-discord/issues/203 +# - (other similar issues in the past) 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://github.com/matrix-discord/mx-puppet-discord.git" +matrix_mx_puppet_discord_container_image_self_build_repo: "https://gitlab.com/beeper/mx-puppet-monorepo" +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: "docker/Dockerfile-discord" # Controls whether the mx-puppet-discord container exposes its HTTP port (tcp/8432 in the container). # @@ -13,8 +21,8 @@ matrix_mx_puppet_discord_container_image_self_build_repo: "https://github.com/ma matrix_mx_puppet_discord_container_http_host_bind_port: '' matrix_mx_puppet_discord_version: latest -matrix_mx_puppet_discord_docker_image: "{{ matrix_mx_puppet_discord_docker_image_name_prefix }}sorunome/mx-puppet-discord:{{ matrix_mx_puppet_discord_version }}" -matrix_mx_puppet_discord_docker_image_name_prefix: "{{ 'localhost/' if matrix_mx_puppet_discord_container_image_self_build else matrix_container_global_registry_prefix }}" +matrix_mx_puppet_discord_docker_image: "{{ matrix_mx_puppet_discord_docker_image_name_prefix }}beeper/mx-puppet-monorepo:{{ matrix_mx_puppet_discord_version }}" +matrix_mx_puppet_discord_docker_image_name_prefix: "{{ 'localhost/' if matrix_mx_puppet_discord_container_image_self_build else '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" diff --git a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml index 3ef57cb7..31a10be0 100644 --- a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml @@ -78,6 +78,7 @@ 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 }}" register: matrix_mx_puppet_discord_git_pull_results when: "matrix_mx_puppet_discord_enabled|bool and matrix_mx_puppet_discord_container_image_self_build" @@ -88,7 +89,7 @@ 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: Dockerfile + 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" From 65f92f043a9b4edc3a5be920c90038dcba8dd361 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 10 Mar 2022 20:14:59 +0200 Subject: [PATCH 4/4] Fix mx-puppet-discord container image repository URL Fixup for d8a19e5bf9526e7eb2cc0 --- roles/matrix-bridge-mx-puppet-discord/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml index 34b03e03..52257689 100644 --- a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml @@ -21,7 +21,7 @@ matrix_mx_puppet_discord_container_image_self_build_dockerfile_path: "docker/Doc matrix_mx_puppet_discord_container_http_host_bind_port: '' matrix_mx_puppet_discord_version: latest -matrix_mx_puppet_discord_docker_image: "{{ matrix_mx_puppet_discord_docker_image_name_prefix }}beeper/mx-puppet-monorepo:{{ matrix_mx_puppet_discord_version }}" +matrix_mx_puppet_discord_docker_image: "{{ matrix_mx_puppet_discord_docker_image_name_prefix }}beeper/mx-puppet-monorepo/discord:{{ matrix_mx_puppet_discord_version }}" matrix_mx_puppet_discord_docker_image_name_prefix: "{{ 'localhost/' if matrix_mx_puppet_discord_container_image_self_build else 'registry.gitlab.com/' }}" matrix_mx_puppet_discord_docker_image_force_pull: "{{ matrix_mx_puppet_discord_docker_image.endswith(':latest') }}"