Compare commits

..

36 Commits

Author SHA1 Message Date
Christian Galo 9427619e89 Update Keycloak image version to 26.4 2025-12-05 01:29:56 +00:00
Christian Galo 1dcce43067 xforwarded 2025-02-25 07:54:57 +00:00
Christian Galo fb9acb2ef5 Update Keycloak environment variables for bootstrap configuration 2025-02-21 00:39:03 +00:00
Christian Galo e427203cda 26.1 changes. Replace KC_PROXY env due to deprecation 2025-02-19 08:32:58 +00:00
Christian Galo adba4a6dee Update Keycloak version to 25.0.1 and add providers volume 2024-07-22 02:23:42 +00:00
Christian Galo 743eee88cd keycloak bump version 2023-10-16 23:19:44 +00:00
Christian Galo 8d0149f128 un-abra-ify. 2023-08-14 07:24:41 +00:00
Christian Galo 2bdc8f8d1e delete abra-specific files. Rewrite README 2023-08-14 03:34:39 +00:00
decentral1se 04b584ab4f chore: publish 7.0.0+22.0.1 release 2023-07-20 17:04:52 +02:00
3wordchant d2b9fffc46 chore: publish 6.0.0+21.0.2 release 2023-04-12 17:34:23 -04:00
3wordchant b682264613 chore: publish 6.0.0+21.0.2 release 2023-04-12 17:17:24 -04:00
3wordchant be3980d66f chore: publish 5.1.0+20.0.3 release 2023-03-19 19:22:18 -04:00
knoflook 157d3beaab fix: put the admin password in the container, also add restore capabilities 2023-03-05 12:07:56 +01:00
knoflook d432a45c21 chore: publish 5.0.2+20.0.3 release 2023-03-02 10:44:47 +01:00
knoflook 6a085e0546 fix: change the themes directory 2023-03-02 10:43:03 +01:00
decentral1se 836abe0237 chore: publish 5.0.1+20.0.3 release 2023-02-13 08:56:00 +01:00
3wordchant 9bd0b2928c Switch to self-hosted stack-ssh-deploy image [mass update] 2023-01-21 11:49:56 -08:00
3wordchant f42183601c Fix CI by adding networks: [mass update] 2023-01-20 11:58:41 -08:00
3wordchant 04618a142b Automatically generate catalogue on release [mass update]
Re: coop-cloud/recipes-catalogue-json#4
2023-01-20 10:27:11 -08:00
3wordchant 5b306db9b7 Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:27 -08:00
3wordchant c0fab3a3a3 fix: improve DB backup 2022-12-22 19:20:30 -08:00
decentral1se 2ac47abfcd feat!: new 20.x release 2022-11-16 19:37:17 +01:00
decentral1se ef6ffd9985 feat: backup labels for mysql 2022-11-16 18:16:25 +01:00
philippr 38bdef2fd0 adds welcome_theme env 2022-05-18 14:54:35 +02:00
decentral1se 2de7006106 chore: publish 4.0.1+16.1.1 release 2022-02-10 11:02:13 +01:00
decentral1se 0edb882a06 release: expand notes 2022-01-03 16:09:47 +01:00
decentral1se 2c29c75398 release: add notes 2022-01-02 15:57:16 +01:00
decentral1se d32ea20cff chore: publish 4.0.0+16.1.0 release 2022-01-02 15:53:12 +01:00
3wordchant 4e2c0013ce Goodbye, emojis! 😢
[ci skip]
2021-11-23 12:19:05 +02:00
3wordchant 45918d2451 Add app config tips from docs 2021-10-30 17:27:31 +02:00
d1admin 1f2ed7932b feat: support storing themes persistently 2021-10-21 14:16:23 +02:00
d1admin 6326aff4f0 Revert "feat: custom theme loading"
This reverts commit 3b9d0237b2.

This doesn't work because we can't get into the root account in the
entrypoint and we need that to use microdnf. Another approach is needed.
2021-10-21 14:14:16 +02:00
decentral1se f4220652a7 Merge pull request 'Custom theme loading' (#10) from custom-theme-loading into master
Reviewed-on: coop-cloud/keycloak#10
2021-10-21 11:48:21 +00:00
d1admin 3b9d0237b2 feat: custom theme loading 2021-10-21 12:55:39 +02:00
d1admin b037067a2e chore: new v15 release 2021-10-12 01:07:05 +02:00
d1admin a497b64968 chore: new v14 release 2021-10-12 01:04:54 +02:00
7 changed files with 121 additions and 151 deletions
-33
View File
@@ -1,33 +0,0 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: decentral1se/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: keycloak
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
environment:
DOMAIN: keycloak.swarm-test.autonomic.zone
STACK_NAME: keycloak
LETS_ENCRYPT_ENV: production
SECRET_ADMIN_PASSWORD_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
SECRET_DB_ROOT_PASSWORD_VERSION: v1
trigger:
branch:
- master
---
kind: pipeline
name: recipe release
steps:
- name: release a new version
image: thecoopcloud/drone-abra:latest
settings:
command: recipe keycloak release
deploy_key:
from_secret: abra_bot_deploy_key
-12
View File
@@ -1,12 +0,0 @@
TYPE=keycloak
DOMAIN=keycloak.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.keycloak.example.com`'
LETS_ENCRYPT_ENV=production
ADMIN_USERNAME=admin
SECRET_DB_ROOT_PASSWORD_VERSION=v1
SECRET_DB_PASSWORD_VERSION=v1
SECRET_ADMIN_PASSWORD_VERSION=v1
+1
View File
@@ -0,0 +1 @@
.env
+30 -23
View File
@@ -1,29 +1,36 @@
# keycloak
# Keycloak
[![Build Status](https://drone.autonomic.zone/api/badges/coop-cloud/keycloak/status.svg)](https://drone.autonomic.zone/coop-cloud/keycloak)
Wiki Cafe's configuration for a Keycloak deployment. Originally slimmed down from an `abra` [recipe](https://git.coopcloud.tech/coop-cloud/keycloak) by [Co-op Cloud](https://coopcloud.tech/).
[Keycloak](https://www.keycloak.org) + Coöp Cloud.
## Extensions
<!-- metadata -->
* **Category**: Apps
* **Status**: ❷💛
* **Image**: [`jboss/keycloak`](https://hub.docker.com/r/jboss/keycloak), ❶💚, upstream
* **Healthcheck**: Yes
* **Backups**: ?
* **Email**: ❸🍎
* **Tests**: ❷💛
* **SSO**: N/A
<!-- endmetadata -->
This stack includes the following extensions:
## Basic usage
- (keycloak-events)[https://github.com/p2-inc/keycloak-events]
- (keycloak-restrict-client-auth)[https://github.com/sventorben/keycloak-restrict-client-auth]
1. Set up Docker Swarm and [`abra`][abra]
2. Deploy [`coop-cloud/traefik`][cc-traefik]
3. `abra app new keycloak --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass`)
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
### Installing extensions
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
[cc-traefik]: https://git.autonomic.zone/coop-cloud/traefik
To install the extensions, download their JAR files and place them in the `providers` directory. Then, restart the Keycloak container.
You can update an extension by simply replacing the old JAR file with the new one.
## Deploying the app with Docker Swarm
Set the environment variables from the .env file during the shell session.
```
set -a && source .env && set +a
```
Set the secrets.
```
printf "SECRET_HERE" | docker secret create SECRET_NAME -
```
Deploy using the `-c` flag to specify one or multiple compose files.
```
docker stack deploy keycloak --detach=true -c compose.yaml
```
+90
View File
@@ -0,0 +1,90 @@
services:
app:
image: "keycloak/keycloak:26.4"
entrypoint: >
bash -c "KC_BOOTSTRAP_ADMIN_PASSWORD=\"$$(cat /run/secrets/admin_password)\" KC_DB_PASSWORD=\"$$(cat /run/secrets/db_password)\" /opt/keycloak/bin/kc.sh start"
networks:
- proxy
- internal
secrets:
- admin_password
- db_password
environment:
- KC_DB=mariadb
- KC_DB_URL_DATABASE=keycloak
- KC_DB_URL_HOST=db
- KC_HOSTNAME=https://${DOMAIN}
- KC_PROXY_HEADERS=xforwarded
- KC_BOOTSTRAP_ADMIN_USERNAME=${ADMIN_USERNAME}
- KEYCLOAK_WELCOME_THEME=${WELCOME_THEME}
- KC_FEATURES
- KC_HTTP_ENABLED=true
# healthcheck:
# https://www.keycloak.org/server/health
# Use external health checks
volumes:
- "themes:/opt/keycloak/themes"
- "providers:/opt/keycloak/providers"
depends_on:
- mariadb
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
- "traefik.http.routers.keycloak.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.keycloak.entrypoints=web-secure"
- "traefik.http.routers.keycloak.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.keycloak.middlewares=keycloak-redirect"
- "traefik.http.middlewares.keycloak-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.keycloak-redirect.headers.SSLHost=${DOMAIN}"
- "caddy=${DOMAIN}"
- "caddy.reverse_proxy={{upstreams 8080}}"
- "caddy.tls.on_demand="
db:
image: "mariadb:10.11"
environment:
- MYSQL_DATABASE=keycloak
- MYSQL_USER=keycloak
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
secrets:
- db_password
- db_root_password
volumes:
- "mariadb:/var/lib/mysql"
networks:
- internal
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.path: "/tmp/dump.sql.gz"
backupbot.backup.post-hook: "rm -f /tmp/dump.sql.gz"
backupbot.backup.pre-hook: "sh -c 'mysqldump -u root -p\"$$(cat /run/secrets/db_root_password)\" keycloak | gzip > /tmp/dump.sql.gz'"
backupbot.restore.pre-hook: "sh -c 'cd /tmp && gzip -d dump.sql.gz'"
backupbot.restore: "true"
backupbot.restore.post-hook: "sh -c 'mysql -u root -p\"$$(cat /run/secrets/db_root_password)\" keycloak < /tmp/dump.sql && rm -f /tmp/dump.sql'"
networks:
internal:
proxy:
external: true
secrets:
admin_password:
name: keycloak_admin_password
external: true
db_password:
name: keycloak_db_password
external: true
db_root_password:
name: keycloak_db_root_password
external: true
volumes:
mariadb:
themes:
providers:
-77
View File
@@ -1,77 +0,0 @@
---
version: "3.8"
services:
app:
image: "jboss/keycloak:13.0.1"
networks:
- proxy
- internal
secrets:
- admin_password
- db_password
environment:
- DB_ADDR=db
- DB_DATABASE=keycloak
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_USER=keycloak
- DB_VENDOR=mariadb
- KEYCLOAK_PASSWORD_FILE=/run/secrets/admin_password
- KEYCLOAK_USER=${ADMIN_USERNAME}
- PROXY_ADDRESS_FORWARDING=true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
depends_on:
- mariadb
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=1.0.0+13.0.1"
db:
image: "mariadb:10.6"
environment:
- MYSQL_DATABASE=keycloak
- MYSQL_USER=keycloak
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
secrets:
- db_password
- db_root_password
volumes:
- "mariadb:/var/lib/mysql"
networks:
- internal
networks:
internal:
proxy:
external: true
secrets:
admin_password:
name: ${STACK_NAME}_admin_password_${SECRET_ADMIN_PASSWORD_VERSION}
external: true
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
db_root_password:
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true
volumes:
mariadb:
-6
View File
@@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}