Keycloak image and themes for the bitborg identity service
  • FreeMarker 65.2%
  • Java 14.3%
  • Shell 12.5%
  • Dockerfile 8%
Hitta en fil
Kodförråd filer (senaste incheckning först)
Filnamn Senaste incheckningsmeddelande Senaste incheckningsdatum
Bitborg Renovate 722c86ba3a
Alla kontroller lyckades
ci / ci (push) Successful in 3m53s
release / build-and-release (push) Successful in 4m20s
chore(deps): update docker.io/library/maven:3.10.0-eclipse-temurin-21 docker digest to 3e18d95 (#30)
2026-11-27 01:35:27 +00:00
.forgejo/workflows ci: scan the built image with trivy (#16) 2026-10-20 08:55:59 +00:00
providers/email fix(deps): update dependency org.keycloak:keycloak-services to v26.8.2 (#27) 2026-11-15 22:09:43 +00:00
scripts chore(deps): update ghcr.io/aquasecurity/trivy docker tag to v0.76.2 (#25) 2026-11-15 22:09:33 +00:00
themes/bitborg feat(email): add migration variant of the execute-actions email (#14) 2026-10-10 19:30:04 +00:00
.gitignore feat(theme): username on passkey enrolment, activation email (#10) 2026-10-09 21:30:59 +00:00
Containerfile chore(deps): update docker.io/library/maven:3.10.0-eclipse-temurin-21 docker digest to 3e18d95 (#30) 2026-11-27 01:35:27 +00:00
LICENSE chore: add licence and readme 2026-10-08 20:49:09 +02:00
README.md chore(renovate): automerge digest updates (#32) 2026-11-26 18:57:41 +00:00
renovate.json chore(renovate): automerge digest updates (#32) 2026-11-26 18:57:41 +00:00

bitborg-keycloak

The Keycloak image behind id.bitborg.se. See ADR 0044 in bitborg-docs.

What it does

The Containerfile runs kc.sh build on a pinned upstream Keycloak with the options fixed at build time: PostgreSQL and the health and metrics endpoints. The runtime image defaults to local caches for a single node and starts with start --optimized, so it never rebuilds at start-up. Production pulls this image from our registry and nothing from quay.io.

Runtime settings (database URL and credentials, hostname, proxy headers) come from the environment. The infrastructure repository sets them.

Versioning

A tag v<keycloak version>-<n> publishes:

  • git.bitborg.se/bitborg/bitborg-keycloak:<keycloak version>-<n>
  • git.bitborg.se/bitborg/bitborg-keycloak:sha-<short sha>

<n> starts at 1 and counts our own rebuilds on the same Keycloak version. The release fails if the tag does not match the base image in the Containerfile. Tags are immutable. There is no :latest.

Upgrading

Renovate opens a PR when a new upstream patch is published. Review it and merge it within a week.

A digest update of a pinned image merges by itself once CI is green. Tag a release to ship it.

A minor waits for approval on the dependency dashboard. Treat it as an upgrade task:

  1. Read the upstream upgrade notes.
  2. Back up the database. A minor migrates the schema and cannot be rolled back.
  3. Deploy to staging and test sign-in, enrolment and recovery.
  4. Then deploy to production.

Only the latest minor gets fixes upstream. Never skip a minor.

Development

podman build -t localhost/bitborg-keycloak:dev -f Containerfile .
scripts/smoke-test.sh localhost/bitborg-keycloak:dev

The smoke test starts the image against PostgreSQL and waits for /health/ready on the management port. CI runs the same script on every pull request.

Theme

themes/bitborg/login is a minimal login theme on keycloak.v2. It shows the username on the update-password and TOTP pages so password managers can tie the credential to the account. The Keycloakify themes (bitborg/bitborg-keycloak#2) will replace it. Their JAR goes into /opt/keycloak/providers/ before kc.sh build.

Action email

providers/email is a Maven module built in the first stage of the Containerfile. It picks the subject of the execute-actions-email message: executeActionsActivateSubject when the required actions include VERIFY_EMAIL, else executeActionsSubject. A user with the attribute bitborg_migration = true gets executeActionsMigrateSubject and the executeActionsMigrate.ftl body instead. The image selects it at build time with --spi-email-template--provider=bitborg (set as KC_SPI_EMAIL_TEMPLATE__PROVIDER). themes/bitborg/email renders the matching body. The realm must set emailTheme to bitborg.

Licence

AGPL-3.0. Keycloak itself is Apache-2.0.