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..17e415f6c 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,5 @@ -# SPDX-FileCopyrightText: 2024 - 2025 MDAD project contributors +# SPDX-FileCopyrightText: 2024 MDAD project contributors +# SPDX-FileCopyrightText: 2024 - 2025 Catalan Lover # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev # SPDX-FileCopyrightText: 2024 Suguru Hirahara # @@ -51,12 +52,12 @@ matrix_appservice_draupnir_for_all_systemd_wanted_services_list: [] # Note: Draupnir is fairly verbose - expect a lot of messages from it. # This room is diffrent for Appservice Mode compared to normal mode. # In Appservice mode it provides functions like user management. -matrix_appservice_draupnir_for_all_master_control_room_alias: "" +matrix_appservice_draupnir_for_all_config_adminRoom: "" # noqa var-naming -# Placeholder Remenant of the fact that Cat belived Master Control Room to be separated from Access Control Policy List. -# The alias of the Policy list used to control who can provision a bot for them selfs. -# 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_config_roomStateBackingStore_enabled: false # noqa var-naming matrix_appservice_draupnir_for_all_database_username: matrix_appservice_draupnir_for_all matrix_appservice_draupnir_for_all_database_password: 'some-passsword' diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/main.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/main.yml index 5e4af332b..51f5fe4f2 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/main.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/main.yml @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2024 MDAD project contributors +# SPDX-FileCopyrightText: 2024 Catalan Lover # # SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml index e4d51b7f7..12781f5dc 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2024 David Mehren # SPDX-FileCopyrightText: 2024 MDAD project contributors +# SPDX-FileCopyrightText: 2024 Catalan Lover # SPDX-FileCopyrightText: 2024 Slavi Pantaleev # SPDX-FileCopyrightText: 2024 Suguru Hirahara # diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_uninstall.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_uninstall.yml index da78634d6..4ad172539 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_uninstall.yml @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2023 - 2024 MDAD project contributors +# SPDX-FileCopyrightText: 2024 Catalan Lover # # SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml index 8d8d1168c..72f86a7ef 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2024 MDAD project contributors +# SPDX-FileCopyrightText: 2024 Catalan Lover # SPDX-FileCopyrightText: 2024 Slavi Pantaleev # SPDX-FileCopyrightText: 2025 Suguru Hirahara # @@ -22,3 +23,5 @@ when: "item.old in vars" with_items: - {'old': 'matrix_appservice_draupnir_for_all_docker_image_name_prefix', 'new': 'matrix_appservice_draupnir_for_all_docker_image_registry_prefix'} + - {'old': 'matrix_appservice_draupnir_for_all_enable_room_state_backing_store', 'new': 'matrix_appservice_draupnir_for_all_config_roomStateBackingStore_enabled'} + - {'old': 'matrix_appservice_draupnir_for_all_master_control_room_alias', 'new': 'matrix_appservice_draupnir_for_all_config_adminRoom'} 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..ea168dac9 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,6 @@ {# 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 @@ -18,8 +19,14 @@ db: # A room you have created that scopes who can access the appservice. # See docs/access_control.md -adminRoom: "{{ matrix_appservice_draupnir_for_all_master_control_room_alias }}" +adminRoom: {{ matrix_appservice_draupnir_for_all_config_adminRoom | to_json }} # 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" + +roomStateBackingStore: + enabled: {{ matrix_appservice_draupnir_for_all_config_roomStateBackingStore_enabled | to_json }} 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..63eb20b22 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,6 @@ {# SPDX-FileCopyrightText: 2024 MDAD project contributors +SPDX-FileCopyrightText: 2024 - 2025 Catalan Lover SPDX-License-Identifier: AGPL-3.0-or-later #} @@ -73,3 +74,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 diff --git a/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2.license b/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2.license index c66c5baed..b39d4ce53 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2.license +++ b/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2.license @@ -1,4 +1,5 @@ SPDX-FileCopyrightText: 2024 MDAD project contributors +SPDX-FileCopyrightText: 2024 Catalan Lover SPDX-FileCopyrightText: 2024 Slavi Pantaleev SPDX-License-Identifier: AGPL-3.0-or-later