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

Allow system admins to send server notices to all local users #5501

Open
rxl881 opened this issue Jun 20, 2019 · 18 comments
Open

Allow system admins to send server notices to all local users #5501

rxl881 opened this issue Jun 20, 2019 · 18 comments
Assignees
Labels
A-Admin-API T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-feature (Deprecated Label)

Comments

@rxl881
Copy link

rxl881 commented Jun 20, 2019

(It seems that there have been previous issues to track this, but all appeared to be closed at the moment)

Admin APIs exist to send server notices to users - https://github.com/matrix-org/synapse/blob/master/docs/admin_api/server_notices.md (, and https://github.com/matrix-org/synapse/blob/master/docs/server_notices.md for more generic info. on server notices and their expected use). However, at present it only allows for messages to be sent to specific users.

It would be very useful to be able to send messages to all local users (e.g. for "Messages of the day" or policy updates etc.).

Can we please open up the existing API to send to all users matching a pattern (including '.*'), or create a new endpoint to allow for this?

@richvdh
Copy link
Member

richvdh commented Jun 20, 2019

be aware that such an implementation for "motd" would mean: (a) users that register after the server_notice spam wouldn't receive the motd; (b) users that don't log in between server_notice spams would get all the notices at once when they do log in, which might be a bit confusing.

@rxl881
Copy link
Author

rxl881 commented Jun 20, 2019

a) Isn't an issue from my POV (as I would expect it to work).
b) Noted, but similarly to a), this is probably a feature - "these are the important, system-wide, things that happened since you last logged in". Hopefully they will be very rare, and can be easily marked as read / discarded as it's just one room.

@nicfab
Copy link

nicfab commented Jun 22, 2021

It would be an excellent opportunity for the server admin to send messages to all the local users.

@ptman
Copy link
Contributor

ptman commented Jun 23, 2021

Does it really need to be an API? https://github.com/Awesome-Technologies/synapse-admin/ can be used to send notices to multiple recipients at once.

@nicfab
Copy link

nicfab commented Jun 23, 2021

Does it really need to be an API? https://github.com/Awesome-Technologies/synapse-admin/ can be used to send notices to multiple recipients at once.

Great! Thank you.
After the installation, I should set an Nginx reverse proxy to point http://localhost:8080 to a different address.
Is it so?

@BBaoVanC
Copy link

BBaoVanC commented Jul 2, 2021

Does it really need to be an API? https://github.com/Awesome-Technologies/synapse-admin/ can be used to send notices to multiple recipients at once.

then you run into Awesome-Technologies/synapse-admin#90

@erikjohnston erikjohnston added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Jul 23, 2021
@dklimpel
Copy link
Contributor

dklimpel commented Nov 6, 2021

It would be an excellent opportunity for the server admin to send messages to all the local users.

This API have to be async because send messages to all users of a server can take a while.

@Justinzobel
Copy link

This would be great, right now I am using a python3 script I found to message all users but it has to run at the rate limit. A tool to message all users without having to wait would be much better.

@blinton-sp
Copy link

Would also love for the ability to do this. Perhaps allowing for a "*" in the json content passed to the POST /_synapse/admin/v1/send_server_notice call

@a-0-dev
Copy link

a-0-dev commented Mar 31, 2023

I would also welcome this feature, but as it wasn't there I implemented this functionality for synadm last summer: JOJ0/synadm#74

So if someone of you is using synadm (a very nice wrapper of the admin API), just use this module for sending notices :)

@Justinzobel
Copy link

It would be amazing if Synadm could be merged into the Synapse system or at least hosted within the matrix-org organisation on GitHub.

@gabrc52
Copy link
Contributor

gabrc52 commented Apr 22, 2023

I agree. A use case for this is on the off change that some maintenance is needed and you wish to notify users about downtime.

@rltas
Copy link

rltas commented Jul 19, 2023

https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#override-ratelimiting-for-users

This doesn't seem to work, I assume because system_mxid_localpart isn't a "real" user.

@gabrc52
Copy link
Contributor

gabrc52 commented Jul 19, 2023

No, but you can disable rate limiting for yourself / the admin account to use it to call the admin API repeatedly for everyone

@rltas
Copy link

rltas commented Jul 20, 2023

While that totally makes sense (and I feel like I shouldn't have missed that 😛), I actually have both in ratelimit_override and I'm still running into the rate limit.

          user_id           | messages_per_second | burst_count
----------------------------+---------------------+-------------
 @root:mymatrixdomain.net   |                   0 |           0
 @system:mymatrixdomain.net |                   0 |           0

{"errcode":"M_LIMIT_EXCEEDED","error":"Too Many Requests","retry_after_ms":2150}

And I restarted Synapse, just to be sure.

@gabrc52
Copy link
Contributor

gabrc52 commented Aug 1, 2023

It might be because of this #11785

@rltas
Copy link

rltas commented Aug 1, 2023

Also see #15974

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-feature (Deprecated Label)
Projects
None yet
Development

No branches or pull requests