The following commit contains the fix for ZeroMQ only listening on 0.0.0.0
pull/7053/head
eCrimeLabs 2021-02-21 14:50:43 +01:00
parent 7d9251e7ad
commit bc04f6966d
3 changed files with 12 additions and 2 deletions

View File

@ -273,6 +273,7 @@ class PubSubTool
'redis_password' => '',
'redis_database' => '1',
'redis_namespace' => 'mispq',
'host' => '127.0.0.1',
'port' => '50000',
'username' => null,
'password' => null,

View File

@ -6220,6 +6220,15 @@ class Server extends AppModel
'type' => 'boolean',
'afterHook' => 'zmqAfterHook',
),
'ZeroMQ_host' => array(
'level' => 2,
'description' => __('The host that the pub/sub feature will use.'),
'value' => '127.0.0.1',
'errorMessage' => '',
'test' => 'testForEmpty',
'type' => 'string',
'afterHook' => 'zmqAfterHook',
),
'ZeroMQ_port' => array(
'level' => 2,
'description' => __('The port that the pub/sub feature will use.'),

View File

@ -102,8 +102,8 @@ class MispZmq:
self.socket = context.socket(zmq.PUB)
if self.settings["username"]:
self.socket.plain_server = True # must come before bind
self.socket.bind("tcp://*:{}".format(self.settings["port"]))
self._logger.debug("ZMQ listening on tcp://*:{}".format(self.settings["port"]))
self.socket.bind("tcp://{}:{}".format(self.settings["host"], self.settings["port"]))
self._logger.debug("ZMQ listening on tcp://{}:{}".format(self.settings["host"], self.settings["port"]))
if self._logger.isEnabledFor(logging.DEBUG):
monitor = self.socket.get_monitor_socket()