Skip to content

Commit

Permalink
fix: align ee settings to include huey (#1448)
Browse files Browse the repository at this point in the history
* Align EE settings

* Fix languages
  • Loading branch information
ab-smith authored Jan 29, 2025
1 parent f02055e commit 5333e14
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion enterprise/backend/enterprise_core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def set_ciso_assistant_url(_, __, event_dict):

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get("DJANGO_DEBUG", "False") == "True"
MAIL_DEBUG = os.environ.get("MAIL_DEBUG", "False") == "True"

logger.info("DEBUG mode: %s", DEBUG)
logger.info("CISO_ASSISTANT_URL: %s", CISO_ASSISTANT_URL)
Expand Down Expand Up @@ -157,6 +158,7 @@ def set_ciso_assistant_url(_, __, event_dict):
"allauth.socialaccount",
"allauth.socialaccount.providers.saml",
"allauth.mfa",
"huey.contrib.djhuey",
]

MIDDLEWARE = [
Expand Down Expand Up @@ -308,9 +310,16 @@ def set_ciso_assistant_url(_, __, event_dict):
("es", "Spanish"),
("de", "German"),
("it", "Italian"),
("nd", "Dutch"),
("nl", "Dutch"),
("pl", "Polish"),
("pt", "Portuguese"),
("ar", "Arabic"),
("ro", "Romanian"),
("hi", "Hindi"),
("ur", "Urdu"),
("cs", "Czech"),
("sv", "Swedish"),
("id", "Indonesian"),
]

PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -339,6 +348,7 @@ def set_ciso_assistant_url(_, __, event_dict):
"PASSWORD": os.environ["POSTGRES_PASSWORD"],
"HOST": os.environ["DB_HOST"],
"PORT": os.environ.get("DB_PORT", "5432"),
"CONN_MAX_AGE": os.environ.get("CONN_MAX_AGE", 300),
}
}
else:
Expand Down Expand Up @@ -427,3 +437,19 @@ def set_ciso_assistant_url(_, __, event_dict):
logger.info("License information", seats=LICENSE_SEATS, expiration=LICENSE_EXPIRATION)

INSTALLED_APPS.append("enterprise_core")

if MAIL_DEBUG:
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
DEFAULT_FROM_EMAIL = "[email protected]"


## Huey settings
HUEY_FILE_PATH = os.environ.get("HUEY_FILE_PATH", BASE_DIR / "db" / "huey.db")

HUEY = {
"huey_class": "huey.SqliteHuey",
"name": "ciso_assistant",
"filename": HUEY_FILE_PATH,
"results": True, # would be interesting for debug
"immediate": False, # set to False to run in "live" mode regardless of DEBUG, otherwise it will follow
}

0 comments on commit 5333e14

Please sign in to comment.