mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-03-26 06:27:23 +00:00
Upgrade baibot (v1.14.3 -> v1.15.0) and adapt to support optional access-token auth mode
Ref: - https://github.com/etkecc/baibot/pull/83 -748d2b7fd4/CHANGELOG.md (2026-03-07-version-1150)-748d2b7fd4/docs/configuration/authentication.md
This commit is contained in:
@@ -17,7 +17,7 @@ matrix_bot_baibot_container_repo_version: "{{ 'main' if matrix_bot_baibot_versio
|
||||
matrix_bot_baibot_container_src_files_path: "{{ matrix_base_data_path }}/baibot/container-src"
|
||||
|
||||
# renovate: datasource=docker depName=ghcr.io/etkecc/baibot
|
||||
matrix_bot_baibot_version: v1.14.3
|
||||
matrix_bot_baibot_version: v1.15.0
|
||||
matrix_bot_baibot_container_image: "{{ matrix_bot_baibot_container_image_registry_prefix }}etkecc/baibot:{{ matrix_bot_baibot_version }}"
|
||||
matrix_bot_baibot_container_image_registry_prefix: "{{ 'localhost/' if matrix_bot_baibot_container_image_self_build else matrix_bot_baibot_container_image_registry_prefix_upstream }}"
|
||||
matrix_bot_baibot_container_image_registry_prefix_upstream: "{{ matrix_bot_baibot_container_image_registry_prefix_upstream_default }}"
|
||||
@@ -59,8 +59,28 @@ matrix_bot_baibot_config_homeserver_url: ""
|
||||
# so it can start fresh.
|
||||
matrix_bot_baibot_config_user_mxid_localpart: baibot
|
||||
|
||||
# Authentication settings (`user.*` configuration keys).
|
||||
#
|
||||
# baibot supports 2 mutually-exclusive authentication modes.
|
||||
# Set EITHER:
|
||||
# - password authentication: `matrix_bot_baibot_config_user_password`
|
||||
# OR:
|
||||
# - access-token authentication: `matrix_bot_baibot_config_user_access_token` + `matrix_bot_baibot_config_user_device_id`
|
||||
#
|
||||
# Password authentication is recommended for most playbook-managed deployments,
|
||||
# because it integrates with the `matrix-user-creator` role and can auto-create
|
||||
# the bot account (via the `ensure-matrix-users-created` playbook tag).
|
||||
# This remains true even on many MAS-enabled deployments where the bot account
|
||||
# is local and playbook-managed.
|
||||
|
||||
# Controls the `user.password` configuration setting.
|
||||
matrix_bot_baibot_config_user_password: ''
|
||||
matrix_bot_baibot_config_user_password: null
|
||||
|
||||
# Controls the `user.access_token` configuration setting.
|
||||
matrix_bot_baibot_config_user_access_token: null
|
||||
|
||||
# Controls the `user.device_id` configuration setting.
|
||||
matrix_bot_baibot_config_user_device_id: null
|
||||
|
||||
# Controls the `user.name` configuration setting.
|
||||
#
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_bot_baibot_config_user_mxid_localpart', when: true}
|
||||
- {'name': 'matrix_bot_baibot_config_user_password', when: true}
|
||||
- {'name': 'matrix_bot_baibot_container_network', when: true}
|
||||
- {'name': 'matrix_bot_baibot_config_homeserver_url', when: true}
|
||||
|
||||
@@ -26,6 +25,58 @@
|
||||
|
||||
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_openai_enabled }}"}
|
||||
|
||||
- name: Fail if baibot authentication mode is not configured
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to configure one baibot authentication mode:
|
||||
either `matrix_bot_baibot_config_user_password`
|
||||
or (`matrix_bot_baibot_config_user_access_token` + `matrix_bot_baibot_config_user_device_id`).
|
||||
when: >-
|
||||
(
|
||||
matrix_bot_baibot_config_user_password | default('', true) | string | length == 0
|
||||
)
|
||||
and
|
||||
(
|
||||
matrix_bot_baibot_config_user_access_token | default('', true) | string | length == 0
|
||||
and matrix_bot_baibot_config_user_device_id | default('', true) | string | length == 0
|
||||
)
|
||||
|
||||
- name: Fail if baibot authentication mode is configured ambiguously
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to configure exactly one baibot authentication mode.
|
||||
Set either `matrix_bot_baibot_config_user_password`,
|
||||
or (`matrix_bot_baibot_config_user_access_token` + `matrix_bot_baibot_config_user_device_id`) but not both.
|
||||
when: >-
|
||||
(
|
||||
matrix_bot_baibot_config_user_password | default('', true) | string | length > 0
|
||||
)
|
||||
and
|
||||
(
|
||||
matrix_bot_baibot_config_user_access_token | default('', true) | string | length > 0
|
||||
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length > 0
|
||||
)
|
||||
|
||||
- name: Fail if baibot access token authentication is incomplete
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Access-token authentication requires both
|
||||
`matrix_bot_baibot_config_user_access_token` and `matrix_bot_baibot_config_user_device_id`.
|
||||
when: >-
|
||||
(
|
||||
matrix_bot_baibot_config_user_password | default('', true) | string | length == 0
|
||||
)
|
||||
and
|
||||
(
|
||||
matrix_bot_baibot_config_user_access_token | default('', true) | string | length > 0
|
||||
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length > 0
|
||||
)
|
||||
and
|
||||
(
|
||||
matrix_bot_baibot_config_user_access_token | default('', true) | string | length == 0
|
||||
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length == 0
|
||||
)
|
||||
|
||||
- name: Fail if admin patterns list is empty
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
|
||||
@@ -15,7 +15,11 @@ homeserver:
|
||||
|
||||
user:
|
||||
mxid_localpart: {{ matrix_bot_baibot_config_user_mxid_localpart | to_json }}
|
||||
|
||||
# Authentication: set EITHER password OR access_token + device_id.
|
||||
password: {{ matrix_bot_baibot_config_user_password | to_json }}
|
||||
access_token: {{ matrix_bot_baibot_config_user_access_token | to_json }}
|
||||
device_id: {{ matrix_bot_baibot_config_user_device_id | to_json }}
|
||||
|
||||
# The name the bot uses as a display name and when it refers to itself.
|
||||
# Leave empty to use the default (baibot).
|
||||
|
||||
Reference in New Issue
Block a user