Python3
andpip
or docker installed- a Synapse server available with its Synapse secret
- a user having admin rights on Synapse homeserver
- Poetry installed for development
Set the configurations in an .env
file :
HOMESERVER_URL=https://matrix.example.com
SYNAPSE_SECRET=
ADMIN_USERNAME=
ADMIN_PASSWORD=
You can find SYNAPSE_SECRET
in your homeserver configuration
poetry install
Build docker image
docker build -t eimis-synapse-tools .
See all commands:
poetry run eimis-synapse-tools --help
Or with docker image
docker run eimisans/eimis-synapse-tools:latest --help
This tool will take as input a csv file:
| display_name | username | email |
| ----------------------- | --------------------------- | --------- |
| John Doe - CHU de Nancy | @johndoe:eimis.beta.gouv.fr | jd@pm.com |
Then the command:
poetry run eimis-synapse-tools import-users --dry-run --csv-file ./data/users.csv
Or with docker
docker run -v ./.env:/.env -v ./data/users.csv:/data/users.csv eimisans/eimis-synapse-tools:latest import-users --dry-run --csv-file /data/users.csv
(remove --dry-run
to actually create the users)
Users can then go to their favorite client and click on forgot password
.
poetry run eimis-synapse-tools setup-discoveryroom --help
poetry run eimis-synapse-tools setup-discoveryroom -r matrix.develop.eimis.incubateur.net
Or with docker
docker run eimisans/eimis-synapse-tools:latest setup-discoveryroom -r matrix.develop.eimis.incubateur.net
Python lint with flake8.
poetry run flake8 --count --show-source --statistics
Static type check with mypy.
poetry run mypy . --no-namespace-packages
poetry run python -m unittest discover tests