1
0
Fork
You've already forked sso-grid
0
assume it's MIT licensed
  • Python 100%
Find a file
2025年04月09日 21:09:00 +01:00
.gitignore Initial commit 2025年04月09日 21:09:00 +01:00
config.example.toml Initial commit 2025年04月09日 21:09:00 +01:00
imagesplit.py Initial commit 2025年04月09日 21:09:00 +01:00
main.py Initial commit 2025年04月09日 21:09:00 +01:00
README.md Initial commit 2025年04月09日 21:09:00 +01:00

SSO Grid

Add a grid of SSO providers to a Matrix server's registration flows, based on a larger image.

Setup

  1. Install required modules (preferably in a venv):
virtualenv venv
source venv/bin/activate
pip install requests flask flask_cors Pillow
  1. 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
  1. 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
  1. Reverse proxy /_matrix/media/v3/thumbnail/fake_name/ to the server. "fake_name" must match MEDIA_REPO_NAME in 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
}