Skip to main content

token based matrix registration app

Project description

Build Status Coverage Status Matrix Chat

matrix-registration

a simple python application to have a token based matrix registration

if you like me encountered the situation where you want to invite your friends to your homeserver, but neither wanted to open up public registration nor create accounts for every individual user yourself, this project should be the solution.

with this project you can just quickly generate tokens on the fly and share them with your friends to allow them to register to your homeserver.

setup

git clone https://github.com/ZerataX/matrix-registration.git
cd matrix-registration

virtualenv -p /usr/bin/python3.6 .
source ./bin/activate
python setup.py install

cp config.sample.yaml config.yaml

and edit config.yaml

nginx reverse-proxy

an example nginx setup to expose the html form and the api endpoint on the same URL, based on whether a POST or GET request was made.

location /register {
    alias resources/example.html;

    if ($request_method = POST ) {
        proxy_pass http://localhost:5000;
    }
}

usage

python -m matrix_registration -h

if you've started the api server and generated a token you can register an account with curl, e.g.:

curl -X POST \
     -F 'username=test' \
     -F 'password=verysecure' \
     -F 'confirm=verysecure' \
     -F 'token=DoubleWizardSki' \
     http://localhost:5000/register

or a simple html form, see the sample 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

For more info check the wiki

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

matrix-registration-0.5.1.dev0.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

matrix_registration-0.5.1.dev0-py3-none-any.whl (15.5 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