Skip to content

Add Keycloak page and self-hosting sections for Hub - #165

Merged
tobihagemann merged 2 commits into
developfrom
feature/hub-self-hosting-docs
Aug 5, 2026
Merged

Add Keycloak page and self-hosting sections for Hub#165
tobihagemann merged 2 commits into
developfrom
feature/hub-self-hosting-docs

Conversation

@tobihagemann

Copy link
Copy Markdown
Member

The Hub docs cover the web interface well but say little about configuring Keycloak or operating a self-hosted instance. This adds both.

The new page docs/hub/keycloak.mdx covers the Keycloak configuration that is specific to Hub: connecting an external identity provider over LDAP or OpenID Connect, mapping groups to realm roles, restricting who may access Hub via an essential claim, session timeouts, and migrating between identity providers without losing vault access.

deployment.mdx gets four new sections: trusting a private certificate authority, restoring from a backup, changing the database password, and verifying container image attestations.

The Hub sidebar is reordered so everything relevant to managed customers comes first and the self-hosting pages sit at the bottom.

Open points:

  • The restore steps assume a per-database dump, while the backup section above it documents pg_dumpall. Worth deciding which flow we want to document.
  • The attestation example covers the Keycloak image. The Hub image is attested by build.yml, but the identity regexp for it still needs filling in.
  • The new pages have no screenshots yet.

@tobihagemann
tobihagemann requested a review from SailReal August 4, 2026 14:52
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The Hub documentation navigation is reordered. A new Keycloak page documents identity providers, federation, access restrictions, session settings, and provider migration. Deployment documentation adds trust-store, database recovery, password, and image provenance procedures.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: sailreal

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: adding Keycloak documentation and self-hosting sections for Hub.
Description check ✅ Passed The description directly explains the new Keycloak and self-hosting documentation changes and notes related open points.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/hub-self-hosting-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/hub/deployment.mdx`:
- Around line 220-230: Update the Restore section to use a format-compatible
backup and restore pair: either document creating the backup with pg_dump -d hub
for the existing single-database import, or restore the pg_dumpall backup as
postgres into a replacement cluster. For the single-database procedure, change
the CREATE DATABASE statement to assign OWNER hub rather than relying only on
database privileges.
- Around line 152-187: The Deployment specification defines a volumeMount named
keycloak-truststore-p12 but does not define the corresponding volume in the Pod
spec. Add a volumes section under spec.template.spec that creates a volume named
keycloak-truststore-p12 backed by the instance-secrets Secret. The volume should
map the Secret key keycloak-truststore-p12 to the filename
keycloak-truststore-p12 so the mounted path resolves correctly for the Java
trustStore argument.
- Around line 123-136: The keytool import instruction creates a standalone
PKCS12 trust store containing only the private CA chain, which causes public
HTTPS connections to fail when javax.net.ssl.trustStore points only to this file
(losing access to default public roots). Revise the keytool workflow to import
the private CA into a copy of the runtime default trust store instead of
creating a new standalone file, ensuring both private and public certificate
authorities remain available. Apply this same corrected approach to the desktop
trust-store setup section as well.
- Line 263: Update the deployment command’s certificate identity validation to
use the exact-match option supported by the installed Cosign version, replacing
the regexp-based flag while preserving the expected GitHub Actions identity
containing ${KC_VERSION}.

In `@docs/hub/keycloak.mdx`:
- Line 9: Align the create-vault role name in the opening description with the
configured identifier and the roles section in
docs/hub/user-group-management.mdx. Search the realm configuration and both
documentation pages for create-vaults/create-vault, then update this page to use
the configuration’s exact role name consistently.
- Around line 68-74: Update the Keycloak setup instructions to explicitly
disable the Review Profile prompt: set Review Profile to “Off” or disable that
authentication step, rather than setting it to “Alternative,” which still
prompts users to choose whether to review their profile.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e2a7471-c1a4-4e85-8848-09d003382025

📥 Commits

Reviewing files that changed from the base of the PR and between 35a48a3 and 2491a54.

📒 Files selected for processing (10)
  • docs/hub/access-vault.mdx
  • docs/hub/admin.mdx
  • docs/hub/deployment.mdx
  • docs/hub/early-access.mdx
  • docs/hub/emergency-access.mdx
  • docs/hub/keycloak.mdx
  • docs/hub/user-group-management.mdx
  • docs/hub/vault-management.mdx
  • docs/hub/vault-recovery.mdx
  • docs/hub/your-account.mdx

Comment thread docs/hub/deployment.mdx Outdated
Comment thread docs/hub/deployment.mdx Outdated
Comment thread docs/hub/deployment.mdx
Comment thread docs/hub/deployment.mdx
Comment thread docs/hub/keycloak.mdx
Comment thread docs/hub/keycloak.mdx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
docs/hub/keycloak.mdx (5)

74-74: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Describe the OpenID Connect username claim correctly.

Keycloak does not generally derive brokered usernames from email. For OpenID Connect, the default username claim is preferred_username; the email claim is separate. State the provider-specific claim and explain that the Username Template Importer mapper is only needed for a different username scheme.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 74, The Keycloak documentation incorrectly
states that brokered usernames are derived from email addresses. Update the
explanatory paragraph to identify OpenID Connect’s default username claim as
preferred_username, distinguish it from the separate email claim, and retain
that the Username Template Importer mapper targeting LOCAL is only needed when
using a different username scheme.

Source: MCP tools


121-121: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document the SMTP prerequisite for email linking.

A Keycloak verified email address is not enough by itself. If users use Try Another Way, Keycloak sends the link through Verify Existing Account By Email, which requires SMTP email settings configured in the realm and the step present in the flow. Add this prerequisite before recommending the email linking option.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 121, Update the email-linking guidance in the
Keycloak documentation to state that verified email addresses alone are
insufficient: the realm must have SMTP settings configured and the “Verify
Existing Account By Email” step included in the authentication flow before
recommending the email option.

Source: MCP tools


125-125: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not describe the default provider as automatic account linking.

Setting the new provider as the default identity provider only redirects users through the new login flow. The default First Broker Login flow still asks users to add an existing account before both identities link. Automatic linking requires a custom flow with Automatically Set Existing User; change this to “start the linking flow” or document that custom flow explicitly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 125, Update the provider migration guidance in
the default identity provider section to avoid claiming that setting the new
provider automatically links accounts. Describe it as starting the linking flow,
or explicitly document that automatic linking requires a custom First Broker
Login flow using “Automatically Set Existing User.”

Source: MCP tools


59-59: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Require the Keycloak administration role for default-login setup.

The admin role is a Cubic realm role used by Hub clients, not a Keycloak Admin Console permission. Grant one external-provider account a Keycloak administration role from the realm-management client, such as realm-admin, to avoid locking out realm administration after hiding the login form.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 59, Update the default-login setup guidance in
the Keycloak administration section to require assigning at least one externally
authenticated account a Keycloak administration role from the realm-management
client, such as realm-admin. Clarify that the Cubic realm admin role is
insufficient for Admin Console access, and preserve the warning about lockout
after hiding the local login form.

Source: MCP tools


84-86: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Security Misconfiguration (CWE-16)

Reachability: External

Scope Verify essential claim to OpenID Connect identity brokering.

Verify essential claim checks a claim in an OIDC ID token. This section covers LDAP, SAML, and OpenID Connect before this paragraph, so an operator can apply this setting to LDAP or SAML and get no equivalent restriction. Limit the instruction to OIDC brokering, or document the protocol-specific controls for SAML and LDAP.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` around lines 84 - 86, Revise the Keycloak guidance
around “Verify essential claim” to explicitly limit it to OpenID Connect
identity brokering, since it validates an OIDC ID-token claim. Clarify that the
setting should not be applied as the access filter for LDAP or SAML providers,
without adding protocol-specific controls unless they are documented elsewhere.

Source: MCP tools

♻️ Duplicate comments (2)
docs/hub/keycloak.mdx (2)

68-68: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Disable Review Profile instead of setting it to Alternative.

Alternative does not disable the execution. If the goal is to suppress only the initial page, set Update Profile On First Login to OFF. If the goal is to remove the profile step, disable the execution and review Confirm Link Existing Account as well. Keycloak documents a later Review profile info path even when the setting is OFF. (keycloak.org)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 68, Update the Keycloak setup instructions in
the duplicated flow to disable Review Profile rather than setting it to
Alternative. Instruct users to set Update Profile On First Login to OFF when
suppressing only the initial page, or disable the execution and review Confirm
Link Existing Account when removing the profile step.

Source: MCP tools


9-9: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the role identifier with the realm configuration.

This previous role-name finding is still present: the page lists create-vaults. Verify the realm export and docs/hub/user-group-management.mdx, then use the exact same role name in both pages. A mismatch can make administrators assign a role that Hub does not check.

#!/bin/bash
set -euo pipefail
rg -n -C 3 '\bcreate-vaults?\b' .
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/hub/keycloak.mdx` at line 9, Verify the configured realm export and the
role references in user-group-management.mdx, then update the role list in the
Keycloak documentation to use the exact configured identifier consistently
across both pages. Replace the stale create-vaults spelling only where it
differs from the realm configuration, preserving the other documented roles.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/hub/keycloak.mdx`:
- Line 74: The Keycloak documentation incorrectly states that brokered usernames
are derived from email addresses. Update the explanatory paragraph to identify
OpenID Connect’s default username claim as preferred_username, distinguish it
from the separate email claim, and retain that the Username Template Importer
mapper targeting LOCAL is only needed when using a different username scheme.
- Line 121: Update the email-linking guidance in the Keycloak documentation to
state that verified email addresses alone are insufficient: the realm must have
SMTP settings configured and the “Verify Existing Account By Email” step
included in the authentication flow before recommending the email option.
- Line 125: Update the provider migration guidance in the default identity
provider section to avoid claiming that setting the new provider automatically
links accounts. Describe it as starting the linking flow, or explicitly document
that automatic linking requires a custom First Broker Login flow using
“Automatically Set Existing User.”
- Line 59: Update the default-login setup guidance in the Keycloak
administration section to require assigning at least one externally
authenticated account a Keycloak administration role from the realm-management
client, such as realm-admin. Clarify that the Cubic realm admin role is
insufficient for Admin Console access, and preserve the warning about lockout
after hiding the local login form.
- Around line 84-86: Revise the Keycloak guidance around “Verify essential
claim” to explicitly limit it to OpenID Connect identity brokering, since it
validates an OIDC ID-token claim. Clarify that the setting should not be applied
as the access filter for LDAP or SAML providers, without adding
protocol-specific controls unless they are documented elsewhere.

---

Duplicate comments:
In `@docs/hub/keycloak.mdx`:
- Line 68: Update the Keycloak setup instructions in the duplicated flow to
disable Review Profile rather than setting it to Alternative. Instruct users to
set Update Profile On First Login to OFF when suppressing only the initial page,
or disable the execution and review Confirm Link Existing Account when removing
the profile step.
- Line 9: Verify the configured realm export and the role references in
user-group-management.mdx, then update the role list in the Keycloak
documentation to use the exact configured identifier consistently across both
pages. Replace the stale create-vaults spelling only where it differs from the
realm configuration, preserving the other documented roles.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f946a76c-319f-4f11-a9b5-54dc14a56f4e

📥 Commits

Reviewing files that changed from the base of the PR and between 2491a54 and be479de.

📒 Files selected for processing (3)
  • docs/hub/deployment.mdx
  • docs/hub/keycloak.mdx
  • docs/hub/user-group-management.mdx
💤 Files with no reviewable changes (1)
  • docs/hub/user-group-management.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/hub/deployment.mdx

@SailReal SailReal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@tobihagemann
tobihagemann merged commit a2fe4fc into develop Aug 5, 2026
3 checks passed
@tobihagemann
tobihagemann deleted the feature/hub-self-hosting-docs branch August 5, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants