2025-12-20 16:36:52 -05:00
2026-01-02 13:18:48 -05:00
2026-01-02 13:18:48 -05:00
2025-12-20 16:36:52 -05:00

mx-invite

A simple way to have an invite code system for a Synapse server.

Required endpoints

The following APIs on the homeserver are required for functionality:

  • /_synapse/admin/v1/registration_tokens/new
  • /_matrix/client/v3/account/whoami
  • /_matrix/client/v3/logout
  • /_matrix/client/v3/login

Configuration

The configuration file is config.toml and must be in the same folder as index.py.

Configuration options

  • db_uri, required: The DB URI, e.g. postgresql://postgres@localhost/mx_invites. Currently only PostgreSQL is supported.
  • homeserver_url_base, required: The homeserver base URL, e.g. http://127.0.0.1:8008. Running mx-invite in the same environment as Synapse is recommended.
  • flask_secret_key, required: The secret key Flask uses to sign session IDs. Changing this will invalidate all sessions.
  • admin_access_token, required: Access token of an administrator on the Synapse instance.
  • public_url_prefix: The URL prefix for mx-invite to run on and redirect to. Defaults to /mx-invite/.
  • days_until_expiry: How many days an unused registration token should be valid for. Defaults to 3.
  • code_length: How long registration tokens should be. Defaults to 16, maximum is 64.
  • uses_per_code: How many uses are allowed per registration token. Defaults to 1.
Description
No description provided
Readme 56 KiB
Languages
Python 63.3%
HTML 36.7%