matrixctl


Namematrixctl JSON
Version 0.11.5 PyPI version JSON
download
home_pagehttps://michaelsasser.github.io/matrixctl/index.html
SummaryControl, manage, provision and deploy matrix homeservers.
upload_time2021-12-01 05:52:44
maintainerMichael Sasser
docs_urlNone
authorMichael Sasser
requires_python>=3.9,<4.0
licenseGPL-3.0-or-later
keywords matrix synapse docker oci-container
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![GitHub](https://img.shields.io/github/license/MichaelSasser/matrixctl?style=flat-square)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/matrixctl?style=flat-square)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/michaelsasser/matrixctl?style=flat-square)
![GitHub Release Date](https://img.shields.io/github/release-date/michaelsasser/matrixctl?style=flat-square)
![Matrix](https://img.shields.io/matrix/matrixctl:matrix.org?server_fqdn=matrix.org&style=flat-square)

# MatrixCtl

MatrixCtl is a simple, but feature-rich tool to remotely control, manage,
provision and deploy your Matrix homeservers and users from your virtual
terminal.

```console
$ matrixctl
usage: matrixctl [-h] [--version] [-d] [-s SERVER] [-c CONFIG] Command ...

MatrixCtl is a simple, but feature-rich tool to remotely control, manage, provision and deploy Matrix homeservers.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -d, --debug           Enables debugging mode.
  -s SERVER, --server SERVER
                        Select the server. (default: "default")
  -c CONFIG, --config CONFIG
                        A path to an alternative config file.

Commands:
  The following are commands, you can use to accomplish various tasks.

  Command
    adduser             Add users to the homeserver
    adduser-jitsi       Add users to a jitsi server
    check               Checks the deployment with Ansible
    delete-local-media  Delete cached (local) media that was last accessed before a
                        specific point in time
    delroom             Shutdown a room
    deluser             Deactivate users
    deluser-jitsi       Delete jitsi users
    deploy              Provision and deploy the Ansible playbook
    get-event           Get an event from the database
    get-event-context   Get the context of an event
    get-events          Get events from the database
    is-admin            Check, if a user is a homeserver administrator
    joinroom            Join a user to a room
    maintenance         Run maintenance tasks
    make-room-admin     Grant a user the highest power level available to a local user
                        in this room
    purge-history       Purge historic events from the database
    purge-remote-media  Purge cached, remote media
    report              Get a report event by report identifier
    reports             Lists reported events
    rooms               List rooms
    server-notice       Send a server notice to a user
    set-admin           Change whether a user is a homeserver admin or not
    start               Starts all OCI containers
    restart             Restarts all OCI containers (alias for start)
    stop                Stop and disable all OCI containers
    update              Updates the ansible playbook repository
    upload              Upload a media file.
    user                Get information about a specific user
    users               Lists all users of the homeserver
    version             Get the version information of the Synapse instance

Thank you for using MatrixCtl!
Check out the docs: https://matrixctl.rtfd.io
Report bugs to: https://github.com/MichaelSasser/matrixctl/issues/new/choose
```

## Installation

MatrixCtl is written in Python. The installation is straight forward. Just run
`pip install matrixctl`. It will be installed from the
[Python Package Index (PyPi)](https://pypi.org/project/matrixctl/).

Upgrade MatrixCtl with `pip install --upgrade matrixctl`.

You will find more information in the
[documentation](https://matrixctl.readthedocs.io/en/latest/installation.html).

## Documentation

The
[documentation](https://matrixctl.readthedocs.io/en/latest/index.html) is
waiting for you, to check out.

## Configuration File

To use this tool you need to have a configuration file in
"~/.config/matrixctl/config.yaml" or in "/etc/matrixctl/config.yaml".

```yaml
# Define your homeservers in "servers" here.

servers:
  # Your default server. You can specify muliple servers here with arbitrary
  # Names
  default:

    ansible:
      # The absolute path to your playbook
      playbook: /path/to/ansible/playbook

    synapse:
      # The absolute path to the synapse playbook.
      # This is only used for updating the playbook.
      playbook: /path/to/synapse/playbook

    # If your matrix server is deployed, you may want to fill out the API section.
    # It enables matrixctl to run more and faster commands. You can deploy and
    # provision your Server without this section. You also can cerate a user with
    # "matrixctl adduser --ansible YourUsername" and add your privileges after
    # that.
    api:
      # Your domain should be something like "michaelsasser.org" without the
      # "matrix." in the front. MatrixCtl will add that, if needed. An IP-Address
      # is not enough.
      domain: example.com

      # The username your admin user
      username: johndoe

      # To use the API you need to have an administrator account. Enter your Token
      # here. If you use the element client you will find it your user settings
      # (click on your username on the upper left corner on your browser) in the
      # "Help & About" tab. If you scroll down click next to "Access-Token:" on
      # "<click to reveal>". It will be marked for you. Copy it in here.
      token= "MyMatrixToken"

      # In some cases, MatrixCtl does need to make many requests. To speed those
      # requests a notch, you can set a concurrent_limit which is greater than
      # one. This sets a limit to how many asynchronous workers can be spawned
      # by MatrixCtl. If you set the number to high, MatrixCtl needs more time
      # to spawn the workers, then a synchronous request would take.
      concurrent_limit: 10

    # Here you can add your SSH configuration.
    ssh:
      address: "matrix.{{ servers.default.api.domain }}"  # With Jinja2 support

      # The default port is 22. Can be omitted. Jinja2: "{{ default_ssh_port }}"
      port: 22

      # The default username is your current login name.
      user: john

    # Define your maintainance tasks
    maintenance:
      tasks:
        - compress-state  # Compress synapses state table
        - vacuum          # VACUUM the synapse database (garbage-collection)

  # Another server.
  foo:
    # ...

server: # This is a reserved name, which cannot be used.
```

Predefined Jinja2 placeholders (all placeholders can be overwritten):

- `"{{ home }}"` -- The current users home path e.g. `/home/michael`,
- `"{{ user }}"` -- The current users username e.g. `michael`,
- `"{{ default_ssh_port }}"` -- The default ssh port `22`,
- `"{{ default_api_concurrent_limit }}"` -- The default concurrent limit `4`.

Check out the
[documentation](https://matrixctl.readthedocs.io/en/latest/getting_started/config_file.html)
for more information.

## Discussions & Chat

If you have any thoughts or questions, you can ask them in the
[discusions](https://github.com/MichaelSasser/matrixctl/discussions) or in
the projects matrix room `#matrixctl:matrix.org`.

## Semantic Versioning and Branching Model

This Python package uses [SemVer](https://semver.org/) for its release
cycle and the
[git-flow](https://danielkummer.github.io/git-flow-cheatsheet/index.html)
branching model (by [Vincent Driessen](https://nvie.com/about/)).

It has two branches with infinite lifetime. The:

- [develop](https://github.com/MichaelSasser/matrixctl/tree/develop)
  branch is the merging branch,
- [master](https://github.com/MichaelSasser/matrixctl/tree/master)
  branch gets updated on every release.

## Contributing

Please check our [Contributer Documentation](https://matrixctl.readthedocs.io/en/latest/contributer_documentation/index.html#contributer-documentation).

## License

Copyright &copy; 2020-2001 Michael Sasser <Info@MichaelSasser.org>.
Released under the GPLv3 license.


            

Raw data

            {
    "_id": null,
    "home_page": "https://michaelsasser.github.io/matrixctl/index.html",
    "name": "matrixctl",
    "maintainer": "Michael Sasser",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "Michael@MichaelSasser.org",
    "keywords": "Matrix,Synapse,Docker,OCI-Container",
    "author": "Michael Sasser",
    "author_email": "Michael@MichaelSasser.org",
    "download_url": "https://files.pythonhosted.org/packages/be/0b/1108a33112301c523ae5e49133edeec5d3d5fd3a9dbce71bb9c051e3c8c7/matrixctl-0.11.5.tar.gz",
    "platform": "",
    "description": "![GitHub](https://img.shields.io/github/license/MichaelSasser/matrixctl?style=flat-square)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/matrixctl?style=flat-square)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/michaelsasser/matrixctl?style=flat-square)\n![GitHub Release Date](https://img.shields.io/github/release-date/michaelsasser/matrixctl?style=flat-square)\n![Matrix](https://img.shields.io/matrix/matrixctl:matrix.org?server_fqdn=matrix.org&style=flat-square)\n\n# MatrixCtl\n\nMatrixCtl is a simple, but feature-rich tool to remotely control, manage,\nprovision and deploy your Matrix homeservers and users from your virtual\nterminal.\n\n```console\n$ matrixctl\nusage: matrixctl [-h] [--version] [-d] [-s SERVER] [-c CONFIG] Command ...\n\nMatrixCtl is a simple, but feature-rich tool to remotely control, manage, provision and deploy Matrix homeservers.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -d, --debug           Enables debugging mode.\n  -s SERVER, --server SERVER\n                        Select the server. (default: \"default\")\n  -c CONFIG, --config CONFIG\n                        A path to an alternative config file.\n\nCommands:\n  The following are commands, you can use to accomplish various tasks.\n\n  Command\n    adduser             Add users to the homeserver\n    adduser-jitsi       Add users to a jitsi server\n    check               Checks the deployment with Ansible\n    delete-local-media  Delete cached (local) media that was last accessed before a\n                        specific point in time\n    delroom             Shutdown a room\n    deluser             Deactivate users\n    deluser-jitsi       Delete jitsi users\n    deploy              Provision and deploy the Ansible playbook\n    get-event           Get an event from the database\n    get-event-context   Get the context of an event\n    get-events          Get events from the database\n    is-admin            Check, if a user is a homeserver administrator\n    joinroom            Join a user to a room\n    maintenance         Run maintenance tasks\n    make-room-admin     Grant a user the highest power level available to a local user\n                        in this room\n    purge-history       Purge historic events from the database\n    purge-remote-media  Purge cached, remote media\n    report              Get a report event by report identifier\n    reports             Lists reported events\n    rooms               List rooms\n    server-notice       Send a server notice to a user\n    set-admin           Change whether a user is a homeserver admin or not\n    start               Starts all OCI containers\n    restart             Restarts all OCI containers (alias for start)\n    stop                Stop and disable all OCI containers\n    update              Updates the ansible playbook repository\n    upload              Upload a media file.\n    user                Get information about a specific user\n    users               Lists all users of the homeserver\n    version             Get the version information of the Synapse instance\n\nThank you for using MatrixCtl!\nCheck out the docs: https://matrixctl.rtfd.io\nReport bugs to: https://github.com/MichaelSasser/matrixctl/issues/new/choose\n```\n\n## Installation\n\nMatrixCtl is written in Python. The installation is straight forward. Just run\n`pip install matrixctl`. It will be installed from the\n[Python Package Index (PyPi)](https://pypi.org/project/matrixctl/).\n\nUpgrade MatrixCtl with `pip install --upgrade matrixctl`.\n\nYou will find more information in the\n[documentation](https://matrixctl.readthedocs.io/en/latest/installation.html).\n\n## Documentation\n\nThe\n[documentation](https://matrixctl.readthedocs.io/en/latest/index.html) is\nwaiting for you, to check out.\n\n## Configuration File\n\nTo use this tool you need to have a configuration file in\n\"~/.config/matrixctl/config.yaml\" or in \"/etc/matrixctl/config.yaml\".\n\n```yaml\n# Define your homeservers in \"servers\" here.\n\nservers:\n  # Your default server. You can specify muliple servers here with arbitrary\n  # Names\n  default:\n\n    ansible:\n      # The absolute path to your playbook\n      playbook: /path/to/ansible/playbook\n\n    synapse:\n      # The absolute path to the synapse playbook.\n      # This is only used for updating the playbook.\n      playbook: /path/to/synapse/playbook\n\n    # If your matrix server is deployed, you may want to fill out the API section.\n    # It enables matrixctl to run more and faster commands. You can deploy and\n    # provision your Server without this section. You also can cerate a user with\n    # \"matrixctl adduser --ansible YourUsername\" and add your privileges after\n    # that.\n    api:\n      # Your domain should be something like \"michaelsasser.org\" without the\n      # \"matrix.\" in the front. MatrixCtl will add that, if needed. An IP-Address\n      # is not enough.\n      domain: example.com\n\n      # The username your admin user\n      username: johndoe\n\n      # To use the API you need to have an administrator account. Enter your Token\n      # here. If you use the element client you will find it your user settings\n      # (click on your username on the upper left corner on your browser) in the\n      # \"Help & About\" tab. If you scroll down click next to \"Access-Token:\" on\n      # \"<click to reveal>\". It will be marked for you. Copy it in here.\n      token= \"MyMatrixToken\"\n\n      # In some cases, MatrixCtl does need to make many requests. To speed those\n      # requests a notch, you can set a concurrent_limit which is greater than\n      # one. This sets a limit to how many asynchronous workers can be spawned\n      # by MatrixCtl. If you set the number to high, MatrixCtl needs more time\n      # to spawn the workers, then a synchronous request would take.\n      concurrent_limit: 10\n\n    # Here you can add your SSH configuration.\n    ssh:\n      address: \"matrix.{{ servers.default.api.domain }}\"  # With Jinja2 support\n\n      # The default port is 22. Can be omitted. Jinja2: \"{{ default_ssh_port }}\"\n      port: 22\n\n      # The default username is your current login name.\n      user: john\n\n    # Define your maintainance tasks\n    maintenance:\n      tasks:\n        - compress-state  # Compress synapses state table\n        - vacuum          # VACUUM the synapse database (garbage-collection)\n\n  # Another server.\n  foo:\n    # ...\n\nserver: # This is a reserved name, which cannot be used.\n```\n\nPredefined Jinja2 placeholders (all placeholders can be overwritten):\n\n- `\"{{ home }}\"` -- The current users home path e.g. `/home/michael`,\n- `\"{{ user }}\"` -- The current users username e.g. `michael`,\n- `\"{{ default_ssh_port }}\"` -- The default ssh port `22`,\n- `\"{{ default_api_concurrent_limit }}\"` -- The default concurrent limit `4`.\n\nCheck out the\n[documentation](https://matrixctl.readthedocs.io/en/latest/getting_started/config_file.html)\nfor more information.\n\n## Discussions & Chat\n\nIf you have any thoughts or questions, you can ask them in the\n[discusions](https://github.com/MichaelSasser/matrixctl/discussions) or in\nthe projects matrix room `#matrixctl:matrix.org`.\n\n## Semantic Versioning and Branching Model\n\nThis Python package uses [SemVer](https://semver.org/) for its release\ncycle and the\n[git-flow](https://danielkummer.github.io/git-flow-cheatsheet/index.html)\nbranching model (by [Vincent Driessen](https://nvie.com/about/)).\n\nIt has two branches with infinite lifetime. The:\n\n- [develop](https://github.com/MichaelSasser/matrixctl/tree/develop)\n  branch is the merging branch,\n- [master](https://github.com/MichaelSasser/matrixctl/tree/master)\n  branch gets updated on every release.\n\n## Contributing\n\nPlease check our [Contributer Documentation](https://matrixctl.readthedocs.io/en/latest/contributer_documentation/index.html#contributer-documentation).\n\n## License\n\nCopyright &copy; 2020-2001 Michael Sasser <Info@MichaelSasser.org>.\nReleased under the GPLv3 license.\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Control, manage, provision and deploy matrix homeservers.",
    "version": "0.11.5",
    "split_keywords": [
        "matrix",
        "synapse",
        "docker",
        "oci-container"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48b17de5301b78b19f66ad8f42e621af394a9651efe19e6b7b2a0593dc8da8d7",
                "md5": "fe8c7316de789dc5b237b3eab87c7f8d",
                "sha256": "3126caf0d7a229fa8778d7e74a57e17882fdab388227d6dd318ec8b8434137e4"
            },
            "downloads": -1,
            "filename": "matrixctl-0.11.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe8c7316de789dc5b237b3eab87c7f8d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 155416,
            "upload_time": "2021-12-01T05:52:42",
            "upload_time_iso_8601": "2021-12-01T05:52:42.510573Z",
            "url": "https://files.pythonhosted.org/packages/48/b1/7de5301b78b19f66ad8f42e621af394a9651efe19e6b7b2a0593dc8da8d7/matrixctl-0.11.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be0b1108a33112301c523ae5e49133edeec5d3d5fd3a9dbce71bb9c051e3c8c7",
                "md5": "67570f935a6ed593a9149b3d335c0fda",
                "sha256": "217885295fa00a913a2f067217e3930faa128b9fd55f6fc0c30382421965c163"
            },
            "downloads": -1,
            "filename": "matrixctl-0.11.5.tar.gz",
            "has_sig": false,
            "md5_digest": "67570f935a6ed593a9149b3d335c0fda",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 65739,
            "upload_time": "2021-12-01T05:52:44",
            "upload_time_iso_8601": "2021-12-01T05:52:44.327560Z",
            "url": "https://files.pythonhosted.org/packages/be/0b/1108a33112301c523ae5e49133edeec5d3d5fd3a9dbce71bb9c051e3c8c7/matrixctl-0.11.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-12-01 05:52:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "matrixctl"
}
        
Elapsed time: 0.04811s