Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cyphar/matrix-utils
Random matrix-related scripts.
https://github.com/cyphar/matrix-utils
matrix-org riot-web
Last synced: about 1 month ago
JSON representation
Random matrix-related scripts.
- Host: GitHub
- URL: https://github.com/cyphar/matrix-utils
- Owner: cyphar
- License: gpl-3.0
- Created: 2019-04-13T18:25:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-10T23:00:29.000Z (about 3 years ago)
- Last Synced: 2024-10-12T18:56:43.087Z (2 months ago)
- Topics: matrix-org, riot-web
- Language: Python
- Size: 21.5 KB
- Stars: 32
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- awesome-starred - cyphar/matrix-utils - Random matrix-related scripts. (others)
README
## matrix-utils ##
Random matrix utilities.
### `megolm_backup.py` ###
This script can be used to modify your offline megolm key backups from a shell.
The main use of this is to filter what keys you'd like to share with another
user (let's say you have a 1:1 chat, and the other user lost all their keys and
you need to give them access without giving access to all of your rooms).
[There is currently no Riot-based tooling for this][riotweb-issue6454], so this
script can help in the meantime.I've tested the output and input format with my own room keys and it has worked
so far.```
usage: megolm_backup.py [-h] [-o OUTPUT] (--into | --from) [file]Operate on megolm session backups.
positional arguments:
file Input text file (- for stdin).optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output text file (- for stdout).
--into Encrypt and represent file as a megolm session backup.
--from Decrypt the given megolm session and output the
contents.
```Using the above example, let's say we want to only get session keys of the room
`!foo:matrix.org`. You can do this fairly easily with [`jq`][jq]:```bash
% megolm_backup.py --from riot-keys.py |
jq 'map(select(.room_id == "!foo:matrix.org"))' |
megolm_backup.py --into > new-riot-keys.txt
```You need to have PyCryptodome installed in order for this script to work.
[riotweb-issue6454]: https://github.com/vector-im/riot-web/issues/6454
[jq]: https://stedolan.github.io/jq/### License ###
matrix-utils is licensed under the GNU General Public License version 3 or
later.```
Copyright (C) 2019 Aleksa SaraiThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .
```