[Support] Disable the Creation of Rooms and Spaces While Allowing DMs (One-on-One or Group)
π Context and Objective
Hello,
We self-host a Synapse server with several pre-configured spaces.
Our objective is to:
β
Allow DMs (both one-on-one and group).
β Prevent the creation of new public or private rooms.
β Prevent the creation of new spaces.
We mainly want to enforce these restrictions to better manage resources and avoid the uncontrolled proliferation of rooms and spaces on our self-hosted infrastructure.
π Current Management
To restrict the creation of rooms and spaces, we are currently using a plugin based on synapse-user-restrictions.
However, this plugin also blocks the ability to send DMs, which is an unwanted behavior.
π Research Conducted
Before asking this question, we explored different possibilities:
- We identified that rooms have a type (
room_type), specificallym.spacefor spaces.
Reference: Synapse Admin API - Room Details. - We wonder if this information could be used to differentiate between spaces, rooms, and DMs to allow only DMs.
- We noticed that the distinction between group DMs and standard rooms seems unclear in the permission management system.
- Is there a reliable way to make this distinction?
- Could
room_typebe used?
- We are unsure about the current support for
room_typein restriction rules:- Is this functionality poorly implemented, deprecated, or simply never considered for this use case?
β Questions
- How can we prevent only the creation of rooms and spaces without blocking DMs?
- Is
room_type(e.g.,"m.space") usable to restrict only the creation of spaces and rooms?
Thank you in advance for your help! π
From what i'm understanding from the specs and the code, only m.space type is useful in synapse (when I say useful I mean that only spaces have specific logic in the code).
If I understood it well, the room type is set in the content of the create event (m.room.create) and is directly sent by the frontend. Which means that technically synapse is able to store any kind of room type and then you can do data analysis with a custom plugin. However that means changing the frontend and I'm not sure where to address this issue knowing there are multiple frontend
First time I'm diving into synapse codebase so i'm might be wrong
I would love to see this feature in Synapse!
We host a server for our community and would like to prevent normal users from creating public rooms for two reasons:
- Public rooms already exist for most topics. If too many rooms are created, conversations will be spread across them.
- It's easier to moderate a limited number of public rooms.
Hello π,
Iβd like to follow up on this topic, as weβre still facing the same challenge on our self-hosted Synapse:
- β We need to allow one-to-one and group DMs.
- β We want to forbid the creation of new rooms and spaces.
So far, the only workaround we found (using synapse-user-restrictions) unfortunately blocks DMs as well, which makes it unsuitable.
Any update or guidance would be greatly appreciated π
Thanks in advance!