From 4c1db32ef920f8fa154868cd424782c234622cf4 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 14 Mar 2023 08:52:15 +0200 Subject: [PATCH] Rename some Dendrite variables to improve consistency --- group_vars/matrix_servers | 12 ++++++------ roles/custom/matrix-dendrite/defaults/main.yml | 14 +++++++------- .../matrix-dendrite/tasks/validate_config.yml | 7 +++++++ .../templates/dendrite/dendrite.yaml.j2 | 14 +++++++------- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 60c8349e3..18ad756c4 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -2718,15 +2718,15 @@ devture_postgres_managed_databases_auto: | }] if (matrix_synapse_enabled and matrix_synapse_database_host == devture_postgres_connection_hostname) else []) + ([{ - 'name': matrix_dendrite_federationapi_database, + 'name': matrix_dendrite_federation_api_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ - 'name': matrix_dendrite_keyserver_database, + 'name': matrix_dendrite_key_server_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ - 'name': matrix_dendrite_mediaapi_database, + 'name': matrix_dendrite_media_api_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ @@ -2734,15 +2734,15 @@ devture_postgres_managed_databases_auto: | 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ - 'name': matrix_dendrite_syncapi_database, + 'name': matrix_dendrite_sync_api_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ - 'name': matrix_dendrite_userapi_database, + 'name': matrix_dendrite_user_api_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ - 'name': matrix_dendrite_pushserver_database, + 'name': matrix_dendrite_push_server_database, 'username': matrix_dendrite_database_user, 'password': matrix_dendrite_database_password, },{ diff --git a/roles/custom/matrix-dendrite/defaults/main.yml b/roles/custom/matrix-dendrite/defaults/main.yml index 758a56e88..35793f496 100644 --- a/roles/custom/matrix-dendrite/defaults/main.yml +++ b/roles/custom/matrix-dendrite/defaults/main.yml @@ -150,13 +150,13 @@ matrix_dendrite_database_str: "postgresql://{{ matrix_dendrite_database_user }}: matrix_dendrite_database_hostname: '' matrix_dendrite_database_user: "dendrite" matrix_dendrite_database_password: "itsasecret" -matrix_dendrite_federationapi_database: "dendrite_federationapi" -matrix_dendrite_keyserver_database: "dendrite_keyserver" -matrix_dendrite_mediaapi_database: "dendrite_mediaapi" +matrix_dendrite_federation_api_database: "dendrite_federationapi" +matrix_dendrite_key_server_database: "dendrite_keyserver" +matrix_dendrite_media_api_database: "dendrite_mediaapi" matrix_dendrite_room_database: "dendrite_room" -matrix_dendrite_syncapi_database: "dendrite_syncapi" -matrix_dendrite_userapi_database: "dendrite_userapi" -matrix_dendrite_pushserver_database: "dendrite_pushserver" +matrix_dendrite_sync_api_database: "dendrite_syncapi" +matrix_dendrite_user_api_database: "dendrite_userapi" +matrix_dendrite_push_server_database: "dendrite_pushserver" matrix_dendrite_mscs_database: "dendrite_mscs" matrix_dendrite_client_api_turn_uris: [] @@ -206,7 +206,7 @@ matrix_dendrite_configuration_extension: "{{ matrix_dendrite_configuration_exten # You most likely don't need to touch this variable. Instead, see `matrix_dendrite_configuration_yaml`. matrix_dendrite_configuration: "{{ matrix_dendrite_configuration_yaml | from_yaml | combine(matrix_dendrite_configuration_extension, recursive=True) }}" -matrix_dendrite_userapi_auto_join_rooms: [] +matrix_dendrite_user_api_auto_join_rooms: [] # statistics reporting configuration. These statistics contain the server # name, number of active users and some information on your deployment config. diff --git a/roles/custom/matrix-dendrite/tasks/validate_config.yml b/roles/custom/matrix-dendrite/tasks/validate_config.yml index 53c17498c..1f1b3e411 100644 --- a/roles/custom/matrix-dendrite/tasks/validate_config.yml +++ b/roles/custom/matrix-dendrite/tasks/validate_config.yml @@ -27,3 +27,10 @@ - {'old': 'matrix_dendrite_rate_limiting_enabled', 'new': 'matrix_dendrite_client_api_rate_limiting_enabled'} - {'old': 'matrix_dendrite_rate_limiting_threshold', 'new': 'matrix_dendrite_client_api_rate_limiting_threshold'} - {'old': 'matrix_dendrite_rate_limiting_cooloff_ms', 'new': 'matrix_dendrite_client_api_rate_limiting_cooloff_ms'} + - {'old': 'matrix_dendrite_mediaapi_database', 'new': 'matrix_dendrite_media_api_database'} + - {'old': 'matrix_dendrite_syncapi_database', 'new': 'matrix_dendrite_sync_api_database'} + - {'old': 'matrix_dendrite_userapi_database', 'new': 'matrix_dendrite_user_api_database'} + - {'old': 'matrix_dendrite_userapi_auto_join_rooms', 'new': 'matrix_dendrite_user_api_auto_join_rooms'} + - {'old': 'matrix_dendrite_federationapi_database', 'new': 'matrix_dendrite_federation_api_database'} + - {'old': 'matrix_dendrite_pushserver_database', 'new': 'matrix_dendrite_push_server_database'} + - {'old': 'matrix_dendrite_keyserver_database', 'new': 'matrix_dendrite_key_server_database'} diff --git a/roles/custom/matrix-dendrite/templates/dendrite/dendrite.yaml.j2 b/roles/custom/matrix-dendrite/templates/dendrite/dendrite.yaml.j2 index 1b31584de..37d0064bc 100644 --- a/roles/custom/matrix-dendrite/templates/dendrite/dendrite.yaml.j2 +++ b/roles/custom/matrix-dendrite/templates/dendrite/dendrite.yaml.j2 @@ -223,7 +223,7 @@ federation_api: external_api: listen: http://0.0.0.0:8072 database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federationapi_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federation_api_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1 @@ -266,7 +266,7 @@ key_server: listen: http://0.0.0.0:7779 connect: http://key_server:7779 database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_keyserver_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_key_server_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1 @@ -279,7 +279,7 @@ media_api: external_api: listen: http://0.0.0.0:8074 database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mediaapi_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_media_api_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1 @@ -342,7 +342,7 @@ sync_api: external_api: listen: http://0.0.0.0:8073 database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_syncapi_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_sync_api_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1 @@ -376,7 +376,7 @@ user_api: listen: http://0.0.0.0:7781 connect: http://user_api:7781 account_database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_userapi_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_user_api_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1 @@ -385,7 +385,7 @@ user_api: # is considered to be valid in milliseconds. # The default lifetime is 3600000ms (60 minutes). # openid_token_lifetime_ms: 3600000 - auto_join_rooms: {{ matrix_dendrite_userapi_auto_join_rooms | to_json }} + auto_join_rooms: {{ matrix_dendrite_user_api_auto_join_rooms | to_json }} # Not in dendrite-config.yaml, but is in build/docker/config/dendrite.yaml # Configuration for the Push Server API. @@ -394,7 +394,7 @@ push_server: listen: http://localhost:7782 connect: http://localhost:7782 database: - connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_pushserver_database }}?sslmode=disable + connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_push_server_database }}?sslmode=disable max_open_conns: 10 max_idle_conns: 2 conn_max_lifetime: -1