## COPY keycloak.cli /opt/jboss/startup-scripts/keycloak.cli
#cp -R /opt/custom/deployments/* /opt/jboss/keycloak/standalone/deployments/
embed-server --server-config=standalone-ha.xml --std-out=echo
batch
# Haproxy in front
#/subsystem=keycloak-server/spi=x509cert-lookup/provider=haproxy:remove
#/subsystem=keycloak-server/spi=x509cert-lookup:write-attribute(name=default-provider, value="haproxy")
#/subsystem=keycloak-server/spi=x509cert-lookup/provider=default:remove
#/subsystem=keycloak-server/spi=x509cert-lookup/provider=haproxy:add(enabled=true,properties={ sslClientCert => "SSL_CLIENT_CERT", sslCertChainPrefix => "CERT_CHAIN", certificateChainLength => "10"})
# Add avatar
/subsystem=keycloak-server/:write-attribute(name=providers,value=[ classpath:${jboss.home.dir}/providers/*,module:deployment.avatar-minio-extension-bundle ])
/subsystem=keycloak-server/spi=avatar-storage/:add
/subsystem=keycloak-server/spi=avatar-storage/provider=avatar-storage-minio/:add(enabled=true)
#:reload
run-batch
stop-embedded-server
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/spi=x509cert-lookup:write-attribute(name=default-provider, value="haproxy")'
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/spi=x509cert-lookup/provider=default:remove'
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/spi=x509cert-lookup/provider=haproxy:add(enabled=true,properties={ sslClientCert => "SSL_CLIENT_CERT", sslCertChainPrefix => "CERT_CHAIN", certificateChainLength => "10"})'
#./jboss-cli.sh --connect --command=':reload'
#
# haproxy
#
#
#
#
#
#
#
#
#
#
#
# module:deployment.avatar-minio-extension-bundle
#
#
#
#
#
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheThemes,value=false)'
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheTemplates,value=false)'
#./jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=staticMaxAge,value=-1)'
#./jboss-cli.sh --connect --command='reload'