diff --git a/Dockerfile b/Dockerfile index c638b783..056ff5af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest as py-ea -ARG ELASTALERT_VERSION=v0.1.39 +ARG ELASTALERT_VERSION=v0.2.0b2 ENV ELASTALERT_VERSION=${ELASTALERT_VERSION} # URL from which to download Elastalert. ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip @@ -45,5 +45,12 @@ COPY config/config.json config/config.json COPY rule_templates/ /opt/elastalert/rule_templates COPY elastalert_modules/ /opt/elastalert/elastalert_modules +# Add default rules directory +# Set permission as unpriviledged user (1000:1000), compatible with Kubernetes +RUN mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ \ + && chown -R node:node /opt + +USER node + EXPOSE 3030 ENTRYPOINT ["npm", "start"] diff --git a/Makefile b/Makefile index 82255fc0..9a7610e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -v ?= v0.1.39 +v ?= v0.2.0b2 all: build diff --git a/package.json b/package.json index 0ea6ac65..b1150496 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitsensor/elastalert", - "version": "2.0.1", + "version": "3.0.0-beta.0", "description": "A server that runs ElastAlert and exposes REST API's for manipulating rules and alerts.", "license": "MIT", "main": "index.js", diff --git a/src/controllers/process/index.js b/src/controllers/process/index.js index 83e7f40d..6ad53432 100644 --- a/src/controllers/process/index.js +++ b/src/controllers/process/index.js @@ -48,10 +48,10 @@ export default class ProcessController { }); // Redirect stdin/stderr to logger - if (indexCreate.stdout.toString() !== '') { + if (indexCreate.stdout && indexCreate.stdout.toString() !== '') { logger.info(indexCreate.stdout.toString()); } - if (indexCreate.stderr.toString() !== '') { + if (indexCreate.stderr && indexCreate.stderr.toString() !== '') { logger.error(indexCreate.stderr.toString()); }