[UPD] bump keycloak to 17.0 and improve charm
#22
Closed
njeudy
wants to merge 3 commits from nj-keycloak-17.0
into master
pull from: nj-keycloak-17.0
merge into: 0k:master
0k:0k/dev/master
0k:backup
0k:bgallet/mattermost
0k:bgallet/nextcloud
0k:boris/smtp-extern
0k:charm-codimd-new
0k:cups_service_alpha
0k:dev
0k:dev1
0k:dhcp
0k:element
0k:etherpad-upd
0k:framadate
0k:get-version
0k:lokavaluto/dev/master
0k:master
0k:matomo
0k:new-mailhog-charms
0k:new-monujo-options
0k:nj-collabra-office
0k:nj-organice-charm
0k:nj-vaulwarden-migrate
0k:ntfy-install
0k:odoo_fix_webhook_url
0k:postgres
0k:test
0k:upd-docker
0k:update-latest-synapse
0k:wip
9 changed files with 120 additions and 75 deletions
-
32keycloak/README.rst
-
12keycloak/build/Dockerfile
-
37keycloak/hooks/post_deploy
-
9keycloak/hooks/postgres_database-relation-joined
-
7keycloak/hooks/web_proxy-relation-joined
-
4keycloak/metadata.yml
-
80monujo/lib/common
-
11postgres/hooks/postgres_database-relation-joined
-
3postgres/lib/common
@ -0,0 +1,32 @@ |
|||||
|
Description |
||||
|
=========== |
||||
|
|
||||
|
Using ``keycloak`` version 17.0 |
||||
|
|
||||
|
|
||||
|
Usage |
||||
|
===== |
||||
|
|
||||
|
To start with ``keycloak``, just put this service in your |
||||
|
``compose.yml``:: |
||||
|
|
||||
|
keycloak: |
||||
|
options: |
||||
|
admin-password: CHANGEME |
||||
|
relations: |
||||
|
web-proxy: |
||||
|
frontend: |
||||
|
domain: id.mydomain.fr |
||||
|
|
||||
|
Customize theme |
||||
|
=============== |
||||
|
|
||||
|
You can customize theme by putting your theme in |
||||
|
``/srv/datastore/data/keycloak/opt/keycloak/themes`` |
||||
|
|
||||
|
For example copy the material folder from |
||||
|
https://github.com/MAXIMUS-DeltaWare/material-keycloak-theme and |
||||
|
restart ``keycloak``. |
||||
|
|
||||
|
Then go to your admin console, log in and go to the realm/themes part |
||||
|
to choose you new theme |
@ -0,0 +1,12 @@ |
|||||
|
FROM quay.io/keycloak/keycloak:17.0.0 as builder |
||||
|
|
||||
|
ENV KC_METRICS_ENABLED=true |
||||
|
ENV KC_FEATURES=token-exchange |
||||
|
ENV KC_DB=postgres |
||||
|
RUN /opt/keycloak/bin/kc.sh build |
||||
|
|
||||
|
FROM quay.io/keycloak/keycloak:17.0.0 |
||||
|
COPY --from=builder /opt/keycloak/lib/quarkus/ /opt/keycloak/lib/quarkus/ |
||||
|
WORKDIR /opt/keycloak |
||||
|
ENV KC_LOG_LEVEL=INFO |
||||
|
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"] |
@ -1,37 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
|
|
||||
## Init is run on host |
|
||||
## For now it is run every time the script is launched, but |
|
||||
## it should be launched only once after build. |
|
||||
|
|
||||
## Accessible variables are: |
|
||||
## - SERVICE_NAME Name of current service |
|
||||
## - DOCKER_BASE_IMAGE Base image from which this service might be built if any |
|
||||
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service |
|
||||
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service |
|
||||
|
|
||||
PASSWORD_SET_CONTROL="$SERVICE_CONFIGSTORE/.password-set-control" |
|
||||
|
|
||||
set -e |
|
||||
|
|
||||
if [ -e "$PASSWORD_SET_CONTROL" ]; then |
|
||||
exit 0 |
|
||||
fi |
|
||||
|
|
||||
containers=($(get_running_containers_for_service "$SERVICE_NAME")) |
|
||||
if [ "${#containers[@]}" == 0 ]; then |
|
||||
err "no containers found for service ${DARKYELLOW}$SERVICE_NAME${NORMAL}" |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
## It is not possible at first glance to reset password, so we decided |
|
||||
## to set to admin/admin. This means it is important to change the |
|
||||
## admin password as soon as possible. |
|
||||
|
|
||||
## XXXvlab: taking the first container |
|
||||
container_id="${containers[0]}" |
|
||||
docker exec "$container_id" \ |
|
||||
/opt/jboss/keycloak/bin/add-user-keycloak.sh \ |
|
||||
-u "admin" -p "admin" |
|
||||
docker restart "$container_id" |
|
||||
mkdir -p "${PASSWORD_SET_CONTROL%/*}" && touch "$PASSWORD_SET_CONTROL" |
|
@ -1,11 +1,16 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
|
DOMAIN=$(relation-get domain) || exit 1 |
||||
|
|
||||
set -e |
set -e |
||||
|
|
||||
config-add "\ |
config-add "\ |
||||
services: |
services: |
||||
$MASTER_BASE_SERVICE_NAME: |
$MASTER_BASE_SERVICE_NAME: |
||||
environment: |
environment: |
||||
PROXY_ADDRESS_FORWARDING: \"true\" |
|
||||
|
KC_HOSTNAME: "$DOMAIN" |
||||
|
KC_PROXY: edge |
||||
|
KC_HTTP_ENABLED: \"true\" |
||||
|
KC_HOSTNAME_STRICT: \"false\" |
||||
" |
" |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue