diff --git a/api/tacticalrmm/tacticalrmm/utils.py b/api/tacticalrmm/tacticalrmm/utils.py index 288f5993..724de34a 100644 --- a/api/tacticalrmm/tacticalrmm/utils.py +++ b/api/tacticalrmm/tacticalrmm/utils.py @@ -91,21 +91,17 @@ def reload_nats(): f"{agent.hostname} does not have a user account, NATS will not work" ) - if not settings.DOCKER_BUILD: - domain = settings.ALLOWED_HOSTS[0].split(".", 1)[1] - if hasattr(settings, "CERT_FILE") and hasattr(settings, "KEY_FILE"): - if os.path.exists(settings.CERT_FILE) and os.path.exists(settings.KEY_FILE): - cert_file = settings.CERT_FILE - key_file = settings.KEY_FILE - else: - cert_file = f"/etc/letsencrypt/live/{domain}/fullchain.pem" - key_file = f"/etc/letsencrypt/live/{domain}/privkey.pem" + domain = settings.ALLOWED_HOSTS[0].split(".", 1)[1] + if hasattr(settings, "CERT_FILE") and hasattr(settings, "KEY_FILE"): + if os.path.exists(settings.CERT_FILE) and os.path.exists(settings.KEY_FILE): + cert_file = settings.CERT_FILE + key_file = settings.KEY_FILE else: cert_file = f"/etc/letsencrypt/live/{domain}/fullchain.pem" key_file = f"/etc/letsencrypt/live/{domain}/privkey.pem" else: - cert_file = f"/opt/tactical/certs/fullchain.pem" - key_file = f"/opt/tactical/certs/privkey.pem" + cert_file = f"/etc/letsencrypt/live/{domain}/fullchain.pem" + key_file = f"/etc/letsencrypt/live/{domain}/privkey.pem" config = { "tls": { diff --git a/docker/containers/tactical/entrypoint.sh b/docker/containers/tactical/entrypoint.sh index 34708b27..5e095a7b 100644 --- a/docker/containers/tactical/entrypoint.sh +++ b/docker/containers/tactical/entrypoint.sh @@ -69,6 +69,9 @@ DEBUG = False DOCKER_BUILD = True +CERT_FILE = '/opt/tactical/certs/fullchain.pem' +CERT_KEY = '/opt/tactical/certs/privkey.pem' + SCRIPTS_DIR = '/opt/tactical/scripts' ALLOWED_HOSTS = ['${API_HOST}']