<img src="resources/logo.png" width="300">
[![Build Status](https://travis-ci.org/ZerataX/matrix-registration.svg?branch=master)](https://travis-ci.org/ZerataX/matrix-registration) [![Coverage Status](https://coveralls.io/repos/github/ZerataX/matrix-registration/badge.svg)](https://coveralls.io/github/ZerataX/matrix-registration) [![Translation status](https://l10n.dmnd.sh/widgets/matrix-registration/-/svg-badge.svg)](http://l10n.dmnd.sh/engage/matrix-registration/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/matrix-registration.svg) [![PyPI](https://img.shields.io/pypi/v/matrix-registration.svg)](https://pypi.org/project/matrix-registration/) [![Docker Pulls](https://img.shields.io/docker/pulls/zeratax/matrix-registration)](https://hub.docker.com/r/zeratax/matrix-registration) [![Matrix](https://img.shields.io/matrix/matrix-registration:dmnd.sh.svg?server_fqdn=matrix.org)](https://matrix.to/#/#matrix-registration:dmnd.sh)
# 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.
<img src="https://matrix.org/_matrix/media/v1/download/dmnd.sh/UKGgpbHRdFXzKywxjjbfHAsI" width="500">
## Setup
Install using pip:
```bash
pip3 install matrix-registration
```
or check the [docker guide](https://github.com/ZerataX/matrix-registration/wiki/docker)
### 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.
<details>
<summary> If the configuration file is not automatically discovered...</summary>
you can create a configuration by copying [config.sample.yaml](/config.sample.yaml) to your server and editing it:
```bash
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`.
</details>
__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
```bash
$ 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](https://github.com/ZerataX/matrix-registration/wiki/api#creating-a-new-token) you can register an account either:
- with a simple post request, e.g.:
```bash
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:
```nginx
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](https://github.com/ZerataX/matrix-registration/wiki/api), you'll also need to forward that endpoint. More information on reverse proxying [here](https://github.com/ZerataX/matrix-registration/wiki/reverse-proxy#optional)
### Custom registration page
If you want to write your own registration page, you can take a look at the sample in [resources/example.html](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](https://github.com/ZerataX/matrix-registration/wiki/reverse-proxy#advanced) 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](https://github.com/williamkray/maubot-invite)
### Similar projects
- [matrix-invite](https://gitlab.com/reivilibre/matrix-invite) live at https://librepush.net/matrix/registration/
- [matrix-register-bot](https://github.com/krombel/matrix-register-bot) using a bot to review accounts before sending out invite links
- [MatrixRegistration](https://gitlab.com/olze/matrixregistration/) similar java project using my webui
- [Mother Miounne](https://gitlab.com/etke.cc/miounne) "A bridge between matrix and external services", which also integrates matrix-registration
For more info check the [wiki](https://github.com/ZerataX/matrix-registration/wiki)
### Artwork attribution
- The valley cover photo on the registration page is photo by [Jesús Roncero](https://www.flickr.com/golan)
used under the terms of [CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). No warranties are given.
- The font used on the registration page is [Nunito](https://fonts.google.com/specimen/Nunito) which is licensed under [SIL Open Font License, Version 1.1](./matrix_registration/static/fonts/NUNITO-LICENSE).
没有合适的资源?快使用搜索试试~ 我知道了~
基于令牌的矩阵注册api_Python_HTML_下载.zip
共65个文件
py:16个
yml:8个
yaml:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 63 浏览量
2023-04-13
23:32:38
上传
评论
收藏 655KB ZIP 举报
温馨提示
基于令牌的矩阵注册api_Python_HTML_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于令牌的矩阵注册api_Python_HTML_下载.zip (65个子文件)
matrix-registration-master
SECURITY.md 839B
.travis.yml 300B
setup.py 3KB
shell.nix 224B
.coveragerc 35B
.github
ISSUE_TEMPLATE
feature_request.yml 776B
bug_report.yml 2KB
config.yml 508B
workflows
tests.yml 1KB
pypi.yml 790B
docker.yml 7KB
codeql-analysis.yml 2KB
resources
logo.png 23KB
example.html 3KB
docker-run.sh 139B
docker-serve.sh 171B
alembic.ini 2KB
LICENSE 1KB
default.nix 503B
docker.nix 1KB
tests
__init__.py 0B
config.yaml 888B
localhost.signing.key 59B
context.py 133B
test_registration.py 36KB
homeserver.yaml 666B
localhost.log.config 337B
CONTRIBUTING.md 2KB
tox.ini 210B
alembic
README 0B
script.py.mako 494B
env.py 3KB
versions
130b5c2275d8_update_ip_token_association.py 2KB
140a25d5f185_create_tokens_table.py 2KB
config.sample.yaml 1KB
matrix_registration
__init__.py 117B
wordlist.txt 11KB
tokens.py 6KB
config.schema.json 2KB
app.py 3KB
limiter.py 443B
templates
register.html 11KB
translations
messages.pt_BR.yaml 1KB
messages.de.yaml 1KB
messages.zh_Hans.yaml 1010B
messages.en.yaml 1KB
messages.sv.yaml 1KB
api.py 11KB
translation.py 1KB
matrix_api.py 2KB
static
css
style.css 4KB
images
riot.png 7KB
element-logo.png 2KB
valley.jpg 530KB
favicon.ico 2KB
icon32x32.png 849B
tile.png 4KB
icon.png 10KB
fonts
NUNITO-LICENSE 4KB
Nunito_400_Nunito_700.woff2 19KB
constants.py 711B
config.py 6KB
CODE_OF_CONDUCT.md 3KB
.gitignore 2KB
README.md 6KB
共 65 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功