add setting override to disable sso

This commit is contained in:
wh1te909 2024-11-16 19:28:28 +00:00
parent d1df40633a
commit 91c33b0431
4 changed files with 13 additions and 4 deletions

View File

@ -24,8 +24,6 @@ register_converter(AgentIDConverter, "agent")
urlpatterns = [ urlpatterns = [
path("", home), path("", home),
# all auth urls
path("_allauth/", include(allauth_urls)),
path("v2/checkcreds/", CheckCredsV2.as_view()), path("v2/checkcreds/", CheckCredsV2.as_view()),
path("v2/login/", LoginViewV2.as_view()), path("v2/login/", LoginViewV2.as_view()),
path("logout/", knox_views.LogoutView.as_view()), path("logout/", knox_views.LogoutView.as_view()),
@ -44,10 +42,15 @@ urlpatterns = [
path("scripts/", include("scripts.urls")), path("scripts/", include("scripts.urls")),
path("alerts/", include("alerts.urls")), path("alerts/", include("alerts.urls")),
path("accounts/", include("accounts.urls")), path("accounts/", include("accounts.urls")),
path("accounts/", include("ee.sso.urls")),
path("reporting/", include("ee.reporting.urls")), path("reporting/", include("ee.reporting.urls")),
] ]
if not getattr(settings, "TRMM_DISABLE_SSO", False):
urlpatterns += (
path("_allauth/", include(allauth_urls)),
path("accounts/", include("ee.sso.urls")),
)
if getattr(settings, "BETA_API_ENABLED", False): if getattr(settings, "BETA_API_ENABLED", False):
urlpatterns += (path("beta/v1/", include("beta.v1.urls")),) urlpatterns += (path("beta/v1/", include("beta.v1.urls")),)

View File

@ -30,3 +30,6 @@ TRMM_DISABLE_WEB_TERMINAL=False
# disable server side scripts # disable server side scripts
TRMM_DISABLE_SERVER_SCRIPTS=False TRMM_DISABLE_SERVER_SCRIPTS=False
# disable sso
TRMM_DISABLE_SSO=False

View File

@ -20,6 +20,7 @@ set -e
: "${SKIP_UWSGI_CONFIG:=0}" : "${SKIP_UWSGI_CONFIG:=0}"
: "${TRMM_DISABLE_WEB_TERMINAL:=False}" : "${TRMM_DISABLE_WEB_TERMINAL:=False}"
: "${TRMM_DISABLE_SERVER_SCRIPTS:=False}" : "${TRMM_DISABLE_SERVER_SCRIPTS:=False}"
: "${TRMM_DISABLE_SSO:=False}"
: "${CERT_PRIV_PATH:=${TACTICAL_DIR}/certs/privkey.pem}" : "${CERT_PRIV_PATH:=${TACTICAL_DIR}/certs/privkey.pem}"
: "${CERT_PUB_PATH:=${TACTICAL_DIR}/certs/fullchain.pem}" : "${CERT_PUB_PATH:=${TACTICAL_DIR}/certs/fullchain.pem}"
@ -120,6 +121,7 @@ MESH_WS_URL = '${MESH_WS_URL}'
ADMIN_ENABLED = False ADMIN_ENABLED = False
TRMM_DISABLE_WEB_TERMINAL = ${TRMM_DISABLE_WEB_TERMINAL} TRMM_DISABLE_WEB_TERMINAL = ${TRMM_DISABLE_WEB_TERMINAL}
TRMM_DISABLE_SERVER_SCRIPTS = ${TRMM_DISABLE_SERVER_SCRIPTS} TRMM_DISABLE_SERVER_SCRIPTS = ${TRMM_DISABLE_SERVER_SCRIPTS}
TRMM_DISABLE_SSO = ${TRMM_DISABLE_SSO}
EOF EOF
)" )"

View File

@ -64,6 +64,7 @@ services:
TRMM_PASS: ${TRMM_PASS} TRMM_PASS: ${TRMM_PASS}
TRMM_DISABLE_WEB_TERMINAL: ${TRMM_DISABLE_WEB_TERMINAL} TRMM_DISABLE_WEB_TERMINAL: ${TRMM_DISABLE_WEB_TERMINAL}
TRMM_DISABLE_SERVER_SCRIPTS: ${TRMM_DISABLE_SERVER_SCRIPTS} TRMM_DISABLE_SERVER_SCRIPTS: ${TRMM_DISABLE_SERVER_SCRIPTS}
TRMM_DISABLE_SSO: ${TRMM_DISABLE_SSO}
depends_on: depends_on:
- tactical-postgres - tactical-postgres
- tactical-meshcentral - tactical-meshcentral