outpost: revert managed config, make authentik_host field optional

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-08 16:57:56 +02:00
parent a9ef1a3190
commit c025d64ba3
4 changed files with 23 additions and 17 deletions

View File

@ -1,9 +1,12 @@
"""Outpost managed objects""" """Outpost managed objects"""
from dataclasses import asdict
from authentik.managed.manager import EnsureExists, ObjectManager from authentik.managed.manager import EnsureExists, ObjectManager
from authentik.outposts.models import ( from authentik.outposts.models import (
DockerServiceConnection, DockerServiceConnection,
KubernetesServiceConnection, KubernetesServiceConnection,
Outpost, Outpost,
OutpostConfig,
OutpostType, OutpostType,
) )
@ -30,12 +33,13 @@ class OutpostManager(ObjectManager):
created_callback=outpost_created, created_callback=outpost_created,
name="authentik Embedded Outpost", name="authentik Embedded Outpost",
type=OutpostType.PROXY, type=OutpostType.PROXY,
_config={ _config=asdict(
# We don't use OutpostConfig here to not override authentik_host OutpostConfig(
"kubernetes_disabled_components": [ kubernetes_disabled_components=[
"deployment", "deployment",
"secret", "secret",
], ],
}, )
),
), ),
] ]

View File

@ -59,7 +59,7 @@ class OutpostConfig:
# update website/docs/outposts/outposts.md # update website/docs/outposts/outposts.md
authentik_host: str authentik_host: str = ""
authentik_host_insecure: bool = False authentik_host_insecure: bool = False
log_level: str = CONFIG.y("log_level") log_level: str = CONFIG.y("log_level")
@ -312,10 +312,6 @@ class Outpost(ManagedModel):
@property @property
def config(self) -> OutpostConfig: def config(self) -> OutpostConfig:
"""Load config as OutpostConfig object""" """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) return from_dict(OutpostConfig, self._config)
@config.setter @config.setter

View File

@ -474,8 +474,12 @@ msgid "Browser"
msgstr "Browser" msgstr "Browser"
#: src/pages/admin-overview/cards/VersionStatusCard.ts #: src/pages/admin-overview/cards/VersionStatusCard.ts
msgid "Build hash: {0}" msgid "Build hash:"
msgstr "Build hash: {0}" msgstr "Build hash:"
#:
#~ msgid "Build hash: {0}"
#~ msgstr "Build hash: {0}"
#: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts
#: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts
@ -4027,7 +4031,6 @@ msgstr "Tenants"
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/policies/PolicyListPage.ts #: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
msgid "Test" msgid "Test"
msgstr "Test" msgstr "Test"

View File

@ -470,9 +470,13 @@ msgid "Browser"
msgstr "" msgstr ""
#: src/pages/admin-overview/cards/VersionStatusCard.ts #: src/pages/admin-overview/cards/VersionStatusCard.ts
msgid "Build hash: {0}" msgid "Build hash:"
msgstr "" msgstr ""
#:
#~ msgid "Build hash: {0}"
#~ msgstr ""
#: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts
#: src/pages/sources/SourcesListPage.ts #: src/pages/sources/SourcesListPage.ts
msgid "Built-in" msgid "Built-in"
@ -4019,7 +4023,6 @@ msgstr ""
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/policies/PolicyListPage.ts #: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
msgid "Test" msgid "Test"
msgstr "" msgstr ""