diff --git a/authentik/admin/api/system.py b/authentik/admin/api/system.py index d8d0f80b4..16637067a 100644 --- a/authentik/admin/api/system.py +++ b/authentik/admin/api/system.py @@ -13,6 +13,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from authentik.core.api.utils import PassiveSerializer +from authentik.lib.config import CONFIG from authentik.lib.utils.reflection import get_env from authentik.outposts.apps import MANAGED_OUTPOST from authentik.outposts.models import Outpost @@ -39,6 +40,7 @@ class SystemInfoSerializer(PassiveSerializer): runtime = SerializerMethodField() brand = SerializerMethodField() server_time = SerializerMethodField() + embedded_outpost_disabled = SerializerMethodField() embedded_outpost_host = SerializerMethodField() def get_http_headers(self, request: Request) -> dict[str, str]: @@ -77,6 +79,10 @@ class SystemInfoSerializer(PassiveSerializer): """Current server time""" return now() + def get_embedded_outpost_disabled(self, request: Request) -> bool: + """Whether the embedded outpost is disabled""" + return CONFIG.get_bool("outposts.disable_embedded_outpost", False) + def get_embedded_outpost_host(self, request: Request) -> str: """Get the FQDN configured on the embedded outpost""" outposts = Outpost.objects.filter(managed=MANAGED_OUTPOST) diff --git a/schema.yml b/schema.yml index d0de034a6..c6522f96d 100644 --- a/schema.yml +++ b/schema.yml @@ -43495,8 +43495,12 @@ components: type: string description: Get the FQDN configured on the embedded outpost readOnly: true + embedded_outpost_disabled: + type: boolean + readOnly: true required: - brand + - embedded_outpost_disabled - embedded_outpost_host - http_headers - http_host diff --git a/web/src/admin/admin-overview/cards/SystemStatusCard.ts b/web/src/admin/admin-overview/cards/SystemStatusCard.ts index 7c6ac276c..ee5449fcf 100644 --- a/web/src/admin/admin-overview/cards/SystemStatusCard.ts +++ b/web/src/admin/admin-overview/cards/SystemStatusCard.ts @@ -22,7 +22,10 @@ export class SystemStatusCard extends AdminStatusCard { async getPrimaryValue(): Promise { this.now = new Date(); let status = await new AdminApi(DEFAULT_CONFIG).adminSystemRetrieve(); - if (status.embeddedOutpostHost === "" || !status.embeddedOutpostHost.includes("http")) { + if ( + !status.embeddedOutpostDisabled && + (status.embeddedOutpostHost === "" || !status.embeddedOutpostHost.includes("http")) + ) { // First install, ensure the embedded outpost host is set // also run when outpost host does not contain http // (yes it's called host and requires a URL, i know) @@ -51,7 +54,7 @@ export class SystemStatusCard extends AdminStatusCard { } getStatus(value: SystemInfo): Promise { - if (value.embeddedOutpostHost === "") { + if (!value.embeddedOutpostDisabled && value.embeddedOutpostHost === "") { this.statusSummary = msg("Warning"); return Promise.resolve({ icon: "fa fa-exclamation-triangle pf-m-warning",