This repository contains Python scripts to manage various aspects of a Synapse server using the Admin API. These are designed to be ran on the server or in the same network. They require access to port 8008 to access the Admin API. The scripts included are:
- User Management Script
- Token Management Script
- Federation Management Script
- Python 3.x
requestslibrary (pip install requests)
-
Clone this repository:
git clone https://github.com/prodata2000/Matrix-Management.git cd Matrix-Management -
Create a configuration file named
config.txtwith the following content:admin_url=http://localhost:8008 access_token=YOUR_ACCESS_TOKEN
Replace
http://localhost:8008with the base URL of your Synapse server's Admin API andYOUR_ACCESS_TOKENwith your actual admin access token. -
Ensure you have the
requestslibrary installed:pip install requests
This script allows you to manage user accounts on your Synapse server. It supports listing users, querying user details, creating or modifying user accounts, deactivating accounts, and resetting user passwords.
Run the script:
python user_management.pyFollow the on-screen menu to select an operation:
- List users
- Query user account
- Create or modify user account
- Deactivate user account
- Reset user password
- Exit
This script allows you to manage registration tokens on your Synapse server. It supports listing tokens, querying token details, creating new tokens, updating tokens, and deleting tokens.
Run the script:
python token_management.pyFollow the on-screen menu to select an operation:
- List all tokens
- Query a single token
- Create a new token
- Update a token
- Delete a token
- Exit
This script allows you to manage federation status with other homeservers on your Synapse server. It supports listing all destinations, querying specific destination details, getting rooms federating with a specific destination, and resetting the connection timeout for a specific destination.
Run the script:
python federation_management.pyFollow the on-screen menu to select an operation:
- List all destinations
- Query specific destination details
- Get rooms federating with a specific destination
- Reset connection timeout for a specific destination
- Exit
Create a file named config.txt with the following content:
admin_url=http://localhost:8008
access_token=YOUR_ACCESS_TOKENReplace http://localhost:8008 with the base URL of your Synapse server's Admin API and YOUR_ACCESS_TOKEN with your actual admin access token.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.