A Django app for allowing users to register for a Synapse account.
Project description
Synapse Matrix Registration System
This is a user registration system for a Matrix server using Django and the Synapse Admin API. It handles user sign-ups, admin approvals, and account management.
Features
- User Registration Workflow: A step-by-step registration process, including username checking, email verification, and submission of a reason for registration.
- Admin Approval: Registrations require admin approval before activation.
- User Notifications: Email notifications are sent throughout the registration process to ensure users and admins remain informed.
- Admin Portal: Admins can manage registrations directly from the Django admin interface, approving or denying requests.
Installation
- Clone the Repository:
git clone https://git.private.coffee/PrivateCoffee/synapse-registration.git
cd synapse-registration
python3 -m venv venv
source venv/bin/activate
pip install .
- Create configuration file:
cp config.dist.yaml config.yaml
- Edit configuration file:
Edit the config.yaml file to match your Matrix server and email settings.
The following settings are available:
debug: Set totrueto enable Django debug mode. Do not enable in production.secret_key: Django secret key. If not set, a random key will be generated on startup.synapse: Synapse server settings.admin_token: Access token of an admin user.server: Synapse server URL (e.g.https://matrix.example.com).domain: Matrix server domain (e.g.example.com).verify_cert: If your Synapse server uses a self-signed certificate, set this tofalse, or provide the path to your CA bundle.
hosts: List of domains that the registration system will be accessible at. At least one domain is required.email: Email server settings.host: SMTP server hostname. Required.port: SMTP server port. Required.username: SMTP username. Required.password: SMTP password. Required.tls: Set totrueto enable STARTTLS.ssl: Set totrueto enable SSL.from: Email address to send notifications from. Defaults to theusernamesetting.
admin: Admin user settings.email: Email address to send admin notifications to. Required.
trust_proxy: Set totrueif the registration system is behind a reverse proxy. This ensures the correct IP address is logged.auto_join: Optional list of rooms to automatically join users to after registration. The admin user must be in these rooms and have invite permissions.legal: Optional list of legal documents to link to in the registration form. Each item must have atitleandurl.retention: Optional retention periods for registrations.started: Days to keep unverified registrations. Default is 2 days.completed: Days to keep completed/denied registrations. Default is 30 days.
database: Optional database settings.path: Path to the SQLite database file. Defaults todb.sqlite3in the current directory.
- Run migrations:
synapse_registration migrate
- Create superuser:
synapse_registration createsuperuser
- Run the server:
For development:
synapse_registration runserver
For production, use a WSGI server such as uWSGI, behind a reverse proxy such as Caddy.
Usage
- Access the registration system:
Navigate to the domain you set in the config.yaml file. You should see the registration form.
- Register a new user:
The registration process is as follows:
- Step 1: Enter a username. The system will check if the username is available.
- Step 2: Enter an email address. A verification email will be sent.
- Step 3: Enter a password and reason for registration. The password will be stored in Synapse, the reason will be stored in the admin interface.
- Step 4: Wait for an admin to approve the registration. You will receive an email when this happens.
- Approve a registration:
- Step 1: Log in to the Django admin interface.
- Step 2: Navigate to the
User registrationssection. - Step 3: Review the registration request and set the status to
ApprovedorDenied. This will enable the Matrix account and send an email to the user.
- Clean up registrations:
Note: This is no longer necessary. Old registrations are automatically cleaned up.
You can use the synapse_registration cleanup command to remove old registration requests.
- Unverified registrations are removed after 48 hours.
- Denied and approved registrations are removed after 30 days.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synapse_registration-0.1.3.tar.gz.
File metadata
- Download URL: synapse_registration-0.1.3.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b754b99ec71fae9c5d61d483ec7bc663c78852b12104045e1914def4fc265f
|
|
| MD5 |
2c8c335566b32e0ecd14578980022bc7
|
|
| BLAKE2b-256 |
c918bfa803123e7ebdaf375aa8b17d54ff6c7c9f313fded1a3163699b81d0f57
|
File details
Details for the file synapse_registration-0.1.3-py3-none-any.whl.
File metadata
- Download URL: synapse_registration-0.1.3-py3-none-any.whl
- Upload date:
- Size: 55.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3918cbdcf78f72d92565e62677740d441fcd0ed201e399a48564c2e8ef05d19
|
|
| MD5 |
ec629cb37f447a18a9f1614cd66d200c
|
|
| BLAKE2b-256 |
c23a9a3a8b59989b1bccd7e7e8e95357d48da2d2b7e9d7262576b78bf44dc7be
|