Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added features: --upload, --download, --delete-mxc, --file-name, --ke…
…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
- Loading branch information