zeratax / matrix-registration Goto Github PK
View Code? Open in Web Editor NEWa token based matrix registration api
Home Page: https://zeratax.github.io/matrix-registration/
License: MIT License
a token based matrix registration api
Home Page: https://zeratax.github.io/matrix-registration/
License: MIT License
Describe the bug
The api documentation in the api documentation suggests that one should use the SharedSecret
:
curl -X POST \
-H "Authorization: SharedSecret verysecuresecret" \
-H "Content-Type: application/json" \
-d '{"one_time": true, "ex_date": "24.12.2020"}' \
http://localhost:5000/token
@zeratax clarified for me in #matrix-registration:dmnd.sh that the AdminAPIPass
belongs in that field. This was confusing as I was coming from a previous version of matrix-registration in which SharedSecret
was the necessary credential in this field.
The Readme also does not clarify which password
is meant in the curl example given.
curl -X POST \
-F 'username=test' \
-F 'password=verysecure' \
-F 'confirm=verysecure' \
-F 'token=DoubleWizardSki' \
http://localhost:5000/register
To Reproduce
SharedSecret
(i.e., the Synapse shared secret found in homeserver.yaml)Expected behavior
Documentation should expressly specify AdminAPIPass
in commands where it is required.
After registration Python says that in output:
2018-06-09 20:51:30,888 - flask.app - ERROR - Exception on /register [POST]
Traceback (most recent call last):
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/app.py", line 1815, in full_disp
atch_request
rv = self.handle_user_exception(e)
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_us
er_exception
reraise(exc_type, exc_value, tb)
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/app.py", line 1813, in full_disp
atch_request
rv = self.dispatch_request()
File "/home/commagray/Build/matrix-registration/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_
request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/commagray/Build/matrix-registration/matrix_registration/api.py", line 175, in register
device_id=account_data['device_id'],
KeyError: 'device_id'
2018-06-09 20:51:30,906 - werkzeug - INFO - 127.0.0.1 - - [09/Jun/2018 20:51:30] "POST /register HTTP/1.0" 500 -
And browser redirects to /register and shows 500 error page, but registration works well.
So how can I change that confusing page by something else?
Describe the bug
To Reproduce
Expected behavior
respect pw policy
Screenshots
System:
Additional context
not sure what good practices are in regards of informing users of the pw policy
Describe the bug
When running matrix_registration
without using python -m
an ImportError is thrown:
Traceback (most recent call last):
File "/opt/venvs/matrix-registration/bin/matrix_registration", line 7, in <module>
from matrix_registration.__main__ import main
ImportError: cannot import name 'main'
System:
send out links with email templates
last docker image was updated 5 months ago, but i see more recent commits. I'm having issues with a new install, but i want to make sure i'm on the most recent code before i start asking questions.
Using a base_url: /matrix-registration
configuration setting (implemented in 8dbabbc) fixes URL generation and all assets are linked to in a way that preserves the base URL.
However, styles.css
stylesheet hardcodes /static/images/valley.jpg
in a way that doesn't respect the base URL:
Thus, people still need to rewrite /static
to something like /matrix-registration/static
for text/css
resources.
Having base_url
support is a huge improvement, but putting matrix-registration
under a different path still requires some manual work like this.
Describe the bug
Tokens added to the database by other means are not detected by matrix-registration
.
To Reproduce
tokens
table without using matrix-registration
Expected behavior
Any properly formatted token in the database should be valid.
System:
pip show
nor python3 -m matrix_registration -h
show version.Additional context
I am running one instance of matrix_registration
on a host and another in a container. The two share a database and I can confirm that writes from both instances of the application are persisting in the same table. However, the instances will only validate records they created themselves and report records created by the other instance as invalid. This is confusing to me because the load function looks like it should refresh all tokens from the database and it looks like it is being called during validation. This makes me wonder if there is additional state being saved somewhere that is causing these instances to ignore one another's records.
After the latest update, when trying to register I'm getting
Dec 17 22:24:46 okcool python3[1812240]: [2020-12-17 22:24:46,039] ERROR in app: Exception on /register [POST]
Dec 17 22:24:46 okcool python3[1812240]: Traceback (most recent call last):
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
Dec 17 22:24:46 okcool python3[1812240]: response = self.full_dispatch_request()
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
Dec 17 22:24:46 okcool python3[1812240]: rv = self.handle_user_exception(e)
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
Dec 17 22:24:46 okcool python3[1812240]: reraise(exc_type, exc_value, tb)
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
Dec 17 22:24:46 okcool python3[1812240]: raise value
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
Dec 17 22:24:46 okcool python3[1812240]: rv = self.dispatch_request()
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
Dec 17 22:24:46 okcool python3[1812240]: return self.view_functions[rule.endpoint](**req.view_args)
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/matrix_registration/api.py", line 177, in register
Dec 17 22:24:46 okcool python3[1812240]: error = resp.json()
Dec 17 22:24:46 okcool python3[1812240]: File "/home/matrix-registration/env/lib/python3.8/site-packages/requests/models.py", line 900, in json
Dec 17 22:24:46 okcool python3[1812240]: return complexjson.loads(self.text, **kwargs)
Dec 17 22:24:46 okcool python3[1812240]: File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
Dec 17 22:24:46 okcool python3[1812240]: return _default_decoder.decode(s)
Dec 17 22:24:46 okcool python3[1812240]: File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
Dec 17 22:24:46 okcool python3[1812240]: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Dec 17 22:24:46 okcool python3[1812240]: File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
Dec 17 22:24:46 okcool python3[1812240]: raise JSONDecodeError("Expecting value", s, err.value) from None
Dec 17 22:24:46 okcool python3[1812240]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This happens both when curl
ing locally and with the web interface.
OS: Ubuntu 20.04
Synapse has a --config
command line option which is very useful for packaging it for distributions, as the config file often lives in /etc
there.
Would it be possible to get such an option for matrix-registration as well?
An arm64 docker image would be great especially since I'm trying to use it with https://github.com/spantaleev/matrix-docker-ansible-deploy and I am on an arm64 box.
arm64 machines
No response
Describe the bug
Building for arm32 (Raspbian/Debian Buster) fails after update to v0.8.0.
To Reproduce
I use the "matrix-docker-ansible-deploy" from "spantaleev" and after using the newest version (with matrix-registration v0.8.0) the playbook fails with this message:
fatal: [matrix.[domain hidden]]: FAILED! => {"changed": false, "msg": "Error building localhost/illagrenan/pgloader - code: 100, message: The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends bzip2 ca-certificates curl freetds-dev gawk git libsqlite3-dev libssl1.1 libzip-dev make openssl patch sbcl time unzip wget cl-ironclad cl-babel && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100, logs: [u'Step 1/7 : FROM debian:bullseye-slim as builder', u'\\n', u' ---> d0609bb53fd3\\n', u'Step 2/7 : ARG PGLOADER_VERSION=v3.6.2', u'\\n', u' ---> Using cache\\n', u' ---> 14f52a4736cf\\n', u'Step 3/7 : RUN apt-get update && apt-get install -y --no-install-recommends bzip2 ca-certificates curl freetds-dev gawk git libsqlite3-dev libssl1.1 libzip-dev make openssl patch sbcl time unzip wget cl-ironclad cl-babel && rm -rf /var/lib/apt/lists/*', u'\\n', u' ---> Running in a5b0e4b6d01c\\n', u'Get:1 http://deb.debian.org/debian bullseye InRelease [123 kB]\\n', u'Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]\\n', u'Get:3 http://deb.debian.org/debian bullseye-updates InRelease [40.1 kB]\\n', u'Err:2 http://security.debian.org/debian-security bullseye-security InRelease\\n At least one invalid signature was encountered.\\n', u'Err:1 http://deb.debian.org/debian bullseye InRelease\\n At least one invalid signature was encountered.\\n', u'Err:3 http://deb.debian.org/debian bullseye-updates InRelease\\n At least one invalid signature was encountered.\\n', u'Reading package lists...', u'\\n', u\"\\x1b[91mW: GPG error: http://security.debian.org/debian-security bullseye-security InRelease: At least one invalid signature was encountered.\\nE: The repository 'http://security.debian.org/debian-security bullseye-security InRelease' is not signed.\\nW: GPG error: http://deb.debian.org/debian bullseye InRelease: At least one invalid signature was encountered.\\nE: The repository 'http://deb.debian.org/debian bullseye InRelease' is not signed.\\nW: GPG error: http://deb.debian.org/debian bullseye-updates InRelease: At least one invalid signature was encountered.\\nE: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed.\\n\\x1b[0m\", u'Removing intermediate container a5b0e4b6d01c\\n']"}
Expected behavior
Including v0.7.2 the playbook build matrix-registration for arm32 flawlessly.
System:
Describe the bug
After updating synapse to 1.24, registrations now fail for me with "Unrecognized request". Worked fine before.
To Reproduce
curl -X POST \
-F 'username=test' \
-F 'password=verysecure' \
-F 'confirm=verysecure' \
-F 'token=DoubleWizardSki' \
http://localhost:5000/register
Expected behavior
Successful registration.
Actual behavior
{"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}
System:
Describe the bug
The /token
endpoint returns a 500 error when the request has an empty body or is missing the Content-Type: application/json
header.
To Reproduce
/token
with no body or no content-type headerExpected behavior
application/json
and proceed accordingly, possibly returning a more descriptive error if JSON fails to parse.System:
Ubuntu, matrix-registration v0.8.1.dev3 (from dockerhub)
In api.py
the token object is being created inside the if data:
block, so if data
is {}
then it never gets created. It doesn't look like there should be any problem with moving that statement out of the block.
The content-type issue can be solved by supplying force=True
to the get_json
call (weird that Flask doesn't default to this IMO, it's bitten me before) assuming you want to support that use case.
I'd be happy to submit a pull request to make these changes if you think they make sense.
I tried several times to create a new token with an expiry date, but the token wouldn't work. I was running the module (python -m matrix_registration gen -e 01.04.2020
). When I tried using the /token
API, I realized that I was actually getting a token with expiry on Jan 04, 2020! It sounds like the date formatter might depend on my system locale or something like that. Can we fix it so the format is always DD.MM.YYYY
?
The documented config.sample.yaml indicates server_location: 'https://matrix.org'
as an example url for server location, but this requires nginx to forward https://example.tld/_synapse/admin/v1/register
to the whole world.
According to the official synapse reverse proxy documentation, only location /_synapse/client
should be forwarded.
For my configuration of matrix-registration I used server_location: 'http://localhost:8008'
, which I believe to be more secure.
Should config.sample.yaml show this, or am I missing something?
Because nix is used to build the container image, it's not easy to run alembic.
For 0.9.1
, the alembic
binary happens to be at /nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/alembic
. Seems like we need to set this as an --entrypoint
to invoke it.
It appears that we also need to pass a config to it, which happens to live at /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/alembic.ini
.
Looks like we also need to run the alembic
command with a working directory like /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration
(passed to docker run
via -w
).
In the end, I've gotten to a command like this:
docker run \
-it \
--rm \
--name matrix-registration-db \
--log-driver=none \
--user=991:991 \
--cap-drop=ALL \
--network=matrix \
--mount type=bind,src=/matrix/matrix-registration/config,dst=/config,ro \
--mount type=bind,src=/matrix/matrix-registration/data,dst=/data \
-w /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration \
--entrypoint=/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/alembic \
docker.io/zeratax/matrix-registration:v0.9.1 \
-c /nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/alembic.ini upgrade head
Yet I still get some error like this:
Traceback (most recent call last):
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/.alembic-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 577, in main
CommandLine(prog=prog).main(argv=argv)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 571, in main
self.run_cmd(cfg, options)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/config.py", line 548, in run_cmd
fn(
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
script.run_env()
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
util.load_python_file(self.dir, "env.py")
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
module = load_module_py(module_id, path)
File "/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "alembic/env.py", line 14, in <module>
from matrix_registration import config as mr_config
ModuleNotFoundError: No module named 'matrix_registration
So I'm guessing the command above needs even more work.
Is it possible to adjust the container-building script, so that it puts binaries (or symlinks to them) at a predictable path?
What would be the proper way to invoke alembic
from a container image?
Related to spantaleev/matrix-docker-ansible-deploy#1208
Hi,
thanks for your work and your plugin.
I just tried to install the whole thing on my Matrix server.
Unfortunately I get an error when I try to start the API.
When I try to start the API, I get the following error:
root@vmd76330:~# matrix-registration --config-path /etc/matrix-synapse/registration/config.yaml serve
Traceback (most recent call last):
File "/usr/local/bin/matrix-registration", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/flask/cli.py", line 426, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/matrix_registration/app.py", line 58, in run_server
serve(app, host=config.config.host, port=config.config.port, url_prefix=config.config.base_url)
File "/usr/local/lib/python3.9/dist-packages/waitress/__init__.py", line 12, in serve
server = _server(app, **kw)
File "/usr/local/lib/python3.9/dist-packages/waitress/server.py", line 81, in create_server
last_serv = TcpWSGIServer(
File "/usr/local/lib/python3.9/dist-packages/waitress/server.py", line 239, in __init__
self.bind_server_socket()
File "/usr/local/lib/python3.9/dist-packages/waitress/server.py", line 368, in bind_server_socket
self.bind(sockaddr)
File "/usr/local/lib/python3.9/dist-packages/waitress/wasyncore.py", line 398, in bind
return self.socket.bind(addr)
OSError: [Errno 99] Cannot assign requested address
My Config looks like this:
server_location: 'http://localhost:8008'
server_name: 'matrix.sleser.de'
registration_shared_secret: 'Same as Homeserver.yaml' # see your synapse's homeserver.yaml
admin_api_shared_secret: 'Admin Token i got from the element app' # to generate tokens via the web api
base_url: 'https://matrix.sleser.de/element/register' # e.g. '/element' for https://example.tld/element/register
client_redirect: 'https://app.element.io/#/login'
client_logo: 'static/images/element-logo.png' # use '{cwd}' for current working directory
db: 'sqlite:///{cwd}db.sqlite3'
host: 'localhost'
port: 5000
rate_limit: ["100 per day", "10 per minute"]
allow_cors: false
ip_logging: false
logging:
disable_existing_loggers: false
version: 1
root:
level: DEBUG
handlers: [console, file]
formatters:
brief:
format: '%(name)s - %(levelname)s - %(message)s'
precise:
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
handlers:
console:
class: logging.StreamHandler
level: INFO
formatter: brief
stream: ext://sys.stdout
file:
class: logging.handlers.RotatingFileHandler
formatter: precise
level: INFO
filename: m_reg.log
maxBytes: 10485760 # 10MB
backupCount: 3
encoding: utf8
# password requirements
password:
min_length: 8
# username requirements
username:
validation_regex: [] #list of regexes that the selected username must match. Example: '[a-zA-Z]\.[a-zA-Z]'
invalidation_regex: [] #list of regexes that the selected username must NOT match. Example: '(admin|support)'
I use a Debian 11 and the Matrix Server runs at the same maschine. I installed nginx and added this to my conf:
server {
listen 80;
server_name matrix.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name matrix.sleser.de;
ssl_certificate /etc/letsencrypt/live/matrix.sleser.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/matrix.sleser.de/privkey.pem;
location / {
proxy_pass http://localhost:8008;
proxy_set_header X-Forwarded-For $remote_addr;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
client_max_body_size 10M;
}
location ~ ^/(static|register) {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:5000;
}
}
# This is used for Matrix Federation
# which is using default TCP port '8448'
server {
listen 8448 ssl;
server_name matrix.sleser.de;
ssl_certificate /etc/letsencrypt/live/matrix.sleser.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/matrix.sleser.de/privkey.pem;
location / {
proxy_pass http://localhost:8008;
proxy_set_header X-Forwarded-For $remote_addr;
}
I am new to the whole Matrix topic and hope I am not making an essential mistake. I am very grateful for any help.
Many greetings
Describe the bug
I upgraded to the latest pip3 install, and now all API calls return a 404 error.
To Reproduce
curl -H "Authorization: SharedSecret oop7oophahVie7Ahchainee3seesae4a" http://localhost:5000/api/version
Expected behavior
I expect a JSON object representing the version of matrix-registration to be returned
System:
Additional context
I even went so far as to uninstall and delete the original install completely, and did a full reinstall. Updated the config to the latest sample on Github, and set a value to admin_api_shared_secret:
in the config.
Edit: I realized after the fact that I forgot to censor the secret. I have since changed it in the config.
We've just been talking about registration flows again and someone brought up how fluffychat does it now:
Would it be possible to add a similar thing here as well?
(somewhat relate to #54 )
either use https://github.com/henry-nicolas/docker-mxreg or make my own
I'm trying the 0.9.1
Docker image.
Configuration is like this:
admin_api_shared_secret: MySecret
allow_cors: false
base_url: /matrix-registration
client_logo: static/images/element-logo.png
client_redirect: https://element.DOMAIN
db: postgresql://matrix_registration:password@matrix-postgres:5432/matrix_registration
host: 0.0.0.0
logging:
disable_existing_loggers: false
formatters:
brief:
format: '%(name)s - %(levelname)s - %(message)s'
precise:
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: brief
level: INFO
stream: ext://sys.stdout
root:
handlers:
- console
level: DEBUG
version: 1
password:
min_length: 8
port: 5000
rate_limit:
- 100 per day
- 10 per minute
registration_shared_secret: test
server_location: http://matrix-nginx-proxy:12080
server_name: DOMAIN
The matrix_registration
Postgres database is empty.
I start matrix-registration with the following command: docker run -it --rm --name matrix-registration --log-driver=none --user=991:991 --cap-drop=ALL --network=matrix --mount type=bind,src=/matrix/matrix-registration/config,dst=/config,ro --mount type=bind,src=/matrix/matrix-registration/data,dst=/data docker.io/zeratax/matrix-registration:v0.9.1 --config-path=/config/config.yaml serve
.. which results in:
Traceback (most recent call last):
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "ips"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/bin/.matrix-registration-wrapped", line 9, in <module>
sys.exit(cli())
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/nix/store/7qbdawsyw1bvldh51z1bh1qnb8llz18r-python3.8-Flask-1.1.2/lib/python3.8/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
Command.invoke(self, ctx)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/nix/store/walvddccd81dayrap7lk9krhwlzgbvhz-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/lib/python3.8/site-packages/matrix_registration/app.py", line 43, in cli
db.create_all()
File "/nix/store/chxdhhm13lzalclk28xn33xv21ssl1dn-python3.8-Flask-SQLAlchemy-2.4.4/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1039, in create_all
self._execute_for_all_tables(app, bind, 'create_all')
File "/nix/store/chxdhhm13lzalclk28xn33xv21ssl1dn-python3.8-Flask-SQLAlchemy-2.4.4/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1031, in _execute_for_all_tables
op(bind=self.get_engine(app, bind), **extra)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 4555, in create_all
bind._run_visitor(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2097, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1656, in _run_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 145, in traverse_single
return meth(obj, **kw)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 783, in visit_metadata
self.traverse_single(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 145, in traverse_single
return meth(obj, **kw)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 827, in visit_table
self.connection.execute(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1068, in _execute_ddl
ret = self._execute_context(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
self._handle_dbapi_exception(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
util.raise_(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InvalidForeignKey) there is no unique constraint matching given keys for referenced table "ips"
[SQL:
CREATE TABLE association (
ips VARCHAR NOT NULL,
tokens INTEGER NOT NULL,
PRIMARY KEY (ips, tokens),
FOREIGN KEY(ips) REFERENCES ips (address),
FOREIGN KEY(tokens) REFERENCES tokens (name)
)
]
(Background on this error at: http://sqlalche.me/e/13/f405)
Related to spantaleev/matrix-docker-ansible-deploy#1208
Describe the bug
the alembic version is not in the table on a fresh install, meaning if you run alembic upgrade head
for the first time it will try to apply every db change even though it is already on the latest version.
Expected behavior
insert alembic version on first run, if it's not there already
Describe the bug
matrix-registration fails to start and throws a AttributeError: 'Config' object has no attribute 'logging'
error.
To Reproduce
sudo -u synapse matrix-registration --config-path /etc/matrix-synapse/homeserver.yaml serve
Expected behaviour
not exiting in error :)
Screenshots
sudo -u synapse matrix-registration --config-path /etc/matrix-synapse/homeserver.yaml serve
Traceback (most recent call last):
File "/usr/local/bin/matrix-registration", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1256, in invoke
Command.invoke(self, ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/matrix_registration/app.py", line 35, in cli
logging.config.dictConfig(config.config.logging)
AttributeError: 'Config' object has no attribute 'logging'
System:
Additional context
Running this as the matrix-synapse user, not sure if it matters.
Is your feature request related to a problem?
currently there is no easy way to provide matrix-registration in other languages
Describe the solution you'd like
probably use https://l10n.dmnd.sh/
Is your feature request related to a problem?
I'd like to publicly share invite links to my matrix server, but I'd like to put an upper bound to the number of signups that can happen with this particular token.
I installed matrix-registration on my system a long time ago. Recently when reinstalling into a new system, I got the following error when trying to run matrix-registration serve
:
Traceback (most recent call last):
File "/root/.local/bin/matrix-registration", line 5, in <module>
from matrix_registration.app import cli
File "/root/.local/pipx/venvs/matrix-registration/lib/python3.7/site-packages/matrix_registration/app.py", line 9, in <module>
from flask_limiter.util import get_ipaddr
ImportError: cannot import name 'get_ipaddr' from 'flask_limiter.util' (/root/.local/pipx/venvs/matrix-registration/lib/python3.7/site-packages/flask_limiter/util.py)
I downgraded flask-limiter
to 2.0.0 and the application then runs fine.
You should be able to replicate this by installing matrix-registration
using pip
(or pipx
as in my case) without any constraints as recommended in the README and running matrix-registration serve
. Then you should be able to get it running again using pip install flask-limiter==2.0.0
(or pipx runpip matrix-registration install flask-limiter==2.0.0
, as in my case).
Currently the built in web server only supports serving the registration page on the root of a given URL. There are absolute path references in <head>, in the form post action, and in the css, that prevent ProxyPass for example from properly serving the page from a path such as 'xyz.com/riot/register'.
A new config argument to specify the base URL path could be added, or simply removing the leading slash and using appropriate relative path references seems to work fine.
sorry to re-open this issue. But now seems that the version on pip updated as well. So I got my version updated today and it produces the same errors (regardless of pip or docker image directly)
registration | 2021-05-26T14:20:49.003879113Z Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...
registration | 2021-05-26T14:20:49.003935786Z
registration | 2021-05-26T14:20:49.003952889Z a token based matrix registration app
registration | 2021-05-26T14:20:49.003966510Z
registration | 2021-05-26T14:20:49.003979523Z Options:
registration | 2021-05-26T14:20:49.003992439Z --config-path TEXT specifies the config file to be used
registration | 2021-05-26T14:20:49.004005534Z --version Show the flask version
registration | 2021-05-26T14:20:49.004017721Z -h, --help Show this message and exit.
my command in docker-compose looks like this
[...]
volumes:
- "./configs/synapse-registration/config.yaml:/etc/config.yaml:ro"
- "./configs/synapse-registration/register.html:/usr/local/lib/python3.9/site-packages/matrix_registration/templates/register.html:ro"
- "./data/matrix-registration/:/data/"
command: /bin/sh -c 'matrix-registration --config-path /etc/config.yaml serve'
[...]
so atm matrix-registration is completly broken for me
The only way that works for me is to change my Dockerfile for the build to install matrix-registration==0.8.0
from pip
Originally posted by @jahlives in #64 (comment)
If you are running a public matrix server, there will be the situation, that someone has lost their account password.
At the current situation, the created account will only hold the username, nothing more. Therefore there is no second identifier to validate an user request during a password reset request.
It would be very helpful, to provide an email field within the registration dialog, which value can be passed during the profile creation to the new matrix account.
If the email field is optional or required could be an additional feature.
api.py uses request.remote_addr
for IP logging when enabled. However, this is incorrect when behind a reverse proxy, even when the proxy attaches a header listing the "real" IP address -- the remote_addr
is always going to be the proxy's IP address. Instead, the registration code needs to read something from request.headers
.
As a complicating factor, matrix-registration doesn't actually know if it's behind a proxy. And if it's not, it can't trust even the last element of the X-Forwarded-For header, and should only accept the remote_addr
.
There are a few possible solutions, but the approach I took was to concatenate the XFF and the remote IP, as seen in this branch: master...timmc:timmc/xff
ips = ', '.join(request.headers.getlist('X-Forwarded-For') + [request.remote_addr]) \
if config.config.ip_logging else False
...and store the (string) list of IPs instead of a single IP. (Note also the correction to the nginx config. XFF should be chained, not replaced with a single IP.)
System:
I've got matrix-registration running but I'd like to know how to have it set up as a service so I don't have to worry about manually starting/restarting it on the server I've got running.
Basically I want to get rid of these lines:
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Which show up when I run python3 -m matrix_registration api
As part of the work happening in spantaleev/matrix-docker-ansible-deploy#740, I was trying to migrate matrix-registration
to Postgres for us.
When the Docker container image is used and the configuration specifies db: postgresql://.....
, SQLAlchemy attempts to import psycopg2
, which fails:
ModuleNotFoundError: No module named 'psycopg2'
I've tried fixing this by modifying Dockerfile
, so that it would install py3-psycopg2
and found some strange things:
PYTHON_VERSION=3.7
, yet Alpine 3.11 is used, where the default Python 3 interpreter is 3.8.x
, so there is a mismatch. Installing py3-psycopg
means the module gets installed to /usr/local/lib/python3.8/site-packages
. The Python 3.7 interpreter this image uses actually looks for modules in /usr/local/lib/python3.7/site-packages
. I guess this mismatch should be corrected anyway. And now that Alpine is on 3.12, you probably want to be on that..?
perhaps FROM docker.io/python:${PYTHON_VERSION}-alpine as builder
should be changed to something more specific (instead of letting it use some random Alpine version). Not sure where it currently points right now (perhaps to 3.12?)
even with all of the above fixes, I still couldn't get import psycopg2
to work in the container's Python 3 interpreter. I'm not sure what's going on..
When I send the register post request Python spits out this error:
[2021-07-23 08:46:50,750] ERROR in app: Exception on /register [POST]
Traceback (most recent call last):
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/etc/matrix-registration/lib/python3.9/site-packages/matrix_registration/api.py", line 169, in register
if form.validate():
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/form.py", line 318, in validate
return super(Form, self).validate(extra)
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/form.py", line 150, in validate
if not field.validate(self, extra):
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/fields/core.py", line 226, in validate
stop_validation = self._run_validation_chain(form, chain)
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/fields/core.py", line 246, in _run_validation_chain
validator(form, self)
File "/etc/matrix-registration/lib/python3.9/site-packages/matrix_registration/api.py", line 82, in validate_username
re.escape(domain) + \
File "/usr/lib/python3.9/re.py", line 277, in escape
pattern = str(pattern, 'latin1')
TypeError: decoding to str: need a bytes-like object, NoneType found
matrix_registration.app - ERROR - Exception on /register [POST]
Traceback (most recent call last):
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/etc/matrix-registration/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/etc/matrix-registration/lib/python3.9/site-packages/matrix_registration/api.py", line 169, in register
if form.validate():
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/form.py", line 318, in validate
return super(Form, self).validate(extra)
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/form.py", line 150, in validate
if not field.validate(self, extra):
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/fields/core.py", line 226, in validate
stop_validation = self._run_validation_chain(form, chain)
File "/etc/matrix-registration/lib/python3.9/site-packages/wtforms/fields/core.py", line 246, in _run_validation_chain
validator(form, self)
File "/etc/matrix-registration/lib/python3.9/site-packages/matrix_registration/api.py", line 82, in validate_username
re.escape(domain) + \
File "/usr/lib/python3.9/re.py", line 277, in escape
pattern = str(pattern, 'latin1')
TypeError: decoding to str: need a bytes-like object, NoneType found
Try to register.
No errors.
OS: Arch Linux ARM
python version: 3.9.6
matrix registration version: freshly installed from pip
Describe the bug
While installing matrix-registration, I receive the following output:
root@xxx:~# python3 -m matrix_registration
could not find any configuration file!
Try to define config file, receive
root@xxxx:/# python3 -m matrix_registration --config-path /usr/local/config/config.yaml
could not find any configuration file!
System:
if using the latest version of matrix-registration with https://github.com/williamkray/maubot-invite and nginx reverse proxy, additionally this should be added to nginx.conf inside the corresponding server to show generation link correctly.
location /api {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:5000;
}
Is your feature request related to a problem?
Not really, I just would like to be able to clean up the database via the API.
Describe the solution you'd like
A possible API call for deleting a specified token.
Describe the bug
The generated token is always flagged as invalid. This means no account can be created.
Specifically, if you access https://matrix.bielefeldt.berlin/matrix-registration/register?token=VampireTobaccoAndroid and try to create an account, the token is not accepted, even though it was generated by this instance.
To Reproduce
Go to https://matrix.bielefeldt.berlin/matrix-registration/register?token=VampireTobaccoAndroid.
Try to register an account.
Expected behavior
The token should be accepted as valid and the account created.
System:
Additional context
I have not installed matrix-registration directly but via the playbook described here https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-matrix-registration.md.
Describe the bug
the fix introduced in 4454b3c, is still bad.
the association table currently associates between an ip object and a token object, but since the ip object only has one property it might as well just associate directly between an ip string and the token.
association_table = Table('association', db.Model.metadata,
Column('ips', Integer, ForeignKey('ips.id'), primary_key=True),
Column('tokens', String(255), ForeignKey('tokens.name'), primary_key=True))
Expected behavior
add alembic version that will recreate the association_table properly. should work very similarly to the last fix:
https://github.com/ZerataX/matrix-registration/blob/4454b3cbf222356e2ef2eda695f5ce9a8431c835/alembic/versions/130b5c2275d8_update_ip_token_association.py#L23-L44
downgrading it will first have to create a new ip table and then recreate an association table with the proper ids to tokens associated
Is your feature request related to a problem?
No
Describe the solution you'd like
Please, add Mother Miounne to the "bot" section of readme.
Source code: https://gitlab.com/etke.cc/miounne
Additional context
Is your feature request related to a problem?
It's very annoying to have a new Sqlite3file created where you input the startup command ! You can loose your previous tokens and it create garbage files each time you start the command.
Describe the solution you'd like
Add to the config.yaml where you want to store the log and sqlite file. Like path_to_logs = "";
It would be easier for new users
Regards
postgres
Hi, I noticed in your wiki documentation for the api that the endpoint for token management is under token
but it seems like the endpoint is now behind the path prefix api/token
. Any chance to get the docs updated?
to allow homeserver admins to better moderate their instance it should optionally be possible to log the associated ips for every registration
v0.7.0 doesn't work with Synapse v1.24.0, because the registration API has been moved from /_matrix/client/r0/admin/register
to /_synapse/admin/v1/register
.
This has already been fixed in 6b26255, but since there hasn't been a new release since then, most of us were on v0.7.0 and matrix-registration was failing.
This should be a win for both privacy and load times.
Unfortunately it's not trivial to replace and not zero cost. I found some in-depth discussion about this here: https://www.tunetheweb.com/blog/should-you-self-host-google-fonts/
I tried use API, and getting 404 code for all my requests.
example:
curl -H "Authorization: SharedSecret <my secret>" http://localhost:5001/api/token #i use specific port
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
Describe the bug
Serving the registration app with a postgres backed database fails as multiple steps in the database creation process are not done
To Reproduce
Expected behavior
Database is successfully created and the container will start
Screenshots
N/A
System:
Additional context
N/A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.