Home

Awesome

matrix-register-bot

state: alpha #matrix-register-bot:msg-net.de

This bot provides a two-step-registration for matrix (synapse).

This is done in several steps:

There are two operation modes available:

Requirements

How to install

git clone https://github.com/krombel/matrix-register-bot
cd matrix-register-bot
composer install
cp config.sample.php config.php
editor config.php

When running operationMode=local:

Keyfile which handles thatDescription
rest.endpoints.authinternal/login.phpValidate credentials and get user profile
rest.endpoints.directoryinternal/directory_search.phpSearch for users by arbitrary input
rest.endpoints.identity.singleinternal/identity_single.phpEndpoint to query a single 3PID
rest.endpoints.identity.bulkinternal/identity_bulk.phpEndpoint to query a list of 3PID

Further notes:

Security: Passwords from registration form are stored in clear text

Currently the passwords which are typed in while capturing the register request are stored in clear text. The bot needs to access them to trigger a register request with correct credentials. It is currently strongly recommended to set "getPasswordOnRegistration" => false in your config! This leads to autocreating passwords which will then be send to the users directly without storing it.

Use the ChangePasswortInterceptor (if operationMode=local)

To allow users to change their pasword you need a reverse proxy which maps /_matrix/client/r0/account/password to internal/intercept_change_password.php. Here is an example for nginx:

        location /_matrix/client/r0/account/password {
                proxy_pass http://localhost/mxbot/internal/intercept_change_password.php;
                proxy_set_header X-Forwarded-For $remote_addr;
        }

The bot postpones some actions

There is a cron.php which implements retries and database cleanups (e.g. to remove a username claim) For this run cron.php regularly with your system of choice. A suggested interval is once per day