Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Wishlist - More API Calls #100

Open
PC-Admin opened this issue Dec 23, 2020 · 6 comments
Open

Feature Wishlist - More API Calls #100

PC-Admin opened this issue Dec 23, 2020 · 6 comments
Labels
enhancement New feature or request needs more details Cannot be addressed until more information is provided

Comments

@PC-Admin
Copy link

PC-Admin commented Dec 23, 2020

Some features from my own moderation tool (https://github.com/PC-Admin/PC-Admins-Synapse-Moderation-Tool/blob/master/modtool.py) that are currently missing from 'Synapse Admin':

list_joined_rooms() [Apparently in progress: #73]

# Example:
# $ curl -kXGET https://matrix.perthchat.org/_synapse/admin/v1/users/@PC-Admin:perthchat.org/joined_rooms?access_token=ACCESS_TOKEN

quarantine_users_media()

# Example:
# $ curl -X POST https://matrix.perthchat.org/_synapse/admin/v1/user/@PC-Admin:perthchat.org/media/quarantine?access_token=ACCESS_TOKEN

list_directory_rooms()

# Example
# $ curl -kXGET https://matrix.perthchat.org/_matrix/client/r0/publicRooms?access_token=ACCESS_TOKEN

remove_rooms_from_directory()

# Example
# $ curl -kX PUT -H 'Content-Type: application/json' -d '{"visibility": "private"}' 'https://matrix.perthchat.org/_matrix/client/r0/directory/list/room/!DwUPBvNapIVecNllgt:perthchat.org?access_token=ACCESS_TOKEN'

list_media_in_room()

# Example
# $ curl -kXGET https://matrix.perthchat.org/_synapse/admin/v1/room/<room_id>/media?access_token=ACCESS_TOKEN

quarantine_media_in_room()

# Example
# $ curl -X POST 'https://matrix.perthchat.org/_synapse/admin/v1/room/!DwUPBvNapIVecNllgt:perthchat.org/media/quarantine?access_token=ACCESS_TOKEN'

purge_room() [Deprecated as of Synapse 1.25.0]

# Example:
# $ curl -X POST -H 'Content-Type: application/json' -d '{"new_room_user_id": "@PC-Admin:perthchat.org","room_name": "VIOLATION ROOM 2","message": "You have been very naughty!","block": true,"purge": true}' 'https://matrix.perthchat.org/_synapse/admin/v1/rooms/!mPfaFTrXqUJsgrldwu:perthchat.org/delete?access_token=ACCESS_TOKEN

Lesser importance would be creating/deleting multiple accounts, maybe even purging the remote media repo:

# Example:
# $ date --date '149 days ago' +%s
# 1589442217
# $ curl -X POST --header "Authorization: Bearer ACCESS_TOKEN" 'https://matrix.perthchat.org/_synapse/admin/v1/purge_media_cache?before_ts=1589439628000'

Writing this as a reminder to myself to write you a couple PR's eventually. :) If anyone else feels inspired by it though that's cool too! Sorry if this isn't the best place to post this.

@dklimpel
Copy link
Contributor

list_joined_rooms()

PR: #73

purge_room()

Merged: 26b8cea, 3d4f45d
But without switch for blocking and send notice
purge_room will be deprecated in Synapse 1.25.0: https://github.com/matrix-org/synapse/blob/develop/CHANGES.md

dklimpel added a commit to dklimpel/synapse-admin that referenced this issue Feb 13, 2021
`/_matrix/client/r0/publicRooms`
Related: Awesome-Technologies#100
Missing feature: Pagination
Pagiation is not easy because of special token for next and previous
results.
https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-publicrooms
`next_batch` and `prev_batch`
@awesome-manuel
Copy link
Member

@PC-Admin can you update what you are still missing?

@awesome-manuel awesome-manuel added needs more details Cannot be addressed until more information is provided enhancement New feature or request labels May 6, 2021
@PC-Admin
Copy link
Author

PC-Admin commented May 19, 2021

I believe from the above list i made these are still missing:

quarantine_users_media()

# Example:
# $ curl -X POST https://matrix.perthchat.org/_synapse/admin/v1/user/@PC-Admin:perthchat.org/media/quarantine?access_token=ACCESS_TOKEN

quarantine_media_in_room()

# Example
# $ curl -X POST 'https://matrix.perthchat.org/_synapse/admin/v1/room/!DwUPBvNapIVecNllgt:perthchat.org/media/quarantine?access_token=ACCESS_TOKEN'

This projects been making good progress recently. :)

Edited cheers @dklimpel

@dklimpel
Copy link
Contributor

@PC-Admin please have a look at current version.

list_directory_rooms()
remove_rooms_from_directory

was part of #105

@Thatoo
Copy link

Thatoo commented Jul 10, 2024

It would be nice to be able to Purge Remote Media API

@Thatoo
Copy link

Thatoo commented Jul 10, 2024

It would be nice also to include synapse-compress-state and be able to launch this tool time to time form within synapse-admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs more details Cannot be addressed until more information is provided
Projects
None yet
Development

No branches or pull requests

4 participants