Skip to main content

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.

Code of Conduct

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matrix-registration-bot-0.0.1.tar.gz (17.1 kB view hashes)

Uploaded Source

Built Distributions

matrix_registration_bot-0.0.1-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

Matrix_Registration_Bot-0.0.1-py3-none-any.whl (17.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page