{"id":13557371,"url":"https://github.com/cyphar/matrix-utils","last_synced_at":"2025-03-21T10:31:09.851Z","repository":{"id":46152306,"uuid":"181212385","full_name":"cyphar/matrix-utils","owner":"cyphar","description":"Random matrix-related scripts.","archived":false,"fork":false,"pushed_at":"2021-11-10T23:00:29.000Z","size":22,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-12T18:56:43.087Z","etag":null,"topics":["matrix-org","riot-web"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyphar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-13T18:25:04.000Z","updated_at":"2024-09-09T00:53:26.000Z","dependencies_parsed_at":"2022-08-12T12:40:48.640Z","dependency_job_id":null,"html_url":"https://github.com/cyphar/matrix-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphar%2Fmatrix-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphar%2Fmatrix-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphar%2Fmatrix-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyphar%2Fmatrix-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyphar","download_url":"https://codeload.github.com/cyphar/matrix-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221814031,"owners_count":16884962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matrix-org","riot-web"],"created_at":"2024-08-01T12:04:18.578Z","updated_at":"2024-10-28T09:49:22.209Z","avatar_url":"https://github.com/cyphar.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"## matrix-utils ##\n\nRandom matrix utilities.\n\n### `megolm_backup.py` ###\n\nThis script can be used to modify your offline megolm key backups from a shell.\nThe main use of this is to filter what keys you'd like to share with another\nuser (let's say you have a 1:1 chat, and the other user lost all their keys and\nyou need to give them access without giving access to all of your rooms).\n[There is currently no Riot-based tooling for this][riotweb-issue6454], so this\nscript can help in the meantime.\n\nI've tested the output and input format with my own room keys and it has worked\nso far.\n\n```\nusage: megolm_backup.py [-h] [-o OUTPUT] (--into | --from) [file]\n\nOperate on megolm session backups.\n\npositional arguments:\n  file                  Input text file (- for stdin).\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o OUTPUT, --output OUTPUT\n                        Output text file (- for stdout).\n  --into                Encrypt and represent file as a megolm session backup.\n  --from                Decrypt the given megolm session and output the\n                        contents.\n```\n\nUsing the above example, let's say we want to only get session keys of the room\n`!foo:matrix.org`. You can do this fairly easily with [`jq`][jq]:\n\n```bash\n% megolm_backup.py --from riot-keys.py |\n\tjq 'map(select(.room_id == \"!foo:matrix.org\"))' |\n\tmegolm_backup.py --into \u003e new-riot-keys.txt\n```\n\nYou need to have PyCryptodome installed in order for this script to work.\n\n[riotweb-issue6454]: https://github.com/vector-im/riot-web/issues/6454\n[jq]: https://stedolan.github.io/jq/\n\n### License ###\n\nmatrix-utils is licensed under the GNU General Public License version 3 or\nlater.\n\n```\nCopyright (C) 2019 Aleksa Sarai \u003ccyphar@cyphar.com\u003e\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyphar%2Fmatrix-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyphar%2Fmatrix-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyphar%2Fmatrix-utils/lists"}