Просмотр исходного кода

Add Self Registration and Native Login to Draupnir

pull/3941/head
Catalan Lover 1 год назад
Родитель
Сommit
010832fcfc
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 649BCCF930C07F70
3 измененных файлов: 22 добавлений и 3 удалений
  1. +10
    -0
      group_vars/matrix_servers
  2. +9
    -0
      roles/custom/matrix-bot-draupnir/defaults/main.yml
  3. +3
    -3
      roles/custom/matrix-bot-draupnir/templates/production.yaml.j2

+ 10
- 0
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)+'$', '^@'+(matrix_bot_buscarron_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$',
] if matrix_bot_buscarron_enabled else []) ] 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)+'$', '^@'+(matrix_bot_chatgpt_matrix_bot_username_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$',
] if matrix_bot_chatgpt_enabled else []) ] if matrix_bot_chatgpt_enabled else [])
@@ -5855,6 +5859,12 @@ matrix_user_creator_users_auto: |
'initial_password': matrix_bot_maubot_initial_password, 'initial_password': matrix_bot_maubot_initial_password,
'initial_type': 'bot', 'initial_type': 'bot',
}] if matrix_bot_maubot_enabled else []) }] 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 [])
}} }}


###################################################################### ######################################################################


+ 9
- 0
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_username: ""
matrix_bot_draupnir_pantalaimon_password: "" 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 # 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! # 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. # This should be a room alias or room ID - not a matrix.to URL.


+ 3
- 3
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. # which would allow using secret management systems such as systemd's service credentials.
accessToken: {{ matrix_bot_draupnir_access_token | to_json }} 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) # Options related to Pantalaimon (https://github.com/matrix-org/pantalaimon)
pantalaimon: pantalaimon:
# Whether or not Draupnir will use Pantalaimon to access the Matrix homeserver, # Whether or not Draupnir will use Pantalaimon to access the Matrix homeserver,
@@ -24,14 +24,14 @@ pantalaimon:
use: true use: true


# The username to login with. # 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. # The password Draupnir will login with.
# #
# After successfully logging in once, this will be ignored, so this value can be blanked after first startup. # 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 <path>" at the command line, # This option can be loaded from a file by passing "--pantalaimon-password-path <path>" at the command line,
# which would allow using secret management systems such as systemd's service credentials. # 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 %} {% endif %}


# Experimental usage of the matrix-bot-sdk Rust Crypto. This cannot be used with Pantalaimon. # Experimental usage of the matrix-bot-sdk Rust Crypto. This cannot be used with Pantalaimon.


Загрузка…
Отмена
Сохранить