bolkedebruin / rdpgw

Remote Desktop Gateway in Go for deploying on Linux/BSD/Kubernetes
Apache License 2.0
785 stars 119 forks source link

Unable to run in docker #54

Closed DavidAamcomp closed 8 months ago

DavidAamcomp commented 2 years ago

after running

cd dev/docker
docker-compose build
docker-compose up

I'm getting the following errors

rdpgw_1     | 2022/09/21 22:11:40 Cookies are used as session storage
rdpgw_1     | 2022/09/21 22:11:40 Starting remote desktop gateway server
rdpgw_1     | 2022/09/21 22:11:40 Cannot get oidc provider: Get "http://keycloak:8080/auth/realms/rdpgw/.well-known/openid-configuration": dial tcp 172.18.0.3:8080: connect: connection refused
rdpgw_1     | 2022/09/21 22:11:44 No valid `security.paatokenencryptionkey` specified (empty or not 32 characters). Setting to random
rdpgw_1     | 2022/09/21 22:11:44 Cookies are used as session storage
rdpgw_1     | 2022/09/21 22:11:44 Starting remote desktop gateway server
rdpgw_1     | 2022/09/21 22:11:44 Cannot get oidc provider: 404 Not Found: {"error":"RESTEASY003210: Could not find resource for full path: http://keycloak:8080/auth/realms/rdpgw/.well-known/openid-configuration"}
rdpgw_1     | 2022/09/21 22:11:51 No valid `security.paatokenencryptionkey` specified (empty or not 32 characters). Setting to random
rdpgw_1     | 2022/09/21 22:11:51 Cookies are used as session storage
rdpgw_1     | 2022/09/21 22:11:51 Starting remote desktop gateway server
bolkedebruin commented 2 years ago

your keycloak service did not come up correcty

{"error":"RESTEASY003210: Could not find resource for full path: http://keycloak:8080/auth/realms/rdpgw/.well-known/openid-configuration"}

You will need to fix that first.

DavidAamcomp commented 2 years ago

I thought keycloak was working. Any idea where I need to start troubleshooting?

keycloak    | 2022-09-22 20:14:38,065 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
keycloak    | 2022-09-22 20:14:38,107 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak    | 2022-09-22 20:14:38,542 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.9.Final
keycloak    | 2022-09-22 20:14:39,085 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_560345, Site name: null
keycloak    | 2022-09-22 20:14:39,630 INFO  [io.quarkus] (main) Keycloak 19.0.2 on JVM (powered by Quarkus 2.7.6.Final) started in 7.285s. Listening on: http://0.0.0.0:8080
keycloak    | 2022-09-22 20:14:39,631 INFO  [io.quarkus] (main) Profile dev activated. 
keycloak    | 2022-09-22 20:14:39,631 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, keycloak, logging-gelf, narayana-jta, reactive-routes, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, smallrye-metrics, vault, vertx]
keycloak    | 2022-09-22 20:14:39,675 ERROR [org.keycloak.services] (main) KC-SERVICES0010: Failed to add user 'admin' to realm 'master': user with username exists
keycloak    | 2022-09-22 20:14:39,676 WARN  [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.
xlejo commented 2 years ago

Change the keycloak image tag from latest to legacy.

The docker-compose file needs to be updated in order to match with Keycloak Quarkus distribution :(

tobsec commented 2 years ago

I have the same issue with Keycloak. Using the legacy image doesn't help, instead it results in Keycloak completely failed to start.

What I found is, that Keycloak doesn't import realm-export.json correctly as specified in the KEYCLOAK_IMPORT environment variable. Maybe it could be related to this issue in Keycloak: #https://github.com/keycloak/keycloak/issues/10216

I already tried importing the realm with the mentioned command /opt/keycloak/bin/kcadm.sh create realms -f /export/realm-export.json which basically worked, but rdpgw still is not able to connect to Keycloak.

tobsec commented 2 years ago

Check my PR: #60

bolkedebruin commented 8 months ago

This has been fixed in the latest compose files