Freeze room
This module uses third-party rules callbacks from Synapse's module interface to identify when the last admin of a room leaves it, and when they do it "freezes" the room.
Freezing the room means adding a custom org.matrix.room.frozen to the state of the room.
If the content of this event says the room is frozen ({"frozen": true}), then the module
will prevent any event to be sent in the room. The only exceptions are letting users leave
the room, and letting a user unfreeze it and taking over the room's administration.
Unfreezing the room means sending an org.matrix.room.frozen state event into the room
with the content {"frozen": false}. The user unfreezing the room will then automatically
become the only administrator in the room.
As with other modules using third-party rules callbacks, it is recommended that this module is only used in a closed federation in which every server has this module configured the same way.
This module requires Synapse v1.39.0 or later.
Installation
This plugin can be installed via PyPI:
pip install synapse-freeze-room
Config
Add the following to your Synapse config:
modules:
- module: freeze_room.FreezeRoom
config:
# Optional: a list of servers that are forbidden from unfreezing rooms.
unfreeze_blacklist:
- evil.com
- foo.com
# Optional: if set to true, when the last admin in a room leaves it, the module will
# try to promote any moderator (or user with the highest power level) as admin. In
# this mode, it will only freeze the room if it can't find any user to promote.
# Defaults to false.
promote_moderators: false
Development and Testing
This repository uses tox to run tests.
Tests
This repository uses unittest to run the tests located in the tests
directory. They can be ran with tox -e tests.
Making a release
git tag vX.Y
python3 setup.py sdist
twine upload dist/synapse-freeze-room-X.Y.tar.gz
git push origin vX.Y
Metadata
Release files for synapse-freeze-room 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synapse-freeze-room-1.1.0.tar.gz | 16.3 kB | Without provenance | Details for synapse-freeze-room-1.1.0.tar.gz |
Release files / synapse-freeze-room-1.1.0.tar.gz
| Download URL | synapse-freeze-room-1.1.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64905cf94ca73d2896dfee766eb1a8b8e59466de5fa03413b9d36db42ae4e5fd
|
|
BLAKE2b-256 checksum How to use checksums |
a7dc3cb29fe242cef71a6070fea1429ce548280de77eeaa765037140140545a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
|
Security for synapse-freeze-room 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.