Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Updated to work with latest keycloak updates

Rich Turnerc31a480394b4
diff --git a/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketHttpSubscription.java b/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketHttpSubscription.java
index f146db016..0b33b9bac 100644
--- a/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketHttpSubscription.java
+++ b/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketHttpSubscription.java
@@ -19,8 +19,6 @@
*/
package org.openremote.agent.protocol.websocket;
-import org.openremote.model.value.ValueType;
-
import java.util.List;
import java.util.Map;
diff --git a/container/src/main/java/org/openremote/container/security/IdentityService.java b/container/src/main/java/org/openremote/container/security/IdentityService.java
index 8e54daa01..941ad0f1a 100644
--- a/container/src/main/java/org/openremote/container/security/IdentityService.java
+++ b/container/src/main/java/org/openremote/container/security/IdentityService.java
@@ -76,7 +76,7 @@ public abstract class IdentityService implements ContainerService {
public void secureDeployment(DeploymentInfo deploymentInfo) {
LOG.info("Securing web deployment: " + deploymentInfo.getContextPath());
- deploymentInfo.addOuterHandlerChainWrapper(AuthOverloadHandler::new);
+ deploymentInfo.addInitialHandlerChainWrapper(AuthOverloadHandler::new);
deploymentInfo.setSecurityDisabled(false);
identityProvider.secureDeployment(deploymentInfo);
diff --git a/container/src/main/java/org/openremote/container/security/keycloak/KeycloakIdentityProvider.java b/container/src/main/java/org/openremote/container/security/keycloak/KeycloakIdentityProvider.java
index a2a7e54a9..c10fd56e1 100644
--- a/container/src/main/java/org/openremote/container/security/keycloak/KeycloakIdentityProvider.java
+++ b/container/src/main/java/org/openremote/container/security/keycloak/KeycloakIdentityProvider.java
@@ -22,12 +22,8 @@ package org.openremote.container.security.keycloak;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
-import io.undertow.server.HttpHandler;
-import io.undertow.server.handlers.ResponseCodeHandler;
-import io.undertow.server.handlers.proxy.ProxyHandler;
import io.undertow.servlet.api.DeploymentInfo;
import io.undertow.servlet.api.LoginConfig;
-import io.undertow.util.HttpString;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
@@ -36,9 +32,11 @@ import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.admin.client.resource.RealmsResource;
import org.keycloak.representations.adapters.config.AdapterConfig;
-import org.keycloak.representations.idm.PublishedRealmRepresentation;
+import org.openremote.container.security.ClientCredentialsAuthForm;
import org.openremote.container.security.IdentityProvider;
-import org.openremote.container.web.*;
+import org.openremote.container.web.ClientRequestInfo;
+import org.openremote.container.web.WebClient;
+import org.openremote.container.web.WebTargetBuilder;
import org.openremote.model.Container;
import org.openremote.model.auth.OAuthPasswordGrant;
@@ -57,7 +55,6 @@ import static javax.ws.rs.core.Response.Status.Family.REDIRECTION;
import static javax.ws.rs.core.Response.Status.Family.SUCCESSFUL;
import static org.openremote.container.util.MapAccess.*;
import static org.openremote.container.web.WebClient.getTarget;
-import static org.openremote.container.web.WebService.pathStartsWithHandler;
import static org.openremote.model.Constants.MASTER_REALM_ADMIN_USER;
import static org.openremote.model.Constants.REQUEST_HEADER_REALM;
@@ -74,60 +71,6 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
"master-realm",
"security-admin-console");
-// TODO: Below is here ready for Resteasy 4.x but their maven packages are a mess at the moment
-// protected static class EngineBuilder extends ClientHttpEngineBuilder43 {
-//
-// protected final UnaryOperator<HttpClientBuilder> httpClientBuilderConfigurator;
-//
-// public EngineBuilder(UnaryOperator<HttpClientBuilder> httpClientBuilderConfigurator) {
-// this.httpClientBuilderConfigurator = httpClientBuilderConfigurator;
-// }
-//
-// @Override
-// protected ClientHttpEngine createEngine(HttpClientConnectionManager cm, RequestConfig.Builder rcBuilder, HttpHost defaultProxy, int responseBufferSize, HostnameVerifier verifier, SSLContext theContext) {
-// final HttpClient httpClient;
-// rcBuilder.setProxy(defaultProxy);
-// if (System.getSecurityManager() == null)
-// {
-// HttpClientBuilder clientBuilder = HttpClientBuilder.create()
-// .setConnectionManager(cm)
-// .setDefaultRequestConfig(rcBuilder.build())
-// .disableContentCompression();
-//
-// if (httpClientBuilderConfigurator != null) {
-// clientBuilder = httpClientBuilderConfigurator.apply(clientBuilder);
-// }
-//
-// httpClient = clientBuilder.build();
-// }
-// else {
-// httpClient = AccessController.doPrivileged(new PrivilegedAction<HttpClient>()
-// {
-// @Override
-// public HttpClient run()
-// {
-// HttpClientBuilder clientBuilder = HttpClientBuilder.create()
-// .setConnectionManager(cm)
-// .setDefaultRequestConfig(rcBuilder.build())
-// .disableContentCompression();
-//
-// if (httpClientBuilderConfigurator != null) {
-// clientBuilder = httpClientBuilderConfigurator.apply(clientBuilder);
-// }
-//
-// return clientBuilder.build();
-// }
-// });
-// }
-//
-// ApacheHttpClient43Engine engine = new ApacheHttpClient43Engine(httpClient, true);
-// engine.setResponseBufferSize(responseBufferSize);
-// engine.setHostnameVerifier(verifier);
-// // this may be null. We can't really support this with Apache Client.
-// engine.setSslContext(theContext);
-// return engine;
-// }
-// }
public static final String KEYCLOAK_HOST = "KEYCLOAK_HOST";
public static final String KEYCLOAK_HOST_DEFAULT = "localhost";
public static final String KEYCLOAK_PORT = "KEYCLOAK_PORT";
@@ -151,10 +94,8 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
private static final Logger LOG = Logger.getLogger(KeycloakIdentityProvider.class.getName());
// Each realm in Keycloak has a client application with this identifier
final protected String clientId;
-
// The externally visible address of this installation
protected UriBuilder externalServerUri;
-
// The (internal) URI where Keycloak can be found
protected UriBuilder keycloakServiceUri;
// Configuration options for new realms
@@ -170,8 +111,6 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
protected LoadingCache<KeycloakRealmClient, KeycloakDeployment> keycloakDeploymentCache;
// The configuration for the Keycloak servlet extension, looks up the client application per realm
protected KeycloakConfigResolver keycloakConfigResolver;
- // Optional reverse proxy that listens to AUTH_PATH and forwards requests to Keycloak
- protected HttpHandler authProxyHandler;
protected KeycloakIdentityProvider(String clientId) {
this.clientId = clientId;
@@ -211,17 +150,12 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
UriBuilder.fromPath("/")
.scheme("http")
.host(getString(container.getConfig(), KEYCLOAK_HOST, KEYCLOAK_HOST_DEFAULT))
- .port(getInteger(container.getConfig(), KEYCLOAK_PORT, KEYCLOAK_PORT_DEFAULT))
- .path(KeycloakResource.KEYCLOAK_CONTEXT_PATH);
+ .port(getInteger(container.getConfig(), KEYCLOAK_PORT, KEYCLOAK_PORT_DEFAULT));
LOG.info("Keycloak service URL: " + keycloakServiceUri.build());
-
- // This client sets a custom Host header on outgoing requests, acting like a reverse proxy that "preserves"
- // the Host header. Keycloak will verify token issuer name based on this, so it must match the external host
- // and port that was used to obtain the token.
ResteasyClientBuilder clientBuilder =
- new ProxyWebClientBuilder(externalServerUri.build().getHost(), externalServerUri.build().getPort())
+ new ResteasyClientBuilder()
.connectTimeout(
getInteger(container.getConfig(), KEYCLOAK_CONNECT_TIMEOUT, KEYCLOAK_CONNECT_TIMEOUT_DEFAULT),
TimeUnit.MILLISECONDS
@@ -237,7 +171,7 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
WebTargetBuilder targetBuilder = new WebTargetBuilder(httpClient, keycloakServiceUri.build());
targetBuilder.setOAuthAuthentication(new OAuthPasswordGrant(
- keycloakServiceUri.clone().path("/realms/master/protocol/openid-connect/token").build().toString(),
+ keycloakServiceUri.clone().path("/auth/realms/master/protocol/openid-connect/token").build().toString(),
ADMIN_CLI_CLIENT_ID,
null,
"openid",
@@ -263,22 +197,6 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
return keycloakDeployment;
};
- @SuppressWarnings("deprecation")
- ProxyHandler proxyHandler = ProxyHandler.builder()
- .setProxyClient(new io.undertow.server.handlers.proxy.SimpleProxyClientProvider(keycloakServiceUri.clone().replacePath("").build()))
- .setMaxRequestTime(getInteger(container.getConfig(), KEYCLOAK_REQUEST_TIMEOUT, KEYCLOAK_REQUEST_TIMEOUT_DEFAULT))
- .setNext(ResponseCodeHandler.HANDLE_404)
- .setReuseXForwarded(true)
- .build();
-
- authProxyHandler = exchange -> {
- proxyHandler.handleRequest(exchange);
- // Let the client cache the keycloak.js file for 12 hours
- if (exchange.getRequestPath().endsWith("keycloak.js") && !exchange.isResponseComplete()) {
- exchange.getResponseHeaders().put(HttpString.tryFromString("Cache-Control"), "public,max-age=" + (12 * 60 * 60) + ",must-revalidate");
- }
- };
-
// TODO Not a great way to block startup while we wait for other services (Hystrix?)
waitForKeycloak();
LOG.info("Keycloak identity provider available: " + keycloakServiceUri.build());
@@ -305,9 +223,11 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
return keycloakTarget.proxy(KeycloakResource.class);
}
- public KeycloakResource getExternalKeycloak() {
- return getTarget(httpClient, keycloakServiceUri.build(), null, null, externalServerUri.build())
- .proxy(KeycloakResource.class);
+ public String getAccessToken(String realm, String username, String secret) {
+ return getTarget(httpClient, keycloakServiceUri.build(), null, null, null)
+ .proxy(KeycloakResource.class)
+ .getAccessToken(realm, new ClientCredentialsAuthForm(username, secret))
+ .getToken();
}
//There is a bug in {@link org.keycloak.admin.client.resource.UserStorageProviderResource#syncUsers} which misses the componentId as parameter
@@ -403,18 +323,11 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
keycloakRealmClient.realm, keycloakRealmClient.clientId
);
- // Get the public key for token verification
- PublishedRealmRepresentation realmRepresentation = keycloak.getPublishedRealm(keycloakRealmClient.realm);
- adapterConfig.setRealmKey(realmRepresentation.getPublicKeyPem());
-
- // Must rewrite the auth-server URL to our external host and port, which
- // we reverse-proxy back to Keycloak. This is the issuer baked into a token.
+ // The auth-server-url in the adapter config must be reachable by this manager
adapterConfig.setAuthServerUrl(
- externalServerUri.clone().replacePath(KeycloakResource.KEYCLOAK_CONTEXT_PATH).build().toString()
+ keycloakServiceUri.clone().replacePath("auth").build().toString()
);
- // TODO: Some other options should be configurable, e.g. CORS and NotBefore
-
return KeycloakDeploymentBuilder.build(adapterConfig);
}
};
@@ -426,17 +339,6 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {
.build(loader);
}
- protected void enableAuthProxy(WebService webService) {
- if (authProxyHandler == null)
- throw new IllegalStateException("Initialize this service first");
-
- LOG.info("Enabling auth reverse proxy (passing requests through to Keycloak) on web context: /" + KeycloakResource.KEYCLOAK_CONTEXT_PATH);
- webService.getRequestHandlers().add(0, pathStartsWithHandler(
- "Keycloak auth proxy",
- "/" + KeycloakResource.KEYCLOAK_CONTEXT_PATH,
- authProxyHandler));
- }
-
/**
* There must be _some_ valid redirect URIs for the application or authentication will not be possible.
*/
diff --git a/container/src/main/java/org/openremote/container/security/keycloak/KeycloakResource.java b/container/src/main/java/org/openremote/container/security/keycloak/KeycloakResource.java
index 3f9fb1ec5..9b2d749a6 100644
--- a/container/src/main/java/org/openremote/container/security/keycloak/KeycloakResource.java
+++ b/container/src/main/java/org/openremote/container/security/keycloak/KeycloakResource.java
@@ -30,10 +30,9 @@ import javax.ws.rs.core.Response;
import static javax.ws.rs.core.MediaType.*;
+@Path("auth")
public interface KeycloakResource {
- String KEYCLOAK_CONTEXT_PATH = "auth";
-
@GET
@Path("/")
@Produces(TEXT_HTML)
diff --git a/container/src/main/java/org/openremote/container/security/keycloak/SimpleKeycloakServletExtension.java b/container/src/main/java/org/openremote/container/security/keycloak/SimpleKeycloakServletExtension.java
index 002b041fd..831dc895c 100644
--- a/container/src/main/java/org/openremote/container/security/keycloak/SimpleKeycloakServletExtension.java
+++ b/container/src/main/java/org/openremote/container/security/keycloak/SimpleKeycloakServletExtension.java
@@ -92,11 +92,17 @@ public class SimpleKeycloakServletExtension implements ServletExtension {
}
});
- log.debug("Setting jsession cookie path to: " + deploymentInfo.getContextPath());
- ServletSessionConfig cookieConfig = new ServletSessionConfig();
- cookieConfig.setPath(deploymentInfo.getContextPath());
- deploymentInfo.setServletSessionConfig(cookieConfig);
+ ServletSessionConfig cookieConfig = deploymentInfo.getServletSessionConfig();
+ if (cookieConfig == null) {
+ cookieConfig = new ServletSessionConfig();
+ }
+ if (cookieConfig.getPath() == null) {
+ log.debug("Setting jsession cookie path to: " + deploymentInfo.getContextPath());
+ cookieConfig.setPath(deploymentInfo.getContextPath());
+ deploymentInfo.setServletSessionConfig(cookieConfig);
+ }
ChangeSessionId.turnOffChangeSessionIdOnLogin(deploymentInfo);
+
deploymentInfo.addListener(new ListenerInfo(UndertowNodesRegistrationManagementWrapper.class, (InstanceFactory<UndertowNodesRegistrationManagementWrapper>) () -> {
UndertowNodesRegistrationManagementWrapper listener = new UndertowNodesRegistrationManagementWrapper(nodesRegistrationManagement);
return new ImmediateInstanceHandle<>(listener);
diff --git a/container/src/main/java/org/openremote/container/web/DefaultWebsocketComponent.java b/container/src/main/java/org/openremote/container/web/DefaultWebsocketComponent.java
index 4f11b63db..e12af1512 100644
--- a/container/src/main/java/org/openremote/container/web/DefaultWebsocketComponent.java
+++ b/container/src/main/java/org/openremote/container/web/DefaultWebsocketComponent.java
@@ -152,7 +152,11 @@ public class DefaultWebsocketComponent extends WebsocketComponent {
deploymentInfo.addSecurityConstraints(constraint);
HttpHandler handler = webService.addServletDeployment(identityService, deploymentInfo, true);
- websocketHttpHandler = pathStartsWithHandler(deploymentName, WEBSOCKET_PATH, handler);
+
+ HttpHandler tempHandler = (exchange) -> {
+ handler.handleRequest(exchange);
+ };
+ websocketHttpHandler = pathStartsWithHandler(deploymentName, WEBSOCKET_PATH, tempHandler);
// Give web socket handler higher priority than any other handlers already added
webService.getRequestHandlers().add(0, websocketHttpHandler);
diff --git a/deployment/manager/app/logo.png b/deployment/manager/app/logo.png
deleted file mode 100644
index 2179b259d..000000000
Binary files a/deployment/manager/app/logo.png and /dev/null differ
diff --git a/deployment/manager/app/manager_config.json b/deployment/manager/app/manager_config.json
index a5ec93ae4..e3635d8bd 100644
--- a/deployment/manager/app/manager_config.json
+++ b/deployment/manager/app/manager_config.json
@@ -1,16 +1,7 @@
{
- "pages": [
- {
- "name": "map",
- "hide": false
- }
- ],
"realms": {
"default": {
"appTitle": "OpenRemote Manager Rotterdam Demo",
- "logo": "/logo.png",
- "logoMobile": null,
- "favicon": null,
"language": "en"
}
}
diff --git a/gradle.properties b/gradle.properties
index 275adeee8..9f40dc544 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -12,7 +12,7 @@ undertowVersion = 2.2.3.Final
resteasyVersion = 3.14.0.Final
resteasyVersionAsyncHttpServlet = 3.0.19.Final
jbossLoggingAnnotationsVersion = 2.0.2.Final
-keycloakVersion = 7.0.1
+keycloakVersion = 12.0.1
jacksonVersion = 2.11.4
groovyVersion = 2.5.14
groovySandboxVersion = 1.19
diff --git a/manager/src/main/java/org/openremote/manager/mqtt/EventInterceptHandler.java b/manager/src/main/java/org/openremote/manager/mqtt/EventInterceptHandler.java
index a9bb32d62..13d74d47d 100644
--- a/manager/src/main/java/org/openremote/manager/mqtt/EventInterceptHandler.java
+++ b/manager/src/main/java/org/openremote/manager/mqtt/EventInterceptHandler.java
@@ -261,7 +261,7 @@ public class EventInterceptHandler extends AbstractInterceptHandler {
headers.put(Constants.AUTH_CONTEXT, new AccessTokenAuthContext(connection.realm, accessToken));
} catch (VerificationException e) {
String suppliedClientSecret = new String(connection.password, StandardCharsets.UTF_8);
- connection.accessToken = identityProvider.getExternalKeycloak().getAccessToken(connection.realm, new ClientCredentialsAuthForm(connection.username, suppliedClientSecret)).getToken();
+ connection.accessToken = identityProvider.getAccessToken(connection.realm, connection.username, suppliedClientSecret);
try {
AccessToken accessToken = AdapterTokenVerifier.verifyToken(connection.accessToken, identityProvider.getKeycloakDeployment(connection.realm, KEYCLOAK_CLIENT_ID));
headers.put(Constants.AUTH_CONTEXT, new AccessTokenAuthContext(connection.realm, accessToken));
diff --git a/manager/src/main/java/org/openremote/manager/mqtt/KeycloakAuthorizatorPolicy.java b/manager/src/main/java/org/openremote/manager/mqtt/KeycloakAuthorizatorPolicy.java
index cabf9236c..c4a04695c 100644
--- a/manager/src/main/java/org/openremote/manager/mqtt/KeycloakAuthorizatorPolicy.java
+++ b/manager/src/main/java/org/openremote/manager/mqtt/KeycloakAuthorizatorPolicy.java
@@ -104,7 +104,7 @@ public class KeycloakAuthorizatorPolicy implements IAuthorizatorPolicy {
accessToken = AdapterTokenVerifier.verifyToken(connection.accessToken, identityProvider.getKeycloakDeployment(connection.realm, KEYCLOAK_CLIENT_ID));
} catch (VerificationException e) {
String suppliedClientSecret = new String(connection.password, StandardCharsets.UTF_8);
- connection.accessToken = identityProvider.getExternalKeycloak().getAccessToken(connection.realm, new ClientCredentialsAuthForm(connection.username, suppliedClientSecret)).getToken();
+ connection.accessToken = identityProvider.getAccessToken(connection.realm, connection.username, suppliedClientSecret);
try {
accessToken = AdapterTokenVerifier.verifyToken(connection.accessToken, identityProvider.getKeycloakDeployment(connection.realm, KEYCLOAK_CLIENT_ID));
} catch (VerificationException verificationException) {
diff --git a/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java b/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
index b735212da..45e299eb9 100644
--- a/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
+++ b/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
@@ -58,6 +58,7 @@ import static org.openremote.container.persistence.PersistenceEvent.*;
import static org.openremote.manager.gateway.GatewayService.isNotForGateway;
import static org.openremote.model.notification.PushNotificationMessage.TargetType.*;
+@SuppressWarnings("deprecation")
public class PushNotificationHandler extends RouteBuilder implements NotificationHandler {
private static final Logger LOG = Logger.getLogger(PushNotificationHandler.class.getName());
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
index add19f777..2659daecb 100644
--- a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
+++ b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
@@ -100,7 +100,6 @@ public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider im
@Override
public void start(Container container) {
super.start(container);
- enableAuthProxy(container.getService(WebService.class));
}
@Override
diff --git a/mvp/mvp-docker-compose.yml b/mvp/mvp-docker-compose.yml
index 86f272744..20ae75139 100644
--- a/mvp/mvp-docker-compose.yml
+++ b/mvp/mvp-docker-compose.yml
@@ -63,9 +63,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
diff --git a/profile/deploy-no-build.yml b/profile/deploy-no-build.yml
index 4a64c6304..5d32e6857 100644
--- a/profile/deploy-no-build.yml
+++ b/profile/deploy-no-build.yml
@@ -44,10 +44,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
-
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
# PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld
@@ -277,6 +273,7 @@ services:
DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD
KEYCLOAK_USER: admin
PROXY_ADDRESS_FORWARDING: 'true'
+ KEYCLOAK_FRONTEND_URL: 'https://localhost/auth'
# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!
KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}
diff --git a/profile/deploy.yml b/profile/deploy.yml
index 712f62c37..966c2d200 100644
--- a/profile/deploy.yml
+++ b/profile/deploy.yml
@@ -49,10 +49,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
-
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
# PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld
@@ -304,6 +300,7 @@ services:
DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD
KEYCLOAK_USER: admin
PROXY_ADDRESS_FORWARDING: 'true'
+ KEYCLOAK_FRONTEND_URL: 'https://localhost/auth'
# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!
KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}
diff --git a/profile/dev-proxy.yml b/profile/dev-proxy.yml
index cd0c6cf11..48ed2d83e 100644
--- a/profile/dev-proxy.yml
+++ b/profile/dev-proxy.yml
@@ -1,7 +1,7 @@
#
# Profile for doing development work on the manager in an IDE; uses proxy container to redirect to host machine.
#
-# https://localhost/master
+# https://localhost/
#
# Your changes will be visible live on browser reload or after restart:
#
@@ -33,7 +33,7 @@ services:
proxy:
extends:
- file: deploy.yml
+ file: deploy-no-build.yml
service: proxy
volumes:
# Store data either in host-mapped directory or a named Docker volume
@@ -44,23 +44,25 @@ services:
keycloak:
extends:
- file: deploy.yml
+ file: deploy-no-build.yml
service: keycloak
+ volumes:
+ - ../deployment:/deployment
+ - ../keycloak/themes/openremote:/opt/jboss/keycloak/themes/openremote
+ - ../keycloak/scripts/disable-theme-cache.cli:/opt/jboss/startup-scripts/disable-theme-cache.cli
# Access directly if needed on localhost
ports:
- "8081:8080"
- volumes:
- - ../ui/keycloak/themes:/deployment/keycloak/themes
depends_on:
postgresql:
condition: service_healthy
postgresql:
extends:
- file: deploy.yml
+ file: deploy-no-build.yml
service: postgresql
# Access directly if needed on localhost
ports:
- "5432:5432"
volumes:
- - postgresql-data:/var/lib/postgresql/data
\ No newline at end of file
+ - postgresql-data:/var/lib/postgresql/data
diff --git a/profile/dev-testing.yml b/profile/dev-testing.yml
index d81a4f0e2..c1b0c5db4 100644
--- a/profile/dev-testing.yml
+++ b/profile/dev-testing.yml
@@ -15,7 +15,9 @@ services:
file: deploy-no-build.yml
service: keycloak
volumes:
- - ../ui/keycloak/themes:/deployment/keycloak/themes
+ - ../deployment:/deployment
+ - ../keycloak/themes/openremote:/opt/jboss/keycloak/themes/openremote
+ - ../keycloak/scripts/disable-theme-cache.cli:/opt/jboss/startup-scripts/disable-theme-cache.cli
# Access directly if needed on localhost
ports:
- "8081:8080"
@@ -31,4 +33,4 @@ services:
ports:
- "5432:5432"
volumes:
- - postgresql-data:/var/lib/postgresql/data
\ No newline at end of file
+ - postgresql-data:/var/lib/postgresql/data
diff --git a/swarm/kube-docker-compose.yml b/swarm/kube-docker-compose.yml
index 146c5ea18..93b8bbc82 100644
--- a/swarm/kube-docker-compose.yml
+++ b/swarm/kube-docker-compose.yml
@@ -40,10 +40,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
-
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
# PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld
diff --git a/swarm/swarm-docker-compose.arm64.yml b/swarm/swarm-docker-compose.arm64.yml
index f76aa2e8b..e86403ff8 100644
--- a/swarm/swarm-docker-compose.arm64.yml
+++ b/swarm/swarm-docker-compose.arm64.yml
@@ -63,10 +63,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
-
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
# PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld
diff --git a/swarm/swarm-docker-compose.yml b/swarm/swarm-docker-compose.yml
index f7dad3543..cdd3b3612 100644
--- a/swarm/swarm-docker-compose.yml
+++ b/swarm/swarm-docker-compose.yml
@@ -63,10 +63,6 @@ services:
# when testing (this is important, you are limited to 5 duplicate certificates per week!)
# LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
- # Traffic should be forwarded to this service (defaults to manager:8080)
- # PROXY_BACKEND_HOST: manager
- # PROXY_BACKEND_PORT: 8080
-
# The proxy supports up to 10 custom redirects from hostname to any path on the
# backend service. This can be used to give consoles a vanity domain name.
# PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld
diff --git a/ui/app/manager/images/favicon.ico b/ui/app/manager/images/favicon.ico
new file mode 100644
index 000000000..041659d88
Binary files /dev/null and b/ui/app/manager/images/favicon.ico differ
diff --git a/ui/app/manager/webpack.config.js b/ui/app/manager/webpack.config.js
index d94b5c49a..fc2692911 100644
--- a/ui/app/manager/webpack.config.js
+++ b/ui/app/manager/webpack.config.js
@@ -5,8 +5,9 @@ const webpack = require("webpack");
module.exports = (env, argv) => {
const customConfigDir = env.config;
+ const managerUrl = env.managerUrl;
const IS_DEV_SERVER = process.argv.find(arg => arg.includes("serve"));
- const config = util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+ const config = util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname, managerUrl);
if (IS_DEV_SERVER && customConfigDir) {
console.log("CUSTOM_CONFIG_DIR: " + customConfigDir);
diff --git a/ui/util/webpack.util.js b/ui/util/webpack.util.js
index 859236ef9..a9e8207a3 100644
--- a/ui/util/webpack.util.js
+++ b/ui/util/webpack.util.js
@@ -4,9 +4,9 @@ const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
-function getAppConfig(mode, isDevServer, dirname) {
+function getAppConfig(mode, isDevServer, dirname, managerUrl) {
const production = mode === "production";
- const managerUrl = production ? undefined : "http://localhost:8080";
+ managerUrl = managerUrl || (production ? undefined : "http://localhost:8080");
const OUTPUT_PATH = isDevServer ? 'src' : 'dist';
const config = {