Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit a8db8c6

Browse files
authored
Remove user-visible groups/communities code (#12553)
Makes it so that groups/communities no longer exist from a user-POV. E.g. we remove: * All API endpoints (including Client-Server, Server-Server, and admin). * Documented configuration options (and the experimental flag, which is now unused). * Special handling during room upgrades. * The `groups` section of the `/sync` response.
1 parent 759f9c0 commit a8db8c6

File tree

19 files changed

+3
-2217
lines changed

19 files changed

+3
-2217
lines changed

changelog.d/12553.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove support for the non-standard groups/communities feature from Synapse.

docs/sample_config.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,16 +2521,6 @@ push:
25212521
# "events_default": 1
25222522

25232523

2524-
# Uncomment to allow non-server-admin users to create groups on this server
2525-
#
2526-
#enable_group_creation: true
2527-
2528-
# If enabled, non server admins can only create groups with local parts
2529-
# starting with this prefix
2530-
#
2531-
#group_creation_prefix: "unofficial_"
2532-
2533-
25342524

25352525
# User Directory configuration
25362526
#

docs/usage/configuration/config_documentation.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,25 +3145,6 @@ Example configuration:
31453145
encryption_enabled_by_default_for_room_type: invite
31463146
```
31473147
---
3148-
Config option: `enable_group_creation`
3149-
3150-
Set to true to allow non-server-admin users to create groups on this server
3151-
3152-
Example configuration:
3153-
```yaml
3154-
enable_group_creation: true
3155-
```
3156-
---
3157-
Config option: `group_creation_prefix`
3158-
3159-
If enabled/present, non-server admins can only create groups with local parts
3160-
starting with this prefix.
3161-
3162-
Example configuration:
3163-
```yaml
3164-
group_creation_prefix: "unofficial_"
3165-
```
3166-
---
31673148
Config option: `user_directory`
31683149

31693150
This setting defines options related to the user directory.

synapse/api/constants.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
# the maximum length for a user id is 255 characters
3232
MAX_USERID_LENGTH = 255
3333

34-
# The maximum length for a group id is 255 characters
35-
MAX_GROUPID_LENGTH = 255
36-
MAX_GROUP_CATEGORYID_LENGTH = 255
37-
MAX_GROUP_ROLEID_LENGTH = 255
38-
3934

4035
class Membership:
4136

synapse/app/generic_worker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
from synapse.rest.client import (
7070
account_data,
7171
events,
72-
groups,
7372
initial_sync,
7473
login,
7574
presence,
@@ -323,9 +322,6 @@ def _listen_http(self, listener_config: ListenerConfig) -> None:
323322

324323
presence.register_servlets(self, resource)
325324

326-
if self.config.experimental.groups_enabled:
327-
groups.register_servlets(self, resource)
328-
329325
resources.update({CLIENT_API_PREFIX: resource})
330326

331327
resources.update(build_synapse_client_resource_tree(self))

synapse/config/experimental.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
7373
# MSC3720 (Account status endpoint)
7474
self.msc3720_enabled: bool = experimental.get("msc3720_enabled", False)
7575

76-
# The deprecated groups feature.
77-
self.groups_enabled: bool = experimental.get("groups_enabled", False)
78-
7976
# MSC2654: Unread counts
8077
self.msc2654_enabled: bool = experimental.get("msc2654_enabled", False)
8178

synapse/config/groups.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,3 @@ class GroupsConfig(Config):
2525
def read_config(self, config: JsonDict, **kwargs: Any) -> None:
2626
self.enable_group_creation = config.get("enable_group_creation", False)
2727
self.group_creation_prefix = config.get("group_creation_prefix", "")
28-
29-
def generate_config_section(self, **kwargs: Any) -> str:
30-
return """\
31-
# Uncomment to allow non-server-admin users to create groups on this server
32-
#
33-
#enable_group_creation: true
34-
35-
# If enabled, non server admins can only create groups with local parts
36-
# starting with this prefix
37-
#
38-
#group_creation_prefix: "unofficial_"
39-
"""

synapse/federation/transport/server/__init__.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
FederationAccountStatusServlet,
2828
FederationTimestampLookupServlet,
2929
)
30-
from synapse.federation.transport.server.groups_local import GROUP_LOCAL_SERVLET_CLASSES
31-
from synapse.federation.transport.server.groups_server import (
32-
GROUP_SERVER_SERVLET_CLASSES,
33-
)
3430
from synapse.http.server import HttpServer, JsonResource
3531
from synapse.http.servlet import (
3632
parse_boolean_from_args,
@@ -199,38 +195,6 @@ async def on_POST(
199195
return 200, data
200196

201197

202-
class FederationGroupsRenewAttestaionServlet(BaseFederationServlet):
203-
"""A group or user's server renews their attestation"""
204-
205-
PATH = "/groups/(?P<group_id>[^/]*)/renew_attestation/(?P<user_id>[^/]*)"
206-
207-
def __init__(
208-
self,
209-
hs: "HomeServer",
210-
authenticator: Authenticator,
211-
ratelimiter: FederationRateLimiter,
212-
server_name: str,
213-
):
214-
super().__init__(hs, authenticator, ratelimiter, server_name)
215-
self.handler = hs.get_groups_attestation_renewer()
216-
217-
async def on_POST(
218-
self,
219-
origin: str,
220-
content: JsonDict,
221-
query: Dict[bytes, List[bytes]],
222-
group_id: str,
223-
user_id: str,
224-
) -> Tuple[int, JsonDict]:
225-
# We don't need to check auth here as we check the attestation signatures
226-
227-
new_content = await self.handler.on_renew_attestation(
228-
group_id, user_id, content
229-
)
230-
231-
return 200, new_content
232-
233-
234198
class OpenIdUserInfo(BaseFederationServlet):
235199
"""
236200
Exchange a bearer token for information about a user.
@@ -292,16 +256,9 @@ async def on_GET(
292256
SERVLET_GROUPS: Dict[str, Iterable[Type[BaseFederationServlet]]] = {
293257
"federation": FEDERATION_SERVLET_CLASSES,
294258
"room_list": (PublicRoomList,),
295-
"group_server": GROUP_SERVER_SERVLET_CLASSES,
296-
"group_local": GROUP_LOCAL_SERVLET_CLASSES,
297-
"group_attestation": (FederationGroupsRenewAttestaionServlet,),
298259
"openid": (OpenIdUserInfo,),
299260
}
300261

301-
DEFAULT_SERVLET_GROUPS = ("federation", "room_list", "openid")
302-
303-
GROUP_SERVLET_GROUPS = ("group_server", "group_local", "group_attestation")
304-
305262

306263
def register_servlets(
307264
hs: "HomeServer",
@@ -324,10 +281,7 @@ def register_servlets(
324281
Defaults to ``DEFAULT_SERVLET_GROUPS``.
325282
"""
326283
if not servlet_groups:
327-
servlet_groups = DEFAULT_SERVLET_GROUPS
328-
# Only allow the groups servlets if the deprecated groups feature is enabled.
329-
if hs.config.experimental.groups_enabled:
330-
servlet_groups = servlet_groups + GROUP_SERVLET_GROUPS
284+
servlet_groups = SERVLET_GROUPS.keys()
331285

332286
for servlet_group in servlet_groups:
333287
# Skip unknown servlet groups.

synapse/federation/transport/server/groups_local.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)