Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering of domain management docs, note table of contents #3162

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 27 additions & 33 deletions doc/developers-guide/domain_management.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MongooseIM core component
## MongooseIM core component

Implemented by `mongoose_domain_core` module.

Expand Down Expand Up @@ -42,7 +42,7 @@ It must provide the following interfaces:
- Static domains are not replicated.
- Static domains has priority above DB domains.

# MongooseIM service
## MongooseIM service

Implements the service behaviour.
Implemented by `service_domain_db` module.
Expand Down Expand Up @@ -102,28 +102,37 @@ Configure host-type first to delete such domains.
## Service options

### `event_cleaning_interval`

The number of seconds between cleaning attempts of the `domain_events` table.

* **Syntax:** positive integer
* **Default:** `1800` (30 minutes)
* **Example:** `event_cleaning_interval = 1800`

### `event_max_age`

The number of seconds after an event must be deleted from the `domain_events` table.

* **Syntax:** positive integer
* **Default:** `7200` (2 hours)
* **Example:** `event_max_age = 7200`

# REST API
## REST API

Provides API for adding/removing and enabling/disabling domains over HTTP.

Implemented by `mongoose_domain_handler` module.

Configuration example:
### `listen.http.handlers.mongoose_domain_handler.username`
* **Syntax:** string
* **Default:** not set
* **Example:** `username = "admin"`

When set, enables authentication to access this endpoint. Requires setting `password`.

### `listen.http.handlers.mongoose_domain_handler.password`
* **Syntax:** string
* **Default:** not set
* **Example:** `password = "secret"`

Required to enable authentication for this endpoint.

### Example configuration

```toml
[[listen.http]]
Expand All @@ -139,22 +148,7 @@ Configuration example:
password = "secret"
```

#### `listen.http.handlers.mongoose_domain_handler.username`
* **Syntax:** string
* **Default:** not set
* **Example:** `username = "admin"`

When set, enables authentication to access this endpoint. Requires setting `password`.

#### `listen.http.handlers.mongoose_domain_handler.password`
* **Syntax:** string
* **Default:** not set
* **Example:** `password = "secret"`

Required to enable authentication for this endpoint.


## Add domain
### Add domain

```bash
curl -v -X PUT "http://localhost:8088/api/domains/example.db" \
Expand All @@ -180,7 +174,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
### Delete domain

You must provide the domain's host type inside the body:

Expand All @@ -201,7 +195,7 @@ Result codes:
* 500 - other errors.


## Enable/disable domain
### Enable/disable domain

Provide `{"enabled": true}` as a body to enable a domain.
Provide `{"enabled": false}` as a body to disable a domain.
Expand All @@ -221,37 +215,37 @@ Result codes:
* 403 - service disabled.


# Command Line Interface
## Command Line Interface

Implemented by `service_admin_extra_domain` module.

Configuration example:
### Configuration example:

```toml
[services.service_admin_extra]
submods = ["node", "accounts", "sessions", "vcard", "gdpr", "upload",
"roster", "last", "private", "stanza", "stats", "domain"]
```

Add domain:
### Add domain:

```
./mongooseimctl insert_domain domain host_type
```

Delete domain:
### Delete domain:

```
./mongooseimctl delete_domain domain host_type
```

Disable domain:
### Disable domain:

```
./mongooseimctl disable_domain domain
```

Enable domain:
### Enable domain:

```
./mongooseimctl enable_domain domain
Expand Down