-
Notifications
You must be signed in to change notification settings - Fork 23
docs(configuration): add white labeling guide #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b9af03e
docs(configuration): add white labeling guide
lexfrei d2eecfc
docs(white-labeling): address review feedback
lexfrei ec35075
docs(white-labeling): fix CRD resource name and duplicated text
lexfrei 2bf92d1
docs(white-labeling): remove namespace from cluster-scoped Package, u…
lexfrei 4fbd8ec
docs(white-labeling): use server-side apply, remove namespace from ku…
lexfrei d874df1
docs(white-labeling): address review recommendations
lexfrei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
content/en/docs/v1/operations/configuration/white-labeling.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| --- | ||
| title: "White Labeling" | ||
| linkTitle: "White Labeling" | ||
| description: "Customize branding elements in the Cozystack Dashboard and Keycloak authentication pages" | ||
| weight: 50 | ||
| --- | ||
|
|
||
| White labeling allows you to replace default Cozystack branding with your own logos and text across the Dashboard UI and Keycloak authentication pages. | ||
|
|
||
| ## Overview | ||
|
|
||
| Branding is configured through the `branding` field in the Platform Package (`spec.components.platform.values.branding`). The configuration propagates automatically to: | ||
|
|
||
| - **Dashboard**: logo, page title, footer text, favicon, and tenant identifier | ||
| - **Keycloak**: realm display name on authentication pages | ||
|
|
||
| ## Configuration | ||
|
|
||
| Edit your Platform Package to add or update the `branding` section: | ||
|
|
||
| ```yaml | ||
| apiVersion: cozystack.io/v1alpha1 | ||
| kind: Package | ||
| metadata: | ||
| name: cozystack.cozystack-platform | ||
| spec: | ||
| variant: isp-full # use your variant | ||
| components: | ||
| platform: | ||
| values: | ||
| branding: | ||
| # Dashboard branding | ||
| titleText: "My Company Dashboard" | ||
| footerText: "My Company Platform" | ||
| tenantText: "Production v1.0" | ||
| logoText: "" | ||
| logoSvg: "<base64-encoded SVG>" | ||
| iconSvg: "<base64-encoded SVG>" | ||
| # Keycloak branding | ||
| brandName: "My Company" | ||
| brandHtmlName: "<div style='font-weight:bold;'>My Company</div>" | ||
| ``` | ||
|
|
||
| Apply the changes: | ||
|
|
||
| ```bash | ||
| kubectl apply --server-side --filename platform-package.yaml | ||
| ``` | ||
|
|
||
| ## Configuration Fields | ||
|
|
||
| ### Dashboard Fields | ||
|
|
||
| | Field | Default | Description | | ||
| | --- | --- | --- | | ||
| | `titleText` | `Cozystack Dashboard` | Browser tab title and Dashboard header text. | | ||
| | `footerText` | `Cozystack` | Text displayed in the Dashboard footer. | | ||
| | `tenantText` | Platform version string | Version or tenant identifier displayed in the Dashboard. | | ||
| | `logoText` | `""` (empty) | Alternative text-based logo. Used when SVG logo is not provided. | | ||
| | `logoSvg` | Cozystack logo (base64) | Base64-encoded SVG logo displayed in the Dashboard header. | | ||
| | `iconSvg` | Cozystack icon (base64) | Base64-encoded SVG icon used as the browser favicon. | | ||
|
|
||
| ### Keycloak Fields | ||
|
|
||
| | Field | Default | Description | | ||
| | --- | --- | --- | | ||
| | `brandName` | Not set | Plain text realm name displayed in the Keycloak browser tab. | | ||
| | `brandHtmlName` | Not set | HTML-formatted realm name displayed on Keycloak login pages. Supports inline HTML/CSS for styled branding. | | ||
|
|
||
| ## Preparing SVG Logos | ||
|
|
||
| ### Theme-Aware SVG Variables | ||
|
|
||
| The Dashboard supports template variables in SVG content that adapt to light and dark themes: | ||
|
|
||
| - `{token.colorText}` — replaced at runtime with the current theme's text color | ||
|
|
||
| {{< note >}} | ||
| The `{token.colorText}` syntax is **not valid XML**. The attribute value is intentionally unquoted because the Dashboard performs raw string substitution on the SVG source before rendering — it replaces `{token.colorText}` with the actual color value. This means SVG files with these placeholders cannot be opened directly in a browser or validated with an XML parser. This is expected and matches the upstream Dashboard implementation. | ||
| {{< /note >}} | ||
|
|
||
| Example SVG using a theme-aware variable: | ||
|
|
||
| ```text | ||
| <svg width="150" height="30" viewBox="0 0 150 30" fill="none" | ||
| xmlns="http://www.w3.org/2000/svg"> | ||
| <path d="M10 5h30v20H10z" fill={token.colorText} /> | ||
| <text x="50" y="20" fill={token.colorText}>My Company</text> | ||
| </svg> | ||
| ``` | ||
|
|
||
| ### Converting SVG to Base64 | ||
|
|
||
| Encode your SVG files to base64 strings: | ||
|
|
||
| ```bash | ||
| base64 < logo.svg | tr -d '\n' | ||
| ``` | ||
|
|
||
| ### Example Workflow | ||
|
|
||
| ```bash | ||
| # Encode logos | ||
| LOGO_B64=$(base64 < logo.svg | tr -d '\n') | ||
| ICON_B64=$(base64 < icon.svg | tr -d '\n') | ||
|
|
||
| # Patch the Platform Package | ||
| kubectl patch packages.cozystack.io cozystack.cozystack-platform \ | ||
| --type merge --server-side \ | ||
| --patch "{ | ||
| \"spec\": { | ||
| \"components\": { | ||
| \"platform\": { | ||
| \"values\": { | ||
| \"branding\": { | ||
| \"logoSvg\": \"$LOGO_B64\", | ||
| \"iconSvg\": \"$ICON_B64\" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }" | ||
| ``` | ||
|
|
||
| ## Verification | ||
|
|
||
| After applying changes, verify that branding is correctly configured: | ||
|
|
||
| 1. **Check the Platform Package**: | ||
|
|
||
| ```bash | ||
| kubectl get packages.cozystack.io cozystack.cozystack-platform \ | ||
| --output jsonpath='{.spec.components.platform.values.branding}' | jq . | ||
| ``` | ||
|
|
||
| 2. **Dashboard**: open the Dashboard URL and verify the logo, title, footer, and favicon. | ||
|
|
||
| 3. **Keycloak**: open the Keycloak login page and verify the realm display name. | ||
|
|
||
| {{< note >}} | ||
| You may need to hard-refresh (Ctrl+Shift+R / Cmd+Shift+R) or clear browser cache to see updated branding. | ||
| {{< /note >}} | ||
|
|
||
| ## Migration from v0 | ||
|
|
||
| In Cozystack v0, branding was configured via a standalone `cozystack-branding` ConfigMap in the `cozy-system` namespace. In v1, this ConfigMap is no longer used. The [migration script]({{% ref "/docs/v1/operations/upgrades#step-3-generate-the-platform-package" %}}) automatically converts the old ConfigMap values into the Platform Package `branding` field. | ||
|
|
||
| If you previously used the ConfigMap approach, no manual migration is needed — the upgrade process handles it automatically. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for
tenantTextis described as "Platform version string". To enhance clarity, it would be beneficial to provide a more concrete example of what this string typically looks like (e.g., "v1.0.0" or "1.0") or explain how it's derived. This would help users understand what to expect if they don't explicitly set this field.