Я пытаюсь настроить mosquitto- go -auth для postgresql и хочу протестировать сквозное, так упомянутое ниже, все шаги, которые я пробовал. Прошел https://github.com/iegomez/mosquitto-go-auth/ и попытался построить docker образ, используя docker -compose.yml, который есть в репо. В docker -compose.yml:
version: "3"
services:
postgres:
image: postgres:9.0
volumes:
- psql:/var/lib/postgresql/data
environment:
- 'POSTGRES_DB:appserver'
- 'POSTGRES_USER:appserver'
- 'POSTGRES_PASSWORD:appserver'
ports:
- "5435:5432"
mosquitto:
image: iegomez/mosquitto-go-auth:0.5.0
volumes:
- ./conf:/etc/mosquitto
ports:
- 1883:1883
volumes:
psql:
И у меня также есть изменения в conf / go -auth.conf.
auth_opt_log_level debug
auth_opt_backends files
auth_opt_check_prefix false
auth_opt_password_path /etc/mosquitto/auth/passwords
auth_opt_acl_path /etc/mosquitto/auth/acls
auth_opt_pg_host localhost
auth_opt_pg_port 5432
auth_opt_pg_dbname appserver
auth_opt_pg_user appserver
auth_opt_pg_password appserver
auth_opt_pg_userquery select password_hash from "user" where username = $1 and is_active = true limit 1
В пароле:
test:PBKDF2$sha512$100000$os24lcPr9cJt2QDVWssblQ==$BK1BQ2wbwU1zNxv3Ml3wLuu5//hPop3/LvaPYjjCwdBvnpwusnukJPpcXQzyyjOlZdieXTx6sXAcX4WnZRZZnw==
У меня есть файл mqtt_publi sh, который обычно выполняет аутентификацию, подключается к брокеру и публикует sh на topi c. В публичном sh .py файле:
client.username_pw_set("test","testpw")
Но появляется ошибка, например, невозможность аутентификации.
time="2020-01-27T10:19:25Z" level=debug msg="checking auth cache for test"
time="2020-01-27T10:19:25Z" level=debug msg="checking user test with backend Files"
time="2020-01-27T10:19:25Z" level=warning msg="wrong password for user test\n"
Пожалуйста, помогите.