Merge pull request #27131 from richardlarocque/mosquitto_pw
mosquitto: Explicitly configure password file
This commit is contained in:
commit
ed250d8093
@ -12,6 +12,10 @@ let
|
|||||||
keyfile ${cfg.ssl.keyfile}
|
keyfile ${cfg.ssl.keyfile}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passwordConf = optionalString cfg.checkPasswords ''
|
||||||
|
password_file ${cfg.dataDir}/passwd
|
||||||
|
'';
|
||||||
|
|
||||||
mosquittoConf = pkgs.writeText "mosquitto.conf" ''
|
mosquittoConf = pkgs.writeText "mosquitto.conf" ''
|
||||||
pid_file /run/mosquitto/pid
|
pid_file /run/mosquitto/pid
|
||||||
acl_file ${aclFile}
|
acl_file ${aclFile}
|
||||||
@ -19,6 +23,7 @@ let
|
|||||||
allow_anonymous ${boolToString cfg.allowAnonymous}
|
allow_anonymous ${boolToString cfg.allowAnonymous}
|
||||||
bind_address ${cfg.host}
|
bind_address ${cfg.host}
|
||||||
port ${toString cfg.port}
|
port ${toString cfg.port}
|
||||||
|
${passwordConf}
|
||||||
${listenerConf}
|
${listenerConf}
|
||||||
${cfg.extraConf}
|
${cfg.extraConf}
|
||||||
'';
|
'';
|
||||||
@ -153,6 +158,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkPasswords = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Refuse connection when clients provide incorrect passwords.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraConf = mkOption {
|
extraConf = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
Loading…
Reference in New Issue
Block a user