Coder Social home page Coder Social logo

jeff-tian / keycloak-heroku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mieckert/keycloak-heroku

26.0 2.0 33.0 21.83 MB

Deploy Keycloak to Heroku, Okteto, and more...

Home Page: https://keycloak.jiwai.win

License: Apache License 2.0

Dockerfile 3.82% Shell 16.18% Batchfile 1.44% HTML 9.53% Java 39.30% CSS 1.48% JavaScript 19.69% TypeScript 6.89% Ruby 1.67%
keycloak heroku heroku-deployment herokuapp sso sso-authentication sso-login single-sign-on

keycloak-heroku's Introduction

🔑 keycloak-heroku


一键部署 Keycloak 到 Heroku PaaS 平台、Okteto 等 k8s 平台。

Deploy Keycloak to Heroku PaaS and k8s such as Okteto by just one click.

Lines of Code Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities Duplicated Lines (%) Technical Debt

🇨🇳 中文版说明

部署到 Heroku

Keycloak 是一款优秀的开源身份与访问管理系统,直接部署到 Heroku 会存在一个小问题,因此需要做一些小调整。本仓库基于上游的调整,升级了 Keycloak 的版本,并适配了 Heroku 的免费 Dyno,从而不需要付费,免费拥有一个 Keycloak 实例。

线上域名

注意 ⚠️

详见《Free Arch: Bye-bye to Heroku - Jeff Tian的文章 - 知乎》,Heroku 不再提供免费 Dyno,因此,部署该项目到 Heroku,可能会产生费用。替代方案:部署到 Okteto 或者 Naptive 等免费的 k8s 集群☸️ 中。

📃 更多说明:

✨ Star 历史

https://api.star-history.com/svg?repos=jeff-tian/keycloak-heroku&type=Date

💻 开发

运行部署到 k8s 集群的版本

mvn clean install
docker compose up --build

运行部署到 heroku 的版本:

mvn clean install
docker compose -f docker-compose.heroku.yml up --build

在本地用 h2 数据库模拟部署到 heroku 的版本:

# The following token was restricted to be only able to pull
# Jeff Tian's GitHub Packages, so it's OK to be public and included
# in the source code
GH_TOKEN=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 docker compose -f docker-compose.local.yml up --build
open http://localhost:8080/

在本地用 PostgreSQL 数据库模拟部署到 heroku 的版本:

docker compose -f docker-compose.local-postgres.yml up --build
open http://localhost:8080/

💵 欢迎问我!

有任何相关问题,欢迎来知乎咨询:

向我咨询

感谢

🇱🇷 English README

Deploy to Heroku

This repository deploys the Keycloak Identity and Access Management Solution to Heroku. It is based of Keycloak's official docker image with some slight modifications to use the Heroku variable for PORT and DATABASE_URL properly.

The deployment will be made with a single Free dyno (although it won't run very well in smaller dynos due to Java's memory hunger, it can be used as testing purpose without issues) with a free Postgres database attached.

keycloak-heroku's People

Contributors

ap-tianjef avatar imgbotapp avatar jeff-tian avatar meckert-salesforce avatar mieckert avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

keycloak-heroku's Issues

本地以 postgres 为数据库启动出现问题。

@Jeff-Tian ➜ /workspaces/keycloak-heroku (master) $ docker compose -f docker-compose.local-postgres.yml up 
[+] Running 3/0
 ✔ Container keycloak-heroku-adminer-1   C...                                       0.0s 
 ✔ Container keycloak-heroku-keycloak-1  Created                                    0.0s 
 ✔ Container keycloak-heroku-postgres-1  Created                                    0.0s 
Attaching to keycloak-heroku-adminer-1, keycloak-heroku-keycloak-1, keycloak-heroku-postgres-1
keycloak-heroku-adminer-1   | [Sat Sep  9 05:04:51 2023] PHP 7.4.33 Development Server (http://[::]:8080) started
keycloak-heroku-postgres-1  | 
keycloak-heroku-postgres-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
keycloak-heroku-postgres-1  | 
keycloak-heroku-postgres-1  | 
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.372 UTC [1] LOG:  starting PostgreSQL 15.4 (Debian 15.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.372 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.372 UTC [1] LOG:  listening on IPv6 address "::", port 5432
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.397 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.423 UTC [28] LOG:  database system was shut down at 2023-09-09 05:04:07 UTC
keycloak-heroku-postgres-1  | 2023-09-09 05:04:51.441 UTC [1] LOG:  database system is ready to accept connections
keycloak-heroku-keycloak-1  | 2023-09-09 05:04:52,980 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: account3, admin-fine-grained-authz, client-secret-rotation, declarative-user-profile, recovery-codes, scripts, token-exchange, update-email
keycloak-heroku-keycloak-1  | 2023-09-09 05:04:53,607 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
keycloak-heroku-keycloak-1  | 2023-09-09 05:04:55,880 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
keycloak-heroku-keycloak-1  | 2023-09-09 05:04:56,000 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak-heroku-keycloak-1  | ERROR: Failed to start server in (development) mode
keycloak-heroku-keycloak-1  | ERROR: io.quarkus.runtime.configuration.ConfigurationException: Model classes are defined for the default persistence unit keycloak-default but configured datasource <default> not found: the default EntityManagerFactory will not be created. To solve this, configure the default datasource. Refer to https://quarkus.io/guides/datasource for guidance.
keycloak-heroku-keycloak-1  | ERROR: Model classes are defined for the default persistence unit keycloak-default but configured datasource <default> not found: the default EntityManagerFactory will not be created. To solve this, configure the default datasource. Refer to https://quarkus.io/guides/datasource for guidance.
keycloak-heroku-keycloak-1  | For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
keycloak-heroku-keycloak-1 exited with code 1
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Stopping 3/3
 ✔ Container keycloak-heroku-keycloak-1  Stopped                                    0.0s 
 ✔ Container keycloak-heroku-postgres-1  Stopped                                    0.5s 
 ✔ Container keycloak-heroku-adminer-1   S...                                       0.3s 
canceled
@Jeff-Tian ➜ /workspaces/keycloak-heroku (master) $ docker compose -f docker-compose.local-postgres.yml up --build
[+] Building 2.3s (9/17)                                                  docker:default
 => [keycloak internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                                     0.0s
 => [keycloak internal] load build definition from Dockerfile.local                 0.1s
 => => transferring dockerfile: 1.44kB                                              0.0s
 => [keycloak internal] load metadata for quay.io/keycloak/keycloak:22.0.1          1.1s
 => [keycloak internal] load metadata for docker.io/jefftian/keycloak-builder:late  1.9s
 => [keycloak auth] jefftian/keycloak-builder:pull token for registry-1.docker.io   0.0s
 => CACHED [keycloak mvn_builder 1/1] FROM docker.io/jefftian/keycloak-builder@sha  0.0s
 => CACHED [keycloak builder 1/8] FROM quay.io/keycloak/keycloak:22.0.1@sha256:89b  0.0s
 => [keycloak internal] load build context                                          0.1s
 => => transferring context: 678B                                                   0.0s
 => ERROR [keycloak builder 2/8] COPY --from=mvn_builder /tmp/target/*.jar /opt/ke  0.2s
------
 > [keycloak builder 2/8] COPY --from=mvn_builder /tmp/target/*.jar /opt/keycloak/providers/:
------
failed to solve: lstat /var/lib/docker/tmp/buildkit-mount3727961911/tmp/target: no such file or directory

在 Windows 和 GitHub Codespace 的 Linux 上出现以上错误,在自己的 Mac 上没能重现。

启动时的内存优化

Heroku 上启动时内存占用过高导致进程被杀死:

2024-03-28T07:38:47.904342+00:00 heroku[web.1]: Process running mem=1530M(298.9%)
2024-03-28T07:38:47.906493+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2024-03-28T07:38:47.908490+00:00 heroku[web.1]: Stopping process with SIGKILL
2024-03-28T07:38:48.117020+00:00 heroku[web.1]: Process exited with status 137
2024-03-28T07:38:48.140853+00:00 heroku[web.1]: State changed from starting to crashed

No such provider 'ldap'

在 Heroku 上从 22.0.4 升级到 24.0.0 时,最终在启动时报错:

2024-03-28T09:53:37.100732+00:00 app[web.1]: 2024-03-28 09:53:37,100 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2024-03-28T09:53:37.102222+00:00 app[web.1]: 2024-03-28 09:53:37,100 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) Error details:: java.lang.IllegalArgumentException: No such provider 'ldap'
2024-03-28T09:53:37.102223+00:00 app[web.1]: at org.keycloak.models.utils.ComponentUtil.getComponentFactory(ComponentUtil.java:87)
2024-03-28T09:53:37.102224+00:00 app[web.1]: at org.keycloak.models.utils.ComponentUtil.getComponentFactory(ComponentUtil.java:57)
2024-03-28T09:53:37.102224+00:00 app[web.1]: at org.keycloak.models.jpa.RealmAdapter.updateComponent(RealmAdapter.java:2111)
2024-03-28T09:53:37.102227+00:00 app[web.1]: at org.keycloak.migration.migrators.MigrateTo24_0_0.lambda$updateLdapProviderConfig$2(MigrateTo24_0_0.java:101)
2024-03-28T09:53:37.102227+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
2024-03-28T09:53:37.102236+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
2024-03-28T09:53:37.102236+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
2024-03-28T09:53:37.102236+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
2024-03-28T09:53:37.102237+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
2024-03-28T09:53:37.102237+00:00 app[web.1]: at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
2024-03-28T09:53:37.102238+00:00 app[web.1]: at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
2024-03-28T09:53:37.102238+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
2024-03-28T09:53:37.102239+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
2024-03-28T09:53:37.102239+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2024-03-28T09:53:37.102239+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2024-03-28T09:53:37.102239+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2024-03-28T09:53:37.102239+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
2024-03-28T09:53:37.102240+00:00 app[web.1]: at org.keycloak.migration.migrators.MigrateTo24_0_0.updateLdapProviderConfig(MigrateTo24_0_0.java:99)
2024-03-28T09:53:37.102240+00:00 app[web.1]: at org.keycloak.migration.migrators.MigrateTo24_0_0.migrateRealm(MigrateTo24_0_0.java:63)
2024-03-28T09:53:37.102240+00:00 app[web.1]: at org.keycloak.migration.migrators.MigrateTo24_0_0.lambda$migrate$0(MigrateTo24_0_0.java:45)
2024-03-28T09:53:37.102240+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
2024-03-28T09:53:37.102241+00:00 app[web.1]: at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2024-03-28T09:53:37.102242+00:00 app[web.1]: at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
2024-03-28T09:53:37.102243+00:00 app[web.1]: at org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
2024-03-28T09:53:37.102243+00:00 app[web.1]: at org.keycloak.migration.migrators.MigrateTo24_0_0.migrate(MigrateTo24_0_0.java:45)
2024-03-28T09:53:37.102243+00:00 app[web.1]: at org.keycloak.storage.datastore.DefaultMigrationManager.migrate(DefaultMigrationManager.java:141)
2024-03-28T09:53:37.102243+00:00 app[web.1]: at org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:33)
2024-03-28T09:53:37.102244+00:00 app[web.1]: at org.keycloak.quarkus.runtime.storage.legacy.database.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:213)
2024-03-28T09:53:37.102244+00:00 app[web.1]: at org.keycloak.quarkus.runtime.storage.legacy.database.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:207)
2024-03-28T09:53:37.102244+00:00 app[web.1]: at org.keycloak.models.utils.KeycloakModelUtils.lambda$runJobInTransaction$1(KeycloakModelUtils.java:257)
2024-03-28T09:53:37.102244+00:00 app[web.1]: at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransactionWithResult(KeycloakModelUtils.java:379)
2024-03-28T09:53:37.102244+00:00 app[web.1]: at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:256)
2024-03-28T09:53:37.102248+00:00 app[web.1]: at org.keycloak.quarkus.runtime.storage.legacy.database.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:132)
2024-03-28T09:53:37.102248+00:00 app[web.1]: at org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:105)
2024-03-28T09:53:37.102249+00:00 app[web.1]: at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.createSessionFactory(QuarkusKeycloakApplication.java:56)
2024-03-28T09:53:37.102249+00:00 app[web.1]: at org.keycloak.services.resources.KeycloakApplication.startup(KeycloakApplication.java:131)
2024-03-28T09:53:37.102250+00:00 app[web.1]: at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.onStartupEvent(QuarkusKeycloakApplication.java:46)
2024-03-28T09:53:37.102250+00:00 app[web.1]: at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication_Observer_onStartupEvent_GNZ8m5QenZ9h9VNelo7awjUZFDE.notify(Unknown Source)
2024-03-28T09:53:37.102250+00:00 app[web.1]: at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:346)
2024-03-28T09:53:37.102250+00:00 app[web.1]: at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:328)
2024-03-28T09:53:37.102252+00:00 app[web.1]: at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:82)
2024-03-28T09:53:37.102252+00:00 app[web.1]: at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:155)
2024-03-28T09:53:37.102252+00:00 app[web.1]: at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:106)
2024-03-28T09:53:37.102252+00:00 app[web.1]: at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
2024-03-28T09:53:37.102252+00:00 app[web.1]: at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
2024-03-28T09:53:37.102253+00:00 app[web.1]: at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
2024-03-28T09:53:37.102253+00:00 app[web.1]: at io.quarkus.runtime.Application.start(Application.java:101)
2024-03-28T09:53:37.102253+00:00 app[web.1]: at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
2024-03-28T09:53:37.102253+00:00 app[web.1]: at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
2024-03-28T09:53:37.102253+00:00 app[web.1]: at org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:117)
2024-03-28T09:53:37.102254+00:00 app[web.1]: at org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:33)
2024-03-28T09:53:37.102254+00:00 app[web.1]: at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
2024-03-28T09:53:37.102254+00:00 app[web.1]: at picocli.CommandLine.access$1500(CommandLine.java:148)
2024-03-28T09:53:37.102254+00:00 app[web.1]: at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
2024-03-28T09:53:37.102254+00:00 app[web.1]: at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at picocli.CommandLine.execute(CommandLine.java:2170)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:125)
2024-03-28T09:53:37.102255+00:00 app[web.1]: at org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:107)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
2024-03-28T09:53:37.102256+00:00 app[web.1]: at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
2024-03-28T09:53:37.102257+00:00 app[web.1]:
2024-03-28T09:53:37.259374+00:00 heroku[web.1]: Process exited with status 1
2024-03-28T09:53:37.288634+00:00 heroku[web.1]: State changed from starting to crashed

在 Heroku 上启动失败,显示13 changesets check sum 不匹配

问题

我在 Heroku 上启动 keycloak 失败:

Starting process with command `start-dev --hostname-strict\=false --http-port\=\19626 --proxy\=edge --db\=postgres --db-url\=\jdbc:postgresql://ec2-34-235-108-214.compute-1.amazonaws.com:5432/dde6l921b6kpq2 --db-username\=\ofuwdjfhloaomb --db-password\=\15d60fa7871c34fbbd039eee2e42876cc76a1efb4e2f0c30bfdf1ae2d097e902 --features\=\"preview,scripts\"`
2023-11-01T04:48:44.626714+00:00 app[web.1]: Updating the configuration and installing your custom providers, if any. Please wait.
2023-11-01T04:48:48.416294+00:00 app[web.1]: 2023-11-01 04:48:44,833 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: account3, admin-fine-grained-authz, client-secret-rotation, declarative-user-profile, recovery-codes, scripts, token-exchange, update-email
2023-11-01T04:48:48.419103+00:00 app[web.1]: 2023-11-01 04:48:46,657 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: account3, admin-fine-grained-authz, client-secret-rotation, declarative-user-profile, recovery-codes, scripts, token-exchange, update-email
2023-11-01T04:48:56.262528+00:00 app[web.1]: 2023-11-01 04:48:56,259 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 9973ms
2023-11-01T04:48:59.319875+00:00 app[web.1]: 2023-11-01 04:48:57,353 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: account3, admin-fine-grained-authz, client-secret-rotation, declarative-user-profile, recovery-codes, scripts, token-exchange, update-email
2023-11-01T04:48:59.320045+00:00 app[web.1]: 2023-11-01 04:48:57,805 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
2023-11-01T04:48:59.332948+00:00 app[web.1]: 2023-11-01 04:48:59,289 WARN  [io.quarkus.agroal.runtime.DataSources] (main) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
2023-11-01T04:48:59.708279+00:00 app[web.1]: 2023-11-01 04:48:59,707 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2023-11-01T04:48:59.934474+00:00 app[web.1]: 2023-11-01 04:48:59,934 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2023-11-01T04:49:00.566792+00:00 heroku[logplex]: Error L10 (output buffer overflow): drain 'd.ab7af9e0-226d-4145-9401-b98fce276991' dropped 1 messages since 2023-11-01T04:48:30.629322+00:00.
2023-11-01T04:49:00.411159+00:00 app[web.1]: 2023-11-01 04:49:00,410 WARN  [io.quarkus.vertx.http.runtime.VertxHttpRecorder] (main) The X-Forwarded-* and Forwarded headers will be considered when determining the proxy address. This configuration can cause a security issue as clients can forge requests and send a forwarded header that is not overwritten by the proxy. Please consider use one of these headers just to forward the proxy address in requests.
2023-11-01T04:49:00.416309+00:00 app[web.1]: 2023-11-01 04:49:00,416 INFO  [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
2023-11-01T04:49:00.435569+00:00 app[web.1]: 2023-11-01 04:49:00,435 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_83764, Site name: null
2023-11-01T04:49:01.207355+00:00 heroku[logplex]: Error L10 (output buffer overflow): drain 'd.ab7af9e0-226d-4145-9401-b98fce276991' dropped 1 messages since 2023-11-01T04:48:31.258117+00:00.
2023-11-01T04:49:01.610459+00:00 app[web.1]: 2023-11-01 04:49:01,610 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
2023-11-01T04:49:01.610653+00:00 app[web.1]: 2023-11-01 04:49:01,610 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: liquibase.exception.ValidationFailedException: Validation Failed:
2023-11-01T04:49:01.610654+00:00 app[web.1]:      113 changesets check sum
2023-11-01T04:49:01.610654+00:00 app[web.1]:           META-INF/jpa-changelog-1.0.0.Final.xml::1.0.0.Final-KEYCLOAK-5461::[email protected] was: 9:6f1016664e21e16d26517a4418f5e3df but is now: 8:bda77d94bf90182a1e30c24f1c155ec7
2023-11-01T04:49:01.610654+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.0.0.Final.xml::1.0.0.Final-KEYCLOAK-5461::[email protected] was: 9:828775b1596a07d1200ba1d49e5e3941 but is now: 8:1ecb330f30986693d1cba9ab579fa219
2023-11-01T04:49:01.610655+00:00 app[web.1]:           META-INF/jpa-changelog-1.1.0.Beta1.xml::1.1.0.Beta1::[email protected] was: 9:5f090e44a7d595883c1fb61f4b41fd38 but is now: 8:cb7ace19bc6d959f305605d255d4c843
2023-11-01T04:49:01.610655+00:00 app[web.1]:           META-INF/jpa-changelog-1.1.0.Final.xml::1.1.0.Final::[email protected] was: 9:c07e577387a3d2c04d1adc9aaad8730e but is now: 8:80230013e961310e6872e871be424a63
2023-11-01T04:49:01.610655+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::[email protected] was: 9:b68ce996c655922dbcd2fe6b6ae72686 but is now: 8:67f4c20929126adc0c8e9bf48279d244
2023-11-01T04:49:01.610655+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::[email protected] was: 9:543b5c9989f024fe35c6f6c5a97de88e but is now: 8:7311018b0b8179ce14628ab412bb6783
2023-11-01T04:49:01.610659+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::[email protected] was: 9:765afebbe21cf5bbca048e632df38336 but is now: 8:037ba1216c3640f8785ee6b8e7c8e3c1
2023-11-01T04:49:01.610659+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::[email protected] was: 9:db4a145ba11a6fdaefb397f6dbf829a1 but is now: 8:7fe6ffe4af4df289b3157de32c624263
2023-11-01T04:49:01.610660+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.Final.xml::1.2.0.Final::keycloak was: 9:9d05c7be10cdb873f8bcb41bc3a8ab23 but is now: 8:9c136bc3187083a98745c7d03bc8a303
2023-11-01T04:49:01.610660+00:00 app[web.1]:           META-INF/jpa-changelog-1.3.0.xml::1.3.0::[email protected] was: 9:18593702353128d53111f9b1ff0b82b8 but is now: 8:b5f09474dca81fb56a97cf5b6553d331
2023-11-01T04:49:01.610660+00:00 app[web.1]:           META-INF/jpa-changelog-1.4.0.xml::1.4.0::[email protected] was: 9:6122efe5f090e41a85c0f1c9e52cbb62 but is now: 8:ca924f31bd2a3b219fdcfe78c82dacf4
2023-11-01T04:49:01.610660+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.4.0.xml::1.4.0::[email protected] was: 9:e1ff28bf7568451453f844c5d54bb0b5 but is now: 8:8acad7483e106416bcfa6f3b824a16cd
2023-11-01T04:49:01.610660+00:00 app[web.1]:           META-INF/jpa-changelog-1.5.0.xml::1.5.0::[email protected] was: 9:7af32cd8957fbc069f796b61217483fd but is now: 8:9b1266d17f4f87c78226f5055408fd5e
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from15::[email protected] was: 9:6005e15e84714cd83226bf7879f54190 but is now: 8:d80ec4ab6dbfe573550ff72396c7e910
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from16-pre::[email protected] was: 9:bf656f5a2b055d07f314431cae76f06c but is now: 8:d86eb172171e7c20b9c849b584d147b2
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from16::[email protected] was: 9:f8dadc9284440469dcf71e25ca6ab99b but is now: 8:5735f46f0fa60689deb0ecdc2a0dea22
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1::[email protected] was: 9:d41d8cd98f00b204e9800998ecf8427e but is now: 8:d41d8cd98f00b204e9800998ecf8427e
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.7.0.xml::1.7.0::[email protected] was: 9:3368ff0be4c2855ee2dd9ca813b38d8e but is now: 8:5c1a8fd2014ac7fc43b90a700f117b23
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.8.0.xml::1.8.0::[email protected] was: 9:8ac2fb5dd030b24c0570a763ed75ed20 but is now: 8:1f6c2c2dfc362aff4ed75b3f0ef6b331
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/jpa-changelog-1.8.0.xml::1.8.0-2::keycloak was: 9:f91ddca9b19743db60e3057679810e6c but is now: 8:dee9246280915712591f83a127665107
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0::[email protected] was: 9:831e82914316dc8a57dc09d755f23c51 but is now: 8:9eb2ee1fa8ad1c5e426421a6f8fdfa6a
2023-11-01T04:49:01.610661+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0-2::keycloak was: 9:f91ddca9b19743db60e3057679810e6c but is now: 8:dee9246280915712591f83a127665107
2023-11-01T04:49:01.610662+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.0.xml::1.9.0::[email protected] was: 9:bc3d0f9e823a69dc21e23e94c7a94bb1 but is now: 8:d9fa18ffa355320395b86270680dd4fe
2023-11-01T04:49:01.610663+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.1.xml::1.9.1::keycloak was: 9:c9999da42f543575ab790e76439a2679 but is now: 8:90cff506fedb06141ffc1c71c4a1214c
2023-11-01T04:49:01.610663+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.9.1.xml::1.9.1::keycloak was: 9:0d6c65c6f58732d81569e77b10ba301d but is now: 8:11a788aed4961d6d29c427c063af828c
2023-11-01T04:49:01.610663+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.2.xml::1.9.2::keycloak was: 9:fc576660fc016ae53d2d4778d84d86d0 but is now: 8:a4218e51e1faf380518cce2af5d39b43
2023-11-01T04:49:01.610664+00:00 app[web.1]: 
2023-11-01T04:49:01.610975+00:00 app[web.1]: 2023-11-01 04:49:01,610 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Validation Failed:
2023-11-01T04:49:01.610975+00:00 app[web.1]:      113 changesets check sum
2023-11-01T04:49:01.610975+00:00 app[web.1]:           META-INF/jpa-changelog-1.0.0.Final.xml::1.0.0.Final-KEYCLOAK-5461::[email protected] was: 9:6f1016664e21e16d26517a4418f5e3df but is now: 8:bda77d94bf90182a1e30c24f1c155ec7
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.0.0.Final.xml::1.0.0.Final-KEYCLOAK-5461::[email protected] was: 9:828775b1596a07d1200ba1d49e5e3941 but is now: 8:1ecb330f30986693d1cba9ab579fa219
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.1.0.Beta1.xml::1.1.0.Beta1::[email protected] was: 9:5f090e44a7d595883c1fb61f4b41fd38 but is now: 8:cb7ace19bc6d959f305605d255d4c843
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.1.0.Final.xml::1.1.0.Final::[email protected] was: 9:c07e577387a3d2c04d1adc9aaad8730e but is now: 8:80230013e961310e6872e871be424a63
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::[email protected] was: 9:b68ce996c655922dbcd2fe6b6ae72686 but is now: 8:67f4c20929126adc0c8e9bf48279d244
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::[email protected] was: 9:543b5c9989f024fe35c6f6c5a97de88e but is now: 8:7311018b0b8179ce14628ab412bb6783
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::[email protected] was: 9:765afebbe21cf5bbca048e632df38336 but is now: 8:037ba1216c3640f8785ee6b8e7c8e3c1
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::[email protected] was: 9:db4a145ba11a6fdaefb397f6dbf829a1 but is now: 8:7fe6ffe4af4df289b3157de32c624263
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.2.0.Final.xml::1.2.0.Final::keycloak was: 9:9d05c7be10cdb873f8bcb41bc3a8ab23 but is now: 8:9c136bc3187083a98745c7d03bc8a303
2023-11-01T04:49:01.610976+00:00 app[web.1]:           META-INF/jpa-changelog-1.3.0.xml::1.3.0::[email protected] was: 9:18593702353128d53111f9b1ff0b82b8 but is now: 8:b5f09474dca81fb56a97cf5b6553d331
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.4.0.xml::1.4.0::[email protected] was: 9:6122efe5f090e41a85c0f1c9e52cbb62 but is now: 8:ca924f31bd2a3b219fdcfe78c82dacf4
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.4.0.xml::1.4.0::[email protected] was: 9:e1ff28bf7568451453f844c5d54bb0b5 but is now: 8:8acad7483e106416bcfa6f3b824a16cd
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.5.0.xml::1.5.0::[email protected] was: 9:7af32cd8957fbc069f796b61217483fd but is now: 8:9b1266d17f4f87c78226f5055408fd5e
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from15::[email protected] was: 9:6005e15e84714cd83226bf7879f54190 but is now: 8:d80ec4ab6dbfe573550ff72396c7e910
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from16-pre::[email protected] was: 9:bf656f5a2b055d07f314431cae76f06c but is now: 8:d86eb172171e7c20b9c849b584d147b2
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1_from16::[email protected] was: 9:f8dadc9284440469dcf71e25ca6ab99b but is now: 8:5735f46f0fa60689deb0ecdc2a0dea22
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.6.1.xml::1.6.1::[email protected] was: 9:d41d8cd98f00b204e9800998ecf8427e but is now: 8:d41d8cd98f00b204e9800998ecf8427e
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.7.0.xml::1.7.0::[email protected] was: 9:3368ff0be4c2855ee2dd9ca813b38d8e but is now: 8:5c1a8fd2014ac7fc43b90a700f117b23
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.8.0.xml::1.8.0::[email protected] was: 9:8ac2fb5dd030b24c0570a763ed75ed20 but is now: 8:1f6c2c2dfc362aff4ed75b3f0ef6b331
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/jpa-changelog-1.8.0.xml::1.8.0-2::keycloak was: 9:f91ddca9b19743db60e3057679810e6c but is now: 8:dee9246280915712591f83a127665107
2023-11-01T04:49:01.610977+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0::[email protected] was: 9:831e82914316dc8a57dc09d755f23c51 but is now: 8:9eb2ee1fa8ad1c5e426421a6f8fdfa6a
2023-11-01T04:49:01.610978+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0-2::keycloak was: 9:f91ddca9b19743db60e3057679810e6c but is now: 8:dee9246280915712591f83a127665107
2023-11-01T04:49:01.610978+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.0.xml::1.9.0::[email protected] was: 9:bc3d0f9e823a69dc21e23e94c7a94bb1 but is now: 8:d9fa18ffa355320395b86270680dd4fe
2023-11-01T04:49:01.610978+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.1.xml::1.9.1::keycloak was: 9:c9999da42f543575ab790e76439a2679 but is now: 8:90cff506fedb06141ffc1c71c4a1214c
2023-11-01T04:49:01.610979+00:00 app[web.1]:           META-INF/db2-jpa-changelog-1.9.1.xml::1.9.1::keycloak was: 9:0d6c65c6f58732d81569e77b10ba301d but is now: 8:11a788aed4961d6d29c427c063af828c
2023-11-01T04:49:01.610980+00:00 app[web.1]:           META-INF/jpa-changelog-1.9.2.xml::1.9.2::keycloak was: 9:fc576660fc016ae53d2d4778d84d86d0 but is now: 8:a4218e51e1faf380518cce2af5d39b43
2023-11-01T04:49:01.610980+00:00 app[web.1]: 

我的 Dockerfile 是这样的:

ARG KEYCLOAK_VERSION=22.0.1

FROM docker.io/jefftian/keycloak-builder as mvn_builder

FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} as builder
#COPY --from=mvn_builder /tmp/target/*.jar /opt/keycloak/providers/
#COPY --from=mvn_builder /tmp/target/*.jar /opt/keycloak/deployments/

COPY idps/wechat-mobile/keycloak-services-social-weixin.jar \
    /opt/keycloak/providers/

COPY idps/wecom/keycloak-services-social-wechat-work.jar \
    /opt/keycloak/providers/
COPY idps/wecom/templates/realm-identity-provider-wechat-work.html \
    /opt/keycloak/themes/base/admin/resources/partials
COPY idps/wecom/templates/realm-identity-provider-wechat-work-ext.html \
    /opt/keycloak/themes/base/admin/resources/partials


#COPY  temp/* /opt/keycloak/themes/base/admin/resources/partials
#COPY  ui/font_iconfont /opt/keycloak/themes/keycloak/common/resources/lib/font_iconfont
#COPY  ui/theme.properties /opt/keycloak/themes/keycloak/login/

ENV KC_PROXY_ADDRESS_FORWARDING=true

USER 1000

RUN /opt/keycloak/bin/kc.sh build --health-enabled=true

FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION}
COPY --from=builder /opt/keycloak/ /opt/keycloak/
WORKDIR /opt/keycloak

CMD ["start-dev", "--hostname-strict=false", "--http-port=$PORT", "--proxy=edge", "--db=postgres", "--db-url=$DB_URL", "--db-username=$DB_USERNAME", "--db-password=$DB_PASSWORD", "--features=\"preview,scripts\""]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.