Skip to content

Commit

Permalink
feat: updated initial keycloak configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
NithinKuruba committed Apr 3, 2024
1 parent efe3fcf commit ae51b59
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/keycloak/Dockerfile-22.0.8
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ COPY --from=builder /opt/keycloak/ /opt/keycloak/
# copy the theme directory to `/opt/keycloak/themes/` for now, but we can consider to archive to be deployed later.
COPY ./extensions-7.6/themes/src/main/resources/theme /opt/keycloak/themes

COPY ./configuration/cache-ispn.xml /opt/keycloak/conf

COPY ./configuration/keycloak.conf /opt/keycloak/conf

COPY ./configuration/quarkus.properties /opt/keycloak/conf

ENV KC_HOSTNAME=localhost
# change these values to point to a running postgres instance
Expand Down
85 changes: 85 additions & 0 deletions docker/keycloak/configuration/cache-ispn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:14.0 http://www.infinispan.org/schemas/infinispan-config-14.0.xsd"
xmlns="urn:infinispan:config:14.0">

<cache-container name="keycloak">
<transport lock-timeout="60000"/>
<local-cache name="realms" simple-cache="true">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<local-cache name="users" simple-cache="true">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<distributed-cache name="sessions" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<distributed-cache name="authenticationSessions" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<distributed-cache name="offlineSessions" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<distributed-cache name="clientSessions" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<distributed-cache name="offlineClientSessions" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<distributed-cache name="loginFailures" owners="2">
<expiration lifespan="900000000000000000"/>
</distributed-cache>
<local-cache name="authorization" simple-cache="true">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<replicated-cache name="work">
<expiration lifespan="900000000000000000"/>
</replicated-cache>
<local-cache name="keys" simple-cache="true">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<expiration max-idle="3600000"/>
<memory max-count="1000"/>
</local-cache>
<distributed-cache name="actionTokens" owners="2">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<expiration max-idle="-1" lifespan="900000000000000000" interval="300000"/>
<memory max-count="-1"/>
</distributed-cache>
</cache-container>
</infinispan>
13 changes: 13 additions & 0 deletions docker/keycloak/configuration/keycloak.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# theme
spi-theme-static-max-age=2592000
spi-theme-cache-themes=true
spi-theme-cache-templates=true

#logging
log="console,file"
log-console-color=false
log-file=/var/log/eap/${jboss.node.name}.log
# root-logger-level:INFO
log-level="INFO,com.arjuna:warn,io.jaegertracing.Configuration:warn,org.keycloak.events:debug,sun.rmi:warn"
log-console-output=json
log-file-output=json
10 changes: 10 additions & 0 deletions docker/keycloak/configuration/quarkus.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
quarkus.log.console.json.exception-output-type=formatted
quarkus.log.console.json.key-overrides=timestamp=@timestamp
quarkus.log.console.json.additional-field."@version".value=1
quarkus.log.file.json.exception-output-type=formatted
quarkus.log.file.json.key-overrides=timestamp=@timestamp
quarkus.log.file.json.additional-field."@version".value=1
quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd
# Optional: Disable rotation by size (adjust value as needed)
quarkus.log.handler.file.rotation.max-file-size=10000M
quarkus.log.handler.file.rotation.max-backup-index=100

0 comments on commit ae51b59

Please sign in to comment.