From d14e499365b2710ad90b073e7bc71adc005636d4 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 25 Jul 2022 14:58:36 +0300 Subject: [PATCH] Add dedicated variables for controlling Kakaotalk encryption --- ...ing-playbook-bridge-appservice-kakaotalk.md | 18 +----------------- .../defaults/main.yml | 4 ++++ .../templates/config.yaml.j2 | 4 ++-- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/docs/configuring-playbook-bridge-appservice-kakaotalk.md b/docs/configuring-playbook-bridge-appservice-kakaotalk.md index 0b284db1..0b1a03f7 100644 --- a/docs/configuring-playbook-bridge-appservice-kakaotalk.md +++ b/docs/configuring-playbook-bridge-appservice-kakaotalk.md @@ -26,23 +26,7 @@ There are some additional things you may wish to configure about the bridge. Take a look at: - `roles/matrix-bridge-appservice-kakaotalk/defaults/main.yml` for some variables that you can customize via your `vars.yml` file -- `roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2` for the bridge's default configuration. You can override settings using the `matrix_appservice_kakaotalk_configuration_extension_yaml` variable - -Here's some example configuration (which goes into your `vars.yml` file): -```yaml -# This configuration: -# - enables encryption (it's off by default) -# - grants some user on your homeserver 'admin' access to the bridge -# (note: the user specified in the `matrix_admin` (part of `roles/matrix-base/defaults/main.yml`) is made an admin by default) -matrix_appservice_kakaotalk_configuration_extension_yaml: | - bridge: - permissions: - '@YOUR_USERNAME:{{ matrix_domain }}': admin - - encryption: - allow: true - default: true -``` +- `roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2` for the bridge's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_appservice_kakaotalk_configuration_extension_yaml` variable ### Set up Double Puppeting diff --git a/roles/matrix-bridge-appservice-kakaotalk/defaults/main.yml b/roles/matrix-bridge-appservice-kakaotalk/defaults/main.yml index dc5e2591..d2bc94f2 100644 --- a/roles/matrix-bridge-appservice-kakaotalk/defaults/main.yml +++ b/roles/matrix-bridge-appservice-kakaotalk/defaults/main.yml @@ -119,6 +119,10 @@ matrix_appservice_kakaotalk_bridge_permissions: | matrix_appservice_kakaotalk_appservice_bot_username: kakaotalkbot matrix_appservice_kakaotalk_user_prefix: 'kakaotalk_as_' +# End-to-bridge encryption configuration +matrix_appservice_kakaotalk_bridge_encryption_allow: false +matrix_appservice_kakaotalk_bridge_encryption_default: "{{ matrix_appservice_kakaotalk_bridge_encryption_allow }}" + # Specifies the default log level for all bridge loggers. matrix_appservice_kakaotalk_logging_level: WARNING diff --git a/roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2 b/roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2 index 183377f3..1bb87cb4 100644 --- a/roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2 +++ b/roles/matrix-bridge-appservice-kakaotalk/templates/config.yaml.j2 @@ -133,10 +133,10 @@ bridge: # application service. encryption: # Allow encryption, work in group chat rooms with e2ee enabled - allow: false + allow: {{ matrix_appservice_kakaotalk_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. - default: false + default: {{ matrix_appservice_kakaotalk_bridge_encryption_default| to_json }} # Options for automatic key sharing. key_sharing: # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.