diff --git a/api/tacticalrmm/core/tests.py b/api/tacticalrmm/core/tests.py index f60498d33c..985b00a267 100644 --- a/api/tacticalrmm/core/tests.py +++ b/api/tacticalrmm/core/tests.py @@ -449,7 +449,7 @@ def setUp(self): self.setup_coresettings() def test_standard_install(self): - self.assertEqual(get_nats_url(), "nats://localhost:4222") + self.assertEqual(get_nats_url(), "nats://127.0.0.1:4222") @override_settings( NATS_STANDARD_PORT=5000, @@ -469,7 +469,7 @@ def test_custom_connect_host_env(self): self.assertEqual(get_nats_url(), "nats://172.20.4.3:4222") def test_standard_nats_hosts(self): - self.assertEqual(get_nats_hosts(), ("localhost", "localhost", "localhost")) + self.assertEqual(get_nats_hosts(), ("127.0.0.1", "127.0.0.1", "127.0.0.1")) @override_settings(DOCKER_BUILD=True, ALLOWED_HOSTS=["api.example.com"]) def test_docker_nats_hosts(self): diff --git a/api/tacticalrmm/tacticalrmm/helpers.py b/api/tacticalrmm/tacticalrmm/helpers.py index c3d86fbc17..a54aecb56b 100644 --- a/api/tacticalrmm/tacticalrmm/helpers.py +++ b/api/tacticalrmm/tacticalrmm/helpers.py @@ -58,9 +58,9 @@ def get_nats_hosts() -> tuple[str, str, str]: # standard install if not settings.DOCKER_BUILD and not getattr(settings, "USE_NATS_STANDARD", False): std_bind_host, ws_bind_host, connect_host = ( - "localhost", - "localhost", - "localhost", + "127.0.0.1", + "127.0.0.1", + "127.0.0.1", ) # allow customizing all nats hosts