如何在Keycloak 20中禁用主题缓存

huangapple go评论41阅读模式
英文:

How to disable theme caching in keycloak 20

问题

我在Docker中运行Keycloak 20.0.3,设置为KC_CACHE: ispn
我有几个登录页面的主题。如何禁用和清除主题缓存?较新版本的Keycloak没有standalone_ha.xml

英文:

I am running keycloak 20.0.3 in docker with setting KC_CACHE: ispn
I have a few themes for the login page. How can I disable and clear theme caching ? Newer version of keycloak does not have standalone_ha.xml

答案1

得分: 1

如果您以开发模式启动Keycloak,主题缓存应该会自动停用。

使用以下命令:

podman|docker run --name mykeycloak -p 8080:8080 \
    -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
    quay.io/keycloak/keycloak:latest \
    start-dev

(来源: https://www.keycloak.org/server/containers)

如果不起作用,请将以下参数添加到启动脚本中:

bin/kc.[sh|bat] start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false

(来源: https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)

我从docker-compose中这样启动它:

entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev",
    # 在主题开发期间停用主题缓存
    "--spi-theme-static-max-age=-1",
    "--spi-theme-cache-themes=false",
    "--spi-theme-cache-templates=false"
    # ...
]
英文:

If you start keycloak in development mode theme caching should be deactivated automatically.

Call:

podman|docker run --name mykeycloak -p 8080:8080 \
    -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
    quay.io/keycloak/keycloak:latest \
    start-dev

(from: https://www.keycloak.org/server/containers)

If it doesn't work add the following params to the startup script:

bin/kc.[sh|bat] start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false

(from: https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)

I start it from docker-compose like this:

    entrypoint: [ "/opt/keycloak/bin/kc.sh", "start-dev",
      # deactivate theme caching during theme development
              "--spi-theme-static-max-age=-1",
              "--spi-theme-cache-themes=false",
              "--spi-theme-cache-templates=false"
      # ...
    ]

huangapple
  • 本文由 发表于 2023年2月6日 14:21:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/75357960.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定