Skip to content

Commit

Permalink
doc: add config explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWaWaR committed Sep 25, 2023
1 parent 8503adb commit 87f9b15
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Cargo.lock
# Added by cargo

/target

.DS_Store
1 change: 1 addition & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Akasa 用 [glommio][glommio] 来实现高性能低延迟的网络 IO. 它底层

```shell
git clone https://github.com/akasamq/akasa.git && cd akasa
# 可能你需要先安装 openssl: https://docs.rs/openssl/latest/openssl/#automatic
cargo build --release

./target/release/akasa --help
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ It uses [glommio][glommio] for high performance and low latency network IO. The

```shell
git clone https://github.com/akasamq/akasa.git && cd akasa
# You may also need to install openssl: https://docs.rs/openssl/latest/openssl/#automatic
cargo build --release

./target/release/akasa --help
Expand All @@ -33,6 +34,10 @@ cargo build --release
# help Print this message or the help of the given subcommand(s)
```

For more documentation:

- [Config Options Explanation](docs/english/config.md)

## Benchmark
TODO

Expand Down
98 changes: 98 additions & 0 deletions docs/english/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@


## Config Options Explanation
```yaml
# Network Listeners
listeners:
# (optional) Listen on TCP socket
mqtt:
# The socket address
addr: 127.0.0.1:1883
# (optional) proxy protocol mode, can be:
# null : Disable proxy protocol
# Normal : Client side non-TLS, server side non-TLS
# TlsTermination : Client side TLS, proxy handle TLS, server side non-TLS (read host name(SNI) from proxy protocol header)
proxy_mode: null
# (optional) Listen on TCP socket with TLS
mqtts:
# The socket address
addr: 127.0.0.1:8883
# Enable proxy protocol v2 or not
proxy: false
# This CA file is for verify client certificate, if `verify_peer` is true this field MUST be presented.
ca_file: /path/to/mqtts.ca
# key file
key_file: /path/to/mqtts.key
# cert file
cert_file: /path/to/mqtts.cert
# Verifies that the peer’s certificate is trusted.
verify_peer: true
# Abort the handshake if the client did not send a certificate. This should be paired with `verify_peer`.
fail_if_no_peer_cert: true
# (same with `listeners.mqtt`) WebSocket listener
ws: null
# (same with `listeners.mqtts`) WebSocket with TLS listener
wss: null
# Check username/password in connect packet
auth:
enable: true
# The password file, use insert-password/remove-password subcommand to manage the passwords
password_file: /path/to/passwords/file

# (v5.0 only) Scram users used in MQTT v5.0 enhanced authentication.
# To generate the hashed password: https://github.com/akasamq/akasa/blob/8503adb566c46074d57bfea8dbe39a6fd3403e28/akasa-core/src/tests/protocols/mqtt/v5/v500/auth.rs#L21-L24
scram_users:
user:
hashed_password: 2a2a2a
iterations: 4096
salt: 73616c74
# (v5.0 only) The sasl mechanisms supported in MQTT v5.0 enhanced authentication, now only `SCRAM-SHA-256` is supported
sasl_mechanisms:
- SCRAM-SHA-256

# When client connect with MQTT v3.1 protocol, if set this option to true, akasa will forbid client identifier length greater than 23.
check_v310_client_id_length: false
# (v5.0 only) The shared subscription mode, can be: [Random, HashClientId, HashTopicName]
shared_subscription_mode: Random
# Maximum allowed QoS the client can publish or subscribe
max_allowed_qos: 2
# Timeout seconds to resend inflight pending messages
inflight_timeout: 15
# Maximum inflight pending messages for client default value
max_inflight_client: 10
# Maximum inflight pending messages the server will handle
max_inflight_server: 10
# Maximum allowed pending messages in memory
max_in_mem_pending_messages: 256
# (unused) Maximum allowed pending messages in database
max_in_db_pending_messages: 65536
# (v5.0 only) The minimum allowed keep alive config
min_keep_alive: 10
# (v5.0 only) The maximum allowed keep alive config
max_keep_alive: 65535
# (v5.0 only, unused)
multiple_subscription_id_in_publish: false
# (v5.0 only) The maximum session expiry interval value can set in connect packet
max_session_expiry_interval: 4294967295
# (v5.0 only) The maximum packet size given by client (to limit server)
max_packet_size_client: 268435460
# (v5.0 only) The maximum packet size given by server (to limit client)
max_packet_size_server: 268435460
# (v5.0 only) The maximum topic alias value can be used in publish packet
topic_alias_max: 65535
# (v5.0 only) Whether support retained message
retain_available: true
# (v5.0 only) Whether support shared subscription
shared_subscription_available: true
# (v5.0 only) Whether support subscription identifiers
subscription_id_available: true
# (v5.0 only) Whether supports wildcard subscriptions
wildcard_subscription_available: true
# The value indicate whether call certain hook function
hook:
enable_before_connect: true
enable_after_connect: true
enable_publish: true
enable_subscribe: true
enable_unsubscribe: true
```
Empty file added docs/english/getting-started.md
Empty file.

0 comments on commit 87f9b15

Please sign in to comment.