From c2e444249a14788aeb11517c8c77d0853b96e000 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 25 Oct 2023 20:21:06 +0000 Subject: [PATCH] add helper --- api/tacticalrmm/core/management/commands/get_config.py | 7 +++++++ api/tacticalrmm/tacticalrmm/constants.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/api/tacticalrmm/core/management/commands/get_config.py b/api/tacticalrmm/core/management/commands/get_config.py index 4374228d..f9a4fa20 100644 --- a/api/tacticalrmm/core/management/commands/get_config.py +++ b/api/tacticalrmm/core/management/commands/get_config.py @@ -4,6 +4,7 @@ from django.conf import settings from django.core.management.base import BaseCommand from tacticalrmm.helpers import get_webdomain +from tacticalrmm.utils import get_certs class Command(BaseCommand): @@ -59,3 +60,9 @@ class Command(BaseCommand): obj = core.mesh_token self.stdout.write(obj) + case "certfile" | "keyfile": + crt, key = get_certs() + if kwargs["name"] == "certfile": + self.stdout.write(crt) + elif kwargs["name"] == "keyfile": + self.stdout.write(key) diff --git a/api/tacticalrmm/tacticalrmm/constants.py b/api/tacticalrmm/tacticalrmm/constants.py index 568287e2..85a77013 100644 --- a/api/tacticalrmm/tacticalrmm/constants.py +++ b/api/tacticalrmm/tacticalrmm/constants.py @@ -450,4 +450,6 @@ CONFIG_MGMT_CMDS = ( "meshuser", "meshtoken", "meshdomain", + "certfile", + "keyfile", )