-
Notifications
You must be signed in to change notification settings - Fork 0
/
mosquitto.conf
30 lines (24 loc) · 897 Bytes
/
mosquitto.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Plain MQTT protocol
listener 1883
protocol mqtt
# Plain WebSockets configuration
listener 8000
protocol websockets
auth_plugin /mosquitto/go-auth.so
auth_opt_log_level debug
auth_opt_backends postgres
auth_opt_check_prefix false
allow_anonymous false
# Postgres configuration
auth_opt_pg_host db
auth_opt_pg_port 5432
auth_opt_pg_dbname auth_db
auth_opt_pg_user auth_db_admin
auth_opt_pg_password 123456
auth_opt_pg_connect_tries 5
auth_opt_pg_sslmode disable
auth_opt_pg_userquery SELECT "passwordHash" FROM "MqttUsers" WHERE "userName" = $1 and "isActive" = true limit 1
auth_opt_pg_aclquery SELECT "topic" FROM "MqttAcls" acl JOIN "MqttUsers" "user" on acl."userId" = "user".id WHERE "user"."userName" = $1 and (acl.rw = $2 or acl.rw = 999)
auth_opt_pg_superquery SELECT count(*) FROM "MqttUsers" WHERE "userName" = $1 and "isAdmin" = true
auth_opt_hasher bcrypt
auth_opt_hasher_cost 10