Giter VIP home page Giter VIP logo

matrixctl's People

Contributors

deepsourcebot avatar dependabot[bot] avatar kenrap avatar michaelsasser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jgarte

matrixctl's Issues

Fix: start password creation with None

matrixctl.password_helpers.ask_password starts with two not matching
passwords, which will be guaranteed overwritten in the next lines.
Unfortunately, this triggers CWE-798: Use of Hard-coded Credentials, which
is a false-positive.

Starting with

passwd: Optional[str] = None
passwd2: Optional[str] = None

should fix that problem.

[FEATURE] docs: move to rtd

Consider moving the docs back to rtd since the bug with pyproject seems to be fixed. Maybe use gh actions for building docs off the develop branch.

[BUG] adduser --ansible does not work

Describe the bug

  1. adduser --ansible username throws an error when generating password because of \'` .
  2. adduser --ansible does not work

To Reproduce
Steps to reproduce the behavior:

  1. Enter command 'adduser --ansible username
  2. Enter or autogenerate pasword
  3. Press "y" [ENTER]
  4. See error

Expected behavior
Added user like the API version of that command.

Debug output

2020-04-13 09:18:36 - DEBUG - Loading Config file(s)
2020-04-13 09:18:36 - DEBUG - [ANSIBLE]
2020-04-13 09:18:36 - DEBUG -   ├─  matrixdockeransibledeploypath := /home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy
2020-04-13 09:18:36 - DEBUG -   ┴
2020-04-13 09:18:36 - DEBUG - [SERVER]
2020-04-13 09:18:36 - DEBUG -   ├─  ansiblecfg := /home/michael/repos/playbooks/matrix/ansible.cfg
2020-04-13 09:18:36 - DEBUG -   ├─  ansibleplaybook := /home/michael/repos/playbooks/matrix/site.yml
2020-04-13 09:18:36 - DEBUG -   ├─  ansibletags := setup-all
2020-04-13 09:18:36 - DEBUG -   ┴
2020-04-13 09:18:36 - DEBUG - [API]
2020-04-13 09:18:36 - DEBUG -   ├─  domain := michaelsasser.org
2020-04-13 09:18:36 - DEBUG -   ├─  token := **HIDDEN (Length=284)**
2020-04-13 09:18:36 - DEBUG -   ┴
2020-04-13 09:18:36 - DEBUG - args=Namespace(admin=False, ansible=True, debug=True, func=<function adduser at 0x7f01460095e0>, passwd=None, user='myuser')
2020-04-13 09:18:36 - DEBUG - Disabing help on AttributeError
2020-04-13 09:18:36 - WARNING - In debugging mode help is disabled! If you don't use any attibutes, the program will throw a AttributeError like: "AttributeError: 'Namespace' object has no attribute 'func".' This is perfectly normal and not a bug. If you want the help in debug mode, use the "--help" attribute.
Username: myuser
Password (generated): t7D9^P82|;r17jXC
Admin:    no
Is everything ok? [y/n]
PLAY [Set up a Matrix server] *****************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************
[WARNING]: Platform linux on host matrix.michaelsasser.org is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
ok: [matrix.michaelsasser.org]

TASK [matrix-base : set_fact] *****************************************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-base : Fail if running on Ansible < 2.5] *****************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-base : Fail if running on Ansible 2.5.x (lower than 2.5.2)] **********************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-base : (Deprecation) Catch and report renamed settings] **************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org] => (item={'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'}) 
skipping: [matrix.michaelsasser.org] => (item={'old': 'hostname_identity', 'new': 'matrix_domain'}) 
skipping: [matrix.michaelsasser.org] => (item={'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}) 
skipping: [matrix.michaelsasser.org] => (item={'old': 'hostname_riot', 'new': 'matrix_server_fqn_riot'}) 

TASK [matrix-base : Fail if required variables are undefined] *********************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org] => (item=matrix_domain) 
skipping: [matrix.michaelsasser.org] => (item=matrix_server_fqn_matrix) 
skipping: [matrix.michaelsasser.org] => (item=matrix_server_fqn_riot) 

TASK [matrix-base : Fail if uppercase domain used] ********************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org] => (item=michaelsasser.org) 
skipping: [matrix.michaelsasser.org] => (item=matrix.michaelsasser.org) 
skipping: [matrix.michaelsasser.org] => (item=riot.michaelsasser.org) 

TASK [matrix-base : Fail if using python2 on Archlinux] ***************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-mailer : set_fact] ***************************************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-postgres : set_fact] *************************************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-corporal : set_fact] *************************************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-discord : Fail if matrix-synapse role already executed] ********************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-discord : set_fact] ********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-discord : set_fact] ********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Fail if matrix-synapse role already executed] **********************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Fail if matrix-synapse role already executed] **********************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Fail if matrix-nginx-proxy role already executed] ******************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy] ************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Register Slack Appservice proxying configuration with matrix-nginx-proxy] ******************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-slack : Warn about reverse-proxying if matrix-nginx-proxy not used] ********************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Fail if matrix-synapse role already executed] *******************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : set_fact] *******************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : set_fact] *******************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Fail if matrix-synapse role already executed] *******************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Fail if matrix-nginx-proxy role already executed] ***************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy] ******************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Register webhooks Appservice proxying configuration with matrix-nginx-proxy] ************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-webhooks : Warn about reverse-proxying if matrix-nginx-proxy not used] *****************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-irc : Fail if matrix-synapse role already executed] ************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-irc : set_fact] ************************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-appservice-irc : set_fact] ************************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-facebook : set_fact] **********************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-facebook : set_fact] **********************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-facebook : Fail if running on Ansible lower than 2.8 and trying self building] ************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : Fail if matrix-nginx-proxy role already executed] ******************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : Generate Mautrix Hangouts proxying configuration for matrix-nginx-proxy] *******************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : Register Mautrix Hangouts proxying configuration with matrix-nginx-proxy] ******************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : Warn about reverse-proxying if matrix-nginx-proxy not used] ********************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-hangouts : Fail if running on Ansible lower than 2.8 and trying self building] ************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : Fail if matrix-nginx-proxy role already executed] ******************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : Generate Mautrix Telegram proxying configuration for matrix-nginx-proxy] *******************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : Register Mautrix Telegram proxying configuration with matrix-nginx-proxy] ******************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-telegram : Warn about reverse-proxying if matrix-nginx-proxy not used] ********************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-whatsapp : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mautrix-whatsapp : set_fact] **********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mx-puppet-skype : set_fact] ***********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mx-puppet-skype : set_fact] ***********************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-bridge-mx-puppet-skype : Fail if running on Ansible lower than 2.8 and trying self building] *************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-synapse : set_fact] **************************************************************************************************************************************************************************************************
ok: [matrix.michaelsasser.org]

TASK [matrix-synapse : set_fact] **************************************************************************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-synapse : Fail if running on Ansible lower than 2.8 and trying self building] ****************************************************************************************************************************************
skipping: [matrix.michaelsasser.org]

TASK [matrix-synapse : Fail if playbook called incorrectly] ***********************************************************************************************************************************************************************
fatal: [matrix.michaelsasser.org]: FAILED! => {"changed": false, "msg": "The `username` variable needs to be provided to this playbook, via --extra-vars"}

PLAY RECAP ************************************************************************************************************************************************************************************************************************
matrix.michaelsasser.org   : ok=23   changed=0    unreachable=0    failed=1    skipped=34   rescued=0    ignored=0   

Traceback (most recent call last):
  File "/home/michael/.cache/pypoetry/virtualenvs/matrixctl-bgeLX2r0-py3.8/bin/matrixctl", line 11, in <module>
    load_entry_point('matrixctl', 'console_scripts', 'matrixctl')()
  File "/home/michael/repos/matrixctl/matrixctl/application.py", line 194, in main
    args.func(args, config, api)
  File "/home/michael/repos/matrixctl/matrixctl/account.py", line 103, in adduser
    ansible_synapse(
  File "/home/michael/repos/matrixctl/matrixctl/ansible_handler.py", line 65, in ansible_synapse
    subprocess.run(cmd, check=True)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ansible-playbook', '-i', '/home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy/inventory/hosts', '/home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy/setup.yml', "--extra-vars='username=myuser password=t7D9^P82|;r17jXC admin=False'", '--tags=register-user']' returned non-zero exit status 2.

Desktop (please complete the following information):

  • OS: Arch linux x64 5.5.13-arch2
  • MatrixCtl Version: 0.2.0

Additional context
None

[Feature]: Let the user decide which maintenance steps are executed

Is your feature request related to a problem? Please describe.

The user should be able to choose which maintenance steps are used for a server.

Describe the solution you'd like

Add option to config:

maintenance:
  - foo
  - bar

Additional context

Use some simple names and add docs to describe what will happen.

[BUG] run-postgres-synapse-janitor should be removed from maintenance

See run-postgres-synapse-janitor

maintenance currently does not work because it got a safety "switch".

fatal: [matrix.michaelsasser.org]: FAILED! => 
{"changed": false, "msg": "Using Synapse Janitor
is considered dangerous and may break your database. See 
https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/465. 
If you'd like to run it anyway, add 
`--extra-vars='i_know_synapse_janitor_is_dangerous=1'` 
to your command."}

The feature to generate passwords should be removed

Is your feature request related to a problem? Please describe.

Currently it is possible to let MatrixCtl generate passwords. A user should use an password generator to generate passwords. The feature should be removed.

Add tox

Is your feature request related to a problem? Please describe.
Developers should have an simple way to test/lint.

Describe the solution you'd like
tox

[FEATURE] SSH handler should raise an error, if unable to connect

Describe the solution you'd like
See title.

Additional context

matrixctl -d update
2020-04-30 07:25:58 - DEBUG - args=Namespace(debug=True, func=<function update at 0x7fa3871b2700>)
2020-04-30 07:25:58 - DEBUG - Disabing help on AttributeError
2020-04-30 07:25:58 - WARNING - In debugging mode help is disabled! If you don't use any attibutes, the program will throw a AttributeError like: "AttributeError: 'Namespace' object has no attribute 'func".' This is perfectly normal and not a bug. If you want the help in debug mode, use the "--help" attribute.
2020-04-30 07:25:58 - DEBUG - Loading Config file(s)
2020-04-30 07:25:58 - DEBUG - [SYNAPSE]
2020-04-30 07:25:58 - DEBUG -   ├─  Path := /home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy
2020-04-30 07:25:58 - DEBUG -   ┴
2020-04-30 07:25:58 - DEBUG - [ANSIBLE]
2020-04-30 07:25:58 - DEBUG -   ├─  Path := /home/michael/repos/playbooks/matrix
2020-04-30 07:25:58 - DEBUG -   ├─  Cfg := /home/michael/repos/playbooks/matrix/ansible.cfg
2020-04-30 07:25:58 - DEBUG -   ├─  Playbook :=  setup.yml
2020-04-30 07:25:58 - DEBUG -   ├─  DeployTags := ['setup-all']
2020-04-30 07:25:58 - DEBUG -   ┴
2020-04-30 07:25:58 - DEBUG - [API]
2020-04-30 07:25:58 - DEBUG -   ├─  Domain := michaelsasser.org
2020-04-30 07:25:58 - DEBUG -   ├─  Token := **HIDDEN (Length=284)**
2020-04-30 07:25:58 - DEBUG -   ┴
2020-04-30 07:25:58 - DEBUG - [SSH]
2020-04-30 07:25:58 - DEBUG -   ├─  Address := matrix.michaelsasser.org
2020-04-30 07:25:58 - DEBUG -   ├─  Port := 22
2020-04-30 07:25:58 - DEBUG -   ├─  User := michael
2020-04-30 07:25:58 - DEBUG -   ┴
2020-04-30 07:25:58 - DEBUG - Popen(['git', 'pull'], cwd=/home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy, universal_newlines=False, shell=None, istream=None)
Traceback (most recent call last):
  File "/usr/bin/matrixctl", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/matrixctl/application.py", line 126, in main
    return int(args.func(args))
  File "/usr/lib/python3.8/site-packages/matrixctl/update.py", line 41, in update
    git.pull()
  File "/usr/lib/python3.8/site-packages/matrixctl/handlers/git.py", line 120, in pull
    self.git.pull()
  File "/home/michael/.local/lib/python3.8/site-packages/git/cmd.py", line 542, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/home/michael/.local/lib/python3.8/site-packages/git/cmd.py", line 1005, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/home/michael/.local/lib/python3.8/site-packages/git/cmd.py", line 822, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git pull
  stderr: 'fatal: unable to access 'https://github.com/spantaleev/matrix-docker-ansible-deploy.git/': Could not resolve host: github.com'

[BUG] plain deploy does nothing

Describe the bug
Deploy does nothing, when no switches are added

To Reproduce
Steps to reproduce the behavior:

  1. Enter command matrixctl -d deploy
  2. (Does nothing)

Workaround
Add the -s or -a switch

Expected behavior
Deploy everything, that is configured

Debug output

matrixctl -d deploy
2020-09-25 08:01:24 - DEBUG - args=Namespace(ansible=False, debug=True, func=<function deploy at 0x7efe8f2bd430>, synapse=False)
2020-09-25 08:01:24 - DEBUG - Disabing help on AttributeError
2020-09-25 08:01:24 - WARNING - In debugging mode help is disabled! If you don't use any attibutes, the program will throw a AttributeError like: "AttributeError: 'Namespace' object has no attribute 'func".' This is perfectly normal and not a bug. If you want the help in debug mode, use the "--help" attribute.
2020-09-25 08:01:24 - DEBUG - deploy
2020-09-25 08:01:24 - DEBUG - Loading Config file(s)
2020-09-25 08:01:24 - DEBUG - [SYNAPSE]
2020-09-25 08:01:24 - DEBUG -   ├─  Path := /home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy
2020-09-25 08:01:24 - DEBUG -   ┴
2020-09-25 08:01:24 - DEBUG - [API]
2020-09-25 08:01:24 - DEBUG -   ├─  Domain := michaelsasser.org
2020-09-25 08:01:24 - DEBUG -   ├─  Token := **HIDDEN (Length=284)**
2020-09-25 08:01:24 - DEBUG -   ┴
2020-09-25 08:01:24 - DEBUG - [SSH]
2020-09-25 08:01:24 - DEBUG -   ├─  Address := matrix.michaelsasser.org
2020-09-25 08:01:24 - DEBUG -   ├─  Port := 22
2020-09-25 08:01:24 - DEBUG -   ├─  User := michael
2020-09-25 08:01:24 - DEBUG -   ┴

Desktop

  • MatrixCtl Version 0.6.3

changelog

Is your feature request related to a problem? Please describe.
The changelog is currently only available from GH releases and should be
available from a specific file in the repo.

Describe the solution you'd like
towncrier

[FEATURE] Deactivated users are not shown by "users"

To Reproduce

  1. Enter command matrixctl users

Expected behavior
Deactivated users should be listed

Desktop (please complete the following information):

  • MatrixCtl Version: 0.2.2

Additional context

  • There sould be a easy way to deactivate/activate and show deactivated users.
  • Deactivated users should be shown by users

Only configure one playbook

If the user is able to configure an own playbook, the user is also able to do a import_playbook to run a user configured playbook before the synapse playbook. There is no need to configure two playbooks. This would make the configuration less confusing.

[FEATURE] There should be a Error message on M_UNKNOWN_TOKEN

When the access token is outdated, the API will response with the error
code M_UNKNOWN_TOKEN. This should be reflected by MatrixCtl.
Currently there is only the dummy error code like in that example:

matrixctl -d rooms
2020-06-02 14:28:23 - DEBUG - args=Namespace(debug=True, filter=None, func=<function rooms at 0x7ff82d8db550>, number=0, order_by_size=False, reverse=False)
2020-06-02 14:28:23 - DEBUG - Disabing help on AttributeError
2020-06-02 14:28:23 - WARNING - In debugging mode help is disabled! If you don't use any attibutes, the program will throw a AttributeError like: "AttributeError: 'Namespace' object has no attribute 'func".' This is perfectly normal and not a bug. If you want the help in debug mode, use the "--help" attribute.
2020-06-02 14:28:23 - DEBUG - Loading Config file(s)
2020-06-02 14:28:23 - DEBUG - [SYNAPSE]
2020-06-02 14:28:23 - DEBUG -   ├─  Path := /home/michael/repos/playbooks/synapse/matrix-docker-ansible-deploy
2020-06-02 14:28:23 - DEBUG -   ┴
2020-06-02 14:28:23 - DEBUG - [ANSIBLE]
2020-06-02 14:28:23 - DEBUG -   ├─  Path := /home/michael/repos/playbooks/matrix
2020-06-02 14:28:23 - DEBUG -   ├─  Cfg := /home/michael/repos/playbooks/matrix/ansible.cfg
2020-06-02 14:28:23 - DEBUG -   ├─  Playbook :=  setup.yml
2020-06-02 14:28:23 - DEBUG -   ├─  DeployTags := ['setup-all']
2020-06-02 14:28:23 - DEBUG -   ┴
2020-06-02 14:28:23 - DEBUG - [API]
2020-06-02 14:28:23 - DEBUG -   ├─  Domain := michaelsasser.org
2020-06-02 14:28:23 - DEBUG -   ├─  Token := **HIDDEN (Length=284)**
2020-06-02 14:28:23 - DEBUG -   ┴
2020-06-02 14:28:23 - DEBUG - [SSH]
2020-06-02 14:28:23 - DEBUG -   ├─  Address := matrix.michaelsasser.org
2020-06-02 14:28:23 - DEBUG -   ├─  Port := 22
2020-06-02 14:28:23 - DEBUG -   ├─  User := michael
2020-06-02 14:28:23 - DEBUG -   ┴
2020-06-02 14:28:23 - DEBUG - Started API request.
2020-06-02 14:28:23 - DEBUG - url (unparsed): https://matrix.michaelsasser.org/_synapse/admin/v1/rooms
2020-06-02 14:28:23 - DEBUG - url   (parsed): https://matrix.michaelsasser.org/_synapse/admin/v1/rooms
2020-06-02 14:28:23 - DEBUG - Method: GET
2020-06-02 14:28:23 - DEBUG - Headers: {'User-Agent': 'matrixctl0.6.0', 'Authorization': 'HIDDEN (Length=284)'}
2020-06-02 14:28:23 - DEBUG - Params: {'from': 0}
2020-06-02 14:28:23 - DEBUG - Data: None
2020-06-02 14:28:23 - DEBUG - Starting new HTTPS connection (1): matrix.michaelsasser.org:443
2020-06-02 14:28:23 - DEBUG - https://matrix.michaelsasser.org:443 "GET /_synapse/admin/v1/rooms?from=0 HTTP/1.1" 401 85
2020-06-02 14:28:23 - DEBUG - response.json()={'errcode': 'M_UNKNOWN_TOKEN', 'error': 'Unrecognised access token', 'soft_logout': False}
2020-06-02 14:28:23 - CRITICAL - Could not get the room table.

ansible-runner

The playbooks should be run by ansible-runner instead of a subprocess.

__main__.py instead of application.py

  • The application should use matrixctl/__main__.py instead of
    matrixctl/application.py.
  • app.py in the project root should be removed. With __main__.py developers
    are able to run the program with python matrixctl from the root of the
    project.

[BUG] inconsistant --with-bots switch with LDAP users

Describe the bug
When using LDAP, the users are only shown, when using the --with-bots switch.

To Reproduce
Steps to reproduce the behavior:

  1. Configure LDAP
  2. Enter command matrixctl users
  3. No users are shown
  4. Enter command matrixctl users --with-bots
  5. Users and bots are shown

Expected behavior
Show users

Desktop

  • MatrixCtl Version 0.6.2

feature: add stop command

Is your feature request related to a problem? Please describe.
Sometimes it is necessary to stop the services. It would be helpful to add a stop command.

Describe the solution you'd like
Add matrixctl stop using the stop tag of the synapse playbook.

[BUG] Logging TypeError

Describe the bug
Observed: TypeError: not all arguments converted during string formatting when debugging API handler

To Reproduce
Steps to reproduce the behavior:

  1. Enter command which uses API e.g. 'matrixctl -d users'
  2. See errors

Expected behavior
No errors

Debug output
e.g.:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/__init__.py", line 1079, in emit
    msg = self.format(record)
  File "/usr/lib/python3.9/logging/__init__.py", line 923, in format
    return fmt.format(record)
  File "/usr/lib/python3.9/site-packages/coloredlogs/__init__.py", line 1137, in format
    return logging.Formatter.format(self, record)
  File "/usr/lib/python3.9/logging/__init__.py", line 659, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.9/logging/__init__.py", line 363, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/bin/matrixctl", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/matrixctl/application.py", line 123, in main
    return int(args.func(args))
  File "/usr/lib/python3.9/site-packages/matrixctl/users.py", line 108, in users
    lst: JsonDict = api.request().json()
  File "/usr/lib/python3.9/site-packages/matrixctl/handlers/api.py", line 232, in request
    debug("Method:", self.__method)
Message: 'Method:'
Arguments: ('GET',)

Desktop (please complete the following information):

Additional context
Possibly introduced in a previous version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.