GithubHelp home page GithubHelp logo

ad2ien / synapse-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eimis-ans/eimis-synapse-tools

0.0 0.0 0.0 97 KB

Some scripts to manage user enrollment on a Synapse homeserver

License: MIT License

Python 92.84% Dockerfile 7.16%

synapse-tools's Introduction

EIMIS Synapse tools

Gitmoji python License

Prerequisites

  • Python3 and pip or docker installed
  • a Synapse server available with its Synapse secret
  • a user having admin rights on Synapse homeserver
  • Poetry installed for development

Configuration

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

Install

poetry install

Build docker image

docker build -t eimis-synapse-tools .

Usage

Help

See all commands:

poetry run eimis-synapse-tools --help

Or with docker image

docker run eimisans/eimis-synapse-tools:latest --help

Import users

This tool will take as input a csv file:

| display_name            | username                    | email     |
| ----------------------- | --------------------------- | --------- |
| John Doe - CHU de Nancy | @johndoe:eimis.beta.gouv.fr | [email protected] |

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.

Discovery room

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

Lint

Python lint with flake8.

poetry run flake8 --count --show-source --statistics

Static type check with mypy.

poetry run mypy . --no-namespace-packages

Tests

poetry run python -m unittest discover tests

synapse-tools's People

Contributors

ad2ien avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.