From 3b81f0974899fdaaa0c614506149d8287fc357c9 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 21 Dec 2024 13:57:01 +0200 Subject: [PATCH] Make various Cinny options configurable via dedicated variables Provoked by https://github.com/etkecc/mrs/pull/4 I've discovered that Cinny supports various configuration options and it'd be better if we add support for them. --- .../matrix-client-cinny/defaults/main.yml | 18 ++++++++++++++++++ .../templates/config.json.j2 | 11 +++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-client-cinny/defaults/main.yml b/roles/custom/matrix-client-cinny/defaults/main.yml index b242dee37da..86e5d9ef93b 100644 --- a/roles/custom/matrix-client-cinny/defaults/main.yml +++ b/roles/custom/matrix-client-cinny/defaults/main.yml @@ -147,9 +147,27 @@ matrix_client_cinny_self_check_validate_certificates: true # See `matrix_client_cinny_config_homeserverList`. matrix_client_cinny_default_hs_url: "" +# Controls the `defaultHomeserver` value in the `config.json` file. +matrix_client_cinny_config_defaultHomeserver: 0 # noqa var-naming + # Controls the `homeserverList` value in the `config.json` file. matrix_client_cinny_config_homeserverList: "{{ [matrix_client_cinny_default_hs_url] }}" # noqa var-naming +# Controls the `allowCustomHomeservers` value in the `config.json` file. +matrix_client_cinny_config_allowCustomHomeservers: true # noqa var-naming + +# Controls the `featuredCommunities.spaces` value in the `config.json` file. +matrix_client_cinny_config_featuredCommunities_spaces: [] # noqa var-naming + +# Controls the `featuredCommunities.rooms` value in the `config.json` file. +matrix_client_cinny_config_featuredCommunities_rooms: [] # noqa var-naming + +# Controls the `featuredCommunities.servers` value in the `config.json` file. +matrix_client_cinny_config_featuredCommunities_servers: ["matrix.org"] # noqa var-naming + +# Controls the `featuredCommunities.openAsDefault` value in the `config.json` file. +matrix_client_cinny_config_featuredCommunities_openAsDefault: false # noqa var-naming + # Default Cinny configuration template which covers the generic use case. # You can customize it by controlling the various variables inside it. # diff --git a/roles/custom/matrix-client-cinny/templates/config.json.j2 b/roles/custom/matrix-client-cinny/templates/config.json.j2 index 2a5bd1bcfd2..6c2b1431384 100644 --- a/roles/custom/matrix-client-cinny/templates/config.json.j2 +++ b/roles/custom/matrix-client-cinny/templates/config.json.j2 @@ -1,4 +1,11 @@ { - "defaultHomeserver": 0, - "homeserverList": {{ matrix_client_cinny_config_homeserverList | to_json }} + "defaultHomeserver": {{ matrix_client_cinny_config_defaultHomeserver | to_json }}, + "homeserverList": {{ matrix_client_cinny_config_homeserverList | to_json }}, + "allowCustomHomeservers": {{ matrix_client_cinny_config_allowCustomHomeservers | to_json }}, + "featuredCommunities": { + "spaces": {{ matrix_client_cinny_config_featuredCommunities_spaces | to_json }}, + "rooms": {{ matrix_client_cinny_config_featuredCommunities_rooms | to_json }}, + "servers": {{ matrix_client_cinny_config_featuredCommunities_servers | to_json }}, + "openAsDefault": {{ matrix_client_cinny_config_featuredCommunities_openAsDefault | to_json }} + } }