-
Notifications
You must be signed in to change notification settings - Fork 60
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
Question: a "delete media" option e.g. for clean-up purposes #3
Comments
Anyone wanting to contribute? Anyone willing to provide a PR? Any contributions are ❤️ appreciated! |
Which matrix-nio AsyncClient API calls or logic would do such a media delete? |
…y-dict, --access-token ``` < --upload UPLOAD [UPLOAD ...] < Upload one or multiple files to the content < repository. The files will be given a Matrix URI and < stored on the server. --upload allows the optional < argument --plain to skip encryption for upload. < --download DOWNLOAD [DOWNLOAD ...] < Download one or multiple files from the content < repository. You must provide one or multiple Matrix < URIs (MXCs) which are strings like this < 'mxc://example.com/SomeStrangeUriKey'. If found they < will be downloaded, decrypted, and stored in local < files. If file names are specified with --file-name < the downloads will be saved with these file names. If < --file-name is not specified the original file name < from the upload will be used. If neither specified nor < 'mxc-<mxc-id>' will be used. If a file name in --file- < name contains the placeholder __mxc_id__, it will be < replaced with the mxc-id. If a file name is specified < as empty string in --file-name, then also the name < 'mxc-<mxc-id>' will be used. By default, the upload < provided to decrypt the data. Specify one or multiple < decryption keys with --key-dict. If --key-dict is not < set, not decryption is attempted; and the data might < be stored in encrypted fashion, or might be plain-text < if the --upload skipped encryption with --plain. < --delete-mxc DELETE_MXC [DELETE_MXC ...] < Delete one or multiple objects (e.g. files) from the < content repository. You must provide one or multiple < Matrix URIs (MXC) which are strings like this < 'mxc://example.com/SomeStrangeUriKey'. Alternatively, < you can just provide the MXC id, i.e. the part after < the last slash. If found they will be deleted from the < server database. In order to delete objects one must < have server admin permissions. Having only room admin < permissions is not sufficient and it will fail. Read < https://matrix-org.github.io/synapse/latest/usage/admi < nistration/admin_api/ for learning how to set server < admin permissions on the server. Alternatively, and < optionally, one can specify an access token which has < server admin permissions with the --access-token < argument. < --file-name FILE_NAME [FILE_NAME ...] < Specify one or multiple file names for some actions. < This is an optional argument. Use this option in < combination with options like --download to specify < one or multiple file names. Ignored if used by itself < without an appropriate corresponding action. < --key-dict KEY_DICT [KEY_DICT ...] < Specify one or multiple key dictionaries for < decryption. One or multiple decryption dictionaries < are provided by the --upload action as a result. A < decryption dictionary is a string like this: "{'v': < 'v2', 'key': {'kty': 'oct', 'alg': 'A256CTR', 'ext': < True, 'k': 'somekey', 'key_ops': ['encrypt', < 'decrypt']}, 'iv': 'someiv', 'hashes': {'sha256': < 'someSHA'}}". If you have a list of key dictionaries < and want to skip one, use the empty string. < --access-token ACCESS_TOKEN < Set a custom access token for use by certain actions. < It is an optional argument. By default --access-token < is ignored and not used. It is used only by the < --delete-mxc action. ``` See also Issue #3 See also matrix-nio/matrix-nio#308
But as required by the Matrix API it requires user to have server admin permissions. See documentation. Closing issue. |
Just wanted to add that I looked at the Client API (not the Admin API) and confirm that there is no "delete" operation for the content repository. So, I think what was implemented was the only available option. See: Matrix Client API documentation: https://spec.matrix.org/latest/client-server-api |
Yes, this is not in the specification. This issue asks to add it to the spec. The Synapse endpoints may change in the future, because this issue asks for simplification. Also note that Synapse supports media retention configuration since 1.61 and documented here. It auto-deletes based on the last accessed time and other configurable criteria. For clarity / posterity, this github issue is about local media, not local copies (cache) of remote media received through federation. |
Thank you @opk12 for sharing this very relevant information. If matrix-org/matrix-spec#226 gets implemented and (ideally) is available via |
The text was updated successfully, but these errors were encountered: