Repository navigation
core, web, docs: introduce base URL - #24159
Conversation
8856a7f to
8661e70
Compare
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24159 +/- ##
==========================================
+ Coverage 93.50% 93.53% +0.02%
==========================================
Files 1063 1067 +4
Lines 64124 64323 +199
Branches 424 424
==========================================
+ Hits 59962 60164 +202
+ Misses 4162 4159 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
authentik translations instructionsThanks for your pull request! authentik translations are handled using Transifex. Please edit translations over there and they'll be included automatically. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-f26d06eb7232a8f0441b26a2d779d316aa78912e
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-f26d06eb7232a8f0441b26a2d779d316aa78912eAfterwards, run the upgrade commands from the latest release notes. |
05fc312 to
25e2350
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a tenant-level Base URL setting to serve as a default external URL for cases where brand-based URL resolution isn’t available (e.g., link construction), and wires it through backend storage/API, setup/OOBE capture, and the Admin UI with a persistent warning banner when unset.
Changes:
- Add
base_urlto theTenantmodel, expose it via admin settings + system-info APIs, and backfill it from config or embedded outpost host during tenant reconciliation. - Update the initial setup (OOBE) flow to collect and persist Base URL, plus add backend test coverage for normalization, API roundtrip/validation, and backfill behavior (including multi-tenant).
- Add a generic admin banner component and a specific “Base URL not configured” banner, plus surface the new field in the Admin Settings form; update docs and OpenAPI/client artifacts.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/sys-mgmt/settings.md | Documents the new Base URL system setting and its Admin warning behavior. |
| website/docs/install-config/configuration/configuration.mdx | Documents AUTHENTIK_WEB__BASE_URL bootstrap behavior and precedence. |
| web/src/elements/banner/BaseURLBanner.ts | Adds a non-dismissible admin banner prompting Base URL configuration when unset. |
| web/src/elements/banner/Banner.ts | Introduces a reusable PatternFly-based banner web component. |
| web/src/admin/ak-interface-admin.ts | Renders the Base URL banner in the admin navbar area. |
| web/src/admin/admin-settings/AdminSettingsForm.ts | Adds Base URL input to the Admin Settings form. |
| schema.yml | Extends OpenAPI schema with base_url in settings and system-info. |
| packages/client-ts/src/models/SystemInfo.ts | Adds baseUrl to the generated TS SystemInfo model. |
| packages/client-ts/src/models/SettingsRequest.ts | Adds baseUrl to the generated TS SettingsRequest model. |
| packages/client-ts/src/models/Settings.ts | Adds baseUrl to the generated TS Settings model. |
| packages/client-ts/src/models/PatchedSettingsRequest.ts | Adds baseUrl to the generated TS PatchedSettingsRequest model. |
| blueprints/default/flow-oobe.yaml | Prompts for Base URL during initial setup and seeds a default from the request host. |
| authentik/tenants/utils.py | Adds normalize_base_url() helper for trimming/normalizing configured values. |
| authentik/tenants/tests/test_normalize_base_url.py | Tests normalization behavior (whitespace + trailing slashes). |
| authentik/tenants/tests/test_base_url_settings.py | Tests settings API roundtrip, validation rejection, normalization, and system-info exposure. |
| authentik/tenants/tests/test_base_url_backfill.py | Tests reconcile-time backfill behavior, warnings/events, and idempotency. |
| authentik/tenants/tests/test_base_url_backfill_multi_tenant.py | Verifies backfill updates the correct tenant in multi-tenant contexts. |
| authentik/tenants/models.py | Adds base_url field to the Tenant model. |
| authentik/tenants/migrations/0008_tenant_base_url.py | Adds the database migration for the Tenant base_url field. |
| authentik/tenants/apps.py | Adds reconciliation backfill + deprecation warning/event when Base URL is unset. |
| authentik/tenants/api/settings.py | Exposes base_url via tenant settings serializer and normalizes on write. |
| authentik/lib/default.yml | Adds default config key web.base_url. |
| authentik/core/tests/test_setup.py | Extends setup flow test to submit and verify persisted Base URL normalization. |
| authentik/core/setup/views.py | Persists Base URL from setup flow context during post-setup stage. |
| authentik/admin/api/system.py | Exposes configured base_url from current tenant via admin system-info endpoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
website/docs/sys-mgmt/settings.md:15
- This section says the Base URL “displays a warning… until a value is provided”, but then immediately states “This setting is currently unused…”. That’s internally inconsistent (the warning behavior is already a use), and the feature also affects setup/backfill behavior in this PR. Reword to clarify it’s not yet used for link generation, rather than unused.
While this setting is empty, authentik displays a warning in the Admin interface until a value is provided. You can seed it at install time with the [`AUTHENTIK_WEB__BASE_URL`](../install-config/configuration/configuration.mdx) configuration option, but the value set here always takes precedence. A trailing slash is removed automatically. Defaults to an empty string.
This setting is currently unused until it can be marked as required, starting from authentik version 2026.11.
website/docs/install-config/configuration/configuration.mdx:830
- This section describes behavior (bootstrapping into the system setting) and then states “This setting is currently unused…”, which is misleading given it already influences setup/backfill and Admin UI warnings. Consider rewording to “not yet used for generating links” to match the current state and avoid contradicting the earlier paragraphs.
This option is a bootstrap value. On first start, authentik copies it into the **Base URL** [system setting](../../sys-mgmt/settings.md) when that setting has not been configured yet. It never overwrites a Base URL that was already set through the Admin interface or API, and when it is empty authentik falls back to the host configured on the embedded outpost. Once the system setting holds a value, this option is no longer consulted, so it does not need to remain in your environment configuration.
Any trailing slash is removed, so `https://authentik.company` and `https://authentik.company/` are equivalent.
Defaults to an empty string.
This setting is currently unused until it can be marked as required, starting from authentik version 2026.11.
| protected override render(): SlottedTemplateResult { | ||
| const { dismissed, dismissKey, level, sticky, actionHref, actionLabel } = this; | ||
|
|
||
| return guard([dismissed, level, sticky, actionHref, actionLabel], () => { |
| export const P4BannerDispositionClassName = { | ||
| [P4Disposition.Info]: "pf-m-info", | ||
| [P4Disposition.Warning]: "pf-m-warning", | ||
| [P4Disposition.Danger]: "pf-m-danger", | ||
| [P4Disposition.Neutral]: "pf-m-gray", | ||
| [P4Disposition.Error]: "pf-m-error", | ||
| } as const satisfies Record<P4Disposition, string>; |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
web/src/elements/banner/BaseURLBanner.ts:48
BaseURLBanneris documented as “Non-dismissible”, and the PR description/docs say the warning should remain until Base URL is configured, but the banner is currently dismissible viadismiss-key. This lets admins permanently hide the warning while the setting is still empty (and it will also stay hidden if Base URL is later cleared).
return html`<ak-banner
dismiss-key="base-url-banner"
level=${P4Disposition.Warning}
action-href="#/admin/settings"
web/src/elements/banner/Banner.ts:124
dismissKeyaffects whether the dismiss button renders, but it isn’t included in theguard()dependency array. Ifdismiss-keyis set/cleared dynamically, the template can fail to update accordingly.
const { dismissed, dismissKey, level, sticky, actionHref, actionLabel } = this;
return guard([dismissed, level, sticky, actionHref, actionLabel], () => {
if (dismissed) return null;
| ? html`<button | ||
| part="dismiss-button" | ||
| class="pf-c-button ${dispositionClass}" | ||
| type="button" |
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Signed-off-by: Emil Burzo <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (3)
web/src/elements/banner/Banner.ts:123
dismissKeyaffects the rendered output (dismiss button), but it isn’t included in theguard()dependency list. Ifdismiss-keychanges, the cached template can be reused and the dismiss button won’t appear/disappear correctly.
return guard([dismissed, level, sticky, actionHref, actionLabel], () => {
website/docs/sys-mgmt/settings.md:19
- The docs say this setting is “currently unused”, but this PR already uses it to drive admin UI warnings (and it’s read/written via the settings/system-info APIs). Consider rewording to clarify it’s not yet used for link generation, rather than unused overall.
This setting is currently unused until it can be marked as required, starting from authentik version 2026.11.
website/docs/install-config/configuration/configuration.mdx:824
- This paragraph implies an unconditional fallback to the embedded outpost host, but the backfill logic only uses that source when an embedded outpost exists (otherwise the value stays empty). Consider qualifying this fallback as “when available” to match the actual behavior.
This option is a bootstrap value. On first start, authentik copies it into the **Base URL** [system setting](../../sys-mgmt/settings.md) when that setting has not been configured yet. It never overwrites a Base URL that was already set through the Admin interface or API, and when it is empty authentik falls back to the host configured on the embedded outpost. Once the system setting holds a value, this option is no longer consulted, so it does not need to remain in your environment configuration.
|
|
||
| Defaults to an empty string. | ||
|
|
||
| This setting is currently unused until it can be marked as required, starting from authentik version 2026.11. |
# Conflicts: # packages/client-ts/src/models/SystemInfo.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
web/src/elements/banner/Banner.ts:124
render()is wrapped in aguard()keyed on[dismissed, level, sticky, actionHref, actionLabel], but the template also depends ondismissKey(it controls whether the dismiss button is rendered). Ifdismiss-keyis added/removed or changed after initial render, the guard can prevent updates and leave the dismiss button out of sync with the current attribute value. IncludedismissKeyin the guard dependency array.
protected override render(): SlottedTemplateResult {
const { dismissed, dismissKey, level, sticky, actionHref, actionLabel } = this;
return guard([dismissed, level, sticky, actionHref, actionLabel], () => {
if (dismissed) return null;
* main: (21 commits) website/integrations: fix favicon (#24354) core, web: update translations (#24331) core, web, docs: introduce base URL (#24159) core: bump openapitools/openapi-generator-cli from v7.22.0 to v7.24.0 in /packages/client-ts (#24337) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-go (#24335) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-rust (#24336) ci: bump github/codeql-action/autobuild from 4.37.1 to 4.37.2 (#24343) ci: bump github/codeql-action/init from 4.37.1 to 4.37.2 (#24349) ci: bump astral-sh/setup-uv from 8.3.2 to 9.0.0 in /.github/actions/setup (#24350) core: bump axllent/mailpit from v1.30.4 to v1.30.5 in /tests/e2e (#24338) core: bump types-jwcrypto from 1.5.7.20260518 to 1.5.8.20260720 in the types group (#24339) core: bump astral-sh/uv from 0.11.29 to 0.11.30 in /lifecycle/container (#24340) core: bump geoip2 from 5.2.0 to 5.3.0 (#24341) core: bump constructs from 10.7.0 to 10.7.1 (#24342) core: bump sentry-sdk from 2.65.0 to 2.66.0 (#24344) core: bump serde_json from 1.0.150 to 1.0.151 (#24345) core: bump clap from 4.6.2 to 4.6.3 (#24346) ci: bump github/codeql-action/analyze from 4.37.1 to 4.37.2 (#24347) core: bump time from 0.3.53 to 0.3.54 (#24348) endpoints/connectors/agent: fix auth schema correctly (#24327) ...
* web/maint/ak-label: (194 commits) Really need these lint errors to go away. website/integrations: fix favicon (#24354) core, web: update translations (#24331) core, web, docs: introduce base URL (#24159) core: bump openapitools/openapi-generator-cli from v7.22.0 to v7.24.0 in /packages/client-ts (#24337) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-go (#24335) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-rust (#24336) ci: bump github/codeql-action/autobuild from 4.37.1 to 4.37.2 (#24343) ci: bump github/codeql-action/init from 4.37.1 to 4.37.2 (#24349) ci: bump astral-sh/setup-uv from 8.3.2 to 9.0.0 in /.github/actions/setup (#24350) core: bump axllent/mailpit from v1.30.4 to v1.30.5 in /tests/e2e (#24338) core: bump types-jwcrypto from 1.5.7.20260518 to 1.5.8.20260720 in the types group (#24339) core: bump astral-sh/uv from 0.11.29 to 0.11.30 in /lifecycle/container (#24340) core: bump geoip2 from 5.2.0 to 5.3.0 (#24341) core: bump constructs from 10.7.0 to 10.7.1 (#24342) core: bump sentry-sdk from 2.65.0 to 2.66.0 (#24344) core: bump serde_json from 1.0.150 to 1.0.151 (#24345) core: bump clap from 4.6.2 to 4.6.3 (#24346) ci: bump github/codeql-action/analyze from 4.37.1 to 4.37.2 (#24347) core: bump time from 0.3.53 to 0.3.54 (#24348) ...
* web/maint/ak-label: (22 commits) Really need these lint errors to go away. website/integrations: fix favicon (#24354) core, web: update translations (#24331) core, web, docs: introduce base URL (#24159) core: bump openapitools/openapi-generator-cli from v7.22.0 to v7.24.0 in /packages/client-ts (#24337) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-go (#24335) core: bump openapitools/openapi-generator-cli from v7.23.0 to v7.24.0 in /packages/client-rust (#24336) ci: bump github/codeql-action/autobuild from 4.37.1 to 4.37.2 (#24343) ci: bump github/codeql-action/init from 4.37.1 to 4.37.2 (#24349) ci: bump astral-sh/setup-uv from 8.3.2 to 9.0.0 in /.github/actions/setup (#24350) core: bump axllent/mailpit from v1.30.4 to v1.30.5 in /tests/e2e (#24338) core: bump types-jwcrypto from 1.5.7.20260518 to 1.5.8.20260720 in the types group (#24339) core: bump astral-sh/uv from 0.11.29 to 0.11.30 in /lifecycle/container (#24340) core: bump geoip2 from 5.2.0 to 5.3.0 (#24341) core: bump constructs from 10.7.0 to 10.7.1 (#24342) core: bump sentry-sdk from 2.65.0 to 2.66.0 (#24344) core: bump serde_json from 1.0.150 to 1.0.151 (#24345) core: bump clap from 4.6.2 to 4.6.3 (#24346) ci: bump github/codeql-action/analyze from 4.37.1 to 4.37.2 (#24347) core: bump time from 0.3.53 to 0.3.54 (#24348) ...
Fixes #22532
TODO
use for email linksnot until it's requiredtranslationshow can we actually enforce it?we can't until the next major release since it's a breaking changeScreenshots
Initial setup
Persistent banner with CTA
System settings page