Skip to content

armgit / core

Public Imported from GitHub
0

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

Support deployment/extensions/ directory for custom projects

Christian Bauerc351402cc932
diff --git a/README.md b/README.md
index 3bd91f897..614e73820 100644
--- a/README.md
+++ b/README.md
@@ -34,9 +34,10 @@ To keep your data, backup the `deployment` directory and start the stack with `S
More configuration options of the images are documented [in the deploy.yml profile](https://github.com/openremote/openremote/blob/master/profile/deploy.yml).
-Perform a clean build and run all tests (before committing):
+Perform a clean build, delete all data volumes (!), and run all tests (before committing):
```
+docker volume prune
docker-compose -p openremote -f profile/dev.yml up -d
./gradlew clean build installDist
docker build -t openremote/proxy:latest haproxy
diff --git a/manager/client/build.gradle b/manager/client/build.gradle
index c2015fa03..1b000d663 100644
--- a/manager/client/build.gradle
+++ b/manager/client/build.gradle
@@ -22,7 +22,7 @@ dependencies {
gwtDev "com.google.gwt:gwt-dev:$gwtVersion"
}
-def gwtOutputDir = "${project.buildDir}/gwt/out"
+def gwtOutputDir = "${project.buildDir}/gwt/output"
def gwtExtraDir = "${project.buildDir}/gwt/extra"
def gwtWorkDir = "${project.buildDir}/gwt/work"
def gwtCacheDir = "${project.buildDir}/gwt/cache"
diff --git a/manager/client/src/main/webapp/index.html b/manager/client/src/main/webapp/index.html
index 233bb269e..619767e5c 100644
--- a/manager/client/src/main/webapp/index.html
+++ b/manager/client/src/main/webapp/index.html
@@ -36,7 +36,7 @@
load.css("/static/3rdparty/mapbox-gl-js/0.35.0/mapbox-gl.css"),
load.js("/static/3rdparty/mapbox-gl-js/0.35.0/mapbox-gl.js"),
- load.js("/static/bower_components/chart.js/Chart.js"),
+ load.js("/static/bower_components/chart.js/dist/Chart.js"),
load.js("/static/3rdparty/sprintf/1.0.3/sprintf.min.js"),
diff --git a/manager/server/src/main/java/org/openremote/manager/server/web/ManagerFileServlet.java b/manager/server/src/main/java/org/openremote/manager/server/web/ManagerFileServlet.java
index c4af67030..b1a21f2ab 100644
--- a/manager/server/src/main/java/org/openremote/manager/server/web/ManagerFileServlet.java
+++ b/manager/server/src/main/java/org/openremote/manager/server/web/ManagerFileServlet.java
@@ -31,7 +31,6 @@ import org.openremote.container.web.file.GzipResponseFilter;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
-import javax.servlet.Servlet;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -64,7 +63,6 @@ public class ManagerFileServlet extends FileServlet {
put("text/xml", 1800);
put("text/css", 1800);
put("text/javascript", 1800);
- put("text/html", 1800);
put("application/javascript", 1800);
put("application/json", 1800);
}
diff --git a/manager/server/src/main/java/org/openremote/manager/server/web/ManagerWebService.java b/manager/server/src/main/java/org/openremote/manager/server/web/ManagerWebService.java
index 17201593b..8525cdd98 100644
--- a/manager/server/src/main/java/org/openremote/manager/server/web/ManagerWebService.java
+++ b/manager/server/src/main/java/org/openremote/manager/server/web/ManagerWebService.java
@@ -29,15 +29,12 @@ import org.openremote.model.Constants;
import javax.ws.rs.core.UriBuilder;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.logging.Logger;
import java.util.regex.Pattern;
import static org.openremote.container.util.MapAccess.getString;
public class ManagerWebService extends WebService {
- private static final Logger LOG = Logger.getLogger(ManagerWebService.class.getName());
-
public static final String MANAGER_DOCROOT = "MANAGER_DOCROOT";
public static final String MANAGER_DOCROOT_DEFAULT = "manager/client/src/main/webapp";
public static final String CONSOLE_DOCROOT = "CONSOLE_DOCROOT";
diff --git a/profile/demo.yml b/profile/demo.yml
index d11995533..3ff14629e 100644
--- a/profile/demo.yml
+++ b/profile/demo.yml
@@ -14,7 +14,7 @@
# Steps to create a permanent installation:
#
# 1. DO NOT FORGET TO CHANGE KEYCLOAK_PASSWORD!
-# 2. Consider setting a custom DOMAINNAME, see deploy.yml
+# 2. Consider setting a custom DOMAINNAME, LE_EMAIL, and IDENTITY_NETWORK_HOST, see deploy.yml
# 3. Understand how persistent data and volume mappings work, see below
# 4. Execute once:
#
@@ -29,6 +29,8 @@
# 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 manager's ../deployment/extensions/ directory.
+#
version: '2.2'
# If you enable volume mappings in services, you need this. Otherwise, remove the volumes
@@ -55,9 +57,9 @@ services:
# - proxy-data:/deployment
# This configuration expects manager deployment-specific data such as map tiles,
- # console application static resources (HTML, JS, CSS), and other configuration files
- # to be available in the '../deployment' directory. To set a custom deployment
- # directory, use env variable DEPLOYMENT_DIRECTORY.
+ # console application static resources (HTML, JS, CSS), extensions, and other
+ # configuration files to be available in the '../deployment' directory. To set
+ # a custom deployment# directory, use env variable DEPLOYMENT_DIRECTORY.
manager:
extends:
file: deploy.yml
@@ -70,6 +72,9 @@ services:
- ${DEPLOYMENT_DIRECTORY:-../deployment}/manager:/deployment
# - manager-data:/deployment
environment:
+ # Override built-in logging.properties with a file of your choice.
+ LOGGING_CONFIG_FILE: '/deployment/logging.properties'
+
# This switch can wipe all your Manager and Keycloak data, this is the factory reset!
SETUP_WIPE_CLEAN_INSTALL: 'true'
# When you are ready to permanently install your project, replace it with the next lines...
diff --git a/profile/deploy.yml b/profile/deploy.yml
index 2d88e4a10..32f5750df 100644
--- a/profile/deploy.yml
+++ b/profile/deploy.yml
@@ -43,6 +43,9 @@ services:
# --staging requests fake certificates to avoid hitting limits during testing
#LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
+ # Customize log output
+ PROXY_LOGLEVEL: 'notice'
+
# Run proxy, obtain and automatically renew SSL certificates if DOMAINNAME is not localhost (see help)
command: run
@@ -145,9 +148,6 @@ services:
# have the name of a realm to which the console app belongs.
# CONSOLE_DOCROOT: '/deployment/consoles'
- # Optional: Override built-in logging.properties with a file of your choice.
- # LOGGING_CONFIG_FILE: '/deployment/logging.properties'
-
# Optional: Provide a path to the map tiles database file (see https://openmaptiles.com/).
# MAP_TILES_PATH: '/deployment/mapdata.mbtiles'
@@ -180,19 +180,8 @@ services:
# unless you want to deploy a modified version of the Manager UI.
# MANAGER_DOCROOT: 'manager/client/src/main/webapp'
- # Override entrypoint for custom JVM options
- #
- # You should always set maximum memory limits, as the JVM will compute default heap size
- # by looking at RAM on the host (taking a quarter of that usually), not whatever limits
- # you set on the Docker container!
- #
- # entrypoint:
- # - "java"
- # - "-Xmx1024m"
- # - "-XX:+PrintGCDetails"
- # - "-cp"
- # - "/opt/app/lib/*"
- # - "org.openremote.manager.server.Main"
+ # Custom JVM options (default max heap size is 1GB)
+ # JAVA_OPTS: '-Xmx1g -XX:+PrintGCDetails'
# Configure logging of the container, see deployment/logging.properties
logging:
diff --git a/project.gradle b/project.gradle
index fd694c1b6..b5c5c252a 100644
--- a/project.gradle
+++ b/project.gradle
@@ -18,6 +18,21 @@ repositories {
// Eclipse needs help
apply plugin: "eclipse"
+// Intellij needs help
+apply plugin: 'idea'
+// Use the same output directories in IDE as in gradle
+idea {
+ module {
+ outputDir file('build/classes/main')
+ testOutputDir file('build/classes/test')
+ }
+}
+if(project.convention.findPlugin(JavaPluginConvention)) {
+ // Change the output directory for the main and test source sets back to the old path
+ sourceSets.main.output.classesDirs = new File(buildDir, "classes/main")
+ sourceSets.test.output.classesDirs = new File(buildDir, "classes/test")
+}
+
// Configure versions in gradle.properties (putting a gradle.properties file
// in a subproject only overrides root properties of same name for the actual
// subproject, not for its children!)
diff --git a/proxy/Dockerfile b/proxy/Dockerfile
index 6f0cb291f..5f2e97e70 100644
--- a/proxy/Dockerfile
+++ b/proxy/Dockerfile
@@ -11,6 +11,7 @@ ARG ACME_PLUGIN_VERSION=0.1.1
ARG DOMAINNAME
ENV DOMAINNAME=${DOMAINNAME:-localhost}
ENV TERM xterm
+ENV PROXY_LOGLEVEL notice
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/proxy/entrypoint.sh b/proxy/entrypoint.sh
index 7f0f5096a..6bb8b77c8 100644
--- a/proxy/entrypoint.sh
+++ b/proxy/entrypoint.sh
@@ -26,6 +26,7 @@ if [ -n "${DOMAINNAME}" ] && [ "${DOMAINNAME}" != "localhost" ]; then
CERT_FILE="/deployment/letsencrypt/live/${DOMAINNAME}/haproxy.pem"
fi
export CERT_FILE=${CERT_FILE}
+export PROXY_LOGLEVEL=${PROXY_LOGLEVEL}
# Assume
if [ ! -f ${CERT_FILE} ]; then
diff --git a/proxy/haproxy-init.cfg b/proxy/haproxy-init.cfg
index ffc8fd2f0..a98ba23dc 100644
--- a/proxy/haproxy-init.cfg
+++ b/proxy/haproxy-init.cfg
@@ -3,7 +3,7 @@
# SSL reverse-proxy for host "manager:8080"
#
global
- log 127.0.0.1:514 local0 notice
+ log 127.0.0.1:514 local0 "${PROXY_LOGLEVEL}"
# Used for serving certificate validation challenges
chroot /deployment/acme-webroot
diff --git a/proxy/haproxy.cfg b/proxy/haproxy.cfg
index 6a5d1525f..d9294ea7b 100644
--- a/proxy/haproxy.cfg
+++ b/proxy/haproxy.cfg
@@ -3,7 +3,7 @@
# SSL reverse-proxy for host "manager:8080"
#
global
- log 127.0.0.1:514 local0 notice
+ log 127.0.0.1:514 local0 "${PROXY_LOGLEVEL}"
# Used for serving certificate validation challenges
chroot /deployment/acme-webroot