From d71ee194e11d3b7edcd08ca855bed7de89dcf5bd Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 18 Oct 2022 00:12:57 +0000 Subject: [PATCH] add optional nats monitoring --- api/tacticalrmm/tacticalrmm/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/tacticalrmm/tacticalrmm/utils.py b/api/tacticalrmm/tacticalrmm/utils.py index ef730fa6..66283707 100644 --- a/api/tacticalrmm/tacticalrmm/utils.py +++ b/api/tacticalrmm/tacticalrmm/utils.py @@ -209,6 +209,11 @@ def reload_nats() -> None: }, } + if "NATS_HTTP_PORT" in os.environ: + config["http_port"] = int(os.getenv("NATS_HTTP_PORT")) # type: ignore + elif hasattr(settings, "NATS_HTTP_PORT"): + config["http_port"] = settings.NATS_HTTP_PORT # type: ignore + conf = os.path.join(settings.BASE_DIR, "nats-rmm.conf") with open(conf, "w") as f: json.dump(config, f)