spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.92k stars 1.05k forks source link

Access Tokens for BaiBot #3524

Open gitayam opened 2 months ago

gitayam commented 2 months ago

Access Token instead of password is vital to homeservers without local accounts.

I did try this config just in case it was mistakenly not included in documentation.

Solution would allow configuration

matrix_bot_baibot_config_access_token: 'access_token_here'
gitayam commented 2 months ago

While providing the ability for access token is still desirable, @spantaleev presented this solution:

https://matrix.to/#/!cNSQwPqhHKkIZdBnvt:devture.com/$JDy5ZbM7oZagR6aNA5sumN0l65c6cEPzO6RSO8fqf64?via=devture.com&via=matrix.org&via=beeper.com

You should not log in manually as the bot and set up security key. Just create the local account with some passwords and give that password to the bot - it will log in by itself and prepare its own encryption keys + Secure Storage recovery.

If you initialize the keys via Element, then the bot starts its own new session.. and may or may not be able to recover the Secure Storage recovery session you created via Element.

When using the playbook, you don't even need to prepare the bot's account manually.. Just set a password in the Ansible variable and re-run the playbook - everything will happen automatically.

The only thing you need is to keep matrix_synapse_password_config_localdb_enabled: true (this is the default value anyway.. unless you've changed it, you're good to go!)