Skip to content

Commit

Permalink
add setting override to disable sso
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Nov 16, 2024
1 parent d1df406 commit 91c33b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
9 changes: 6 additions & 3 deletions api/tacticalrmm/tacticalrmm/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def to_url(self, value):

urlpatterns = [
path("", home),
# all auth urls
path("_allauth/", include(allauth_urls)),
path("v2/checkcreds/", CheckCredsV2.as_view()),
path("v2/login/", LoginViewV2.as_view()),
path("logout/", knox_views.LogoutView.as_view()),
Expand All @@ -44,10 +42,15 @@ def to_url(self, value):
path("scripts/", include("scripts.urls")),
path("alerts/", include("alerts.urls")),
path("accounts/", include("accounts.urls")),
path("accounts/", include("ee.sso.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):
urlpatterns += (path("beta/v1/", include("beta.v1.urls")),)

Expand Down
5 changes: 4 additions & 1 deletion docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VERSION=latest
TRMM_USER=tactical
TRMM_PASS=tactical

# optional web port override settings
# optional web port override settings
TRMM_HTTP_PORT=80
TRMM_HTTPS_PORT=443

Expand All @@ -30,3 +30,6 @@ TRMM_DISABLE_WEB_TERMINAL=False

# disable server side scripts
TRMM_DISABLE_SERVER_SCRIPTS=False

# disable sso
TRMM_DISABLE_SSO=False
2 changes: 2 additions & 0 deletions docker/containers/tactical/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -e
: "${SKIP_UWSGI_CONFIG:=0}"
: "${TRMM_DISABLE_WEB_TERMINAL:=False}"
: "${TRMM_DISABLE_SERVER_SCRIPTS:=False}"
: "${TRMM_DISABLE_SSO:=False}"

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

Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ services:
TRMM_PASS: ${TRMM_PASS}
TRMM_DISABLE_WEB_TERMINAL: ${TRMM_DISABLE_WEB_TERMINAL}
TRMM_DISABLE_SERVER_SCRIPTS: ${TRMM_DISABLE_SERVER_SCRIPTS}
TRMM_DISABLE_SSO: ${TRMM_DISABLE_SSO}
depends_on:
- tactical-postgres
- tactical-meshcentral
Expand Down

0 comments on commit 91c33b0

Please sign in to comment.