Procházet zdrojové kódy

Add Self Registration and Native Login to Draupnir

pull/3941/head
Catalan Lover před 1 rokem
rodič
revize
010832fcfc
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 649BCCF930C07F70
3 změnil soubory, kde provedl 22 přidání a 3 odebrání
  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 Zobrazit soubor

@@ -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 [])
}}

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


+ 9
- 0
roles/custom/matrix-bot-draupnir/defaults/main.yml Zobrazit soubor

@@ -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.


+ 3
- 3
roles/custom/matrix-bot-draupnir/templates/production.yaml.j2 Zobrazit soubor

@@ -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 <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.


Načítá se…
Zrušit
Uložit