diff --git a/CHANGELOG.md b/CHANGELOG.md index 99691cc1..201f26ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,10 @@ v1.6.1 - unreleased ------------------- - Enhancement: Make Unbound drop privileges after binding to port - Enhancement: Create an Authentication Token with IPv6 address restriction ([#829](https://github.com/Mailu/Mailu/issues/829)) -- Bug: Fix creating new fetched accounts - Enhancement: Missing wildcard option in alias flask command ([#869](https://github.com/Mailu/Mailu/issues/869)) +- Bug: Fix creating new fetched accounts - Bug: Fix poor performance if ANTIVIRUS is configured to none. +- Bug: Rename cli commands and their options (replace "\_" with "-") ([#877](https://github.com/Mailu/Mailu/issues/877)) - Bug: Fix typo in migration script ([#905](https://github.com/Mailu/Mailu/issues/905)) v1.6.0 - 2019-01-18 diff --git a/core/admin/mailu/manage.py b/core/admin/mailu/manage.py index 3a8256ad..462bce67 100644 --- a/core/admin/mailu/manage.py +++ b/core/admin/mailu/manage.py @@ -64,7 +64,7 @@ def admin(localpart, domain_name, password): @click.argument('localpart') @click.argument('domain_name') @click.argument('password') -@click.argument('hash_scheme') +@click.argument('hash_scheme', required=False) @flask_cli.with_appcontext def user(localpart, domain_name, password, hash_scheme=None): """ Create a user @@ -86,12 +86,14 @@ def user(localpart, domain_name, password, hash_scheme=None): @mailu.command() -@click.option('-n', '--domain_name') -@click.option('-u', '--max_users') -@click.option('-a', '--max_aliases') -@click.option('-q', '--max_quota_bytes') +@click.argument('domain_name') +@click.option('-u', '--max-users') +@click.option('-a', '--max-aliases') +@click.option('-q', '--max-quota-bytes') @flask_cli.with_appcontext def domain(domain_name, max_users=-1, max_aliases=-1, max_quota_bytes=0): + """ Create a domain + """ domain = models.Domain.query.get(domain_name) if not domain: domain = models.Domain(name=domain_name) @@ -126,7 +128,7 @@ def user_import(localpart, domain_name, password_hash, hash_scheme = None): @mailu.command() @click.option('-v', '--verbose') -@click.option('-d', '--delete_objects') +@click.option('-d', '--delete-objects') @flask_cli.with_appcontext def config_update(verbose=False, delete_objects=False): """sync configuration with data from YAML-formatted stdin""" diff --git a/docs/cli.rst b/docs/cli.rst index d666ab4b..bdd030f9 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -4,11 +4,12 @@ Mailu command line Managing users and aliases can be done from CLI using commands: * alias -* alias_delete +* alias-delete +* domain * user -* user_import -* user_delete -* config_update +* user-import +* user-delete +* config-update alias ----- @@ -18,21 +19,31 @@ alias docker-compose exec admin flask mailu alias foo example.net "mail1@example.com,mail2@example.com" -alias_delete +alias-delete ------------ .. code-block:: bash - docker-compose exec admin flask mailu alias_delete foo@example.net + docker-compose exec admin flask mailu alias-delete foo@example.net + + +domain +---- + +.. code-block:: bash + + docker-compose exec admin flask mailu domain example.net + user ---- .. code-block:: bash - docker-compose exec admin flask mailu user --hash_scheme='SHA512-CRYPT' myuser example.net 'password123' + docker-compose exec admin flask mailu user myuser example.net 'password123' -user_import + +user-import ----------- primary difference with simple `user` command is that password is being imported as a hash - very useful when migrating users from other systems where only hash is known. @@ -41,21 +52,21 @@ primary difference with simple `user` command is that password is being imported docker-compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT' -user_delete +user-delete ------------ .. code-block:: bash - docker-compose exec admin flask mailu user_delete foo@example.net + docker-compose exec admin flask mailu user-delete foo@example.net -config_update +config-update ------------- The sole purpose of this command is for importing users/aliases in bulk and synchronizing DB entries with external YAML template: .. code-block:: bash - cat mail-config.yml | docker-compose exec admin flask mailu config_update --delete_objects + cat mail-config.yml | docker-compose exec -T admin flask mailu config-update --delete-objects where mail-config.yml looks like: @@ -72,7 +83,7 @@ where mail-config.yml looks like: domain: example.com destination: "user1@example.com,user2@example.com" -without ``--delete_object`` option config_update will only add/update new values but will *not* remove any entries missing in provided YAML input. +without ``--delete-object`` option config-update will only add/update new values but will *not* remove any entries missing in provided YAML input. Users ----- diff --git a/docs/kubernetes/mailu/index.rst b/docs/kubernetes/mailu/index.rst index 0f2451fa..0711abbd 100644 --- a/docs/kubernetes/mailu/index.rst +++ b/docs/kubernetes/mailu/index.rst @@ -128,7 +128,7 @@ And in the pod run the following command. The command uses following entries: .. code-block:: bash - python manage.py admin root example.com password + flask mailu admin root example.com password - ``admin`` Make it an admin user - ``root`` The first part of the e-mail adres (ROOT@example.com) @@ -207,4 +207,4 @@ If the login problem still persists, or more specific, happens now and then and kubectl -n mailu-mailserver get po kubectl -n mailu-mailserver delete po/mailu-imap... -Happy mailing! \ No newline at end of file +Happy mailing!