A bot to manage user registrations of a matrix server.
Project description
Matrix Registration Bot
This bot aims to create and manage registration tokens for a matrix server. It wants to help invitation based servers to maintain usability. It does not create a user itself, but rather aims to make use of MSC3231. The feature is still experimental. More information can be found in the Synapse Documentation.
Getting started
Prerequisites
Server configuration
Your server should be configured to a token restricted registration. Add the following to your homeserver.yaml
:
enable_registration: true
registration_requires_token: true
Create a bot account
Then you need to create an account for the bot on the server, like you would do with any other account.
A good username is registration-bot
. Also note the access token of the bot. One way to get the token is to login as
the bot and got to Settings -> Help & About -> Access Token in Element.
Once you are finished you can start the installation of the bot.
Installation
The installation can easily be done via PyPi
$ pip install matrix-registration-bot
Configuration
Configure the bot with a file named config.yml
. It should look like this
bot:
server: "https://synapse.example.com"
username: "registerbot"
access_token: "verysecret"
api:
# API endpoint of the registration tokens
base_url: 'https://synapse.example.com'
endpoint: '/_synapse/admin/v1/registration_tokens'
# Access token of an administrator on the server
token: "supersecret"
Usage
Start the bot with
python -m matrix_registration_bot.bot
and then open a Direct Message to the bot. The type one of the following commands.
Supported commands
!help
: Shows this help!list
: Lists all registration token!show <token>
: Shows token details in human-readable format!create
: Creates a token that that is valid for one registration for seven days!delete <token>
Deletes the specified token!delete-all
Deletes all token
Contributing
Feel free to contribute or discuss this bot with me. You can reach me via @moanos:hyteck.de. The project is made possible by Simple-Matrix-Bot-Lib.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for matrix-registration-bot-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 314ddd911357159dd841c567d4b9fa005c993ecad00ac5d44bb021c1c8863681 |
|
MD5 | fa6e68179c127cc6b57be62339c8006e |
|
BLAKE2b-256 | 6e34636e8ad2b3c55142af088aa94764c870af3f771ced03f4ee750fdaf76471 |
Hashes for matrix_registration_bot-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f32f8a8d2bdbc63e1c156c6c7f369c8e295a23f28af82c5172a23f15f84c991 |
|
MD5 | 012e4368a2e9e0f662330af4c56a7f1e |
|
BLAKE2b-256 | e941756d9dd3c9faa6dd98a4ad22d9c3fd3595159c653db2db2807034a1e5317 |
Hashes for Matrix_Registration_Bot-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2269bd19b9997e047a290904e5e7d94218fc8c423ef6d058bb827fb42a514d64 |
|
MD5 | c77978336a686ace1a2693a20d1fc175 |
|
BLAKE2b-256 | 18bbb38259735101d4f33b7177d1c9f9863eef9ec6fed742cb07283243d77657 |