From dd6d660c9ee4db66d5ec74da549801b42c72355d Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Fri, 24 Sep 2021 17:12:51 +0200 Subject: [PATCH 1/7] [skip ci] Remove duplicates --- doc/developers-guide/domain_management.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/developers-guide/domain_management.md b/doc/developers-guide/domain_management.md index 3a99b3e44c..5b50531311 100644 --- a/doc/developers-guide/domain_management.md +++ b/doc/developers-guide/domain_management.md @@ -129,9 +129,8 @@ curl -v -X PUT "http://localhost:8088/api/domains/example.db" \ Result codes: * 204 - inserted. +* 403 - DB service disabled, or an unknown host type. * 409 - domain already exists with a different host type. -* 403 - DB service disabled. -* 403 - unknown host type. * 500 - other errors. Example of the result body with a failure reason: @@ -142,7 +141,6 @@ Example of the result body with a failure reason: Check the `src/domain/mongoose_domain_handler.erl` file for the exact values of the `what` field if needed. - ### Delete domain You must provide the domain's host type inside the body: @@ -157,13 +155,9 @@ curl -v -X DELETE "http://localhost:8088/api/domains/example.db" \ Result codes: * 204 - the domain is removed or not found. -* 403 - the domain is static. -* 403 - the DB service is disabled. -* 403 - the host type is wrong (does not match the host type in the database). -* 403 - the host type is unknown. +* 403 - the domain is static, the DB service is disabled, the host type is wrong (does not match the host type in the database), or the host type is unknown. * 500 - other errors. - ### Enable/disable domain Provide `{"enabled": true}` as a body to enable a domain. @@ -179,10 +173,8 @@ curl -v -X PATCH "http://localhost:8088/api/domains/example.db" \ Result codes: * 204 - updated. -* 404 - domain not found; -* 403 - domain is static; -* 403 - service disabled. - +* 403 - the domain is static, or the service is disabled. +* 404 - domain not found. ## Command Line Interface From 75618c92b822c2a6cc48ca24373f4d4ded49fd3b Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Fri, 24 Sep 2021 17:13:49 +0200 Subject: [PATCH 2/7] [skip ci] Add amoc-arsenal-xmpp, remove Tide As Tide is not live, maybe it's better not to advertise it for now. --- doc/Contributions.md | 9 +++++++++ doc/developers-guide/Testing-MongooseIM.md | 4 +--- doc/user-guide/Features.md | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/Contributions.md b/doc/Contributions.md index f21da16cc3..c38455229d 100644 --- a/doc/Contributions.md +++ b/doc/Contributions.md @@ -56,6 +56,15 @@ Apache license 2.0 !!! Info amoc stands for "A Murder of Crows" +### amoc-arsenal-xmpp + +See [esl/amoc-arsenal-xmpp](https://github.com/esl/amoc-arsenal-xmpp) on GitHub for more details. + +A collection of scenarios for [amoc](#amoc), which we use to test MongooseIM. +They can however be used to load test any XMPP server. + +Apache license 2.0 + ### exml See [esl/exml](https://github.com/esl/exml) on GitHub for more details. diff --git a/doc/developers-guide/Testing-MongooseIM.md b/doc/developers-guide/Testing-MongooseIM.md index 046b9a885d..c927661634 100644 --- a/doc/developers-guide/Testing-MongooseIM.md +++ b/doc/developers-guide/Testing-MongooseIM.md @@ -402,6 +402,4 @@ Finally, set `GDRIVE_PARENT_DIR` environment variable of your build to the direc ### Load testing Alongside CI, we do also CLT (Continuous Load Testing). -We have our own load testing infrastructure, called Tide, which is triggered after every successful test run, and gives us a feedback on changes to MongooseIM performance. - -Test results are publicly available on the [Hello Tide!](http://tide.erlang-solutions.com/public) page. +We use [amoc](https://github.com/esl/amoc) and [amoc-arsenal-xmpp](https://github.com/esl/amoc-arsenal-xmpp/) to perform tests that give us a feedback on changes to MongooseIM performance. diff --git a/doc/user-guide/Features.md b/doc/user-guide/Features.md index 943a41404b..e57eef6ad6 100644 --- a/doc/user-guide/Features.md +++ b/doc/user-guide/Features.md @@ -64,7 +64,7 @@ MongooseIM gathers over 50 different XMPP-related metrics, allowing close monito Erlang Solutions also provides [WombatOAM](https://www.erlang-solutions.com/products/wombat-oam.html), an Erlang VM monitoring solution, that enables ops and devs to better understand what going on in a MongooseIM cluster. -For load testing consider [Tide](http://tide.erlang-solutions.com/), another Erlang Solutions' tool that enables devs and ops to validate their scalability, given the clients scenarios. +For load testing we use [our own tools](../Contributions.md#amoc), that enable us to validate MongooseIM's scalability, given different scenarios. ## Multi-tenancy (dynamic domains) From fb3750cea53f3731b5bf591ed3d168f0cdaf5799 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Fri, 24 Sep 2021 17:15:02 +0200 Subject: [PATCH 3/7] [skip ci] Link mod_inbox with the XMPP extension --- doc/modules/mod_inbox.md | 1 + doc/open-extensions/inbox.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/modules/mod_inbox.md b/doc/modules/mod_inbox.md index fb02b74d31..fb753a2806 100644 --- a/doc/modules/mod_inbox.md +++ b/doc/modules/mod_inbox.md @@ -1,6 +1,7 @@ ## Module Description `Inbox` is an experimental feature implemented as a few separate modules. +It is described in detail as our [Open XMPP Extension](../open-extensions/inbox.md). To use it, enable mod\_inbox in the config file. ## Options diff --git a/doc/open-extensions/inbox.md b/doc/open-extensions/inbox.md index 0275d35a09..cc9fd10575 100644 --- a/doc/open-extensions/inbox.md +++ b/doc/open-extensions/inbox.md @@ -1,5 +1,5 @@ When a messaging client starts, it typically builds a UI showing a list of recent chats, with metadata attached to them like, whether any chat has new messages and how many, or if it is fully read, or if they are for example muted and until when. - +In MongooseIM this functionality is provided by [mod_inbox](../modules/mod_inbox.md). ## Terminology: From 55f1674a3b824195921616796a4f8e5f5ea224d5 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Mon, 27 Sep 2021 15:10:14 +0200 Subject: [PATCH 4/7] [skip ci] Remove @HOSTS@ mentions --- doc/modules/mod_event_pusher_push.md | 8 ++++---- doc/tutorials/push-notifications/Push-notifications.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/modules/mod_event_pusher_push.md b/doc/modules/mod_event_pusher_push.md index b4ddfe87c8..8fec83c1e9 100644 --- a/doc/modules/mod_event_pusher_push.md +++ b/doc/modules/mod_event_pusher_push.md @@ -52,7 +52,7 @@ See the [relevant section](#plugin-module) for more details. * **Default:** `[]` * **Example:** `virtual_pubsub_hosts = ["host1", "host2"]` -The list of "simulated" Publish-Subscribe domains. You may use the `@HOSTS@` pattern in the domain name. +The list of "simulated" Publish-Subscribe domains. You may use the `@HOST@` pattern in the domain name. It will automatically be replaced by a respective XMPP domain (e.g. `localhost`). See the [relevant section](#virtual-pubsub-hosts) for more details. @@ -61,7 +61,7 @@ See the [relevant section](#virtual-pubsub-hosts) for more details. If a notification is published to one of the configured domains, the internal push notification hook is executed in MongooseIM instead of the XEP-0357 typical behaviour. If an existing PubSub domain is added to this list, it will be shadowed in the push notifications context. To ensure complete -shadowing of all the PubSub subdomains we must use the `@HOSTS@` pattern, otherwise only the +shadowing of all the PubSub subdomains we must use the `@HOST@` pattern, otherwise only the subdomain of the user is shadowed. It enables easy migration from PubSub-full deployments to PubSub-less variants. @@ -70,7 +70,7 @@ PubSub-less variants. This is an example of how you can migrate the existing setup to the new model. PubSub service still exists, just for the case of a user attempting to create a node. However, its domain is overridden for the purpose of sending push notifications. Please note the value of `virtual_pubsub_hosts` -option. `"pubsub.@HOSTS@"` is the default domain for `mod_pubsub`. +option. `"pubsub.@HOST@"` is the default domain for `mod_pubsub`. ```toml [modules.mod_pubsub] @@ -80,7 +80,7 @@ option. `"pubsub.@HOSTS@"` is the default domain for `mod_pubsub`. backend.push.backend = "mnesia" # optional backend.push.wpool.workers = 200 # optional backend.push.plugin_module = "mod_event_pusher_push_plugin_defaults" # optional - backend.push.virtual_pubsub_hosts = ["pubsub.@HOSTS@"] + backend.push.virtual_pubsub_hosts = ["pubsub.@HOST@"] ``` #### Advantages diff --git a/doc/tutorials/push-notifications/Push-notifications.md b/doc/tutorials/push-notifications/Push-notifications.md index cf695210ed..c5d58bba68 100644 --- a/doc/tutorials/push-notifications/Push-notifications.md +++ b/doc/tutorials/push-notifications/Push-notifications.md @@ -84,7 +84,7 @@ node. Check out [this][WithMongoosePush] tutorial on how to setup [MongoosePush] backend.push.backend = "mnesia" # optional backend.push.wpool.workers = 200 # optional backend.push.plugin_module = "mod_event_pusher_push_plugin_defaults" # optional - backend.push.virtual_pubsub_hosts = ["pubsub.@HOSTS@"] + backend.push.virtual_pubsub_hosts = ["pubsub.@HOST@"] ``` ### Advantages From be3fecd4c32353f38424393475d0bbcb6a5b9136 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Tue, 28 Sep 2021 10:57:44 +0200 Subject: [PATCH 5/7] [skip ci] Add license links --- doc/Contributions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Contributions.md b/doc/Contributions.md index c38455229d..6e5e826f74 100644 --- a/doc/Contributions.md +++ b/doc/Contributions.md @@ -43,7 +43,7 @@ See [esl/escalus](https://github.com/esl/escalus) on GitHub for more details. An XMPP client library in Erlang for conveniently testing XMPP servers -Apache license 2.0 +[Apache license 2.0](https://github.com/esl/escalus/blob/master/LICENSE) ### amoc @@ -51,7 +51,7 @@ See [esl/amoc](https://github.com/esl/amoc) on GitHub for more details. amoc is a simple tool for running massively parallel XMPP tests -Apache license 2.0 +[Apache license 2.0](https://github.com/esl/amoc/blob/master/LICENSE) !!! Info amoc stands for "A Murder of Crows" @@ -63,7 +63,7 @@ See [esl/amoc-arsenal-xmpp](https://github.com/esl/amoc-arsenal-xmpp) on GitHub A collection of scenarios for [amoc](#amoc), which we use to test MongooseIM. They can however be used to load test any XMPP server. -Apache license 2.0 +[Apache license 2.0](https://github.com/esl/amoc-arsenal-xmpp/blob/master/LICENSE) ### exml @@ -71,7 +71,7 @@ See [esl/exml](https://github.com/esl/exml) on GitHub for more details. XML parsing library in Erlang -Apache license 2.0 +[Apache license 2.0](https://github.com/esl/exml/blob/master/LICENSE) ### MongooseICE: ICE (STUN/TURN) server From c0e566fc0523a509ddd0bc71a43a927e15633a08 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Tue, 28 Sep 2021 10:58:35 +0200 Subject: [PATCH 6/7] Unify error descriptions --- doc/developers-guide/domain_management.md | 26 ++++++++++++++--------- doc/rest-api/Dynamic-domains_swagger.yml | 8 +++---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/doc/developers-guide/domain_management.md b/doc/developers-guide/domain_management.md index 5b50531311..30a1b70210 100644 --- a/doc/developers-guide/domain_management.md +++ b/doc/developers-guide/domain_management.md @@ -128,10 +128,11 @@ curl -v -X PUT "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - inserted. -* 403 - DB service disabled, or an unknown host type. -* 409 - domain already exists with a different host type. -* 500 - other errors. +* 204 - Domain was successfully inserted. +* 400 - Bad request. +* 403 - DB service disabled, or the host type is unknown. +* 409 - Domain already exists with a different host type. +* 500 - Other errors. Example of the result body with a failure reason: @@ -154,9 +155,13 @@ curl -v -X DELETE "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - the domain is removed or not found. -* 403 - the domain is static, the DB service is disabled, the host type is wrong (does not match the host type in the database), or the host type is unknown. -* 500 - other errors. +* 204 - The domain is removed or not found. +* 403 - One of: + * the domain is static. + * the DB service is disabled. + * the host type is wrong (does not match the host type in the database). + * the host type is unknown. +* 500 - Other errors. ### Enable/disable domain @@ -172,9 +177,10 @@ curl -v -X PATCH "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - updated. -* 403 - the domain is static, or the service is disabled. -* 404 - domain not found. +* 204 - Domain was successfully updated. +* 403 - Domain is static, or the service is disabled. +* 404 - Domain not found. +* 500 - Other errors. ## Command Line Interface diff --git a/doc/rest-api/Dynamic-domains_swagger.yml b/doc/rest-api/Dynamic-domains_swagger.yml index 677a05a40b..887ee848d0 100644 --- a/doc/rest-api/Dynamic-domains_swagger.yml +++ b/doc/rest-api/Dynamic-domains_swagger.yml @@ -42,7 +42,7 @@ paths: 204: description: Domain was successfully inserted. 400: - description: Bad request + description: Bad request. examples: application/json: {"what": "body is empty"} 409: @@ -50,7 +50,7 @@ paths: examples: application/json: {"what": "duplicate"} 403: - description: DB service disabled or the host type is unknown. + description: DB service disabled, or the host type is unknown. examples: application/json: {"what": "domain is static"} 500: @@ -79,7 +79,7 @@ paths: type: boolean responses: 204: - description: Domain was sucessfully updated. + description: Domain was successfully updated. 404: description: Domain not found. examples: @@ -141,6 +141,6 @@ paths: examples: application/json: {"what": "unknown host type"} 500: - description: "Other errors" + description: "Other errors." examples: application/json: {"what": "database error"} From 55f0dc3956ef908d9f50ad8cfdad0359128974a8 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Tue, 28 Sep 2021 11:57:59 +0200 Subject: [PATCH 7/7] Apply review --- doc/developers-guide/domain_management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developers-guide/domain_management.md b/doc/developers-guide/domain_management.md index 30a1b70210..e424349e29 100644 --- a/doc/developers-guide/domain_management.md +++ b/doc/developers-guide/domain_management.md @@ -142,7 +142,7 @@ Example of the result body with a failure reason: Check the `src/domain/mongoose_domain_handler.erl` file for the exact values of the `what` field if needed. -### Delete domain +### Remove domain You must provide the domain's host type inside the body: