assume it's MIT licensed
| .gitignore | Initial commit | |
| config.example.toml | Initial commit | |
| imagesplit.py | Initial commit | |
| main.py | Initial commit | |
| README.md | Initial commit | |
SSO Grid
Add a grid of SSO providers to a Matrix server's registration flows, based on a larger image.
Setup
- Install required modules (preferably in a venv):
virtualenv venv
source venv/bin/activate
pip install requests flask flask_cors Pillow
- Pick an image that can be split into a 6x6 grid. Create a directory to save the grid tiles in, and run imagesplit.py on the image:
mkdir tile_dir
python imagesplit.py tile_dir image.png
- Write configuration to
config.toml:
MEDIA_REPO_NAME = "regpro" # a fake domain name for media URLs
UPSTREAM_URL = "http://localhost:8008" # the real matrix server
TILE_DIR = "tiles" # where the tiles from imagesplit are stored
- Reverse proxy
/_matrix/media/v3/thumbnail/fake_name/to the server. "fake_name" must matchMEDIA_REPO_NAMEin the config.
Also reverse proxy GET requests for /_matrix/client/v3/login to the server.
This program doesn't handle POST requests for login.
Caddy example:
https://matrix.example.com {
reverse_proxy localhost:8008
@ssogrid {
method GET
path /_matrix/client/v3/login
path /_matrix/media/v3/thumbnail/ssogrid/*
}
reverse_proxy @ssogrid localhost:5000
}