Skip to content

Commit

Permalink
handle localhost bind issues on some instances
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Feb 6, 2024
1 parent fb83f84 commit 94649cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/tacticalrmm/core/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions api/tacticalrmm/tacticalrmm/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94649cb

Please sign in to comment.