From c025d64ba387ac8bf3912984de69bd560fa9864d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 8 Aug 2021 16:57:56 +0200 Subject: [PATCH] outpost: revert managed config, make authentik_host field optional Signed-off-by: Jens Langhammer --- authentik/outposts/managed.py | 18 +++++++++++------- authentik/outposts/models.py | 6 +----- web/src/locales/en.po | 9 ++++++--- web/src/locales/pseudo-LOCALE.po | 7 +++++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/authentik/outposts/managed.py b/authentik/outposts/managed.py index e8238a92e..7e988ea77 100644 --- a/authentik/outposts/managed.py +++ b/authentik/outposts/managed.py @@ -1,9 +1,12 @@ """Outpost managed objects""" +from dataclasses import asdict + from authentik.managed.manager import EnsureExists, ObjectManager from authentik.outposts.models import ( DockerServiceConnection, KubernetesServiceConnection, Outpost, + OutpostConfig, OutpostType, ) @@ -30,12 +33,13 @@ class OutpostManager(ObjectManager): created_callback=outpost_created, name="authentik Embedded Outpost", type=OutpostType.PROXY, - _config={ - # We don't use OutpostConfig here to not override authentik_host - "kubernetes_disabled_components": [ - "deployment", - "secret", - ], - }, + _config=asdict( + OutpostConfig( + kubernetes_disabled_components=[ + "deployment", + "secret", + ], + ) + ), ), ] diff --git a/authentik/outposts/models.py b/authentik/outposts/models.py index 012415bcd..8b66aaa57 100644 --- a/authentik/outposts/models.py +++ b/authentik/outposts/models.py @@ -59,7 +59,7 @@ class OutpostConfig: # update website/docs/outposts/outposts.md - authentik_host: str + authentik_host: str = "" authentik_host_insecure: bool = False log_level: str = CONFIG.y("log_level") @@ -312,10 +312,6 @@ class Outpost(ManagedModel): @property def config(self) -> OutpostConfig: """Load config as OutpostConfig object""" - # When embedded outpost is generated initially, this field isn't set - # (on purpose, as we don't want it to be managed by us) - if "authentik_host" not in self._config: - self._config["authentik_host"] = "" return from_dict(OutpostConfig, self._config) @config.setter diff --git a/web/src/locales/en.po b/web/src/locales/en.po index bd6f5be54..18cc77183 100644 --- a/web/src/locales/en.po +++ b/web/src/locales/en.po @@ -474,8 +474,12 @@ msgid "Browser" msgstr "Browser" #: src/pages/admin-overview/cards/VersionStatusCard.ts -msgid "Build hash: {0}" -msgstr "Build hash: {0}" +msgid "Build hash:" +msgstr "Build hash:" + +#: +#~ msgid "Build hash: {0}" +#~ msgstr "Build hash: {0}" #: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts @@ -4027,7 +4031,6 @@ msgstr "Tenants" #: src/pages/applications/ApplicationViewPage.ts #: src/pages/policies/PolicyListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts -#: src/pages/property-mappings/PropertyMappingListPage.ts msgid "Test" msgstr "Test" diff --git a/web/src/locales/pseudo-LOCALE.po b/web/src/locales/pseudo-LOCALE.po index 9d3603a5e..a2dfae292 100644 --- a/web/src/locales/pseudo-LOCALE.po +++ b/web/src/locales/pseudo-LOCALE.po @@ -470,9 +470,13 @@ msgid "Browser" msgstr "" #: src/pages/admin-overview/cards/VersionStatusCard.ts -msgid "Build hash: {0}" +msgid "Build hash:" msgstr "" +#: +#~ msgid "Build hash: {0}" +#~ msgstr "" + #: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts msgid "Built-in" @@ -4019,7 +4023,6 @@ msgstr "" #: src/pages/applications/ApplicationViewPage.ts #: src/pages/policies/PolicyListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts -#: src/pages/property-mappings/PropertyMappingListPage.ts msgid "Test" msgstr ""