1
0
Fork 0
mirror of https://github.com/element-hq/synapse.git synced 2025-03-24 08:36:42 +00:00
Commit graph

262 commits

Author SHA1 Message Date
Erik Johnston
b2a187f49b
Disable room list publication by default ()
This is in line with our general policy of ensuring that the default
config is reasonably locked down.

SyTest PR to fix tests: https://github.com/matrix-org/sytest/pull/1396
2025-02-24 12:06:16 +00:00
Shay
e34fd1228d
Add the ability to filter by state event type on admin room state endpoint ()
Adds a query param `type` to `/_synapse/admin/v1/rooms/{room_id}/state`
that filters the state event query by state event type.

---------

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2025-01-08 15:38:26 +00:00
Mathieu Velten
b3ba501c52
Properly purge state groups tables when purging a room ()
Currently purging a complex room can lead to a lot of orphaned rows left
behind in the state groups tables.
It seems it is because we are loosing track of state groups sometimes.

This change uses the `room_id` indexed column of `state_groups` table to
decide what to delete instead of doing an indirection through
`event_to_state_groups`.

Related to https://github.com/element-hq/synapse/issues/3364.

### Pull Request Checklist

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Erik Johnston <erikj@jki.re>
2025-01-06 15:32:18 +00:00
Shay
b5267678d2
Add a test to verify remote user messages can be redacted via admin api redaction endpoint if requester is admin in room () 2025-01-03 12:52:42 +00:00
Shay
8208186e3c
Add some useful endpoints to Admin API ()
- Fetch the number of invites the provided user has sent after a given
timestamp
- Fetch the number of rooms the provided user has joined after a given
timestamp, regardless if they have left/been banned from the rooms
subsequently
- Get report IDs of event reports where the provided user was the sender
of the reported event
2024-12-16 13:27:34 -06:00
Travis Ralston
b90ad26ebc
Promote account suspension to stable ()
MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/3823
2024-12-04 17:56:42 -06:00
Shay
4587decd67
Return suspended status when querying user account () 2024-11-22 12:37:19 +00:00
Travis Ralston
d0a474d312
Enable authenticated media by default ()
Co-authored-by: Olivier 'reivilibre <oliverw@matrix.org>
2024-11-20 14:48:22 +00:00
Benjamin Bouvier
bfb197c596
Fix typo in error message when a media ID isn't known () 2024-11-12 16:41:14 +00:00
Shay
58deef5eba
Add admin handler to list of handlers used for background tasks ()
Fixes 

While we're at it, makes a change where the redactions are sent as the
admin if the user is not a member of the server (otherwise these fail
with a "User must be our own" message).
2024-10-29 13:50:13 -05:00
Shay
a5986ac229
Improvements to admin redact api ()
- better validation on user input
- fix an early task completion
- when checking membership in rooms, check for rooms user has been
banned from as well
2024-10-08 14:23:21 +01:00
Shay
51dd4df0a3
Add an Admin API endpoint to redact all a user's events () 2024-09-18 10:08:01 +00:00
Quentin Gliech
7d52ce7d4b
Format files with Ruff ()
I thought ruff check would also format, but it doesn't.

This runs ruff format in CI and dev scripts. The first commit is just a
run of `ruff format .` in the root directory.
2024-09-02 12:39:04 +01:00
Erik Johnston
57538eb4d9
Finish up work to allow per-user feature flags ()
Follows on from @H-Shay's great work at
https://github.com/matrix-org/synapse/pull/15344 and MSC4026.

Also enables its use for MSC3881, mainly as an easy but concrete example
of how to use it.
2024-07-05 13:02:35 +01:00
Shay
7a11c0ac4f
Add support for MSC3823 - Account Suspension Part 2 () 2024-06-24 14:21:22 +01:00
Alexander Fechler
9104a9f0d0
Filter added to Admin-API GET /rooms () 2024-06-19 11:45:48 +01:00
Richard van der Hoff
3aae60f17b
Enable cross-signing key upload without UIA ()
Per MSC3967, which is now stable, we should not require UIA when
uploading cross-signing keys for the first time.

Fixes: 
2024-06-14 11:14:56 +01:00
Travis Ralston
f1c4dfb08b
Add report room API (MSC4151) ()
https://github.com/matrix-org/matrix-spec-proposals/pull/4151

This is intended to be enabled by default for immediate use. When FCP is
complete, the unstable endpoint will be dropped and stable endpoint
supported instead - no backwards compatibility is expected for the
unstable endpoint.
2024-06-12 12:27:46 +02:00
Andrew Morgan
89fc579329
Fix filtering of rooms when supplying the destination query parameter to /_synapse/admin/v1/federation/destinations/<destination>/rooms () 2024-04-26 10:52:24 +01:00
Gordan Trevis
1d47532310
Parse json validation ()
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-04-18 13:57:38 +01:00
Gordan Trevis
f0d6f14047
Parse Integer negative value validation () 2024-04-16 19:12:36 +00:00
Alexander Fechler
48f59d3806
deactivated flag refactored to filter deactivated users. ()
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-03-11 16:08:04 +00:00
Erik Johnston
23740eaa3d
Correctly mention previous copyright ()
During the migration the automated script to update the copyright
headers accidentally got rid of some of the existing copyright lines.
Reinstate them.
2024-01-23 11:26:48 +00:00
Adam Jędrzejewski
c7d0d02be7
Search non ASCII display names using Admin API ()
Closes 

Signed-off-by: Adam Jedrzejewski <adamjedrzejewski@icloud.com>
2024-01-04 09:36:57 +00:00
Dirk Klimpel
14ed84ac33
Enable user without password ()
Closes:
- https://github.com/matrix-org/synapse/issues/10397
-  

An administrator should know whether he wants to set a password or not.
There are many uses cases where a blank password is required.

- Use of only some users with SSO.
- Use of bots with password, users with SSO
2024-01-02 11:52:51 +00:00
Erik Johnston
eaad9bb156 Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
Mathieu Velten
e108c31fc0
Add avatar and topic settings for server notice room () 2023-12-12 15:22:19 +00:00
Mathieu Velten
9e7f80037d
Server notices: add an autojoin setting for the notices room ()
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2023-12-04 12:31:42 +00:00
David Robertson
32a59a6495
Keep track of user_ips and monthly_active_users when delegating auth ()
* Describe `insert_client_ip`
* Pull out client_ips and MAU tracking to BaseAuth
* Define HAS_AUTHLIB once in tests

sick of copypasting

* Track ips and token usage when delegating auth
* Test that we track MAU and user_ips
* Don't track `__oidc_admin`
2023-11-23 12:35:37 +00:00
Patrick Cloke
8e1e62c9e0 Update license headers 2023-11-21 15:29:58 -05:00
David Robertson
43d1aa75e8
Add an Admin API to temporarily grant the ability to update an existing cross-signing key without UIA () 2023-11-15 17:28:10 +00:00
Patrick Cloke
f2f2c7c1f0
Use full GitHub links instead of bare issue numbers. () 2023-11-15 08:02:11 -05:00
Patrick Cloke
ab3f1b3b53
Convert simple_select_one_txn and simple_select_one to return tuples. () 2023-11-09 11:13:31 -05:00
Patrick Cloke
ff716b483b
Return attrs for more media repo APIs. () 2023-11-09 11:00:30 -05:00
Patrick Cloke
2bf9341406
Ensure local invited & knocking users leave before purge. ()
This is mostly useful for federated rooms where some users
would get stuck in the invite or knock state when the room
was purged from their homeserver.
2023-10-27 12:50:50 -04:00
Patrick Cloke
26b960b08b
Register media servlets via regex. ()
This converts the media servlet URLs in the same way as
(most) of the rest of Synapse. This will give more flexibility
in the versions each endpoint exists under.
2023-10-06 07:22:55 -04:00
MomentQYC
5725712d47
Remove Python version from /_synapse/admin/v1/server_version ()
There's no reason to expose the full Python version over what is
frequently a public API.
2023-10-02 09:07:53 -04:00
Hanadi
eef2b9e344
Filter locked users in the admin API ()
Co-authored-by: Hanadi Tamimi <hanadi.tamimi@sdui.de>
2023-09-18 15:37:51 +01:00
Mathieu Velten
dd44ee00b6
Add automatic purge after all users forget a room ()
Also add restore of purge/shutdown rooms after a synapse restart.

Co-authored-by:  Eric Eastwood <erice@matrix.org>
Co-authored-by: Erik Johnston <erikj@matrix.org>
2023-09-15 15:37:44 +02:00
Patrick Cloke
aa483cb4c9
Update ruff config ()
Enable additional checks & clean-up unneeded configuration.
2023-09-08 11:24:36 -04:00
Mathieu Velten
dcb2778341
Add last_seen_ts to the admin users API () 2023-09-04 18:13:28 +02:00
Patrick Cloke
9ec3da06da
Bump mypy-zope & mypy. () 2023-08-29 10:38:56 -04:00
Patrick Cloke
daf11e26ef
Replace make_awaitable with AsyncMock ()
Python 3.8 provides a native AsyncMock, we can replace the
homegrown version we have.
2023-08-24 19:38:46 -04:00
Alexander Fechler
54317d34b7
Allow filtering for admins in the list accounts admin API () 2023-08-18 12:26:38 +01:00
Mathieu Velten
dac97642e4
Implements admin API to lock an user (MSC3939) () 2023-08-10 09:10:55 +00:00
Shay
f08d05dd2c
Actually stop reading from column user_id of tables profiles () 2023-07-23 16:30:54 -07:00
Mathieu Velten
8eb7bb975e
Mark get_user_in_directory private since only used in tests () 2023-07-12 11:09:13 +02:00
Michael Weimann
c8e81898b6
Add not_user_type param to the list accounts admin API ()
Signed-off-by: Michael Weimann <michaelw@element.io>
2023-07-04 15:03:20 -07:00
Hugh Nimmo-Smith
bad1f2cd35 Tests for JWKS endpoint 2023-05-30 09:43:06 -04:00
Shay
0e8aa2a1b2
Remove references to supporting per-user flag for msc2654 () 2023-05-02 14:21:36 -07:00