- FreeMarker 65.2%
- Java 14.3%
- Shell 12.5%
- Dockerfile 8%
| Filnamn | Senaste incheckningsmeddelande | Senaste incheckningsdatum |
|---|---|---|
| .forgejo/workflows | ||
| providers/email | ||
| scripts | ||
| themes/bitborg | ||
| .gitignore | ||
| Containerfile | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
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:
- Read the upstream upgrade notes.
- Back up the database. A minor migrates the schema and cannot be rolled back.
- Deploy to staging and test sign-in, enrolment and recovery.
- 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.