From 26f9c65cf39d99579b8b9df1fdd83f6fd3c5d922 Mon Sep 17 00:00:00 2001 From: Catalan Lover Date: Wed, 12 Mar 2025 19:25:29 +0100 Subject: [PATCH] Update D4A Configuration D4A had some breaking config changes so this commit fixes them and gets us back into compliance with upstream. And since we run in a docker container we can use the /data/storage default. --- .../defaults/main.yml | 7 ++++++- .../templates/production-appservice.yaml.j2 | 8 +++++++- .../templates/production-bots.yaml.j2 | 19 ++++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/roles/custom/matrix-appservice-draupnir-for-all/defaults/main.yml b/roles/custom/matrix-appservice-draupnir-for-all/defaults/main.yml index a1eebf5af..31550ada3 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/defaults/main.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/defaults/main.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2024 - 2025 MDAD project contributors +# SPDX-FileCopyrightText: 2024 - 2025 Catalan Lover # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev # SPDX-FileCopyrightText: 2024 Suguru Hirahara # @@ -58,6 +58,11 @@ matrix_appservice_draupnir_for_all_master_control_room_alias: "" # This should be a room alias - not a matrix.to URL. # matrix_appservice_draupnir_for_all_management_policy_list_alias: "" +# Controls if the room state backing store is activated. +# Room state backing store makes restarts of the bot lightning fast as the bot does not suffer from amnesia. +# This config option has diminished improvements for bots on extremely fast homeservers or very very small bots on fast homeservers. +matrix_appservice_draupnir_for_all_enable_room_state_backing_store: "false" + matrix_appservice_draupnir_for_all_database_username: matrix_appservice_draupnir_for_all matrix_appservice_draupnir_for_all_database_password: 'some-passsword' matrix_appservice_draupnir_for_all_database_hostname: '' diff --git a/roles/custom/matrix-appservice-draupnir-for-all/templates/production-appservice.yaml.j2 b/roles/custom/matrix-appservice-draupnir-for-all/templates/production-appservice.yaml.j2 index 346b57e96..cdd6c418d 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/templates/production-appservice.yaml.j2 +++ b/roles/custom/matrix-appservice-draupnir-for-all/templates/production-appservice.yaml.j2 @@ -1,5 +1,5 @@ {# -SPDX-FileCopyrightText: 2024 MDAD project contributors +SPDX-FileCopyrightText: 2024-2025 Catalan Lover SPDX-FileCopyrightText: 2024 Suguru Hirahara SPDX-License-Identifier: AGPL-3.0-or-later @@ -23,3 +23,9 @@ adminRoom: "{{ matrix_appservice_draupnir_for_all_master_control_room_alias }}" # This is a web api that the widget connects to in order to interact with the appservice. webAPI: port: 9000 + +# The directory the bot should store various bits of information in +dataPath: "/data/storage" + +roomStateBackingStore: + enabled: {{ matrix_appservice_draupnir_for_all_enable_room_state_backing_store }} diff --git a/roles/custom/matrix-appservice-draupnir-for-all/templates/production-bots.yaml.j2 b/roles/custom/matrix-appservice-draupnir-for-all/templates/production-bots.yaml.j2 index de581ed8e..9b057b6be 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/templates/production-bots.yaml.j2 +++ b/roles/custom/matrix-appservice-draupnir-for-all/templates/production-bots.yaml.j2 @@ -1,5 +1,5 @@ {# -SPDX-FileCopyrightText: 2024 MDAD project contributors +SPDX-FileCopyrightText: 2024-2025 Catalan Lover SPDX-License-Identifier: AGPL-3.0-or-later #} @@ -73,3 +73,20 @@ commands: - "brigading" - "harassment" - "disagreement" + +# Safe mode provides recovery options for some failure modes when Draupnir +# fails to start. For example, if the bot fails to resolve a room alias in +# a watched list, or if the server has parted from a protected room and can't +# find a way back in. Safe mode will provide different options to recover from +# these. Such as unprotecting the room or unwatching the policy list. +# By default Draupnir will boot into safe mode only when the failure mode +# is recoverable. +# It may be desirable to prevent the bot from starting into safe mode if you have +# a pager system when Draupnir is down, as Draupnir could prevent your monitoring +# system from identifying a failure to start. +#safeMode: +# # The option for entering safe mode when Draupnir fails to start up. +# # - "RecoveryOnly" will only start the bot in safe mode when there are recovery options available. This is the default. +# # - "Never" will never start the bot in safe mode when Draupnir fails to start normally. +# # - "Always" will always start the bot in safe mode when Draupnir fails to start normally. +# bootOption: RecoveryOnly