mirror of
https://github.com/vimagick/dockerfiles.git
synced 2024-12-23 01:39:27 +02:00
99 lines
2.1 KiB
Plaintext
99 lines
2.1 KiB
Plaintext
# #============================================================
|
|
# # NanoMQ Broker
|
|
# #============================================================
|
|
|
|
mqtt {
|
|
property_size = 32
|
|
max_packet_size = 10KB
|
|
max_mqueue_len = 2048
|
|
retry_interval = 10s
|
|
keepalive_multiplier = 1.25
|
|
}
|
|
|
|
listeners.tcp {
|
|
bind = "0.0.0.0:1883"
|
|
}
|
|
|
|
# listeners.ssl {
|
|
# bind = "0.0.0.0:8883"
|
|
# keyfile = "/etc/certs/key.pem"
|
|
# certfile = "/etc/certs/cert.pem"
|
|
# cacertfile = "/etc/certs/cacert.pem"
|
|
# verify_peer = false
|
|
# fail_if_no_peer_cert = false
|
|
# }
|
|
|
|
listeners.ws {
|
|
bind = "0.0.0.0:8083/mqtt"
|
|
}
|
|
|
|
http_server {
|
|
port = 8081
|
|
limit_conn = 2
|
|
username = admin
|
|
password = public
|
|
auth_type = basic
|
|
jwt {
|
|
public.keyfile = "/etc/nanomq/jwtRS256.key.pub"
|
|
}
|
|
}
|
|
|
|
log {
|
|
to = [file, console]
|
|
level = warn
|
|
dir = "/var/log/nanomq"
|
|
file = "nanomq.log"
|
|
rotation {
|
|
size = 10MB
|
|
count = 5
|
|
}
|
|
}
|
|
|
|
auth {
|
|
allow_anonymous = true
|
|
no_match = allow
|
|
deny_action = ignore
|
|
cache = {
|
|
max_size = 32
|
|
ttl = 1m
|
|
}
|
|
password = {include "/etc/nanomq/pwd.conf"}
|
|
acl = {include "/etc/nanomq/acl.conf"}
|
|
}
|
|
|
|
sqlite {
|
|
disk_cache_size = 102400 # Max number of messages for caching
|
|
mounted_file_path = "/var/lib/nanomq" # Mounted file path
|
|
flush_mem_threshold = 100 # The threshold number of flushing messages to flash
|
|
resend_interval = 5000 # Resend interval (ms)
|
|
}
|
|
|
|
# rules.sqlite = {
|
|
# path = "/var/lib/nanomq/test.db"
|
|
# rules = [
|
|
# {
|
|
# sql = "SELECT topic, payload FROM \"test\""
|
|
# table = "test"
|
|
# }
|
|
# ]
|
|
# }
|
|
|
|
# webhook = {
|
|
# url = "https://httpbin.org/post"
|
|
# headers.content-type = "application/json"
|
|
# body.encoding = "plain"
|
|
# pool_size = 32
|
|
# events = [
|
|
# {
|
|
# event = "on_client_connack"
|
|
# }
|
|
# {
|
|
# event = "on_client_disconnected"
|
|
# }
|
|
# {
|
|
# event = "on_message_publish"
|
|
# topic = "a/b/c"
|
|
# }
|
|
# ]
|
|
# }
|