diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 7ac246bb6..8db2a7298 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4993,6 +4993,10 @@ matrix_synapse_admin_config_asManagedUsers_auto: | '^@'+(matrix_bot_buscarron_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', ] if matrix_bot_buscarron_enabled else []) + + ([ + '^@'+(matrix_bot_draupnir_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_draupnir_enabled else []) + + ([ '^@'+(matrix_bot_chatgpt_matrix_bot_username_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', ] if matrix_bot_chatgpt_enabled else []) @@ -5855,6 +5859,12 @@ matrix_user_creator_users_auto: | 'initial_password': matrix_bot_maubot_initial_password, 'initial_type': 'bot', }] if matrix_bot_maubot_enabled else []) + + + ([{ + 'username': matrix_bot_draupnir_login, + 'initial_password': matrix_bot_draupnir_password, + 'initial_type': 'bot', + }] if matrix_bot_draupnir_enabled else []) }} ###################################################################### diff --git a/roles/custom/matrix-bot-draupnir/defaults/main.yml b/roles/custom/matrix-bot-draupnir/defaults/main.yml index 0aa653e6e..7e3285938 100644 --- a/roles/custom/matrix-bot-draupnir/defaults/main.yml +++ b/roles/custom/matrix-bot-draupnir/defaults/main.yml @@ -72,6 +72,15 @@ matrix_bot_draupnir_access_token: "" matrix_bot_draupnir_pantalaimon_username: "" matrix_bot_draupnir_pantalaimon_password: "" +# Username and password the bot uses for logging in directly. If using Pantalimon +# these values become the values of `matrix_bot_draupnir_pantalaimon_username` and `matrix_bot_draupnir_pantalaimon_password` +matrix_bot_draupnir_login: "{{ matrix_bot_draupnir_pantalaimon_username }}" +matrix_bot_draupnir_password: "{{ matrix_bot_draupnir_pantalaimon_password }}" + +# Controls if we activate the pantalaimon config block for now. This configuration block is proable to change name for our usecase +# due to a Draupnir push to scrub Pantalaimon from the codebase. +matrix_bot_draupnir_login_native: "{{'true' if matrix_bot_draupnir_enable_experimental_rust_crypto == 'false'}}" + # The room ID where people can use the bot. The bot has no access controls, so # anyone in this room can use the bot - secure your room! # This should be a room alias or room ID - not a matrix.to URL. diff --git a/roles/custom/matrix-bot-draupnir/templates/production.yaml.j2 b/roles/custom/matrix-bot-draupnir/templates/production.yaml.j2 index bd2a18a16..52bb6fa6b 100644 --- a/roles/custom/matrix-bot-draupnir/templates/production.yaml.j2 +++ b/roles/custom/matrix-bot-draupnir/templates/production.yaml.j2 @@ -11,7 +11,7 @@ rawHomeserverUrl: {{ matrix_bot_draupnir_raw_homeserver_url | to_json }} # which would allow using secret management systems such as systemd's service credentials. accessToken: {{ matrix_bot_draupnir_access_token | to_json }} -{% if matrix_bot_draupnir_pantalaimon_use %} +{% if matrix_bot_draupnir_pantalaimon_use or matrix_bot_draupnir_login_native %} # Options related to Pantalaimon (https://github.com/matrix-org/pantalaimon) pantalaimon: # Whether or not Draupnir will use Pantalaimon to access the Matrix homeserver, @@ -24,14 +24,14 @@ pantalaimon: use: true # The username to login with. - username: {{ matrix_bot_draupnir_pantalaimon_username | to_json }} + username: {{ matrix_bot_draupnir_login | to_json }} # The password Draupnir will login with. # # After successfully logging in once, this will be ignored, so this value can be blanked after first startup. # This option can be loaded from a file by passing "--pantalaimon-password-path " at the command line, # which would allow using secret management systems such as systemd's service credentials. - password: {{ matrix_bot_draupnir_pantalaimon_password | to_json }} + password: {{ matrix_bot_draupnir_password | to_json }} {% endif %} # Experimental usage of the matrix-bot-sdk Rust Crypto. This cannot be used with Pantalaimon.