100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Cleanup of environment variables, dockerfiles and docker compose profiles
Rich Turnerb9e427637c3c
diff --git a/README.md b/README.mdindex 472661855..30ce1a5ab 100644--- a/README.md+++ b/README.md@@ -156,6 +156,26 @@ We work with Java, Groovy, TypeScript, Gradle, Docker, and a wide range of APIsFor more information and how to set up a development environment, see the [Developer Guide](https://github.com/openremote/openremote/wiki).+## Running OpenRemote on ARM64 device++This procedure was tested on AWS t4g EC2 instance using [CloudFormation template](https://github.com/openremote/openremote/gitlab-ci/aws-cloudformation.template.arm64.yml).++OpenRemote images on Docker Hub are multi-arch created automatically by CI/CD pipeline, therefore there is no need to build them locally. The multi-arch build procedure is defined as [Github action](https://github.com/openremote/openremote/blob/master/.github/workflows/gradle.yml) and uses official Docker QEMU action.++There is no official base Keycloak ARM image provided, therefore the stack uses basic http authentication.+TODO: use central remote Keycloak installation.++To start the OpenRemote stack:+- login to ARM device;+- install *docker* with *docker-compose* if necessary;+- start the stack:+```bash+docker-compose -p openremote -f profile/demo-basic-no-build.yml up -d+```++**Tip:** [AWS CloudFormation template](https://github.com/openremote/openremote/gitlab-ci/aws-cloudformation.template.arm64.yml) Resources.EC2Instance.Properties.UserData section contains installation script for AWS Linux ARM device. The minimum RAM is 512M, which can be run on [BeagleBoneBlack](http://beagleboard.org/black).+TODO: test it on actual device.+## Discuss OpenRemotediff --git a/agent/src/main/resources/META-INF/services/org.openremote.container.ContainerService b/agent/src/main/resources/META-INF/services/org.openremote.container.ContainerServicedeleted file mode 100644index 0dcd40d18..000000000--- a/agent/src/main/resources/META-INF/services/org.openremote.container.ContainerService+++ /dev/null@@ -1,15 +0,0 @@-org.openremote.agent.protocol.simulator.SimulatorProtocol-org.openremote.agent.protocol.macro.MacroProtocol-org.openremote.agent.protocol.timer.TimerProtocol-org.openremote.agent.protocol.knx.KNXProtocol-org.openremote.agent.protocol.velbus.VelbusTcpProtocol-org.openremote.agent.protocol.velbus.VelbusSerialProtocol-org.openremote.agent.protocol.http.HttpClientProtocol-org.openremote.agent.protocol.udp.UdpClientProtocol-org.openremote.agent.protocol.websocket.WebsocketClientProtocol-org.openremote.agent.protocol.artnet.ArtnetProtocol-org.openremote.agent.protocol.tcp.TcpClientProtocol-org.openremote.agent.protocol.serial.SerialClientProtocol-org.openremote.agent.protocol.event.ClientEventProtocol-org.openremote.agent.protocol.tradfri.TradfriProtocol-org.openremote.agent.protocol.zwave.ZWProtocoldiff --git a/container/src/main/java/org/openremote/container/Container.java b/container/src/main/java/org/openremote/container/Container.javaindex 7d03046ba..f8f8683da 100644--- a/container/src/main/java/org/openremote/container/Container.java+++ b/container/src/main/java/org/openremote/container/Container.java@@ -24,6 +24,7 @@ import org.openremote.container.concurrent.ContainerScheduledExecutor;import org.openremote.container.concurrent.ContainerThreads;import org.openremote.container.util.LogUtil;import org.openremote.model.ContainerService;+import org.openremote.model.util.TextUtil;import org.openremote.model.value.Values;import java.util.*;@@ -44,7 +45,7 @@ import static org.openremote.container.util.MapAccess.getInteger;* manage the life cycle of these services.* <p>* Access environment configuration through {@link #getConfig()} and the helper methods- * in {@link org.openremote.container.util.MapAccess}. Consider using {@link #DEV_MODE}+ * in {@link org.openremote.container.util.MapAccess}. Consider using {@link org.openremote.model.Container#DEV_MODE}* to distinguish between development and production environments.*/public class Container implements org.openremote.model.Container {@@ -77,12 +78,10 @@ public class Container implements org.openremote.model.Container {public static final int SCHEDULED_TASKS_THREADS_MAX_DEFAULT = Math.max(Runtime.getRuntime().availableProcessors(), 2);static {- LogUtil.configureLogging("logging.properties");+ LogUtil.configureLogging();LOG = Logger.getLogger(Container.class.getName());}- public static final String DEV_MODE = "DEV_MODE";- public static final boolean DEV_MODE_DEFAULT = true;protected final Map<String, String> config = new HashMap<>();protected final boolean devMode;@@ -109,7 +108,9 @@ public class Container implements org.openremote.model.Container {public Container(Map<String, String> config, Iterable<ContainerService> services) {for (Map.Entry<String, String> entry : config.entrySet()) {- this.config.put(entry.getKey(), entry.getValue());+ if (!TextUtil.isNullOrEmpty(entry.getValue())) {+ this.config.put(entry.getKey(), entry.getValue());+ }}this.devMode = getBoolean(this.config, DEV_MODE, DEV_MODE_DEFAULT);diff --git a/container/src/main/java/org/openremote/container/persistence/Database.java b/container/src/main/java/org/openremote/container/persistence/Database.javaindex 6d8140ac7..4d267855c 100644--- a/container/src/main/java/org/openremote/container/persistence/Database.java+++ b/container/src/main/java/org/openremote/container/persistence/Database.java@@ -36,54 +36,60 @@ public interface Database {*/Properties createProperties();- /**- * Modify persistence properties (e.g. set datasource) used to call <code>Persistence.createEntityManagerFactory(persistenceUnitName, persistenceUnitProperties)</code>- */- void open(Properties properties, String connectionUrl, String username, String password, int connectionTimeoutSeconds, int minIdle, int maxPoolSize);-- void close();-- enum Product implements Database {-- POSTGRES {- protected HikariConfig hikariConfig;- protected HikariDataSource hikariDataSource;-- @Override- public Properties createProperties() {- Properties properties = new Properties();- properties.put(AvailableSettings.DIALECT, PostgreSQL95Dialect.class.getName());- return properties;- }-- @Override- public void open(Properties properties, String connectionUrl, String username, String password, int connectionTimeoutSeconds, int minIdle, int maxPoolSize) {- hikariConfig = new HikariConfig();- hikariConfig.setRegisterMbeans(true);- hikariConfig.setPoolName(properties.containsKey(PROPERTY_POOL_NAME) ? properties.get(PROPERTY_POOL_NAME).toString() : "or-pool");- hikariConfig.setThreadFactory(new ContainerThreadFactory("Database Connections"));- hikariConfig.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");- hikariConfig.addDataSourceProperty("url", connectionUrl);- hikariConfig.setUsername(username);- hikariConfig.setPassword(password);- hikariConfig.setConnectionTimeout(connectionTimeoutSeconds * 1000);- hikariConfig.setInitializationFailTimeout(connectionTimeoutSeconds * 1000);- hikariConfig.setMinimumIdle(minIdle);- hikariConfig.setMaximumPoolSize(maxPoolSize);-- hikariDataSource = new HikariDataSource(hikariConfig);-- properties.put(AvailableSettings.DATASOURCE, hikariDataSource);- }-- @Override- public void close() {- if (hikariDataSource != null)- hikariDataSource.close();- hikariConfig = null;- hikariDataSource = null;- }+ /**+ * Modify persistence properties (e.g. set datasource) used to call <code>Persistence.createEntityManagerFactory(persistenceUnitName, persistenceUnitProperties)</code>+ */+ void open(Properties properties, String connectionUrl, String username, String password, int connectionTimeoutSeconds, int minIdle, int maxPoolSize);++ void close();++ String getConnectorName();++ enum Product implements Database {++ POSTGRES {+ protected HikariConfig hikariConfig;+ protected HikariDataSource hikariDataSource;++ @Override+ public Properties createProperties() {+ Properties properties = new Properties();+ properties.put(AvailableSettings.DIALECT, PostgreSQL95Dialect.class.getName());+ return properties;}- }+ @Override+ public String getConnectorName() {+ return "postgresql";+ }++ @Override+ public void open(Properties properties, String connectionUrl, String username, String password, int connectionTimeoutSeconds, int minIdle, int maxPoolSize) {+ hikariConfig = new HikariConfig();+ hikariConfig.setRegisterMbeans(true);+ hikariConfig.setPoolName(properties.containsKey(PROPERTY_POOL_NAME) ? properties.get(PROPERTY_POOL_NAME).toString() : "or-pool");+ hikariConfig.setThreadFactory(new ContainerThreadFactory("Database Connections"));+ hikariConfig.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");+ hikariConfig.addDataSourceProperty("url", connectionUrl);+ hikariConfig.setUsername(username);+ hikariConfig.setPassword(password);+ hikariConfig.setConnectionTimeout(connectionTimeoutSeconds * 1000);+ hikariConfig.setInitializationFailTimeout(connectionTimeoutSeconds * 1000);+ hikariConfig.setMinimumIdle(minIdle);+ hikariConfig.setMaximumPoolSize(maxPoolSize);++ hikariDataSource = new HikariDataSource(hikariConfig);++ properties.put(AvailableSettings.DATASOURCE, hikariDataSource);+ }++ @Override+ public void close() {+ if (hikariDataSource != null)+ hikariDataSource.close();+ hikariConfig = null;+ hikariDataSource = null;+ }+ }+}}diff --git a/container/src/main/java/org/openremote/container/persistence/PersistenceService.java b/container/src/main/java/org/openremote/container/persistence/PersistenceService.javaindex e69208842..c62e22988 100644--- a/container/src/main/java/org/openremote/container/persistence/PersistenceService.java+++ b/container/src/main/java/org/openremote/container/persistence/PersistenceService.java@@ -60,9 +60,6 @@ import java.util.logging.Logger;import static org.openremote.container.util.MapAccess.*;-/**- * Uses the SQL database schema {@link #DEFAULT_SCHEMA_NAME} for all operations.- */public class PersistenceService implements ContainerService {/**@@ -80,7 +77,6 @@ public class PersistenceService implements ContainerService {props.put(AvailableSettings.FORMAT_SQL, "true");props.put(AvailableSettings.USE_SQL_COMMENTS, "true");props.put(AvailableSettings.SCANNER_DISCOVERY, "none");- props.put(AvailableSettings.DEFAULT_SCHEMA, DEFAULT_SCHEMA_NAME);//props.put(AvailableSettings.SHOW_SQL, "true");props.put(AvailableSettings.CURRENT_SESSION_CONTEXT_CLASS, "thread");props.put(AvailableSettings.HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR, "org.openremote.container.persistence.EnhancedImportSqlCommandExtractor");@@ -187,24 +183,29 @@ public class PersistenceService implements ContainerService {* database artifacts from wipe/migrate in FlywayDB...) you must have it in the 'public'* schema. Hence we need a different schema here.*/- public static final String DEFAULT_SCHEMA_NAME = "openremote";public static final String SETUP_WIPE_CLEAN_INSTALL = "SETUP_WIPE_CLEAN_INSTALL";public static final String PERSISTENCE_UNIT_NAME = "PERSISTENCE_UNIT_NAME";public static final String PERSISTENCE_UNIT_NAME_DEFAULT = "OpenRemotePU";- public static final String DATABASE_PRODUCT = "DATABASE_PRODUCT";- public static final String DATABASE_PRODUCT_DEFAULT = Database.Product.POSTGRES.name();- public static final String DATABASE_CONNECTION_URL = "DATABASE_CONNECTION_URL";- public static final String DATABASE_CONNECTION_URL_DEFAULT = "jdbc:postgresql://localhost:5432/openremote";- public static final String DATABASE_USERNAME = "DATABASE_USERNAME";- public static final String DATABASE_USERNAME_DEFAULT = "postgres";- public static final String DATABASE_PASSWORD = "DATABASE_PASSWORD";- public static final String DATABASE_PASSWORD_DEFAULT = "CHANGE_ME_DB_USER_PASSWORD";- public static final String DATABASE_MIN_POOL_SIZE = "DATABASE_MIN_POOL_SIZE";- public static final int DATABASE_MIN_POOL_SIZE_DEFAULT = 5;- public static final String DATABASE_MAX_POOL_SIZE = "DATABASE_MAX_POOL_SIZE";- public static final int DATABASE_MAX_POOL_SIZE_DEFAULT = 20;- public static final String DATABASE_CONNECTION_TIMEOUT_SECONDS = "DATABASE_CONNECTION_TIMEOUT_SECONDS";- public static final int DATABASE_CONNECTION_TIMEOUT_SECONDS_DEFAULT = 5;+ public static final String DB_VENDOR = "DB_VENDOR";+ public static final String DB_VENDOR_DEFAULT = Database.Product.POSTGRES.name();+ public static final String DB_HOST = "DB_HOST";+ public static final String DB_HOST_DEFAULT = "localhost";+ public static final String DB_PORT = "DB_PORT";+ public static final int DB_PORT_DEFAULT = 5432;+ public static final String DB_NAME = "DB_NAME";+ public static final String DB_NAME_DEFAULT = "openremote";+ public static final String DB_SCHEMA = "DB_SCHEMA";+ public static final String DB_SCHEMA_DEFAULT = "openremote";+ public static final String DB_USERNAME = "DB_USERNAME";+ public static final String DB_USERNAME_DEFAULT = "postgres";+ public static final String DB_PASSWORD = "DB_PASSWORD";+ public static final String DB_PASSWORD_DEFAULT = "postgres";+ public static final String DB_MIN_POOL_SIZE = "DB_MIN_POOL_SIZE";+ public static final int DB_MIN_POOL_SIZE_DEFAULT = 5;+ public static final String DB_MAX_POOL_SIZE = "DB_MAX_POOL_SIZE";+ public static final int DB_MAX_POOL_SIZE_DEFAULT = 20;+ public static final String DB_CONNECTION_TIMEOUT_SECONDS = "DB_CONNECTION_TIMEOUT_SECONDS";+ public static final int DB_CONNECTION_TIMEOUT_SECONDS_DEFAULT = 300;public static final int PRIORITY = Integer.MIN_VALUE + 100;protected MessageBrokerService messageBrokerService;@@ -229,9 +230,24 @@ public class PersistenceService implements ContainerService {? container.getService(MessageBrokerService.class): null;- String databaseProduct = getString(container.getConfig(), DATABASE_PRODUCT, DATABASE_PRODUCT_DEFAULT);- LOG.info("Preparing persistence service for database: " + databaseProduct);- database = Database.Product.valueOf(databaseProduct);+ String dbVendor = getString(container.getConfig(), DB_VENDOR, DB_VENDOR_DEFAULT).toUpperCase(Locale.ROOT);+ LOG.info("Preparing persistence service for database: " + dbVendor);++ try {+ database = Database.Product.valueOf(dbVendor);+ } catch (Exception e) {+ LOG.severe("Requested DB_VENDOR is not supported: " + dbVendor);+ throw new UnsupportedOperationException("Requested DB_VENDOR is not supported: " + dbVendor);+ }++ String dbHost = getString(container.getConfig(), DB_HOST, DB_HOST_DEFAULT);+ int dbPort = getInteger(container.getConfig(), DB_PORT, DB_PORT_DEFAULT);+ String dbName = getString(container.getConfig(), DB_NAME, DB_NAME_DEFAULT);+ String dbSchema = getString(container.getConfig(), DB_SCHEMA, DB_SCHEMA_DEFAULT);+ String dbUsername = getString(container.getConfig(), DB_USERNAME, DB_USERNAME_DEFAULT);+ String dbPassword = getString(container.getConfig(), DB_PASSWORD, DB_PASSWORD_DEFAULT);+ String connectionUrl = "jdbc:" + database.getConnectorName() + "://" + dbHost + ":" + dbPort + "/" + dbName;+ connectionUrl = UriBuilder.fromUri(connectionUrl).replaceQueryParam("currentSchema", dbSchema).build().toString();persistenceUnitProperties = database.createProperties();@@ -242,11 +258,14 @@ public class PersistenceService implements ContainerService {);}+ persistenceUnitProperties.put(AvailableSettings.DEFAULT_SCHEMA, dbSchema);+persistenceUnitName = getString(container.getConfig(), PERSISTENCE_UNIT_NAME, PERSISTENCE_UNIT_NAME_DEFAULT);forceClean = getBoolean(container.getConfig(), SETUP_WIPE_CLEAN_INSTALL, container.isDevMode());- openDatabase(container, database);+ openDatabase(container, database, dbUsername, dbPassword, connectionUrl);+ prepareSchema(connectionUrl, dbUsername, dbPassword, dbSchema);// Register standard entity classes and also any Entity ClassProvidersList<String> entityClasses = new ArrayList<>(50);@@ -370,25 +389,20 @@ public class PersistenceService implements ContainerService {return schemas;}- protected void openDatabase(Container container, Database database) {- String connectionUrl = getString(container.getConfig(), DATABASE_CONNECTION_URL, DATABASE_CONNECTION_URL_DEFAULT);- connectionUrl = UriBuilder.fromUri(connectionUrl).replaceQueryParam("currentSchema", DEFAULT_SCHEMA_NAME).build().toString();- String databaseUsername = getString(container.getConfig(), DATABASE_USERNAME, DATABASE_USERNAME_DEFAULT);- String databasePassword = getString(container.getConfig(), DATABASE_PASSWORD, DATABASE_PASSWORD_DEFAULT);- int databaseMinPoolSize = getInteger(container.getConfig(), DATABASE_MIN_POOL_SIZE, DATABASE_MIN_POOL_SIZE_DEFAULT);- int databaseMaxPoolSize = getInteger(container.getConfig(), DATABASE_MAX_POOL_SIZE, DATABASE_MAX_POOL_SIZE_DEFAULT);- int connectionTimeoutSeconds = getInteger(container.getConfig(), DATABASE_CONNECTION_TIMEOUT_SECONDS, DATABASE_CONNECTION_TIMEOUT_SECONDS_DEFAULT);- LOG.info("Opening database connection: " + connectionUrl);- database.open(persistenceUnitProperties, connectionUrl, databaseUsername, databasePassword, connectionTimeoutSeconds, databaseMinPoolSize, databaseMaxPoolSize);+ protected void openDatabase(Container container, Database database, String username, String password, String connectionUrl) {- prepareSchemas(connectionUrl, databaseUsername, databasePassword);+ int databaseMinPoolSize = getInteger(container.getConfig(), DB_MIN_POOL_SIZE, DB_MIN_POOL_SIZE_DEFAULT);+ int databaseMaxPoolSize = getInteger(container.getConfig(), DB_MAX_POOL_SIZE, DB_MAX_POOL_SIZE_DEFAULT);+ int connectionTimeoutSeconds = getInteger(container.getConfig(), DB_CONNECTION_TIMEOUT_SECONDS, DB_CONNECTION_TIMEOUT_SECONDS_DEFAULT);+ LOG.info("Opening database connection: " + connectionUrl);+ database.open(persistenceUnitProperties, connectionUrl, username, password, connectionTimeoutSeconds, databaseMinPoolSize, databaseMaxPoolSize);}- protected void prepareSchemas(String connectionUrl, String databaseUsername, String databasePassword) {+ protected void prepareSchema(String connectionUrl, String databaseUsername, String databasePassword, String schemaName) {LOG.fine("Preparing database schema");List<String> locations = new ArrayList<>();List<String> schemas = new ArrayList<>();- schemas.add(DEFAULT_SCHEMA_NAME);+ schemas.add(schemaName);appendSchemas(schemas);appendSchemaLocations(locations);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.javaindex 4f1353608..6789d3feb 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@@ -90,7 +90,7 @@ public abstract class KeycloakIdentityProvider implements IdentityProvider {public static final String IDENTITY_SESSION_MAX_MINUTES = "IDENTITY_SESSION_MAX_MINUTES";public static final int IDENTITY_SESSION_MAX_MINUTES_DEFAULT = 60 * 24; // 1 daypublic static final String IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES = "IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES";- public static final int IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES_DEFAULT = 60 * 24 * 14; // 14 days+ public static final int IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES_DEFAULT = 2628000; // 5 yearspublic static final String IDENTITY_NETWORK_SECURE = "IDENTITY_NETWORK_SECURE";public static final boolean IDENTITY_NETWORK_SECURE_DEFAULT = false;public static final String IDENTITY_NETWORK_HOST = "IDENTITY_NETWORK_HOST";diff --git a/container/src/main/java/org/openremote/container/util/LogUtil.java b/container/src/main/java/org/openremote/container/util/LogUtil.javaindex ea7cd841c..eb7a59d77 100644--- a/container/src/main/java/org/openremote/container/util/LogUtil.java+++ b/container/src/main/java/org/openremote/container/util/LogUtil.java@@ -25,8 +25,11 @@ import java.io.InputStream;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;+import java.util.Locale;import java.util.logging.LogManager;+import static org.openremote.model.Container.DEV_MODE;+public class LogUtil {public static final String LOGGING_CONFIG_FILE = "LOGGING_CONFIG_FILE";@@ -38,12 +41,13 @@ public class LogUtil {* If system property <code>java.util.logging.config.file</code> has not been set, try to load the* logging configuration specified in environment variable <code>LOGGING_CONFIG_FILE</code> as a file.* If this wasn't set, try to find the file <code>/deployment/manager/logging.properties</code>.- * If this also wasn't found, load the given default logging configuration from the classpath.+ * If this also wasn't found, load the given default logging configuration from the classpath+ * (logging-dev.properties when DEV_MODE=true otherwise logging.properties).* <p>* This method should be called in a <code>static { ... }</code> block in the "first" class of your* application (typically where your <code>main()</code> method is located).*/- public static void configureLogging(String defaultLoggingProperties) throws ExceptionInInitializerError {+ public static void configureLogging() throws ExceptionInInitializerError {// If no JUL configuration is providedif (System.getProperty("java.util.logging.config.file") == null) {// Load the logging configuration file specified with an environment variable@@ -69,9 +73,12 @@ public class LogUtil {}} else {// Or load a default configuration from the classpath- try (InputStream is = Container.class.getClassLoader().getResourceAsStream(defaultLoggingProperties)) {+ String devModeStr = System.getenv(DEV_MODE);+ boolean isDevMode = devModeStr == null || "TRUE".equals(devModeStr.toUpperCase(Locale.ROOT));+ String loggingFile = isDevMode ? "logging-dev.properties" : "logging.properties";+ try (InputStream is = Container.class.getClassLoader().getResourceAsStream(loggingFile)) {if (is != null) {- System.out.println("Using logging configuration: logging.properties on classpath");+ System.out.println("Using logging configuration on classpath: " + loggingFile);LogManager.getLogManager().readConfiguration(is);}} catch (Exception ex) {diff --git a/docker-compose.yml b/docker-compose.ymlindex 5c282e376..84d5e82f9 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,66 +1,20 @@# OpenRemote v3#-# By default running this profile installs the stack on https://localhost using a-# self-signed SSL certificate, with username 'admin' and password 'secret'.+# Profile that runs the vanilla stack on https://localhost using a self-signed SSL certificate,+# with username 'admin' and password 'secret'. There is no map data available in the vanilla+# system so the map tile server will not function. Persistent data is stored in a docker+# volume called postgresql-data between restarts, simply delete this volume to reset the+# system to an empty state.#-# Install Docker Community edition (https://docker.com/) on Windows, macOS, or Linux.-#-# Start a demo stack in the project root directory with:-#-# docker-compose up-#-# For full documentation, see profile/deploy.yml-#-# Steps to create a permanent installation:-#-# 1. DO NOT FORGET TO CHANGE SETUP_ADMIN_PASSWORD!-#-# 2. Consider setting a custom DOMAINNAME, LE_EMAIL, and IDENTITY_NETWORK_HOST, see deploy.yml-#-# 3. Understand how bind mounts and volume mappings work, see below and read:-# https://docs.docker.com/engine/admin/volumes/bind-mounts/-# https://docs.docker.com/engine/admin/volumes/volumes/#choose-the--v-or-mount-flag-# Survival guide: docker volume ls|rm|prune-#-# 4. Execute once:-#-# SETUP_WIPE_CLEAN_INSTALL=true \-# SETUP_ADMIN_PASSWORD=secret \-# docker-compose up-#-# This creates the initial database and optionally imports some examples. Inspect the-# running installation and ensure it's working. You should now stop the stack and remove-# all containers. It is important that you recreate the containers and start again WITHOUT-# the SETUP_WIPE_CLEAN_INSTALL setting! Passwords can be changed in the application.-#-# Database schemas will be upgraded to new versions of the services automatically, you do-# not have to wipe all data to install a new version of OpenRemote.-#-# Your extension JAR files should be in the deployment/manager/extensions/ directory.+# Please see profile/deploy.yml for configuration details for each service.#version: '2.4'-# If you enable volume mappings in services, you need this. Otherwise, remove the volumesvolumes:- proxy-data:- deployment-data:postgresql-data:- zwave-data:services:- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- build: 'deployment'- image: openremote/deployment:${DATE_TAG:-latest}- volumes:- - deployment-data:/deployment-- # This configuration does not store SSL certificate data and allow changes to the- # proxy configuration, it is only configured for deployment on localhost. You can- # map a Docker volume or host directory to access/store proxy configuration files- # and SSL certificates.proxy:extends:file: profile/deploy.yml@@ -68,14 +22,7 @@ services:depends_on:manager:condition: service_healthy- volumes:- - proxy-data:/deployment- # Override the haproxy.cfg with custom file- # -${MY_PROXY_CONFIG_FILE}:/etc/haproxy/haproxy.cfg- # This configuration uses the manager's deployment-specific data such as map tiles,- # console application static resources (HTML, JS, CSS), extensions, and other- # configuration files which were baked into the managers image.manager:extends:file: profile/deploy.yml@@ -83,11 +30,6 @@ services:depends_on:keycloak:condition: service_healthy- volumes:- - deployment-data:/deployment- - zwave-data:/zwave- # devices:- # - /dev/ttyACM0keycloak:extends:@@ -96,15 +38,9 @@ services:depends_on:postgresql:condition: service_healthy- volumes:- - deployment-data:/deployment- # This configuration stores postgresql data in a Docker volume. You manage this volume- # independently from your stack with with 'docker volume ls', 'docker volume rm', etc.- # Alternatively, you can store postgresql data in a directory on your host.postgresql:+ image: openremote/postgresql:${DATE_TAG:-latest}extends:file: profile/deploy.ymlservice: postgresql- volumes:- - postgresql-data:/var/lib/postgresql/datadiff --git a/keycloak/Dockerfile b/keycloak/Dockerfileindex 714aed7c2..d39bc079c 100644--- a/keycloak/Dockerfile+++ b/keycloak/Dockerfile@@ -16,6 +16,17 @@ ENV PROXY_ADDRESS_FORWARDING falseENV JBOSS_HOME /opt/jboss/keycloakENV LANG en_US.UTF-8+ENV DB_VENDOR ${DB_VENDOR:-postgres}+ENV DB_ADDR ${DB_ADDR:-postgresql}+ENV DB_PORT ${DB_PORT:-5432}+ENV DB_DATABASE ${DB_DATABASE:-openremote}+ENV DB_USER ${DB_USER:-openremote}+ENV DB_PASSWORD ${DB_PASSWORD:-openremote}+ENV DB_SCHEMA ${DB_SCHEMA:-public}+ENV KEYCLOAK_USER ${KEYCLOAK_USER:-admin}+ENV PROXY_ADDRESS_FORWARDING ${PROXY_ADDRESS_FORWARDING:-true}+ENV TZ ${TZ:-Europe/Amsterdam}+ARG GIT_REPOARG GIT_BRANCHARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz@@ -29,11 +40,12 @@ RUN chmod -R +x /opt/jboss/toolsRUN /opt/jboss/tools/build-keycloak.shRUN mkdir -p /opt/jboss/keycloak/providers+RUN mkdir -p /deployment/keycloak/themesADD themes /opt/jboss/keycloak/themesADD module.xml /opt/jboss/keycloak/providersADD build/image/openremote-keycloak.jar /opt/jboss/keycloak/providers-HEALTHCHECK --interval=3s --timeout=3s --start-period=600s --retries=30 CMD curl --fail --silent http://localhost:8080/auth || exit 1+HEALTHCHECK --interval=3s --timeout=3s --start-period=60s --retries=30 CMD curl --fail --silent http://localhost:8080/auth || exit 1USER 1000diff --git a/manager/Dockerfile b/manager/Dockerfileindex da81231a8..23034c252 100644--- a/manager/Dockerfile+++ b/manager/Dockerfile@@ -12,20 +12,62 @@ ARG GIT_COMMIT=unknownLABEL git-commit=$GIT_COMMIT-ENV JAVA_OPTS=${JAVA_OPTS}-ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}+ENV JAVA_TOOL_OPTIONS ${JAVA_TOOL_OPTIONS}-ENV DEV_MODE false-ENV APP_DOCROOT /opt/web-ENV CUSTOM_APP_DOCROOT /deployment/manager/app-ENV LOGGING_CONFIG_FILE /deployment/manager/logging.properties-ENV MAP_TILES_PATH /deployment/map/mapdata.mbtiles-ENV MAP_SETTINGS_PATH /deployment/map/mapsettings.json-ENV PROVISION_DOCROOT /deployment/manager/provisioning+ENV TZ ${TZ:-Europe/Amsterdam}+ENV SETUP_ADMIN_PASSWORD ${SETUP_ADMIN_PASSWORD:-secret}+ENV IDENTITY_NETWORK_HOST ${IDENTITY_NETWORK_HOST:-localhost}+ENV IDENTITY_NETWORK_SECURE ${IDENTITY_NETWORK_SECURE:-true}+ENV IDENTITY_NETWORK_WEBSERVER_PORT ${IDENTITY_NETWORK_WEBSERVER_PORT:-443}+ENV SETUP_EMAIL_HOST ${SETUP_EMAIL_HOST}+ENV SETUP_EMAIL_USER ${SETUP_EMAIL_USER}+ENV SETUP_EMAIL_PASSWORD ${SETUP_EMAIL_PASSWORD}+ENV SETUP_EMAIL_PORT ${SETUP_EMAIL_PORT:-25}+ENV SETUP_EMAIL_TLS ${SETUP_EMAIL_TLS:-true}+ENV SETUP_EMAIL_FROM_KEYCLOAK ${SETUP_EMAIL_FROM_KEYCLOAK:-no-reply@${NETWORK_IDENTITY_HOST:-localhost}}+ENV SETUP_EMAIL_FROM_DEFAULT ${SETUP_EMAIL_FROM_DEFAULT:-no-reply@${NETWORK_IDENTITY_HOST:-localhost}}+ENV NOTIFICATION_FIREBASE_URL ${NOTIFICATION_FIREBASE_URL:-https://fcm.googleapis.com/fcm/send}+ENV NOTIFICATION_FIREBASE_API_KEY ${NOTIFICATION_FIREBASE_API_KEY}+ENV FIREBASE_CONFIG_FILE ${FIREBASE_CONFIG_FILE:-/deployment/manager/fcm.json}+ENV DEV_MODE ${DEV_MODE:-false}+ENV SETUP_WIPE_CLEAN_INSTALL ${SETUP_WIPE_CLEAN_INSTALL:-false}+ENV WEBSERVER_LISTEN_HOST ${WEBSERVER_LISTEN_HOST:-0.0.0.0}+ENV DB_VENDOR ${DB_VENDOR:-postgres}+ENV DB_HOST ${DB_HOST:-postgresql}+ENV DB_PORT ${DB_PORT:-5432}+ENV DB_NAME ${DB_NAME:-openremote}+ENV DB_SCHEMA ${DB_SCHEMA:-openremote}+ENV DB_USERNAME ${DB_USERNAME:-postgres}+ENV DB_PASSWORD ${DB_PASSWORD:-postgres}+ENV DB_MIN_POOL_SIZE ${DB_MIN_POOL_SIZE:-5}+ENV DB_MAX_POOL_SIZE ${DB_MAX_POOL_SIZE:-20}+ENV DB_CONNECTION_TIMEOUT_SECONDS ${DB_CONNECTION_TIMEOUT_SECONDS:-300}+ENV KEYCLOAK_HOST ${KEYCLOAK_HOST:-keycloak}+ENV KEYCLOAK_PORT ${KEYCLOAK_PORT:-8080}+ENV APP_DOCROOT ${APP_DOCROOT:-/opt/web}+ENV CUSTOM_APP_DOCROOT ${CUSTOM_APP_DOCROOT:-/deployment/manager/app}+ENV PROVISIONING_DOCROOT ${PROVISIONING_DOCROOT:-/deployment/manager/provisioning}+ENV ROOT_REDIRECT_PATH ${ROOT_REDIRECT_PATH:-/manager}+ENV MAP_TILES_PATH ${MAP_TILES_PATH:-/deployment/map/mapdata.mbtiles}+ENV MAP_SETTINGS_PATH ${MAP_SETTINGS_PATH:-/deployment/map/mapsettings.json}+ENV LOGGING_CONFIG_FILE ${LOGGING_CONFIG_FILE}+ENV MAP_TILESERVER_HOST ${MAP_TILESERVER_HOST}+ENV MAP_TILESERVER_PORT ${MAP_TILESERVER_PORT:-8082}+ENV MAP_TILESERVER_REQUEST_TIMEOUT ${MAP_TILESERVER_REQUEST_TIMEOUT:-10000}+ENV SCHEDULED_TASKS_THREADS_MAX ${SCHEDULED_TASKS_THREADS_MAX:-4}+ENV RULE_EVENT_EXPIRES ${RULE_EVENT_EXPIRES:-1h}+ENV IDENTITY_PROVIDER ${IDENTITY_PROVIDER:-keycloak}+ENV IDENTITY_SESSION_MAX_MINUTES ${IDENTITY_SESSION_MAX_MINUTES:-1440}+ENV IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES ${IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES:-2628000}+ENV MANAGER_JAVA_OPTS ${MANAGER_JAVA_OPTS:--Xms400m -Xmx400m \+ -XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m \+ -XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m \+ -XX:MaxDirectMemorySize=25m -XX:NativeMemoryTracking=summary \+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof}EXPOSE 8080-HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=120 CMD curl --fail --silent http://localhost:8080 || exit 1+HEALTHCHECK --interval=3s --timeout=3s --start-period=30s --retries=120 CMD curl --fail --silent http://localhost:8080 || exit 1RUN mkdir -p /opt/app@@ -36,4 +78,4 @@ RUN mkdir -p /deployment/manager/extensionsADD lib /opt/app/libADD web /opt/web-ENTRYPOINT java $JAVA_OPTS -cp /opt/app/lib/*:/deployment/manager/extensions/* org.openremote.manager.Main+ENTRYPOINT java $MANAGER_JAVA_OPTS -cp /opt/app/lib/*:/deployment/manager/extensions/* org.openremote.manager.Maindiff --git a/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java b/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.javaindex 974a87f1b..c81e01996 100644--- a/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java+++ b/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java@@ -1148,10 +1148,12 @@ public class AssetStorageService extends RouteBuilder implements ContainerServicstatement.setString(6, attributeName);int updatedRows = statement.executeUpdate();- LOG.fine("Stored asset '" + asset.getId()- + "' attribute '" + attributeName- + "' (affected rows: " + updatedRows + ") value: "- + (value != null ? Values.asJSON(value).orElse("null") : "null"));+ if (LOG.isLoggable(Level.FINEST)) {+ LOG.finest("Stored asset '" + asset.getId()+ + "' attribute '" + attributeName+ + "' (affected rows: " + updatedRows + ") value: "+ + (value != null ? Values.asJSON(value).orElse("null") : "null"));+ }return updatedRows == 1;}});diff --git a/manager/src/main/java/org/openremote/manager/map/MapService.java b/manager/src/main/java/org/openremote/manager/map/MapService.javaindex a842261ed..527299e0a 100644--- a/manager/src/main/java/org/openremote/manager/map/MapService.java+++ b/manager/src/main/java/org/openremote/manager/map/MapService.java@@ -152,16 +152,17 @@ public class MapService implements ContainerService {mapTilesPath = Paths.get(getString(container.getConfig(), MAP_TILES_PATH, MAP_TILES_PATH_DEFAULT));if (!Files.isRegularFile(mapTilesPath)) {- throw new IllegalStateException(- "Map tiles data file not found (wrong working directory?): " + mapTilesPath.toAbsolutePath()- );+ LOG.warning("Map tiles data file not found '" + mapTilesPath.toAbsolutePath() + "', map functionality will not work");+ mapTilesPath = null;+ return;}mapSettingsPath = Paths.get(getString(container.getConfig(), MAP_SETTINGS_PATH, MAP_SETTINGS_PATH_DEFAULT));if (!Files.isRegularFile(mapSettingsPath)) {- throw new IllegalStateException(- "Map settings file not found: " + mapSettingsPath.toAbsolutePath()- );+ LOG.warning("Map settings file not found '" + mapSettingsPath.toAbsolutePath() + "', map functionality will not work");+ mapTilesPath = null;+ mapSettingsPath = null;+ return;}container.getService(ManagerWebService.class).getApiSingletons().add(@@ -203,6 +204,10 @@ public class MapService implements ContainerService {@Overridepublic void start(Container container) throws Exception {+ if (mapTilesPath == null || mapSettingsPath == null) {+ return;+ }+LOG.info("Starting map service with tile data: " + mapTilesPath.toAbsolutePath());Class.forName(org.sqlite.JDBC.class.getName());connection = DriverManager.getConnection("jdbc:sqlite:" + mapTilesPath.toAbsolutePath());diff --git a/manager/src/main/java/org/openremote/manager/notification/EmailNotificationHandler.java b/manager/src/main/java/org/openremote/manager/notification/EmailNotificationHandler.javaindex a21c9288c..1299d5a9b 100644--- a/manager/src/main/java/org/openremote/manager/notification/EmailNotificationHandler.java+++ b/manager/src/main/java/org/openremote/manager/notification/EmailNotificationHandler.java@@ -80,7 +80,7 @@ public class EmailNotificationHandler implements NotificationHandler {defaultFrom = container.getConfig().getOrDefault(SETUP_EMAIL_FROM, SETUP_EMAIL_FROM_DEFAULT);- if (!TextUtil.isNullOrEmpty(host)) {+ if (!TextUtil.isNullOrEmpty(host) && !TextUtil.isNullOrEmpty(user) && !TextUtil.isNullOrEmpty(password)) {MailerBuilder.MailerRegularBuilder mailerBuilder = MailerBuilder.withSMTPServer(host, port, user, password);boolean startTls = getBoolean(container.getConfig(), SETUP_EMAIL_TLS, SETUP_EMAIL_TLS_DEFAULT);diff --git a/manager/src/main/java/org/openremote/manager/setup/KeycloakInitSetup.java b/manager/src/main/java/org/openremote/manager/setup/KeycloakInitSetup.javaindex 71c4ee1a8..96fa9f913 100644--- a/manager/src/main/java/org/openremote/manager/setup/KeycloakInitSetup.java+++ b/manager/src/main/java/org/openremote/manager/setup/KeycloakInitSetup.java@@ -47,9 +47,6 @@ public class KeycloakInitSetup extends AbstractKeycloakSetup {masterRealm.setDisplayName("Master");keycloakProvider.updateTenant(masterRealm);- // Check that frontend URL has been updated before we proceed; we can see this in- Thread.sleep(10000);-// Create our client application with its default roleskeycloakProvider.createOpenRemoteClientApplication(masterRealm.getRealm());diff --git a/manager/src/main/java/org/openremote/manager/setup/ManagerSetup.java b/manager/src/main/java/org/openremote/manager/setup/ManagerSetup.javaindex dd4339b9b..5130258a3 100644--- a/manager/src/main/java/org/openremote/manager/setup/ManagerSetup.java+++ b/manager/src/main/java/org/openremote/manager/setup/ManagerSetup.java@@ -66,8 +66,8 @@ import static org.openremote.container.util.MapAccess.getString;public class ManagerSetup implements Setup {- public static final String PROVISION_DOCROOT = "PROVISION_DOCROOT";- public static final String PROVISION_DOCROOT_DEFAULT = "deployment/manager/provisioning";+ public static final String PROVISIONING_DOCROOT = "PROVISIONING_DOCROOT";+ public static final String PROVISIONING_DOCROOT_DEFAULT = "deployment/manager/provisioning";protected Path provisionDocRoot;@@ -93,7 +93,7 @@ public class ManagerSetup implements Setup {this.rulesetStorageService = container.getService(RulesetStorageService.class);this.setupService = container.getService(SetupService.class);- provisionDocRoot = Paths.get(getString(container.getConfig(), PROVISION_DOCROOT, PROVISION_DOCROOT_DEFAULT));+ provisionDocRoot = Paths.get(getString(container.getConfig(), PROVISIONING_DOCROOT, PROVISIONING_DOCROOT_DEFAULT));}@Overridediff --git a/manager/src/main/java/org/openremote/manager/setup/SchemaExporter.java b/manager/src/main/java/org/openremote/manager/setup/SchemaExporter.javaindex 4375e2b79..6fc457683 100644--- a/manager/src/main/java/org/openremote/manager/setup/SchemaExporter.java+++ b/manager/src/main/java/org/openremote/manager/setup/SchemaExporter.java@@ -47,7 +47,7 @@ public class SchemaExporter {new ManagerPersistenceService() {@Override- protected void openDatabase(org.openremote.model.Container container, Database database) {+ protected void openDatabase(org.openremote.model.Container container, Database database, String username, String password, String connectionUrl) {// Ignore, we don't want to connect to the database when exporting schema}diff --git a/manager/src/main/java/org/openremote/manager/setup/SetupService.java b/manager/src/main/java/org/openremote/manager/setup/SetupService.javaindex ba79dba4d..dae477285 100644--- a/manager/src/main/java/org/openremote/manager/setup/SetupService.java+++ b/manager/src/main/java/org/openremote/manager/setup/SetupService.java@@ -30,7 +30,7 @@ import java.util.logging.Logger;/*** Executes setup tasks for a clean installation when the application starts.* <p>- * This service is disabled when {@link PersistenceService#SETUP_WIPE_CLEAN_INSTALL} is <code>false</code>.+ * This service is disabled when {@link PersistenceService#isSetupWipeCleanInstall} is <code>false</code>.* <p>* First, this service will load an implementation of {@link SetupTasks} from the* classpath using {@link ServiceLoader}. If multiple providers are found, an error@@ -58,7 +58,7 @@ public class SetupService implements ContainerService {boolean isClean = container.getService(PersistenceService.class).isSetupWipeCleanInstall();if (!isClean) {- LOG.info("Setup service disabled, " + PersistenceService.SETUP_WIPE_CLEAN_INSTALL + "=false");+ LOG.info("Setup service disabled, clean install = false");return;}diff --git a/manager/src/main/java/org/openremote/manager/setup/SetupTasks.java b/manager/src/main/java/org/openremote/manager/setup/SetupTasks.javaindex 9c1b2c380..c2790dda9 100644--- a/manager/src/main/java/org/openremote/manager/setup/SetupTasks.java+++ b/manager/src/main/java/org/openremote/manager/setup/SetupTasks.java@@ -23,84 +23,11 @@ import org.openremote.model.Container;import java.util.List;-import static org.openremote.container.util.MapAccess.getBoolean;-/**- * Provides a list of enabled {@link Setup} tasks.- * <p>- * Implementations use the static getter methods of this interface to query configuration, before returning a- * list of their enabled tasks in {@link #createTasks}.- * <p>- * Configuration options can have dependencies, enabling one option may enforce other options to be enabled.- * <p>- * The configuration options exposed as container environment variables are:- * <dl>- * <dt>{@link #SETUP_WIPE_CLEAN_INSTALL}</dt>- * <dd>- * Defaults to enabled if {@link Container#DEV_MODE} is enabled. All setup tasks will be ignored if this option is disabled.- * </dd>- * <dt>{@link #SETUP_IMPORT_DEMO_USERS}</dt>- * <dd>- * Defaults to enabled if {@link Container#DEV_MODE} is enabled.- * </dd>- * <dt>{@link #SETUP_IMPORT_DEMO_ASSETS}</dt>- * <dd>- * Defaults to enabled if {@link Container#DEV_MODE} is enabled, enables {@link #SETUP_IMPORT_DEMO_USERS}.- * </dd>- * <dt>{@link #SETUP_IMPORT_DEMO_RULES}</dt>- * <dd>- * Defaults to enabled if {@link Container#DEV_MODE} is enabled, enables {@link #SETUP_IMPORT_DEMO_ASSETS}.- * </dd>- * <dt>{@link #SETUP_IMPORT_DEMO_SCENES}</dt>- * <dd>- * Defaults to enabled if {@link Container#DEV_MODE} is enabled, enables {@link #SETUP_IMPORT_DEMO_ASSETS}.- * </dd>- * <dt>{@link #SETUP_IMPORT_DEMO_AGENT}</dt>- * <dd>- * Defaults to disabled even when {@link Container#DEV_MODE} is enabled (as enabling may require- * protocol-specific hardware), enables {@link #SETUP_IMPORT_DEMO_ASSETS}.- * </dd>- * </dl>+ * Provides a list of {@link Setup} tasks to execute.*/public interface SetupTasks {-- String SETUP_IMPORT_DEMO_USERS = "SETUP_IMPORT_DEMO_USERS";- String SETUP_IMPORT_DEMO_ASSETS = "SETUP_IMPORT_DEMO_ASSETS";- String SETUP_IMPORT_DEMO_RULES = "SETUP_IMPORT_DEMO_RULES";- String SETUP_IMPORT_DEMO_SCENES = "SETUP_IMPORT_DEMO_SCENES";- String SETUP_IMPORT_DEMO_AGENT = "SETUP_IMPORT_DEMO_AGENT";- String SETUP_TESTS = "SETUP_TESTS";-- static boolean isImportDemoUsers(Container container) {- return isImportDemoAssets(container)- || getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_USERS, container.isDevMode());- }-- static boolean isImportDemoAssets(Container container) {- return isImportDemoAgent(container)- || isImportDemoRules(container)- || isImportDemoScenes(container)- || getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_ASSETS, container.isDevMode());- }-- static boolean isImportDemoRules(Container container) {- return getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_RULES, container.isDevMode());- }-- static boolean isImportDemoScenes(Container container) {- return getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_SCENES, container.isDevMode());- }-- // Defaults to always disabled as agents might require actual protocol-specific hardware- static boolean isImportDemoAgent(Container container) {- return getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_AGENT, false);- }-- static boolean isTestSetup(Container container) {- return getBoolean(container.getConfig(), SETUP_TESTS, false);- }-List<Setup> createTasks(Container container);<S extends Setup> S getTaskOfType(Class<S> setupType);diff --git a/deployment/manager/logging.properties b/manager/src/main/resources/logging-dev.propertiessimilarity index 62%rename from deployment/manager/logging.propertiesrename to manager/src/main/resources/logging-dev.propertiesindex edf93fbb6..3f1ccf29e 100644--- a/deployment/manager/logging.properties+++ b/manager/src/main/resources/logging-dev.properties@@ -1,27 +1,17 @@-# The default configuration we ship to users.-# Note that a LOGGING_CONFIG_FILE in the Docker setup may override this!-#-# This will only be used automatically# if it's located at-# /deployment/manager/logging.properties on the host machine, or-# set with environment variable LOGGING_CONFIG_FILE.--###############################################################################-# Project categories-###############################################################################--# YOUR PROJECT'S LOG CATEGORIES HERE...+# Built in development logging configuration; used by default when DEV_MODE=true################################################################################ Output handlers################################################################################ Log on STDOUT and internal syslog service (monitoring in Manager UI)-handlers=java.util.logging.ConsoleHandler,org.openremote.manager.syslog.SyslogService+handlers=java.util.logging.ConsoleHandler, \+ org.openremote.manager.syslog.SyslogService# Log on STDOUT, to a file, and internal syslog service (monitoring in Manager UI)#handlers=java.util.logging.ConsoleHandler, \-# java.util.logging.FileHandler \-# org.openremote.manager.syslog.SyslogService+# java.util.logging.FileHandler \+# org.openremote.manager.syslog.SyslogService################################################################################ Console handler@@ -47,60 +37,59 @@ java.util.logging.ConsoleHandler.formatter=org.openremote.container.util.LogFormjava.util.logging.FileLogger.level=FINEST# Output file and format-java.util.logging.FileHandler.pattern=/deployment/manager/logs/openremote.log+java.util.logging.FileHandler.pattern=/deployment/openremote.logjava.util.logging.FileHandler.formatter=org.openremote.container.util.LogFormatter# Rotate between 10 log filesjava.util.logging.FileHandler.count=10# 10 mb per filejava.util.logging.FileHandler.limit=10000000# Set to false to clear log on restart-java.util.logging.FileHandler.append=true+java.util.logging.FileHandler.append=false################################################################################ Categories################################################################################ The root logger category, the default for all categories not configured here-.level=WARNING+.level=INFO# The root logger category of OpenRemote, FINE logs much more than INFO-org.openremote.level=INFO+org.openremote.level=FINE# Rule execution logging#-# - Use "LOG" or "console" in your rules to access this logger-# - Set to FINEST to automatically log all facts and when they are modified+# - Use "global java.util.logging.Logger LOG;" in rule RHS to access this logger+# - Set to FINEST to automatically log all fact additions, removals, and updates# - Set to INFO and prefix your rule name with "-" or "--" to log execution details-#org.openremote.rules.Rules.level=FINE# Set to INFO to get rules engine statistics periodically, FINEST to dump all facts-org.openremote.rules.RulesEngineStats.level=INFO+org.openremote.rules.RulesEngineStats.level=OFF# Set to INFO or higher to debug internal messagingorg.openremote.container.message.MessageBrokerContext.level=WARNING# Set to FINE to log full exception stack traces-org.openremote.container.web.WebServiceExceptions.level=INFO+org.openremote.container.web.WebServiceExceptions.level=FINE# Set to SEVERE to log invalid access tokens-org.keycloak.adapters.BearerTokenRequestAuthenticator.level=OFF+org.keycloak.adapters.BearerTokenRequestAuthenticator.level=SEVERE# Set this to FINEST to log outgoing HTTP trafficorg.apache.http.level=WARNINGorg.apache.http.impl.conn.DefaultClientConnection.level=WARNING+org.apache.http.client.protocol.level=SEVERE# Set this to FINEST to log SQL executionorg.hibernate.SQL.level=WARNINGorg.hibernate.type.descriptor.sql.BasicBinder.level=WARNING# Log only attribute event processing begin/end, useful to debug many events-#org.openremote.container.web.level=INFO-#org.openremote.manager.level=INFO-#org.openremote.manager.asset.AssetProcessingService.level=FINE+org.openremote.container.web.level=INFO+org.openremote.manager.server.level=INFO+# Low-level debugging overrides, most of them are to stop chatty categories-org.openremote.container.concurrent.GlobalLock.level=INFOorg.hibernate.level=WARNINGorg.hibernate.cfg.beanvalidation.TypeSafeActivator.level=SEVEREcom.zaxxer.hikari.level=WARNING@@ -109,15 +98,4 @@ org.xnio.level=WARNINGorg.apache.camel.management.level=WARNINGorg.apache.camel.impl.converter.DefaultTypeConverter.level=WARNINGorg.apache.camel.impl.DefaultShutdownStrategy.level=SEVERE-org.apache.http.client.protocol.level=SEVERE--# Z-Wave log file-org.openremote.protocol.zwave.ZWaveFileHandler.level=FINEST-org.openremote.protocol.zwave.ZWaveFileHandler.pattern=/zwave/zwave.log-org.openremote.protocol.zwave.ZWaveFileHandler.formatter=org.openremote.container.util.LogFormatter-org.openremote.protocol.zwave.ZWaveFileHandler.count=10-org.openremote.protocol.zwave.ZWaveFileHandler.limit=10000000-org.openremote.protocol.zwave.ZWaveFileHandler.append=true--OpenRemote.Controller.protocol.zwave.level=FINEST-OpenRemote.Controller.protocol.zwave.handlers=org.openremote.protocol.zwave.ZWaveFileHandler\ No newline at end of file+org.jeasy.rules.level=WARNINGdiff --git a/manager/src/main/resources/logging.properties b/manager/src/main/resources/logging.propertiesindex 70c475ead..56377a12e 100644--- a/manager/src/main/resources/logging.properties+++ b/manager/src/main/resources/logging.properties@@ -1,26 +1,24 @@-# This is the default configuration file for logging, used when no other option-# is specified. Consider this the "default developer" configuration. If the-# file /deployment/logging.properties exists on the host, or the environment-# variable LOGGING_CONFIG_FILE is set, this file will not be used.+# Built in production logging configuration; used by default when DEV_MODE=false################################################################################ Output handlers################################################################################ Log on STDOUT and internal syslog service (monitoring in Manager UI)-handlers=java.util.logging.ConsoleHandler,org.openremote.manager.syslog.SyslogService--# Log on STDOUT, to a file, and internal syslog service (monitoring in Manager UI)#handlers=java.util.logging.ConsoleHandler, \-# java.util.logging.FileHandler \# org.openremote.manager.syslog.SyslogService+# Log on STDOUT, to a file, and internal syslog service (monitoring in Manager UI)+handlers=java.util.logging.ConsoleHandler, \+ java.util.logging.FileHandler \+ org.openremote.manager.syslog.SyslogService+################################################################################ Console handler################################################################################ Set to FINEST to get all enabled log categories on console handler-java.util.logging.ConsoleHandler.level=FINEST+java.util.logging.ConsoleHandler.level=INFO# Console format, you can colorize this in IntelliJ IDEA "Run Application " console# with the GrepConsole plugin and after copying the configuration file of your@@ -39,7 +37,7 @@ java.util.logging.ConsoleHandler.formatter=org.openremote.container.util.LogFormjava.util.logging.FileLogger.level=FINEST# Output file and format-java.util.logging.FileHandler.pattern=deployment/openremote.log+java.util.logging.FileHandler.pattern=/deployment/openremote.logjava.util.logging.FileHandler.formatter=org.openremote.container.util.LogFormatter# Rotate between 10 log filesjava.util.logging.FileHandler.count=10@@ -56,18 +54,17 @@ java.util.logging.FileHandler.append=true.level=INFO# The root logger category of OpenRemote, FINE logs much more than INFO-org.openremote.level=FINE+org.openremote.level=INFO# Rule execution logging#-# - Use "LOG" or "console" in your rules to access this logger-# - Set to FINEST to automatically log all facts and when they are modified+# - Use "global java.util.logging.Logger LOG;" in rule RHS to access this logger+# - Set to FINEST to automatically log all fact additions, removals, and updates# - Set to INFO and prefix your rule name with "-" or "--" to log execution details-#-org.openremote.rules.Rules.level=FINE+org.openremote.rules.Rules.level=INFO# Set to INFO to get rules engine statistics periodically, FINEST to dump all facts-org.openremote.rules.RulesEngineStats.level=INFO+org.openremote.rules.RulesEngineStats.level=OFF# Set to INFO or higher to debug internal messagingorg.openremote.container.message.MessageBrokerContext.level=WARNING@@ -76,25 +73,23 @@ org.openremote.container.message.MessageBrokerContext.level=WARNINGorg.openremote.container.web.WebServiceExceptions.level=FINE# Set to SEVERE to log invalid access tokens-org.keycloak.adapters.BearerTokenRequestAuthenticator.level=SEVERE+org.keycloak.adapters.BearerTokenRequestAuthenticator.level=OFF# Set this to FINEST to log outgoing HTTP trafficorg.apache.http.level=WARNINGorg.apache.http.impl.conn.DefaultClientConnection.level=WARNING+org.apache.http.client.protocol.level=SEVERE# Set this to FINEST to log SQL executionorg.hibernate.SQL.level=WARNINGorg.hibernate.type.descriptor.sql.BasicBinder.level=WARNING# Log only attribute event processing begin/end, useful to debug many events-org.openremote.container.web.level=INFO-org.openremote.manager.level=INFO-org.openremote.manager.asset.AssetProcessingService.level=FINE-org.openremote.manager.agent.AgentService.level=FINE-org.openremote.manager.asset.AssetStorageService.level=FINE+#org.openremote.container.web.level=FINE+#org.openremote.manager.server.level=FINE+#org.openremote.manager.server.asset.AssetProcessingService.level=FINE# Low-level debugging overrides, most of them are to stop chatty categories-org.openremote.container.concurrent.GlobalLock.level=INFOorg.hibernate.level=WARNINGorg.hibernate.cfg.beanvalidation.TypeSafeActivator.level=SEVEREcom.zaxxer.hikari.level=WARNING@@ -104,15 +99,3 @@ org.apache.camel.management.level=WARNINGorg.apache.camel.impl.converter.DefaultTypeConverter.level=WARNINGorg.apache.camel.impl.DefaultShutdownStrategy.level=SEVEREorg.jeasy.rules.level=WARNING-org.apache.http.client.protocol.level=SEVERE--# Z-Wave log file-org.openremote.protocol.zwave.ZWaveFileHandler.level=FINEST-org.openremote.protocol.zwave.ZWaveFileHandler.pattern=/zwave/zwave.log-org.openremote.protocol.zwave.ZWaveFileHandler.formatter=org.openremote.container.util.LogFormatter-org.openremote.protocol.zwave.ZWaveFileHandler.count=10-org.openremote.protocol.zwave.ZWaveFileHandler.limit=10000000-org.openremote.protocol.zwave.ZWaveFileHandler.append=true--OpenRemote.Controller.protocol.zwave.level=FINEST-OpenRemote.Controller.protocol.zwave.handlers=org.openremote.protocol.zwave.ZWaveFileHandlerdiff --git a/manager/swarm.Dockerfile b/manager/swarm.Dockerfileindex e0f489d97..62be45db9 100644--- a/manager/swarm.Dockerfile+++ b/manager/swarm.Dockerfile@@ -7,22 +7,5 @@ FROM openremote/manager:latestARG GIT_COMMIT=unknownLABEL git-commit=$GIT_COMMIT-ENV JAVA_OPTS -Xmx1g--ENV APP_DOCROOT /opt/web-ENV LOGGING_CONFIG_FILE /deployment/manager/logging.properties-ENV MAP_TILES_PATH /deployment/map/mapdata.mbtiles-ENV MAP_SETTINGS_PATH /deployment/map/mapsettings.json-ENV PROVISION_DOCROOT /deployment/manager/provisioning--EXPOSE 8080--HEALTHCHECK --interval=3s --timeout=3s --start-period=300s --retries=120 CMD curl --fail --silent http://localhost:8080 || exit 1--WORKDIR /opt/app--RUN mkdir -p /deployment/extensions-COPY --from=deployment /deployment/ /deployment/# hadolint ignore=DL3025-ENTRYPOINT java $JAVA_OPTS -cp /opt/app/lib/*:/deployment/manager/extensions/* org.openremote.manager.Maindiff --git a/model/src/main/java/org/openremote/model/Container.java b/model/src/main/java/org/openremote/model/Container.javaindex fbcb53c30..e955fce09 100644--- a/model/src/main/java/org/openremote/model/Container.java+++ b/model/src/main/java/org/openremote/model/Container.java@@ -28,6 +28,9 @@ import java.util.concurrent.ScheduledExecutorService;@TsIgnorepublic interface Container {+ String DEV_MODE = "DEV_MODE";+ boolean DEV_MODE_DEFAULT = true;+boolean isDevMode();Map<String, String> getConfig();diff --git a/mvp/mvp-docker-compose.yml b/mvp/mvp-docker-compose.ymlindex 44e27db8c..da3db661e 100644--- a/mvp/mvp-docker-compose.yml+++ b/mvp/mvp-docker-compose.yml@@ -149,24 +149,6 @@ services:#SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'#SETUP_EMAIL_FROM_DEFAULT: '[email protected]'- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers# The public host name of this OpenRemote installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also@@ -179,33 +161,16 @@ services:# The public port of this OpenRemote installation.IDENTITY_NETWORK_WEBSERVER_PORT: 443- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: openremote- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-# The service-internal host name and port of the identity provider.KEYCLOAK_HOST: keycloakKEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}-- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0-- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}- JAVA_OPTS: '-Xms400m -Xmx400m+ JAVA_OPTS: -Xms400m -Xmx400m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprofvolumes:- deployment-data:/deployment@@ -246,30 +211,18 @@ services:# When you are ready to permanently install your project, replace it with the next line ...# SETUP_ADMIN_PASSWORD: # Allow override on CLI- # Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: openremote- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'- KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'-# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-Xms300m -Xmx300m+ JAVA_OPTS: -Xms300m -Xmx300m-XX:CompressedClassSpaceSize=50m -XX:MaxMetaspaceSize=250m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary-XX:+ExitOnOutOfMemoryError-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=trueports:- "8081:8080"@@ -305,14 +258,6 @@ services:# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.TZ: Europe/Amsterdam- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: openremote- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-# You can open an SQL console on a running container with:# docker exec -it <container ID> psql -U openremotediff --git a/platform/rpi3/README.md b/platform/rpi3/README.mddeleted file mode 100644index 7f1e7483e..000000000--- a/platform/rpi3/README.md+++ /dev/null@@ -1,139 +0,0 @@-# Running OpenRemote on ARM64 device--This procedure was tested on AWS t4g EC2 instance using [CloudFormation template](https://github.com/openremote/openremote/gitlab-ci/aws-cloudformation.template.arm64.yml).--OpenRemote images on Docker Hub are multi-arch created automatically by CI/CD pipeline, therefore there is no need to build them locally. The multi-arch build procedure is defined as [Github action](https://github.com/openremote/openremote/blob/master/.github/workflows/gradle.yml) and uses official Docker QEMU action.--There is no official base Keycloak ARM image provided, therefore the stack uses basic http authentication.-TODO: use central remote Keycloak installation.--To start the OpenRemote stack:-- login to ARM device;-- install *docker* with *docker-compose* if necessary;-- start the stack:-```bash-docker-compose -p openremote -f profile/demo-basic-no-build.yml up -d-```--**Tip:** [AWS CloudFormation template](https://github.com/openremote/openremote/gitlab-ci/aws-cloudformation.template.arm64.yml) Resources.EC2Instance.Properties.UserData section contains installation script for AWS Linux ARM device. The minimum RAM is 512M, which can be run on [BeagleBoneBlack](http://beagleboard.org/black).-TODO: test it on actual device.--## Installing OpenRemote on Raspberry Pi 3 (old)--You need a [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) and and empty SD card. First download [Etcher](https://etcher.io/) to burn SD card images.---Download the [Pi64 Lite distribution](https://github.com/bamarni/pi64/releases) and write it to your card. This is a minimal Debian Linux variant that runs on a 64 bit kernel with OpenJDK ARM64 optimized for this platform.--Next you must copy some files onto your new SD card, so keep it mounted on your computer. Generate the files with:--```-SSH_PUBKEY=/the/path/to/your/ssh/pubkey/id_rsa.pub ./gradlew clean prepareImage-```--Copy everything from `platform/rpi3/build/install` onto your SD card.--Boot your Raspberry Pi 3 with the SD card and wait until you can login with SSH. If you don't know the IP address of your LAN-connected PI (edit `setup` before booting first time to enable WiFi), you can scan your network with:--```-nmap -sP 10.0.0.0/24-```--Test the SSH connection with: `ssh openremote@<IP of your Raspberry Pi 3>`--Next copy from your local machine the OpenRemote app to the Raspberry Pi 3 (there is not enough space on boot partition to include it there):--```-scp -r manager/build/install/manager/client manager/build/install/manager/server openremote@<IP of your Raspberry Pi3>:/home/openremote/app/-```--Continue installation by connecting with SSH and run on the Raspberry Pi 3:-```-sudo POSTGRES_DB=openremote POSTGRES_USER=openremote POSTGRES_PASSWORD='dbsecret' ./openremote-install.sh-```--This will download packages from the Internet, so make sure your machine is connected properly.--Start OpenRemote with:--```-sudo DATABASE_PASSWORD='dbsecret' SETUP_ADMIN_PASSWORD='secret123' IDENTITY_NETWORK_HOST=<IP of your Raspberry Pi3> ./openremote-run.sh-```--Open the Manager UI on `http://<IP of your Raspberry Pi 3>/` and login with `admin` and your password.--TODO: The SSH 'openremote' user on the machine is still secured with the default 'raspberry' password. We should disable password authentication completely, see `setup`.-- <!-- ## Docker machine setup -->-- <!-- The Docker server and your workstation Docker client must be customized so you can connect and deploy OpenRemote containers on the Raspberry Pi. -->-- <!-- On your workstation you should have a Docker installation. Execute the following script to generate the necessary configuration files in the `build` directory: -->-- <!-- ``` -->- <!-- DOCKER_MACHINE_NAME=openremote1 \ -->- <!-- DOCKER_MACHINE_IP=10.0.0.123 \ -->- <!-- WIFI_SSID=MyWifiNetwork \ -->- <!-- WIFI_PASSWORD=MyWifiPassword \ -->- <!-- SSH_PUBKEY=$HOME/.ssh/id_rsa.pub \ -->- <!-- platform/rpi3/machine/openremote-setup.sh -->- <!-- ``` -->-- <!-- Note that `DOCKER_MACHINE_NAME` is used for the name of the Docker Machine configuration on your workstation, as well as the host name of the Raspberry Pi. -->-- <!-- The network setup of the Raspberry Pi will request an IP on interface `wlan0` with DHCP. Make sure your LAN router provides the configured the `DOCKER_MACHINE_IP`. If another IP is assigned, you must edit the generated `config.json` Docker Machine settings. If you don't use Wifi, edit the file `build/boot/device-init.yaml` after generation. -->-- <!-- The provided `SSH_PUBKEY` will be the only authorized key for SSH connections to your Raspberry Pi, password authentication is disabled. You can connect with the user `openremote` on port 22 or simply use `docker-machine ssh openremote1`. -->-- <!-- The setup script generates files that should be copied onto the `boot` partition of your SD card, which is visible when you mount the SD card on your workstation. Also copy the Docker Machine client configuration files into the `$HOME/.docker/machine/machines/` directory. -->-- <!-- After booting the Raspberry Pi from the SD card, verify the connection with a Docker client from your workstation: -->-- <!-- ``` -->- <!-- eval $(docker-machine env openremote1) -->- <!-- docker version -->- <!-- ``` -->-- <!-- TODO: Alternative OS with aarch64 support and better OpenJDK JIT, but currently no Docker CE packages exist: https://github.com/bamarni/pi64 -->- <!-- TODO: Alternative OS: https://project31.github.io/ -->-- <!-- ## Customizing Docker authentication -->-- <!-- By default a dummy CA and self-signed certificates are generated for the Docker client connection and authentication on the Docker host. The same key is used on the server and client. See the comments in `platform/rpi3/machine/openremote-setup.sh` for customization options. -->-- <!-- ## Deploying OpenRemote containers -->-- <!-- The Docker images for OpenRemote can be build on your x86 workstation with the QEMU emulator for the ARM environment. After building the images, you can export and load them onto the Raspberry Pi. -->-- <!-- First build the base image: -->-- <!-- ``` -->- <!-- docker build -t openremote/rpi-raspbian platform/rpi3/rpi-raspbian -->- <!-- ``` -->-- <!-- Next build the OpenRemote service images from source with: -->-- <!-- ``` -->- <!-- ./gradlew clean prepareImage -->- <!-- docker build -t openremote/rpi-haproxy:latest -f haproxy/rpi3.Dockerfile haproxy -->- <!-- docker build -t openremote/rpi-postgresql:latest -f postgresql/rpi3.Dockerfile postgresql -->- <!-- docker build -t openremote/rpi-manager:latest -f manager/build/install/rpi3.Dockerfile manager/build/install -->- <!-- ``` -->-- <!-- TODO: The Manager image uses Oracle JDK by default, which must be licensed if deployed in production! You can switch to the much slower OpenJDK in the `Dockerfile`. We expect a faster OpenJDK to be available with AARCH64 OS. -->-- <!-- Copy them to your Raspberry Pi (replace `openremote1` with your `DOCKER_MACHINE_NAME`): -->-- <!-- ``` -->- <!-- docker save openremote/rpi-haproxy | (eval $(docker-machine env openremote1) && docker load) -->- <!-- docker save openremote/rpi-manager | (eval $(docker-machine env openremote1) && docker load) -->- <!-- docker save openremote/rpi-postgresql | (eval $(docker-machine env openremote1) && docker load) -->- <!-- ``` -->-- <!-- Deploy the containers, providing the IP/hostname of your Raspberry Pi: -->-- <!-- ``` -->- <!-- IDENTITY_NETWORK_HOST=10.0.0.123 docker-compose -p openremote -f profile/demo_rpi.yml up -->- <!-- ``` -->-- <!-- Open the Manager UI on `https://10.0.0.123`, accepting the self-signed demo SSL certificate. Login with `admin` and password `secret`. Edit the profile to change the admin password and other settings. -->diff --git a/postgresql/Dockerfile b/postgresql/Dockerfileindex 2c5a94b22..4cf924414 100644--- a/postgresql/Dockerfile+++ b/postgresql/Dockerfile@@ -1,7 +1,12 @@# Based on https://github.com/appropriate/docker-postgis/blob/master/9.6-2.5-FROM postgres:9.6+FROM postgres:9.6.21ENV POSTGIS_MAJOR 2.3+ENV POSTGRES_DB ${POSTGRES_DB}+ENV POSTGRES_USER ${POSTGRES_USER}+ENV POSTGRES_PASSWORD ${POSTGRES_PASSWORD}+ENV TZ ${TZ}+ENV PGTZ ${PGTZ}RUN apt-get update \&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \@@ -10,4 +15,4 @@ RUN apt-get update \postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \&& rm -rf /var/lib/apt/lists/*-HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=30 CMD gosu postgres pg_isready\ No newline at end of file+HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=30 CMD gosu postgres pg_isreadydiff --git a/profile/basic-identity.yml b/profile/basic-identity.ymlnew file mode 100644index 000000000..c3556a79b--- /dev/null+++ b/profile/basic-identity.yml@@ -0,0 +1,42 @@+# OpenRemote v3+#+# Profile that runs the vanilla stack on https://localhost using a self-signed SSL certificate,+# with username 'admin' and password 'secret' using the basic identity provider (i.e. no keycloak+# for constrained devices such as edge gateways). There is no map data available in the vanilla+# system so the map tile server will not function. Persistent data is stored in a docker+# volume called postgresql-data between restarts, simply delete this volume to reset the+# system to an empty state.+#+# Please see deploy.yml for configuration details for each service.+#+version: '2.4'++volumes:+ postgresql-data:++services:++ proxy:+ extends:+ file: deploy.yml+ service: proxy+ depends_on:+ manager:+ condition: service_healthy++ postgresql:+ extends:+ file: deploy.yml+ service: postgresql+ volumes:+ - postgresql-data:/var/lib/postgresql/data++ manager:+ extends:+ file: deploy.yml+ service: manager+ depends_on:+ postgresql:+ condition: service_healthy+ environment:+ IDENTITY_PROVIDER: basicdiff --git a/profile/build.yml b/profile/build.ymlnew file mode 100644index 000000000..2f13316a7--- /dev/null+++ b/profile/build.yml@@ -0,0 +1,35 @@+# OpenRemote v3+#+# Profile for building the services using docker compose.+#+# Please see deploy.yml for configuration details for each service.+#+version: '2.4'++services:++ proxy:+ image: openremote/proxy:${DATE_TAG:-latest}+ build: '../proxy'++ manager:+ image: openremote/manager:${DATE_TAG:-latest}+ build: '../manager/build/install/manager'++ keycloak:+ image: openremote/keycloak:${DATE_TAG:-latest}+ build: '../keycloak'++ postgresql:+ image: openremote/postgresql:${DATE_TAG:-latest}+ build: '../postgresql'++ map:+ image: openremote/map:${DATE_TAG:-latest}+ build: '../map'++ swarm:+ image: openremote/manager-swarm:${DATE_TAG:-latest}+ build:+ context: '../manager/build/install/manager'+ dockerfile: swarm.Dockerfilediff --git a/profile/demo-basic-no-build.yml b/profile/demo-basic-no-build.ymldeleted file mode 100644index 0933c5fd5..000000000--- a/profile/demo-basic-no-build.yml+++ /dev/null@@ -1,53 +0,0 @@-#-# Demo setup of OpenRemote v3 with basic identity provider-#-version: '2.4'--volumes:- proxy-data:- postgresql-data:- deployment-data:--services:-- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- image: openremote/deployment:${DATE_TAG:-latest}- volumes:- - deployment-data:/deployment-- proxy:- restart: unless-stopped- extends:- file: deploy-no-build.yml- service: proxy- depends_on:- manager:- condition: service_healthy- volumes:- - proxy-data:/deployment- # Override the haproxy.cfg with custom file- # -${MY_PROXY_CONFIG_FILE}:/etc/haproxy/haproxy.cfg-- postgresql:- restart: unless-stopped- extends:- file: deploy-no-build.yml- service: postgresql- volumes:- - postgresql-data:/var/lib/postgresql/data-- manager:- restart: unless-stopped- extends:- file: deploy-no-build.yml- service: manager- depends_on:- postgresql:- condition: service_healthy- volumes:- - deployment-data:/deployment- environment:- # Use basic identity service instead of Keycloak, set master admin password- IDENTITY_PROVIDER: basicdiff --git a/profile/demo-basic.yml b/profile/demo-basic.ymldeleted file mode 100644index 9ef63c32f..000000000--- a/profile/demo-basic.yml+++ /dev/null@@ -1,46 +0,0 @@-#-# Demo setup of OpenRemote v3 with basic identity provider-#-version: '2.4'--volumes:- postgresql-data:- deployment-data:--services:-- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- build: '../deployment'- image: openremote/deployment:${DATE_TAG:-latest}- volumes:- - deployment-data:/deployment-- proxy:- extends:- file: deploy.yml- service: proxy- depends_on:- manager:- condition: service_healthy-- postgresql:- extends:- file: deploy.yml- service: postgresql- volumes:- - postgresql-data:/var/lib/postgresql/data-- manager:- extends:- file: deploy.yml- service: manager- depends_on:- postgresql:- condition: service_healthy- volumes:- - deployment-data:/deployment- environment:- # Use basic identity service instead of Keycloak, set master admin password- IDENTITY_PROVIDER: basicdiff --git a/profile/demo-openremote.yml b/profile/demo-openremote.ymldeleted file mode 100644index 4a003c208..000000000--- a/profile/demo-openremote.yml+++ /dev/null@@ -1,115 +0,0 @@-# OpenRemote v3-#-# By default running this profile installs the stack on https://localhost using a-# self-signed SSL certificate, with username 'admin' and password 'secret'.-#-# Install Docker Community edition (https://docker.com/) on Windows, macOS, or Linux.-#-# Start a demo stack in the project root directory with:-#-# docker-compose up-#-# For full documentation, see deploy.yml-#-# Steps to create a permanent installation:-#-# 1. DO NOT FORGET TO CHANGE SETUP_ADMIN_PASSWORD!-#-# 2. Consider setting a custom DOMAINNAME, LE_EMAIL, and IDENTITY_NETWORK_HOST, see deploy.yml-#-# 3. Understand how bind mounts and volume mappings work, see below and read:-# https://docs.docker.com/engine/admin/volumes/bind-mounts/-# https://docs.docker.com/engine/admin/volumes/volumes/#choose-the--v-or-mount-flag-# Survival guide: docker volume ls|rm|prune-#-# 4. Execute once:-#-# SETUP_WIPE_CLEAN_INSTALL=true \-# SETUP_ADMIN_PASSWORD=secret \-# docker-compose up-#-# This creates the initial database and optionally imports some examples. Inspect the-# running installation and ensure it's working. You should now stop the stack and remove-# all containers. It is important that you recreate the containers and start again WITHOUT-# the SETUP_WIPE_CLEAN_INSTALL setting! Passwords can be changed in the application.-#-# Database schemas will be upgraded to new versions of the services automatically, you do-# not have to wipe all data to install a new version of OpenRemote.-#-# Your extension JAR files should be in the deployment/manager/extensions/ directory.-#-version: '2.4'--# If you enable volume mappings in services, you need this. Otherwise, remove the volumes-volumes:- proxy-data:- deployment-data:- postgresql-data:--services:-- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- build: '../deployment'- image: openremote/deployment:${DATE_TAG:-latest}- volumes:- - deployment-data:/deployment-- # This configuration does not store SSL certificate data and allow changes to the- # proxy configuration, it is only configured for deployment on localhost. You can- # map a Docker volume or host directory to access/store proxy configuration files- # and SSL certificates.- proxy:- extends:- file: deploy.yml- service: proxy- depends_on:- manager:- condition: service_healthy- volumes:- - proxy-data:/deployment- # Override the haproxy.cfg with custom file- # -${MY_PROXY_CONFIG_FILE}:/etc/haproxy/haproxy.cfg- environment:- DOMAINNAME: demo.openremote.io-- # This configuration uses the manager's deployment-specific data such as map tiles,- # console application static resources (HTML, JS, CSS), extensions, and other- # configuration files which were baked into the managers image.- manager:- extends:- file: deploy.yml- service: manager- depends_on:- keycloak:- condition: service_healthy- volumes:- - deployment-data:/deployment- - /deployment.local/manager:/deployment.local- environment:- MAP_TILES_PATH: '/deployment.local/map/mapdata.mbtiles'- IDENTITY_NETWORK_HOST: demo.openremote.io- FIREBASE_CONFIG_FILE: '/fcm.json'-- keycloak:- extends:- file: deploy.yml- service: keycloak- depends_on:- postgresql:- condition: service_healthy- volumes:- - deployment-data:/deployment- environment:- IDENTITY_NETWORK_HOST: demo.openremote.io-- # This configuration stores postgresql data in a Docker volume. You manage this volume- # independently from your stack with with 'docker volume ls', 'docker volume rm', etc.- # Alternatively, you can store postgresql data in a directory on your host.- postgresql:- extends:- file: deploy.yml- service: postgresql- volumes:- - postgresql-data:/var/lib/postgresql/datadiff --git a/profile/deploy-no-build.yml b/profile/deploy-no-build.ymldeleted file mode 100644index d65b82568..000000000--- a/profile/deploy-no-build.yml+++ /dev/null@@ -1,337 +0,0 @@-# OpenRemote v3-#-# This is the base configuration profile. Note that you must extend this-# configuration to complete it with service dependencies and volume-# mappings, see docker-compose.yml for a usable complete configuration.-#-version: '2.4'--services:-- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- image: openremote/deployment:${DATE_TAG:-latest}-- # The frontend proxy manages SSL certificates, terminates SSL/TLS connections and forwards them to the backend.- proxy:-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`- image: openremote/proxy:${DATE_TAG:-latest}-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # network_mode: host-- environment:-- # It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # File to which std out will be logged- LOGFILE: /var/log/proxy.log-- # The public host name of this OpenRemote installation. Set this to request/manage an SSL- # certificate with the free https://letsencrypt.org/ provider. The default 'localhost' will- # rely on a baked-in self-signed certificate. If you change this, adjust manager#IDENTITY_NETWORK_HOST.- DOMAINNAME: ${DOMAINNAME:-localhost}-- # Provide your own email address for your SSL certificates with Let's Encrypt. This should- # be set when DOMAINNAME is not 'localhost'.- LE_EMAIL: ${LE_EMAIL:-}-- # Enable --staging will manage fake certificates, so avoid hitting the rate limits of Let's Encrypt- # when testing (this is important, you are limited to 5 duplicate certificates per week!)- # LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'-- # 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- # PROXY_HOST_REDIRECT_1_TARGET: /console/master- # PROXY_HOST_REDIRECT_2_NAME: www.my-console-tenant-a.tld- # PROXY_HOST_REDIRECT_2_TARGET: /console/building- # PROXY_HOST_REDIRECT_3_NAME: ...-- # Customize proxy log, defaults to 'notice', requests are logged at 'info'.- # Available levels are: emerg, alert, crit, err, warning, notice, info, debug- # PROXY_LOGLEVEL: 'notice'--- # Run proxy, obtain and automatically renew SSL certificates if DOMAINNAME is not localhost. Use- # the command 'help' to get a list of all options.- command: run-- # Expose a public web service mapped to ports on the host.- ports:- - "80:80"- - "443:443"- - "8883:8883"-- # Resource limits- mem_reservation: 512m- oom_kill_disable: true-- # Configure logging of the container- logging:- options:- max-size: 10m-- # The API gateway and Manager web application.- manager:-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`- image: openremote/manager:${DATE_TAG:-latest}-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # network_mode: host-- environment:-- # It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # If developer mode is enabled, all setup tasks will be executed on application startup.- # This will clean all data in the database, and then import demo/test data. Some caching and- # other runtime performance-optimizations will also be disabled.- DEV_MODE: ${DEV_MODE:-false}-- # This switch can wipe your database, this is the factory reset!- SETUP_WIPE_CLEAN_INSTALL: ${SETUP_WIPE_CLEAN_INSTALL:-false}- SETUP_ADMIN_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}-- # When you are ready to permanently install your project, replace it with the next lines...- # SETUP_WIPE_CLEAN_INSTALL: # Allow override on CLI-- # Configure SMTP smart host, to send password reset emails etc.- SETUP_EMAIL_HOST: ${SETUP_EMAIL_HOST:-smtp-host.demo.tld}- SETUP_EMAIL_USER: ${SETUP_EMAIL_USER:-smtp-user}- SETUP_EMAIL_PASSWORD: ${SETUP_EMAIL_PASSWORD:-smtp-password}- SETUP_EMAIL_PORT: ${SETUP_EMAIL_PORT:-25}- #SETUP_EMAIL_TLS: 'true'- #SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'- #SETUP_EMAIL_FROM_DEFAULT: '[email protected]'-- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-- # The public host name of this OpenRemote installation. This name is used in bearer tokens- # and must be the name you access the web services under. If you change proxy#DOMAINNAME, also- # change this to match.- IDENTITY_NETWORK_HOST: ${IDENTITY_NETWORK_HOST:-localhost}-- # Set if SSL is enabled on the frontend reverse proxy and all internal proxies should assume https- IDENTITY_NETWORK_SECURE: 'true'-- # The public port of this OpenRemote installation.- IDENTITY_NETWORK_WEBSERVER_PORT: 443-- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: postgres- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-- # The service-internal host name and port of the identity provider.- KEYCLOAK_HOST: keycloak- KEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # Also remove (or comment) the already existing variables with the same name.- # KEYCLOAK_HOST: 127.0.0.1- # KEYCLOAK_PORT: 8081- # DATABASE_CONNECTION_URL: jdbc:postgresql://localhost/openremote-- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0-- # Console applications can register for push notifications through FCM.- # NOTIFICATION_FIREBASE_URL: https://fcm.googleapis.com/fcm/send- # NOTIFICATION_FIREBASE_API_KEY = '...'- # FIREBASE_CONFIG_FILE = '/deployment/manager/fcm.json'-- # Redirect path when root URI is requested- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}-- # Map related settings.- # Provide a path to the map tiles database file (see https://openmaptiles.com/).- # MAP_TILES_PATH: '/deployment/map/mapdata.mbtiles'- #- # Override the map settings such as center location and zoom when opening the- # manager's map, as well as other style details and colours.- # MAP_SETTINGS_PATH: '/deployment/map/mapsettings.json'- #- # Set the tileserver host name and port; the manager will reverse proxy to this server- # to provider raster map tiles to frontend apps- # MAP_TILESERVER_HOST: null- # MAP_TILESERVER_PORT: 8082- # MAP_TILESERVER_REQUEST_TIMEOUT: 10000-- # Location for the provisioning files- # PROVISION_DOCROOT: '/deployment/manager/provisioning'-- # Override logging.properties with a file of your choice.- # LOGGING_CONFIG_FILE: '/deployment/manager/logging.properties'-- # The number of threads and therefore background tasks that can be executed at the same- # time. Used by scheduled, usually short-lived and non-blocking tasks, such as protocols- # polling a remote service at regular interval, or the internal checks for expired client- # subscriptions on the event bus (default depends on detected CPU cores). Also used by- # the rules engine.- # SCHEDULED_TASKS_THREADS_MAX: 4-- # When asset attributes are enabled for rule events, each value update will be a temporary- # fact in rules. You can set the global default expiration time span used when no other- # attribute-level configuration exists. Default is 1 hour.- # RULE_EVENT_EXPIRES: '1h'-- # The identity provider implementation to use for managing user identities, roles, and- # access authorization. The default is Keycloak, which requires a separate service but- # provides full multi-tenancy identity, role permissions, and user session timeouts.- # The basic provider supports only superusers and their text passwords, managed in a- # simple database table, and always requires a new login when a page is reloaded.- # IDENTITY_PROVIDER: 'basic'-- # For the Keycloak identity provider, you may configure session timeouts of frontend apps. This- # will only be applied on newly created realms, or once on the master realm when clean setup runs.- #- # Validity of non-offline refresh tokens, force login when expired on web app, default is 1 day.- # IDENTITY_SESSION_MAX_MINUTES: 1440- #- # Validity of offline refresh tokens, force login on native console app, default is 14 days.- # Note that production offline tokens should be valid for months or years: When the offline token- # expires, the native console app can no longer contact the service in the background (e.g. when- # processing push notifications) and will therefore fail silently until the user logs in again.- # IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES: 20160-- # Configure the default max age for data points stored in the database (individual attributes can use a custom- # value by using the DATA_POINTS_MAX_AGE_DAYS AssetMeta item).- # DATA_POINTS_MAX_AGE_DAYS = 30-- # Custom JVM options (increase heap size if required)- JAVA_OPTS: '-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'-- # Resource limits- mem_reservation: 512m-- # Configure logging of the container, see deployment/logging.properties- logging:- options:- max-size: 10m-- # Keycloak identity provider- keycloak:-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`- image: openremote/keycloak:${DATE_TAG:-latest}- #image: jboss/keycloak:7.0.0-- environment:-- # It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # Switch to DEBUG to diagnose Keycloak problems.- KEYCLOAK_LOGLEVEL: INFO-- # When you are ready to permanently install your project, replace it with the next line ...- # SETUP_ADMIN_PASSWORD: # Allow override on CLI-- # Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: postgres- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'- KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'-- # CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!- KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}-- # Custom JVM options (increase heap size if required)- JAVA_OPTS: '-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'-- # Resource limits- mem_reservation: 512m-- # Configure logging of the container- logging:- options:- max-size: 10m-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # ports:- # - "8081:8080"-- # PostgreSQL DBMS- postgresql:-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`- image: openremote/postgresql:${DATE_TAG:-latest}-- environment:-- # It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: postgres # 9.6 image doesn't work if we use a custom user- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-- # You can open an SQL console on a running container with:- # docker exec -it <container ID> psql -U openremote-- # Resource limits- mem_reservation: 512m-- # Configure logging of the container- logging:- options:- max-size: 10m-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # ports:- # - "5432:5432"-- # Map tile server for serving raster tiles using mbtiles- map:- image: openremote/tileserver-gl:${DATE_TAG:-latest}-- # Manager for Docker swarm (embedding openremote/deployment and reduced size to save money on public cloud)- swarm:- image: openremote/manager-swarm:${DATE_TAG:-latest}diff --git a/profile/deploy.yml b/profile/deploy.ymlindex b899b6b31..53f7082aa 100644--- a/profile/deploy.yml+++ b/profile/deploy.yml@@ -1,375 +1,325 @@# OpenRemote v3#-# This is the base configuration profile. Note that you must extend this-# configuration to complete it with service dependencies and volume-# mappings, see docker-compose.yml for a usable complete configuration.+# This is the base configuration profile. Note that you must extend this configuration to complete+# it with service dependencies and volume mappings, see docker-compose.yml for a usable complete+# configuration.+#+# This file contains a description of all the environment variables available for each service+# including their default values. These can be overridden in many ways, shell environment variable,+# env file, extending/merging this compose file, etc.+#+# Here's a list of commonly customised environment variables:+#+# SETUP_ADMIN_PASSWORD+# IDENTITY_NETWORK_HOST+# ADMIN_EMAIL+# SETUP_EMAIL_HOST+# SETUP_EMAIL_USER+# SETUP_EMAIL_PASSWORD+# SETUP_EMAIL_FROM_KEYCLOAK+# SETUP_EMAIL_FROM_DEFAULT+# NOTIFICATION_FIREBASE_API_KEY+# IDENTITY_PROVIDER#version: '2.4'-services:+# If you enable volume mappings in services, you need this. Otherwise, remove the volumes+volumes:+ postgresql-data:- # This service will only populate an empty volume on startup and then exit.- # If the volume already contains data, it exits immediately.- deployment:- build: '../deployment'- image: openremote/deployment:${DATE_TAG:-latest}+services:- # The frontend proxy manages SSL certificates, terminates SSL/TLS connections and forwards them to the backend.+ # Reverse proxy which uses self signed certificate when DOMAINNAME=localhost. You can+ # map a Docker volume or host directory to access/store proxy configuration files+ # and SSL certificates.proxy:-- # Image will be built when not already in the cache or when `--build` option is supplied to `docker-compose up`- build:- context: '../proxy'-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`image: openremote/proxy:${DATE_TAG:-latest}-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # network_mode: host-+ restart: unless-stopped+ # Override the haproxy.cfg with custom file+ #volumes:+ # -${MY_PROXY_CONFIG_FILE}:/etc/haproxy/haproxy.cfgenvironment:# It is important that all services have the same timezone and are time synchronized.# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich+ TZ: ${TZ:-Europe/Amsterdam}# File to which std out will be logged- LOGFILE: /var/log/proxy.log+ LOGFILE: ${PROXY_LOGFILE:-/var/log/proxy.log}++ # Customize proxy log, defaults to 'notice', requests are logged at 'info'.+ # Available levels are: emerg, alert, crit, err, warning, notice, info, debug+ PROXY_LOGLEVEL: ${PROXY_LOGLEVEL:-notice}# The public host name of this OpenRemote installation. Set this to request/manage an SSL# certificate with the free https://letsencrypt.org/ provider. The default 'localhost' will# rely on a baked-in self-signed certificate. If you change this, adjust manager#IDENTITY_NETWORK_HOST.- DOMAINNAME: ${DOMAINNAME:-localhost}+ DOMAINNAME: ${IDENTITY_NETWORK_HOST:-localhost}- # Provide your own email address for your SSL certificates with Let's Encrypt. This should- # be set when DOMAINNAME is not 'localhost'.- LE_EMAIL: ${LE_EMAIL:-}+ # Provide your own email address for your SSL certificates with Let's Encrypt.+ LE_EMAIL: ${ADMIN_EMAIL:-}# Enable --staging will manage fake certificates, so avoid hitting the rate limits of Let's Encrypt# when testing (this is important, you are limited to 5 duplicate certificates per week!)- # LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'+ # e.g. '--staging --logs-dir=/etc/letsencrypt'+ LE_EXTRA_ARGS: ${PROXY_EXTRA_ARGS:-}# 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- # PROXY_HOST_REDIRECT_1_TARGET: /console/master- # PROXY_HOST_REDIRECT_2_NAME: www.my-console-tenant-a.tld- # PROXY_HOST_REDIRECT_2_TARGET: /console/building- # PROXY_HOST_REDIRECT_3_NAME: ...-- # Customize proxy log, defaults to 'notice', requests are logged at 'info'.- # Available levels are: emerg, alert, crit, err, warning, notice, info, debug- # PROXY_LOGLEVEL: 'notice'-- # Run proxy, obtain and automatically renew SSL certificates if DOMAINNAME is not localhost. Use- # the command 'help' to get a list of all options.- command: run-- # Expose a public web service mapped to ports on the host.+ # manager service.+ # e.g. PROXY_HOST_REDIRECT_1_NAME: www.my-console-master.tld+ # PROXY_HOST_REDIRECT_1_TARGET: /console/master+ PROXY_HOST_REDIRECT_1_NAME:+ PROXY_HOST_REDIRECT_1_TARGET:+ PROXY_HOST_REDIRECT_2_NAME:+ PROXY_HOST_REDIRECT_2_TARGET:+ PROXY_HOST_REDIRECT_3_NAME:+ PROXY_HOST_REDIRECT_3_TARGET:+ PROXY_HOST_REDIRECT_4_NAME:+ PROXY_HOST_REDIRECT_4_TARGET:+ PROXY_HOST_REDIRECT_5_NAME:+ PROXY_HOST_REDIRECT_5_TARGET:+ PROXY_HOST_REDIRECT_6_NAME:+ PROXY_HOST_REDIRECT_6_TARGET:+ PROXY_HOST_REDIRECT_7_NAME:+ PROXY_HOST_REDIRECT_7_TARGET:+ PROXY_HOST_REDIRECT_8_NAME:+ PROXY_HOST_REDIRECT_8_TARGET:+ PROXY_HOST_REDIRECT_9_NAME:+ PROXY_HOST_REDIRECT_9_TARGET:+ PROXY_HOST_REDIRECT_10_NAME:+ PROXY_HOST_REDIRECT_10_TARGET:++ # Expose public services (web server, MQTT broker)ports:- "80:80"- "443:443"- "8883:8883"- # Resource limits- mem_reservation: 512m- oom_kill_disable: true-- # Configure logging of the container- logging:- options:- max-size: 10m-- healthcheck:- interval: 3s- timeout: 3s- start_period: 2s- retries: 30- test: ["CMD", "curl", "--fail", "--silent", "http://localhost:80"]-- # The API gateway and Manager web application.+ # The OpenRemote Managermanager:-- # Image will be built when not already in the cache or when `--build` option is supplied to `docker-compose up`- build: '../manager/build/install/manager'-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`image: openremote/manager:${DATE_TAG:-latest}-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # network_mode: host-+ restart: unless-stopped+ # Map any custom content into the /deployment dir:+ # /deployment/manager/app - contains custom web content+ # /deployment/manager/extensions - contains JARS to be loaded on the classpath+ # /deployment/manager/provisioning - contains JSON files for provisioning the system+ # /deployment/map/mapdata.mbtiles - map tile data+ # /deployment/map/mapsettings.json - map styling+ #volumes:+ # - deployment-data:/deployment+ # Expose any devices required by agents+ #devices:+ # - /dev/ttyACM0environment:# It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # If developer mode is enabled, all setup tasks will be executed on application startup.- # This will clean all data in the database, and then import demo/test data. Some caching and- # other runtime performance-optimizations will also be disabled.- DEV_MODE: ${DEV_MODE:-false}+ # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts+ TZ: ${TZ:-Europe/Amsterdam}- # This switch can wipe your database, this is the factory reset!- SETUP_WIPE_CLEAN_INSTALL: ${SETUP_WIPE_CLEAN_INSTALL:-false}+ # The password for the super user (admin) of the master realm (must match keycloak password if using+ # the keycloak identity provider).SETUP_ADMIN_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}- # When you are ready to permanently install your project, replace it with the next lines...- # SETUP_WIPE_CLEAN_INSTALL: # Allow override on CLI-- # Configure SMTP smart host, to send password reset emails etc.- #SETUP_EMAIL_HOST: smtp-host.demo.tld- #SETUP_EMAIL_USER: 'smtp-user'- #SETUP_EMAIL_PASSWORD: 'smtp-password'- #SETUP_EMAIL_PORT: 25- #SETUP_EMAIL_TLS: 'true'- #SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'- #SETUP_EMAIL_FROM_DEFAULT: '[email protected]'-- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-- # The public host name of this OpenRemote installation. This name is used in bearer tokens+ # The public host name of this installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also# change this to match.IDENTITY_NETWORK_HOST: ${IDENTITY_NETWORK_HOST:-localhost}# Set if SSL is enabled on the frontend reverse proxy and all internal proxies should assume https- IDENTITY_NETWORK_SECURE: 'true'+ IDENTITY_NETWORK_SECURE: ${IDENTITY_NETWORK_SECURE:-true}# The public port of this OpenRemote installation.- IDENTITY_NETWORK_WEBSERVER_PORT: 443+ IDENTITY_NETWORK_WEBSERVER_PORT: ${IDENTITY_NETWORK_WEBSERVER_PORT:-443}- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote+ # Configure SMTP server, to send password reset emails etc.+ SETUP_EMAIL_HOST:+ SETUP_EMAIL_USER:+ SETUP_EMAIL_PASSWORD:+ SETUP_EMAIL_PORT: ${SETUP_EMAIL_PORT:-25}+ SETUP_EMAIL_TLS: ${SETUP_EMAIL_TLS:-true}+ SETUP_EMAIL_FROM_KEYCLOAK: ${SETUP_EMAIL_FROM_KEYCLOAK:-no-reply@localhost}+ SETUP_EMAIL_FROM_DEFAULT: ${SETUP_EMAIL_FROM_DEFAULT:-no-reply@localhost}- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: postgres- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300+ # Console applications can register for push notifications through FCM.+ NOTIFICATION_FIREBASE_URL: ${NOTIFICATION_FIREBASE_URL:-https://fcm.googleapis.com/fcm/send}+ NOTIFICATION_FIREBASE_API_KEY:+ FIREBASE_CONFIG_FILE: ${FIREBASE_CONFIG_FILE:-/deployment/manager/fcm.json}++ # Developer mode (see code for usages of DEV_MODE flag)+ DEV_MODE: ${MANAGER_DEV_MODE:-false}- # The service-internal host name and port of the identity provider.- KEYCLOAK_HOST: keycloak- KEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}+ # !! WARNING: This will wipe your database !!+ # Force a full clean and setup on startup irrespective of whether there is existing data+ # Default behaviour is false unless DEV_MODE = true or openremote database doesn't already exist+ SETUP_WIPE_CLEAN_INSTALL: ${SETUP_WIPE_CLEAN_INSTALL:-false}- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0+ # Manager web server interface binding; default:+ WEBSERVER_LISTEN_HOST: ${WEBSERVER_LISTEN_HOST:-0.0.0.0}- # Console applications can register for push notifications through FCM.- # NOTIFICATION_FIREBASE_URL: https://fcm.googleapis.com/fcm/send- # NOTIFICATION_FIREBASE_API_KEY = '...'- # FIREBASE_CONFIG_FILE = '/deployment/manager/fcm.json'+ # Database settings+ DB_VENDOR: ${DB_VENDOR:-postgres}+ DB_HOST: ${DB_HOST:-postgresql}+ DB_PORT: ${DB_PORT:-5432}+ DB_NAME: ${DB_NAME:-openremote}+ DB_SCHEMA: ${DB_SCHEMA:-openremote}+ DB_USERNAME: ${DB_USERNAME:-postgres}+ DB_PASSWORD: ${DB_PASSWORD:-postgres}+ DB_MIN_POOL_SIZE: ${DB_MIN_POOL_SIZE:-5}+ DB_MAX_POOL_SIZE: ${DB_MAX_POOL_SIZE:-20}+ DB_CONNECTION_TIMEOUT_SECONDS: ${DB_CONNECTION_TIMEOUT_SECONDS:-300}++ # The service-internal host name and port of the keycloak identity provider; defaults:+ KEYCLOAK_HOST: ${KEYCLOAK_HOST:-keycloak}+ KEYCLOAK_PORT: ${KEYCLOAK_PORT:-8080}++ # Location of built in web content.+ APP_DOCROOT: ${APP_DOCROOT:-/opt/web}++ # Location of the custom web content.+ CUSTOM_APP_DOCROOT: ${CUSTOM_APP_DOCROOT:-/deployment/manager/app}++ # Location for the provisioning files+ PROVISIONING_DOCROOT: ${PROVISIONING_DOCROOT:-/deployment/manager/provisioning}- # Custom location of the static applications.- # APP_DOCROOT: '/opt/web'# Redirect path when root URI is requestedROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}# Map related settings.# Provide a path to the map tiles database file (see https://openmaptiles.com/).- # MAP_TILES_PATH: '/deployment/map/mapdata.mbtiles'- #+ MAP_TILES_PATH: ${MAP_TILES_PATH:-/deployment/map/mapdata.mbtiles}+# Override the map settings such as center location and zoom when opening the# manager's map, as well as other style details and colours.- # MAP_SETTINGS_PATH: '/deployment/map/mapsettings.json'- #- # Set the tileserver host name and port; the manager will reverse proxy to this server- # to provider raster map tiles to frontend apps- # MAP_TILESERVER_HOST: null- # MAP_TILESERVER_PORT: 8082- # MAP_TILESERVER_REQUEST_TIMEOUT: 10000+ MAP_SETTINGS_PATH: ${MAP_SETTINGS_PATH:-/deployment/map/mapsettings.json}- # Location for the provisioning files- # PROVISION_DOCROOT: '/deployment/manager/provisioning'+ # Set the tileserver host name and port; the manager will reverse proxy to this server+ # to provide raster map tiles to frontend apps+ MAP_TILESERVER_HOST:+ MAP_TILESERVER_PORT: ${MAP_TILESERVER_PORT:-8082}+ MAP_TILESERVER_REQUEST_TIMEOUT: ${MAP_TILESERVER_REQUEST_TIMEOUT:-10000}- # Override logging.properties with a file of your choice.- # LOGGING_CONFIG_FILE: '/deployment/manager/logging.properties'+ # Override logging.properties with a file of your choice; if not set then defaults+ # to embedded logging.properties or logging-dev.properties (if DEV_MODE=true)+ LOGGING_CONFIG_FILE:# The number of threads and therefore background tasks that can be executed at the same# time. Used by scheduled, usually short-lived and non-blocking tasks, such as protocols# polling a remote service at regular interval, or the internal checks for expired client# subscriptions on the event bus (default depends on detected CPU cores). Also used by# the rules engine.- # SCHEDULED_TASKS_THREADS_MAX: 4+ SCHEDULED_TASKS_THREADS_MAX: ${SCHEDULED_TASKS_THREADS_MAX:-4}# When asset attributes are enabled for rule events, each value update will be a temporary# fact in rules. You can set the global default expiration time span used when no other# attribute-level configuration exists. Default is 1 hour.- # RULE_EVENT_EXPIRES: '1h'+ RULE_EVENT_EXPIRES: ${RULE_EVENT_EXPIRES:-1h}# The identity provider implementation to use for managing user identities, roles, and- # access authorization. The default is Keycloak, which requires a separate service but+ # access authorization. The default is 'keycloak' which requires a separate service but# provides full multi-tenancy identity, role permissions, and user session timeouts.- # The basic provider supports only superusers and their text passwords, managed in a+ # The 'basic' provider supports only superusers and their text passwords, managed in a# simple database table, and always requires a new login when a page is reloaded.- # IDENTITY_PROVIDER: 'basic'+ IDENTITY_PROVIDER: ${IDENTITY_PROVIDER:-keycloak}# For the Keycloak identity provider, you may configure session timeouts of frontend apps. This# will only be applied on newly created realms, or once on the master realm when clean setup runs.- #+# Validity of non-offline refresh tokens, force login when expired on web app, default is 1 day.- # IDENTITY_SESSION_MAX_MINUTES: 1440- #- # Validity of offline refresh tokens, force login on native console app, default is 14 days.+ IDENTITY_SESSION_MAX_MINUTES: ${IDENTITY_SESSION_MAX_MINUTES:-1440}++ # Validity of offline refresh tokens, force login on native console app, default is 5 years.# Note that production offline tokens should be valid for months or years: When the offline token# expires, the native console app can no longer contact the service in the background (e.g. when# processing push notifications) and will therefore fail silently until the user logs in again.- # IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES: 20160+ IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES: ${IDENTITY_SESSION_OFFLINE_TIMEOUT_MINUTES:-2628000}# Configure the default max age for data points stored in the database (individual attributes can use a custom# value by using the DATA_POINTS_MAX_AGE_DAYS AssetMeta item).# DATA_POINTS_MAX_AGE_DAYS = 30# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'-- # Resource limits- mem_reservation: 512m-- healthcheck:- interval: 3s- timeout: 3s- start_period: 2s- retries: 120- test: ["CMD", "curl", "--fail", "--silent", "http://localhost:8080"]-- # Configure logging of the container, see deployment/logging.properties- logging:- options:- max-size: 10m+ MANAGER_JAVA_OPTS: ${MANAGER_JAVA_OPTS:--Xms400m -Xmx400m+ -XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m+ -XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m+ -XX:MaxDirectMemorySize=25m -XX:NativeMemoryTracking=summary+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof}# Keycloak identity providerkeycloak:-- # Image will be built when not already in the cache or when `--build` option is supplied to `docker-compose up`- build: '../keycloak'-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`image: openremote/keycloak:${DATE_TAG:-latest}- #image: jboss/keycloak:7.0.0-+ restart: unless-stopped+ # Map any custom themes into the /deployment/keycloak/themes dir:+ #volumes:+ # - deployment-data:/deploymentenvironment:# It is important that all services have the same timezone and are time synchronized.- # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # Switch to DEBUG to diagnose Keycloak problems.- KEYCLOAK_LOGLEVEL: INFO+ # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts+ TZ: ${TZ:-Europe/Amsterdam}- # When you are ready to permanently install your project, replace it with the next line ...- # SETUP_ADMIN_PASSWORD: # Allow override on CLI+ # Switch to DEBUG to diagnose Keycloak problems; default:+ KEYCLOAK_LOGLEVEL: ${KEYCLOAK_LOGLEVEL:-INFO}# Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: postgres- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'- KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'-- # CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!+ DB_VENDOR: ${DB_VENDOR:-postgres}+ DB_ADDR: ${DB_HOST:-postgresql}+ DB_PORT: ${DB_PORT:-5432}+ DB_DATABASE: ${DB_NAME:-openremote}+ DB_USER: ${DB_USERNAME:-postgres}+ DB_PASSWORD: ${DB_PASSWORD:-postgres}+ DB_SCHEMA: ${DB_SCHEMA:-public}+ KEYCLOAK_USER: ${KEYCLOAK_USER:-admin}KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}+ PROXY_ADDRESS_FORWARDING: ${PROXY_ADDRESS_FORWARDING:-true}+ KEYCLOAK_FRONTEND_URL: ${KEYCLOAK_FRONTEND_URL:-https://localhost/auth}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'-- # Resource limits- mem_reservation: 512m-- # Configure logging of the container- logging:- options:- max-size: 10m-- healthcheck:- test: ["CMD", "curl", "--fail", "--silent", "http://localhost:8080/auth"]- interval: 3s- timeout: 3s- # This was 600s in the Dockerfile, but that seems way too long.- start_period: 60s- retries: 30+ JAVA_OPTS: ${KEYCLOAK_JAVA_OPTS:--XX:CompressedClassSpaceSize=50m -XX:MaxMetaspaceSize=250m+ -XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m+ -XX:MaxDirectMemorySize=25m+ -XX:NativeMemoryTracking=summary+ -XX:+ExitOnOutOfMemoryError+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true}+# PostgreSQL DBMSpostgresql:-- # Image will be built when not already in the cache or when `--build` option is supplied to `docker-compose up`- build: '../postgresql'-- # Image will be pulled when using the `docker-compose pull` command or `docker-compose up --no-build`image: openremote/postgresql:${DATE_TAG:-latest}-+ restart: unless-stopped+ # Docker volume for persistent storage of DB; can alternatively map to host+ #volumes:+ # - postgresql-data:/var/lib/postgresql/dataenvironment:# It is important that all services have the same timezone and are time synchronized.# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.- TZ: Europe/Zurich-- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: postgres # 9.6 image doesn't work if we use a custom user- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-- # You can open an SQL console on a running container with:- # docker exec -it <container ID> psql -U openremote-- # Resource limits- mem_reservation: 512m-- # Configure logging of the container- logging:- options:- max-size: 10m-- healthcheck:- interval: 3s- timeout: 3s- start_period: 2s- retries: 30- test: ["CMD", "gosu", "postgres", "pg_isready"]-- # Uncomment to support the IKEA TRÅDFRI protocol. USE AT YOUR OWN RISK.- # ports:- # - "5432:5432"-- # Map tile server for serving raster tiles using mbtiles+ TZ: ${TZ:-Europe/Amsterdam}+ PGTZ: ${TZ:-Europe/Amsterdam}++ # Database settings+ POSTGRES_DB: ${DB_NAME:-openremote}+ POSTGRES_USER: ${DB_USERNAME:-postgres}+ POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}++ # # Standalone map tile server+ # map:+ # build: '../map'+ # image: openremote/tileserver-gl:${DATE_TAG:-latest}+ #+ # # Manager for Docker swarm (embedding openremote/deployment and reduced size to save money on public cloud)+ # swarm:+ # build:+ # context: '../manager/build/install/manager'+ # dockerfile: swarm.Dockerfile+ # image: openremote/manager-swarm:${DATE_TAG:-latest}++ # Standalone map tile servermap:- build: '../map'image: openremote/tileserver-gl:${DATE_TAG:-latest}+ restart: unless-stopped# Manager for Docker swarm (embedding openremote/deployment and reduced size to save money on public cloud)swarm:- build:- context: '../manager/build/install/manager'- dockerfile: swarm.Dockerfileimage: openremote/manager-swarm:${DATE_TAG:-latest}+ restart: unless-stoppeddiff --git a/profile/dev-map.yml b/profile/dev-map.ymlindex f69bdaac1..5232165db 100644--- a/profile/dev-map.yml+++ b/profile/dev-map.yml@@ -1,7 +1,9 @@+# OpenRemote v3#-# Profile for doing development work on raster map components.+# Profile for running the map tile server on http://localhost:8082+#+# Please see deploy.yml for configuration details for each service.#-# https://localhost:8082version: '2.4'services:diff --git a/profile/dev-proxy.yml b/profile/dev-proxy.ymlindex b706f5b65..6f3c80efe 100644--- a/profile/dev-proxy.yml+++ b/profile/dev-proxy.yml@@ -1,7 +1,7 @@+# OpenRemote v3#-# Profile for doing development work on the manager in an IDE; uses proxy container to redirect to host machine.-#-# https://localhost/+# Profile for running the reverse proxy on https://localhost/ with the manager backend mapped to the host machine on+# localhost:8080 and the keycloak backend mapped to the host machine on localhost:8081## Your changes will be visible live on browser reload or after restart:#@@ -9,24 +9,12 @@# WEBSERVER_LISTEN_HOST=0.0.0.0# IDENTITY_NETWORK_WEBSERVER_PORT=443# IDENTITY_NETWORK_SECURE=true-# - Edit files in deployment/manager/-# - Edit files in keycloak/theme/-# - Mount the proxy-data volume in a new container and edit proxy configuration files-# - Change the proxy configuration to a directory mount and edit configuration files+#+# Please see deploy.yml for configuration details for each service.#version: '2.4'-#networks:-# default:-# driver: bridge-# ipam:-# driver: default-# config:-# - subnet: 172.18.18.0/24-# gateway: 172.18.18.1-volumes:- proxy-data:postgresql-data:services:@@ -35,34 +23,7 @@ services:extends:file: deploy.ymlservice: proxy- volumes:- # Store data either in host-mapped directory or a named Docker volume- # - ${DEPLOYMENT_DIRECTORY:-../deployment}/proxy:/deployment- - proxy-data:/deploymentenvironment:MANAGER_HOST: 'host.docker.internal'-- keycloak:- extends:- file: deploy.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"- depends_on:- postgresql:- condition: service_healthy-- postgresql:- extends:- file: deploy.yml- service: postgresql- # Access directly if needed on localhost- ports:- - "5432:5432"- volumes:- - postgresql-data:/var/lib/postgresql/data+ KEYCLOAK_HOST: 'host.docker.internal'+ KEYCLOAK_PORT: 8081diff --git a/profile/dev-testing.yml b/profile/dev-testing.ymlindex 9b71e16f9..4b8c23fff 100644--- a/profile/dev-testing.yml+++ b/profile/dev-testing.yml@@ -1,18 +1,16 @@+# OpenRemote v3## Profile for doing IDE development work and running build tests.#-# Run this in the background for full ./gradlew clean build+# Please see profile/deploy.yml for configuration details for each service.#version: '2.4'-volumes:- postgresql-data:-services:keycloak:extends:- file: deploy-no-build.yml+ file: deploy.ymlservice: keycloakvolumes:- ../deployment:/deployment@@ -25,15 +23,13 @@ services:postgresql:condition: service_healthyenvironment:- # Use manager dev mode reverse proxy to access keycloak+ # Use manager dev mode reverse proxy to access keycloak so manager and keycloak hosts matchKEYCLOAK_FRONTEND_URL: 'http://localhost:8080/auth'postgresql:extends:- file: deploy-no-build.yml+ file: deploy.ymlservice: postgresql# Access directly if needed on localhostports:- "5432:5432"- volumes:- - postgresql-data:/var/lib/postgresql/datadiff --git a/profile/dev.yml b/profile/dev-ui.ymlsimilarity index 59%rename from profile/dev.ymlrename to profile/dev-ui.ymlindex dcb65bc27..57764123b 100644--- a/profile/dev.yml+++ b/profile/dev-ui.yml@@ -1,17 +1,12 @@+# OpenRemote v3#-# Profile for doing development work on full stack.+# Profile for doing development work on UI components.#-# Your changes will be visible live on browser reload or after restart:-#-# - Edit files in deployment/manager/-# - Edit files in keycloak/theme/-# - Mount the proxy-data volume in a new container and edit proxy configuration files-# - Change the proxy configuration to a directory mount and edit configuration files+# Please see deploy.yml for configuration details for each service.#version: '2.4'volumes:- proxy-data:postgresql-data:services:@@ -26,9 +21,8 @@ services:ports:- "8080:8080"volumes:- # Use local deployment data in host-mapped directory for easy development. The- # ../deployment directory is the one which will be baked into the managers image.- - ${DEPLOYMENT_DIRECTORY:-../deployment}:/deployment+ # DEPLOYMENT_DIR must be supplied and points to the dir that contains the custom code in development+ - ${DEPLOYMENT_DIR:?DEPLOYMENT_DIR must be set}:/deploymentenvironment:IDENTITY_NETWORK_WEBSERVER_PORT: 8080IDENTITY_NETWORK_SECURE: 'false'@@ -45,7 +39,7 @@ services:ports:- "8081:8080"volumes:- - ../ui/keycloak/themes:/deployment/keycloak/themes+ - ${DEPLOYMENT_DIR:?DEPLOYMENT_DIR must be set}:/deploymentdepends_on:postgresql:condition: service_healthydiff --git a/proxy/Dockerfile b/proxy/Dockerfileindex f45112675..f81d54d7f 100644--- a/proxy/Dockerfile+++ b/proxy/Dockerfile@@ -23,15 +23,16 @@ ARG LUA_VERSION=5.3.5ARG ACME_PLUGIN_VERSION=0.1.1ARG DOMAINNAMEARG LOCAL_CERT_FILE-ENV DOMAINNAME=${DOMAINNAME:-localhost}-ENV LOCAL_CERT_FILE=$LOCAL_CERT_FILE+ENV DOMAINNAME ${DOMAINNAME:-localhost}+ENV LOCAL_CERT_FILE ${LOCAL_CERT_FILE}ENV TERM xterm-ENV PROXY_LOGLEVEL notice-ENV MANAGER_HOST=${MANAGER_HOST:-manager}-ENV MANAGER_WEB_PORT=${MANAGER_WEB_PORT:-8080}-ENV MANAGER_MQTT_PORT=${MANAGER_MQTT_PORT:-1883}-ENV KEYCLOAK_HOST=${KEYCLOAK_HOST:-keycloak}-ENV KEYCLOAK_PORT=${KEYCLOAK_PORT:-8080}+ENV PROXY_LOGLEVEL ${PROXY_LOGLEVEL:-notice}+ENV MANAGER_HOST ${MANAGER_HOST:-manager}+ENV MANAGER_WEB_PORT ${MANAGER_WEB_PORT:-8080}+ENV MANAGER_MQTT_PORT ${MANAGER_MQTT_PORT:-1883}+ENV KEYCLOAK_HOST ${KEYCLOAK_HOST:-keycloak}+ENV KEYCLOAK_PORT ${KEYCLOAK_PORT:-8080}+ENV LOGFILE ${PROXY_LOGFILE:-/var/log/proxy.log}RUN mkdir /tmp/lua && cd /tmp/lua \&& curl -sSL https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz -o lua.tar.gz \diff --git a/swarm/aws-swarm-docker-compose.yml b/swarm/aws-swarm-docker-compose.ymlindex 9d806b79b..7fe0827b8 100644--- a/swarm/aws-swarm-docker-compose.yml+++ b/swarm/aws-swarm-docker-compose.yml@@ -72,25 +72,6 @@ services:#SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'#SETUP_EMAIL_FROM_DEFAULT: '[email protected]'- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-# The public host name of this OpenRemote installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also# change this to match.@@ -102,33 +83,16 @@ services:# The public port of this OpenRemote installation.IDENTITY_NETWORK_WEBSERVER_PORT: 8080- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: openremote- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-# The service-internal host name and port of the identity provider.KEYCLOAK_HOST: keycloakKEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}-- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}-- JAVA_OPTS: '-Xms400m -Xmx400m+ JAVA_OPTS: -Xms400m -Xmx400m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprofports:- "8080:8080"@@ -162,29 +126,17 @@ services:# When you are ready to permanently install your project, replace it with the next line ...# SETUP_ADMIN_PASSWORD: # Allow override on CLI- # Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: openremote- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'- KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'-# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-Xms300m -Xmx300m+ JAVA_OPTS: -Xms300m -Xmx300m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=200m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=trueports:- "8081:8080"@@ -211,14 +163,6 @@ services:# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.TZ: Europe/Amsterdam- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: openremote- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-# You can open an SQL console on a running container with:# docker exec -it <container ID> psql -U openremotediff --git a/swarm/k8s.yml b/swarm/k8s.ymlindex b000b38f2..acaa55645 100644--- a/swarm/k8s.yml+++ b/swarm/k8s.yml@@ -25,20 +25,6 @@ spec:spec:containers:- env:- - name: DB_ADDR- value: postgresql- - name: DB_DATABASE- value: openremote- - name: DB_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DB_PORT- value: "5432"- - name: DB_SCHEMA- value: public- - name: DB_USER- value: openremote- - name: DB_VENDOR- value: postgres- name: JAVA_OPTSvalue: -Xms300m -Xmx300m -XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=200m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m -XX:MaxDirectMemorySize=25m@@ -113,22 +99,6 @@ spec:spec:containers:- env:- - name: ROOT_REDIRECT_PATH- value: "/manager"- - name: DATABASE_CONNECTION_TIMEOUT_SECONDS- value: "300"- - name: DATABASE_CONNECTION_URL- value: jdbc:postgresql://postgresql/openremote- - name: DATABASE_MAX_POOL_SIZE- value: "20"- - name: DATABASE_MIN_POOL_SIZE- value: "5"- - name: DATABASE_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DATABASE_USERNAME- value: openremote- - name: DEV_MODE- value: "false"- name: IDENTITY_NETWORK_HOSTvalue: localhost- name: IDENTITY_NETWORK_SECURE@@ -143,30 +113,12 @@ spec:value: keycloak- name: KEYCLOAK_PORTvalue: "8080"- - name: MASTER_REALM_KEYCLOAK_THEME- value: openremote- name: SETUP_ADMIN_PASSWORDvalue: secret- - name: SETUP_IMPORT_DEMO_AGENT- value: "true"- - name: SETUP_IMPORT_DEMO_AGENT_KNX- value: "false"- - name: SETUP_IMPORT_DEMO_AGENT_VELBUS- value: "false"- - name: SETUP_IMPORT_DEMO_ASSETS- value: "true"- - name: SETUP_IMPORT_DEMO_RULES- value: "true"- - name: SETUP_IMPORT_DEMO_SCENES- value: "true"- - name: SETUP_IMPORT_DEMO_USERS- value: "true"- name: SETUP_WIPE_CLEAN_INSTALLvalue: "true"- name: TZvalue: Europe/Amsterdam- - name: WEBSERVER_LISTEN_HOST- value: 0.0.0.0image: openremote/manager-swarm:latestimagePullPolicy: ""name: manager@@ -219,12 +171,6 @@ spec:spec:containers:- env:- - name: POSTGRES_DB- value: openremote- - name: POSTGRES_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: POSTGRES_USER- value: openremote- name: TZvalue: Europe/Amsterdamimage: openremote/postgresql:latestdiff --git a/swarm/kube-docker-compose.yml b/swarm/kube-docker-compose.ymlindex 8f54150f1..be72aea5c 100644--- a/swarm/kube-docker-compose.yml+++ b/swarm/kube-docker-compose.yml@@ -102,25 +102,6 @@ services:#SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'#SETUP_EMAIL_FROM_DEFAULT: '[email protected]'- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-# The public host name of this OpenRemote installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also# change this to match.@@ -132,33 +113,16 @@ services:# The public port of this OpenRemote installation.IDENTITY_NETWORK_WEBSERVER_PORT: 443- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: openremote- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-# The service-internal host name and port of the identity provider.KEYCLOAK_HOST: keycloakKEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}-- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}-- JAVA_OPTS: '-Xms400m -Xmx400m+ JAVA_OPTS: -Xms400m -Xmx400m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprofdeploy:replicas: 1@@ -196,13 +160,13 @@ services:KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-Xms300m -Xmx300m+ JAVA_OPTS: -Xms300m -Xmx300m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=200m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=trueports:- "8081:8080"@@ -223,14 +187,6 @@ services:# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.TZ: Europe/Amsterdam- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: openremote- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-# You can open an SQL console on a running container with:# docker exec -it <container ID> psql -U openremotediff --git a/swarm/minikube/keycloak-deployment.yaml b/swarm/minikube/keycloak-deployment.yamlindex 3e98177c8..11b8fa004 100644--- a/swarm/minikube/keycloak-deployment.yaml+++ b/swarm/minikube/keycloak-deployment.yaml@@ -25,20 +25,6 @@ spec:spec:containers:- env:- - name: DB_ADDR- value: postgresql- - name: DB_DATABASE- value: openremote- - name: DB_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DB_PORT- value: "5432"- - name: DB_SCHEMA- value: public- - name: DB_USER- value: openremote- - name: DB_VENDOR- value: postgres- name: JAVA_OPTSvalue: -Xms300m -Xmx300m -XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=200m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m -XX:MaxDirectMemorySize=25m@@ -51,8 +37,6 @@ spec:value: secret- name: KEYCLOAK_USERvalue: admin- - name: PROXY_ADDRESS_FORWARDING- value: "true"- name: TZvalue: Europe/Amsterdamimage: openremote/keycloak:latestdiff --git a/swarm/minikube/manager-deployment.yaml b/swarm/minikube/manager-deployment.yamlindex 7ec27c667..121dca7fb 100644--- a/swarm/minikube/manager-deployment.yaml+++ b/swarm/minikube/manager-deployment.yaml@@ -25,22 +25,6 @@ spec:spec:containers:- env:- - name: ROOT_REDIRECT_PATH- value: "/manager"- - name: DATABASE_CONNECTION_TIMEOUT_SECONDS- value: "300"- - name: DATABASE_CONNECTION_URL- value: jdbc:postgresql://postgresql/openremote- - name: DATABASE_MAX_POOL_SIZE- value: "20"- - name: DATABASE_MIN_POOL_SIZE- value: "5"- - name: DATABASE_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DATABASE_USERNAME- value: openremote- - name: DEV_MODE- value: "false"- name: IDENTITY_NETWORK_HOSTvalue: localhost- name: IDENTITY_NETWORK_SECURE@@ -55,30 +39,12 @@ spec:value: keycloak- name: KEYCLOAK_PORTvalue: "8080"- - name: MASTER_REALM_KEYCLOAK_THEME- value: openremote- name: SETUP_ADMIN_PASSWORDvalue: secret- - name: SETUP_IMPORT_DEMO_AGENT- value: "true"- - name: SETUP_IMPORT_DEMO_AGENT_KNX- value: "false"- - name: SETUP_IMPORT_DEMO_AGENT_VELBUS- value: "false"- - name: SETUP_IMPORT_DEMO_ASSETS- value: "true"- - name: SETUP_IMPORT_DEMO_RULES- value: "true"- - name: SETUP_IMPORT_DEMO_SCENES- value: "true"- - name: SETUP_IMPORT_DEMO_USERS- value: "true"- name: SETUP_WIPE_CLEAN_INSTALLvalue: "true"- name: TZvalue: Europe/Amsterdam- - name: WEBSERVER_LISTEN_HOST- value: 0.0.0.0image: openremote/manager-swarm:latestimagePullPolicy: ""name: managerdiff --git a/swarm/minikube/openremote.yml b/swarm/minikube/openremote.ymlindex a86824d9c..522c4f78c 100644--- a/swarm/minikube/openremote.yml+++ b/swarm/minikube/openremote.yml@@ -104,12 +104,6 @@ spec:- image: openremote/postgresql:latestname: postgresqlenv:- - name: POSTGRES_DB- value: openremote- - name: POSTGRES_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: POSTGRES_USER- value: openremote- name: TZvalue: Europe/Amsterdamports:@@ -145,20 +139,6 @@ spec:spec:containers:- env:- - name: DB_ADDR- value: postgresql- - name: DB_DATABASE- value: openremote- - name: DB_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DB_PORT- value: "5432"- - name: DB_SCHEMA- value: public- - name: DB_USER- value: openremote- - name: DB_VENDOR- value: postgres- name: JAVA_OPTSvalue: -Xms300m -Xmx300m -XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=200m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m -XX:MaxDirectMemorySize=25m@@ -171,8 +151,6 @@ spec:value: secret- name: KEYCLOAK_USERvalue: admin- - name: PROXY_ADDRESS_FORWARDING- value: "true"- name: TZvalue: Europe/Amsterdamimage: openremote/keycloak:latest@@ -205,22 +183,6 @@ spec:spec:containers:- env:- - name: ROOT_REDIRECT_PATH- value: "/manager"- - name: DATABASE_CONNECTION_TIMEOUT_SECONDS- value: "300"- - name: DATABASE_CONNECTION_URL- value: jdbc:postgresql://postgresql/openremote- - name: DATABASE_MAX_POOL_SIZE- value: "20"- - name: DATABASE_MIN_POOL_SIZE- value: "5"- - name: DATABASE_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: DATABASE_USERNAME- value: openremote- - name: DEV_MODE- value: "false"- name: IDENTITY_NETWORK_HOSTvalue: localhost- name: IDENTITY_NETWORK_SECURE@@ -235,30 +197,12 @@ spec:value: keycloak- name: KEYCLOAK_PORTvalue: "8080"- - name: MASTER_REALM_KEYCLOAK_THEME- value: openremote- name: SETUP_ADMIN_PASSWORDvalue: secret- - name: SETUP_IMPORT_DEMO_AGENT- value: "true"- - name: SETUP_IMPORT_DEMO_AGENT_KNX- value: "false"- - name: SETUP_IMPORT_DEMO_AGENT_VELBUS- value: "false"- - name: SETUP_IMPORT_DEMO_ASSETS- value: "true"- - name: SETUP_IMPORT_DEMO_RULES- value: "true"- - name: SETUP_IMPORT_DEMO_SCENES- value: "true"- - name: SETUP_IMPORT_DEMO_USERS- value: "true"- name: SETUP_WIPE_CLEAN_INSTALLvalue: "true"- name: TZvalue: Europe/Amsterdam- - name: WEBSERVER_LISTEN_HOST- value: 0.0.0.0image: openremote/manager-swarm:latestimagePullPolicy: ""name: managerdiff --git a/swarm/minikube/postgresql-deployment.yaml b/swarm/minikube/postgresql-deployment.yamlindex e62505581..b9447a2c8 100644--- a/swarm/minikube/postgresql-deployment.yaml+++ b/swarm/minikube/postgresql-deployment.yaml@@ -26,12 +26,6 @@ spec:spec:containers:- env:- - name: POSTGRES_DB- value: openremote- - name: POSTGRES_PASSWORD- value: CHANGE_ME_DB_USER_PASSWORD- - name: POSTGRES_USER- value: openremote- name: TZvalue: Europe/Amsterdamimage: openremote/postgresql:latestdiff --git a/swarm/swarm-docker-compose.arm64.yml b/swarm/swarm-docker-compose.arm64.ymlindex a9e7b1731..7d5ac1c6f 100644--- a/swarm/swarm-docker-compose.arm64.yml+++ b/swarm/swarm-docker-compose.arm64.yml@@ -145,25 +145,6 @@ services:#SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'#SETUP_EMAIL_FROM_DEFAULT: '[email protected]'- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-# The public host name of this OpenRemote installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also# change this to match.@@ -175,33 +156,16 @@ services:# The public port of this OpenRemote installation.IDENTITY_NETWORK_WEBSERVER_PORT: 443- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: openremote- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-# The service-internal host name and port of the identity provider.KEYCLOAK_HOST: keycloakKEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}-- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}-- JAVA_OPTS: '-Xms400m -Xmx400m+ JAVA_OPTS: -Xms400m -Xmx400m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof#volumes:# - deployment-data:/deployment@@ -242,30 +206,18 @@ services:# When you are ready to permanently install your project, replace it with the next line ...# SETUP_ADMIN_PASSWORD: # Allow override on CLI- # Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: openremote- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'- KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'-# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-Xms300m -Xmx300m+ JAVA_OPTS: -Xms300m -Xmx300m-XX:CompressedClassSpaceSize=50m -XX:MaxMetaspaceSize=250m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary-XX:+ExitOnOutOfMemoryError-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=trueports:- "8081:8080"@@ -301,14 +253,6 @@ services:# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.TZ: Europe/Amsterdam- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: openremote- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-# You can open an SQL console on a running container with:# docker exec -it <container ID> psql -U openremotediff --git a/swarm/swarm-docker-compose.yml b/swarm/swarm-docker-compose.ymlindex 7702c4b03..e310ccda0 100644--- a/swarm/swarm-docker-compose.yml+++ b/swarm/swarm-docker-compose.yml@@ -145,25 +145,6 @@ services:#SETUP_EMAIL_FROM_KEYCLOAK: '[email protected]'#SETUP_EMAIL_FROM_DEFAULT: '[email protected]'- # Other demo data can be imported as needed, these examples only use the simulator protocol.- SETUP_IMPORT_DEMO_USERS: 'true'- SETUP_IMPORT_DEMO_ASSETS: 'true'- SETUP_IMPORT_DEMO_RULES: 'true'- SETUP_IMPORT_DEMO_SCENES: 'true'-- # Create a demo agent with example configurations for all built-in protocols:- #- # - KNX IP gateway- # - Velbus IP gateway or serial bridge- #- SETUP_IMPORT_DEMO_AGENT: 'true'- SETUP_IMPORT_DEMO_AGENT_KNX: 'false'- # SETUP_IMPORT_DEMO_AGENT_KNX_GATEWAY_IP: '10.0.0.11'- # SETUP_IMPORT_DEMO_AGENT_KNX_LOCAL_IP: '10.0.0.12'- SETUP_IMPORT_DEMO_AGENT_VELBUS: 'false'- # SETUP_IMPORT_DEMO_AGENT_VELBUS_COM_PORT: 'COM3'- # TODO: Additional docker settings are necessary to use com ports and multicast from within containers-# The public host name of this OpenRemote installation. This name is used in bearer tokens# and must be the name you access the web services under. If you change proxy#DOMAINNAME, also# change this to match.@@ -175,33 +156,16 @@ services:# The public port of this OpenRemote installation.IDENTITY_NETWORK_WEBSERVER_PORT: 443- # The service-internal JDBC connection URL for the database service.- DATABASE_CONNECTION_URL: jdbc:postgresql://postgresql/openremote-- # The database connection settings, passwords should be changed in production!- DATABASE_USERNAME: openremote- DATABASE_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- DATABASE_MIN_POOL_SIZE: 5- DATABASE_MAX_POOL_SIZE: 20- DATABASE_CONNECTION_TIMEOUT_SECONDS: 300-# The service-internal host name and port of the identity provider.KEYCLOAK_HOST: keycloakKEYCLOAK_PORT: 8080- MASTER_REALM_KEYCLOAK_THEME: ${MASTER_REALM_KEYCLOAK_THEME:-openremote}- # The service-internal webservice interface binding, bind to all interfaces- # when running in container. Default is 127.0.0.1.- WEBSERVER_LISTEN_HOST: 0.0.0.0-- ROOT_REDIRECT_PATH: ${ROOT_REDIRECT_PATH:-/manager}-- JAVA_OPTS: '-Xms400m -Xmx400m+ JAVA_OPTS: -Xms400m -Xmx400m-XX:CompressedClassSpaceSize=25m -XX:MaxMetaspaceSize=150m-XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m-XX:MaxDirectMemorySize=25m-XX:NativeMemoryTracking=summary- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof'+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof#volumes:# - deployment-data:/deployment@@ -243,29 +207,20 @@ services:# SETUP_ADMIN_PASSWORD: # Allow override on CLI# Configure how Keycloak connects to the database- DB_VENDOR: postgres- DB_ADDR: postgresql- DB_PORT: 5432- DB_DATABASE: openremote- DB_USER: openremote- DB_SCHEMA: public- DB_PASSWORD: CHANGE_ME_DB_USER_PASSWORD- KEYCLOAK_USER: admin- PROXY_ADDRESS_FORWARDING: 'true'KEYCLOAK_FRONTEND_URL: 'https://${IDENTITY_NETWORK_HOST:-localhost}/auth'# CHANGE THIS PASSWORD BEFORE STARTING THE STACK! THIS IS ONLY FOR DEMO!KEYCLOAK_PASSWORD: ${SETUP_ADMIN_PASSWORD:-secret}# Custom JVM options (increase heap size if required)- JAVA_OPTS: '-Xms300m -Xmx300m- -XX:CompressedClassSpaceSize=50m -XX:MaxMetaspaceSize=250m- -XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m- -XX:MaxDirectMemorySize=25m- -XX:NativeMemoryTracking=summary- -XX:+ExitOnOutOfMemoryError- -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof- -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true'+ JAVA_OPTS: -Xms300m -Xmx300m+ -XX:CompressedClassSpaceSize=50m -XX:MaxMetaspaceSize=250m+ -XX:InitialCodeCacheSize=50m -XX:ReservedCodeCacheSize=50m+ -XX:MaxDirectMemorySize=25m+ -XX:NativeMemoryTracking=summary+ -XX:+ExitOnOutOfMemoryError+ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/javadump.core.hprof+ -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=trueports:- "8081:8080"@@ -301,14 +256,6 @@ services:# Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.TZ: Europe/Amsterdam- # Create database and user if there is no data. For production, run- # this once with your volume mapping for the data directory (see docker-compose.yml),- # then remove the variables and restart to preserve the stored data. It- # doesn't hurt if you don't remove it, an existing will never be reconfigured.- POSTGRES_DB: openremote- POSTGRES_USER: openremote- POSTGRES_PASSWORD: CHANGE_ME_DB_USER_PASSWORD-# You can open an SQL console on a running container with:# docker exec -it <container ID> psql -U openremotediff --git a/test/src/main/groovy/org/openremote/test/ManagerContainerTrait.groovy b/test/src/main/groovy/org/openremote/test/ManagerContainerTrait.groovyindex 0ba361065..3a89f6b6f 100644--- a/test/src/main/groovy/org/openremote/test/ManagerContainerTrait.groovy+++ b/test/src/main/groovy/org/openremote/test/ManagerContainerTrait.groovy@@ -5,7 +5,6 @@ import org.apache.camel.spi.BrowsableEndpointimport org.openremote.container.Containerimport org.openremote.container.message.MessageBrokerServiceimport org.openremote.container.timer.TimerService-import org.openremote.manager.asset.AssetProcessingServiceimport org.openremote.manager.rules.RulesServiceimport org.openremote.model.ContainerServiceimport spock.util.concurrent.PollingConditions@@ -21,6 +20,7 @@ import static org.openremote.container.timer.TimerService.TIMER_CLOCK_TYPEimport static org.openremote.container.web.WebService.WEBSERVER_LISTEN_PORTimport static org.openremote.manager.mqtt.MqttBrokerService.MQTT_SERVER_LISTEN_HOSTimport static org.openremote.manager.setup.SetupTasks.*+import static org.openremote.test.setup.TestSetupTasks.*trait ManagerContainerTrait extends ContainerTrait {@@ -32,11 +32,10 @@ trait ManagerContainerTrait extends ContainerTrait {(WEBSERVER_LISTEN_PORT) : Integer.toString(serverPort),(IDENTITY_NETWORK_HOST) : "127.0.0.1",(IDENTITY_NETWORK_WEBSERVER_PORT): "8081",- (SETUP_TESTS) : "true",- (SETUP_IMPORT_DEMO_ASSETS) : "true",- (SETUP_IMPORT_DEMO_USERS) : "true",- (SETUP_IMPORT_DEMO_SCENES) : "false",- (SETUP_IMPORT_DEMO_RULES) : "false",+ (SETUP_CREATE_ASSETS) : "true",+ (SETUP_CREATE_USERS) : "true",+ (SETUP_CREATE_SCENES) : "false",+ (SETUP_CREATE_RULES) : "false",(MQTT_SERVER_LISTEN_HOST) : "127.0.0.1", // Works best for cross platform test running(TIMER_CLOCK_TYPE) : PSEUDO.name()]@@ -56,8 +55,8 @@ trait ManagerContainerTrait extends ContainerTrait {}Container startContainerWithDemoScenesAndRules(Map<String, String> config, Iterable<ContainerService> services) {- config << [(SETUP_IMPORT_DEMO_SCENES): "true"]- config << [(SETUP_IMPORT_DEMO_RULES): "true"]+ config << [(SETUP_CREATE_SCENES): "true"]+ config << [(SETUP_CREATE_RULES): "true"]startContainer(config, services)}diff --git a/test/src/main/groovy/org/openremote/test/setup/TestSetupTasks.java b/test/src/main/groovy/org/openremote/test/setup/TestSetupTasks.javaindex 38e0a9785..d9a668f92 100644--- a/test/src/main/groovy/org/openremote/test/setup/TestSetupTasks.java+++ b/test/src/main/groovy/org/openremote/test/setup/TestSetupTasks.java@@ -26,6 +26,7 @@ import org.openremote.model.Container;import java.util.List;+import static org.openremote.container.util.MapAccess.getBoolean;import static org.openremote.manager.setup.SetupTasks.*;/**@@ -33,6 +34,35 @@ import static org.openremote.manager.setup.SetupTasks.*;*/public class TestSetupTasks extends EmptySetupTasks {+ public static final String SETUP_CREATE_SCENES = "SETUP_CREATE_SCENES";+ public static final String SETUP_CREATE_USERS = "SETUP_CREATE_USERS";+ public static final String SETUP_CREATE_ASSETS = "SETUP_CREATE_ASSETS";+ public static final String SETUP_CREATE_RULES = "SETUP_CREATE_RULES";+ public static final String SETUP_IMPORT_DEMO_AGENT = "SETUP_CREATE_AGENT";++ static boolean isImportDemoUsers(Container container) {+ return isImportDemoAssets(container)+ || getBoolean(container.getConfig(), SETUP_CREATE_USERS, container.isDevMode());+ }++ static boolean isImportDemoAssets(Container container) {+ return isImportDemoAgent(container)+ || isImportDemoRules(container)+ || getBoolean(container.getConfig(), SETUP_CREATE_ASSETS, container.isDevMode());+ }++ static boolean isImportDemoRules(Container container) {+ return getBoolean(container.getConfig(), SETUP_CREATE_RULES, container.isDevMode());+ }++ // Defaults to always disabled as agents might require actual protocol-specific hardware+ static boolean isImportDemoAgent(Container container) {+ return getBoolean(container.getConfig(), SETUP_IMPORT_DEMO_AGENT, false);+ }+ static boolean isImportDemoScenes(Container container) {+ return getBoolean(container.getConfig(), SETUP_CREATE_SCENES, container.isDevMode());+ }+@Overridepublic List<Setup> createTasks(Container container) {super.createTasks(container);@@ -44,7 +74,7 @@ public class TestSetupTasks extends EmptySetupTasks {addTask(new KeycloakTestSetup(container));}- if (isImportDemoAssets(container)) {+ if (isImportDemoAssets(container) || isImportDemoScenes(container)) {addTask(new ManagerTestSetup(container, isImportDemoScenes(container)));}diff --git a/ui/util/webpack.util.js b/ui/util/webpack.util.jsindex 387895d7e..4147a16e9 100644--- a/ui/util/webpack.util.js+++ b/ui/util/webpack.util.js@@ -7,7 +7,6 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl) {const production = mode === "production";managerUrl = managerUrl || (production ? undefined : "http://localhost:8080");- keycloakUrl = keycloakUrl || (production ? undefined : "http://localhost:8080/auth");const OUTPUT_PATH = isDevServer ? 'src' : 'dist';const config = {