GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - zeratax/matrix-registration: a token based matrix registration api

This repository was archived by the owner on Nov 12, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

311 Commits
311 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
alembic
alembic
 
 
matrix_registration
matrix_registration
 
 
resources
resources
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
alembic.ini
alembic.ini
 
 
config.sample.yaml
config.sample.yaml
 
 
default.nix
default.nix
 
 
docker.nix
docker.nix
 
 
setup.py
setup.py
 
 
shell.nix
shell.nix
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Build Status Coverage Status Translation status PyPI - Python Version PyPI Docker Pulls Matrix

matrix-registration

A simple Python application enabling token-based registration for matrix servers.

You may have, like me, encountered the situation where you want to invite your friends to create an account on your homeserver, but neither want to open up public registration nor create accounts for every individual user yourself. This project aims to solve this problem.

With matrix-registration, you can quickly generate tokens on the fly and share them with your friends to allow them to register on your homeserver.

Setup

Install using pip:

pip3 install matrix-registration

or check the docker guide

First start

To start, execute matrix-registration.

A configuration file should be generated for you on first start.

Note: For server_location it is recommended to use a local connect, e.g. localhost:8008 (or whatever port synapse listens to). It is possible however to connect over the internet, but you will need to make sure /_synapse/admin/v1/register is accessible.

If the configuration file is not automatically discovered...

you can create a configuration by copying config.sample.yaml to your server and editing it:

wget https://raw.githubusercontent.com/ZerataX/matrix-registration/master/config.sample.yaml
cp config.sample.yaml config.yaml
nano config.yaml

Then pass the path to this configuration to the application on startup using --config-path /path/to/config.yaml.

INFO:

  • This only asks you for the most important options. You should definitely take a look at the actual configuration file. The path to the file will be printed by matrix-registration the first time it runs.

Usage

$ matrix-registration -h
Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...

  a token based matrix registration app

Options:
  --config-path TEXT  specifies the config file to be used
  --version           Show the flask version
  -h, --help          Show this message and exit.

Commands:
  generate  generate new token
  serve     start api server
  status    view status or disable

After you've started the API server and generated a token you can register an account either:

  • with a simple post request, e.g.:
curl -X POST \
     -F 'username=test' \
     -F 'password=verysecure' \
     -F 'confirm=verysecure' \
     -F 'token=DoubleWizardSki' \
     http://localhost:5000/register
  • or by visiting http://localhost:5000/register?token=DoubleWizardSki

Further Resources

Nginx reverse-proxy

If you'd like to run matrix-registration behind a reverse-proxy, here is an example nginx setup:

location  ~ ^/(static|register) {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:5000;
}

If you'll be using the web API, you'll also need to forward that endpoint. More information on reverse proxying here

Custom registration page

If you want to write your own registration page, you can take a look at the sample in resources/example.html

The html page looks for the query paramater token and sets the token input field to it's value. this would allow you to directly share links with the token included, e.g.:

https://homeserver.tld/register.html?token=DoubleWizardSki

If you already have a website and want to use your own register page, the wiki describes a more advanced nginx setup.

bot

if you're looking for a bot to interface with matrix-registration and manage your tokens, take a look at:

maubot-invite

Similar projects

  • matrix-invite live at https://librepush.net/matrix/registration/
  • matrix-register-bot using a bot to review accounts before sending out invite links
  • MatrixRegistration similar java project using my webui
  • Mother Miounne "A bridge between matrix and external services", which also integrates matrix-registration

For more info check the wiki

Artwork attribution

  • The valley cover photo on the registration page is photo by Jesús Roncero used under the terms of CC-BY-SA 4.0. No warranties are given.
  • The font used on the registration page is Nunito which is licensed under SIL Open Font License, Version 1.1.

About

a token based matrix registration api

zeratax.github.io/matrix-registration/

Topics

apifriendsmatrixmatrix-orgmatrix-registrationpypipython3registrationtoken-authentication

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

231 stars

Watchers

2 watching

Forks

42 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.