You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ai...@apache.org on 2018/08/02 13:44:47 UTC
nifi git commit: NIFI-5468 Add toolkit to NiFi docker image and use
zip archive NIFI-5468 add keypasswd with the default of keystorepasswd for bc
compatibility NIFI-5468 Use ARG instead of ENV for PATH variables as those
need to be controlled in the buil
Repository: nifi
Updated Branches:
refs/heads/master 4cca9bef7 -> b7fe04257
NIFI-5468 Add toolkit to NiFi docker image and use zip archive
NIFI-5468 add keypasswd with the default of keystorepasswd for bc compatibility
NIFI-5468 Use ARG instead of ENV for PATH variables as those need to be controlled in the build
NIFI-5468 Use BASE_URL for the default case when MIRROR_BASE_URL is not defined (and replace ARCHIVE_BASE_URL)
This closes #2921
Signed-off-by: Andrew I. Christianson <an...@andyic.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/b7fe0425
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/b7fe0425
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/b7fe0425
Branch: refs/heads/master
Commit: b7fe04257d10ab7bf9df2661260d731ce92a223a
Parents: 4cca9be
Author: pepov <pe...@gmail.com>
Authored: Fri Jul 27 14:53:39 2018 +0200
Committer: Andrew I. Christianson <an...@andyic.org>
Committed: Thu Aug 2 09:44:14 2018 -0400
----------------------------------------------------------------------
nifi-docker/dockerhub/Dockerfile | 25 ++++++++++++------
nifi-docker/dockerhub/pom.xml | 4 +--
nifi-docker/dockerhub/sh/common.sh | 1 +
nifi-docker/dockerhub/sh/secure.sh | 18 +++++++++++++
nifi-docker/dockerhub/sh/start.sh | 4 +++
nifi-docker/dockerhub/sh/toolkit.sh | 32 +++++++++++++++++++++++
nifi-docker/dockermaven/Dockerfile | 41 ++++++++++++++++++++++--------
nifi-docker/dockermaven/pom.xml | 23 ++++++++++++++---
nifi-docker/dockermaven/sh/common.sh | 1 +
nifi-docker/dockermaven/sh/secure.sh | 18 +++++++++++++
nifi-docker/dockermaven/sh/start.sh | 4 +++
nifi-docker/dockermaven/sh/toolkit.sh | 32 +++++++++++++++++++++++
12 files changed, 180 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/Dockerfile
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/Dockerfile b/nifi-docker/dockerhub/Dockerfile
index cf932cf..c3df2f6 100644
--- a/nifi-docker/dockerhub/Dockerfile
+++ b/nifi-docker/dockerhub/Dockerfile
@@ -23,11 +23,14 @@ LABEL site="https://nifi.apache.org"
ARG UID=1000
ARG GID=1000
ARG NIFI_VERSION=1.8.0
-ARG MIRROR=https://archive.apache.org/dist
+ARG BASE_URL=https://archive.apache.org/dist
+ARG MIRROR_BASE_URL=${MIRROR_BASE_URL:-${BASE_URL}}
+ARG NIFI_BINARY_PATH=${NIFI_BINARY_PATH:-/nifi/${NIFI_VERSION}/nifi-${NIFI_VERSION}-bin.zip}
+ARG NIFI_TOOLKIT_BINARY_PATH=${NIFI_TOOLKIT_BINARY_PATH:-/nifi/${NIFI_VERSION}/nifi-toolkit-${NIFI_VERSION}-bin.zip}
+
+ENV NIFI_BASE_DIR=/opt/nifi
+ENV NIFI_HOME=${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}
-ENV NIFI_BASE_DIR /opt/nifi
-ENV NIFI_HOME=${NIFI_BASE_DIR}/nifi-${NIFI_VERSION} \
- NIFI_BINARY_URL=/nifi/${NIFI_VERSION}/nifi-${NIFI_VERSION}-bin.tar.gz
ENV NIFI_PID_DIR=${NIFI_HOME}/run
ENV NIFI_LOG_DIR=${NIFI_HOME}/logs
@@ -49,11 +52,17 @@ RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -
USER nifi
+# Download, validate, and expand Apache NiFi Toolkit binary.
+RUN curl -fSL ${MIRROR_BASE_URL}/${NIFI_TOOLKIT_BINARY_PATH} -o ${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip \
+ && echo "$(curl ${BASE_URL}/${NIFI_TOOLKIT_BINARY_PATH}.sha256) *${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip" | sha256sum -c - \
+ && unzip ${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip -d ${NIFI_BASE_DIR} \
+ && rm ${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip
+
# Download, validate, and expand Apache NiFi binary.
-RUN curl -fSL ${MIRROR}/${NIFI_BINARY_URL} -o ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz \
- && echo "$(curl https://archive.apache.org/dist/${NIFI_BINARY_URL}.sha256) *${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz" | sha256sum -c - \
- && tar -xvzf ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz -C ${NIFI_BASE_DIR} \
- && rm ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz
+RUN curl -fSL ${MIRROR_BASE_URL}/${NIFI_BINARY_PATH} -o ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip \
+ && echo "$(curl ${BASE_URL}/${NIFI_BINARY_PATH}.sha256) *${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip" | sha256sum -c - \
+ && unzip ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip -d ${NIFI_BASE_DIR} \
+ && rm ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip
VOLUME ${NIFI_LOG_DIR} \
${NIFI_HOME}/conf \
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/pom.xml b/nifi-docker/dockerhub/pom.xml
index 2dc5df9..837ca3e 100644
--- a/nifi-docker/dockerhub/pom.xml
+++ b/nifi-docker/dockerhub/pom.xml
@@ -39,7 +39,7 @@
<buildArgs>
<UID>1000</UID>
<GID>1000</GID>
- <NIFI_VERSION>1.6.0</NIFI_VERSION>
+ <NIFI_VERSION>1.7.0</NIFI_VERSION>
</buildArgs>
<repository>apache/nifi</repository>
<!-- Right now we can only test against the latest released NiFi version to check our Dockerfile -->
@@ -61,7 +61,7 @@
<configuration>
<arguments>
<argument>${project.version}-dockerhub</argument>
- <argument>1.6.0</argument>
+ <argument>1.7.0</argument>
</arguments>
<executable>${project.basedir}/../dockermaven/integration-test.sh</executable>
</configuration>
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/sh/common.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/sh/common.sh b/nifi-docker/dockerhub/sh/common.sh
index a0a6550..88b3dbb 100755
--- a/nifi-docker/dockerhub/sh/common.sh
+++ b/nifi-docker/dockerhub/sh/common.sh
@@ -25,4 +25,5 @@ prop_replace () {
# NIFI_HOME is defined by an ENV command in the backing Dockerfile
export nifi_props_file=${NIFI_HOME}/conf/nifi.properties
+export nifi_toolkit_props_file=${HOME}/.nifi-cli.nifi.properties
export hostname=$(hostname)
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/sh/secure.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/sh/secure.sh b/nifi-docker/dockerhub/sh/secure.sh
index 5ff56e4..46fa098 100644
--- a/nifi-docker/dockerhub/sh/secure.sh
+++ b/nifi-docker/dockerhub/sh/secure.sh
@@ -41,10 +41,19 @@ fi
prop_replace 'nifi.security.keystore' "${KEYSTORE_PATH}"
prop_replace 'nifi.security.keystoreType' "${KEYSTORE_TYPE}"
prop_replace 'nifi.security.keystorePasswd' "${KEYSTORE_PASSWORD}"
+prop_replace 'nifi.security.keyPasswd' "${KEY_PASSWORD:-$KEYSTORE_PASSWORD}"
prop_replace 'nifi.security.truststore' "${TRUSTSTORE_PATH}"
prop_replace 'nifi.security.truststoreType' "${TRUSTSTORE_TYPE}"
prop_replace 'nifi.security.truststorePasswd' "${TRUSTSTORE_PASSWORD}"
+prop_replace 'keystore' "${KEYSTORE_PATH}" ${nifi_toolkit_props_file}
+prop_replace 'keystoreType' "${KEYSTORE_TYPE}" ${nifi_toolkit_props_file}
+prop_replace 'keystorePasswd' "${KEYSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+prop_replace 'keyPasswd' "${KEY_PASSWORD:-$KEYSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+prop_replace 'truststore' "${TRUSTSTORE_PATH}" ${nifi_toolkit_props_file}
+prop_replace 'truststoreType' "${TRUSTSTORE_TYPE}" ${nifi_toolkit_props_file}
+prop_replace 'truststorePasswd' "${TRUSTSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+
# Disable HTTP and enable HTTPS
prop_replace 'nifi.web.http.port' ''
prop_replace 'nifi.web.http.host' ''
@@ -52,6 +61,9 @@ prop_replace 'nifi.web.https.port' "${NIFI_WEB_HTTPS_PORT:-8443}"
prop_replace 'nifi.web.https.host' "${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}"
prop_replace 'nifi.remote.input.secure' 'true'
+# Setup nifi-toolkit
+prop_replace 'baseUrl' "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}" ${nifi_toolkit_props_file}
+
# Check if the user has specified a nifi.web.proxy.host setting and handle appropriately
if [ -z "${NIFI_WEB_PROXY_HOST}" ]; then
echo 'NIFI_WEB_PROXY_HOST was not set but NiFi is configured to run in a secure mode. The NiFi UI may be inaccessible if using port mapping.'
@@ -62,3 +74,9 @@ fi
# Establish initial user and an associated admin identity
sed -i -e 's|<property name="Initial User Identity 1"></property>|<property name="Initial User Identity 1">'"${INITIAL_ADMIN_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
sed -i -e 's|<property name="Initial Admin Identity"></property>|<property name="Initial Admin Identity">'"${INITIAL_ADMIN_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
+
+if [ -n "${NODE_IDENTITY}" ]; then
+ sed -i -e 's|<property name="Node Identity 1"></property>|<property name="Node Identity 1">'"${NODE_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
+fi
+
+prop_replace 'proxiedEntity' "${INITIAL_ADMIN_IDENTITY}" ${nifi_toolkit_props_file}
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/sh/start.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/sh/start.sh b/nifi-docker/dockerhub/sh/start.sh
index f65a43e..936d277 100755
--- a/nifi-docker/dockerhub/sh/start.sh
+++ b/nifi-docker/dockerhub/sh/start.sh
@@ -26,6 +26,10 @@ prop_replace 'nifi.remote.input.host' "${NIFI_REMOTE_INPUT_HOST:-$HOST
prop_replace 'nifi.remote.input.socket.port' "${NIFI_REMOTE_INPUT_SOCKET_PORT:-10000}"
prop_replace 'nifi.remote.input.secure' 'false'
+# Set nifi-toolkit properties files and baseUrl
+"${scripts_dir}/toolkit.sh"
+prop_replace 'baseUrl' "http://${NIFI_WEB_HTTP_HOST:-$HOSTNAME}:${NIFI_WEB_HTTP_PORT:-8080}" ${nifi_toolkit_props_file}
+
prop_replace 'nifi.variable.registry.properties' "${NIFI_VARIABLE_REGISTRY_PROPERTIES:-}"
prop_replace 'nifi.cluster.is.node' "${NIFI_CLUSTER_IS_NODE:-false}"
prop_replace 'nifi.cluster.node.address' "${NIFI_CLUSTER_ADDRESS:-$HOSTNAME}"
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockerhub/sh/toolkit.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockerhub/sh/toolkit.sh b/nifi-docker/dockerhub/sh/toolkit.sh
new file mode 100755
index 0000000..5262c91
--- /dev/null
+++ b/nifi-docker/dockerhub/sh/toolkit.sh
@@ -0,0 +1,32 @@
+#!/bin/sh -e
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cat <<EOT > ${nifi_toolkit_props_file}
+baseUrl=
+keystore=
+keystoreType=
+keystorePasswd=
+keyPasswd=
+truststore=
+truststoreType=
+truststorePasswd=
+proxiedEntity=
+EOT
+
+cat <<EOT > ${HOME}/.nifi-cli.config
+nifi.props=${nifi_toolkit_props_file}
+EOT
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/Dockerfile
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/Dockerfile b/nifi-docker/dockermaven/Dockerfile
index a4bfce7..796a8fb 100644
--- a/nifi-docker/dockermaven/Dockerfile
+++ b/nifi-docker/dockermaven/Dockerfile
@@ -16,13 +16,12 @@
# under the License.
#
-FROM openjdk:8-jre
+FROM openjdk:8-jre AS artifactbase
LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
-ARG UID=1000
-ARG GID=1000
ARG NIFI_VERSION
ARG NIFI_BINARY
+ARG NIFI_TOOLKIT_BINARY
ENV NIFI_BASE_DIR /opt/nifi
ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
@@ -31,22 +30,44 @@ ENV NIFI_LOG_DIR=${NIFI_HOME}/logs
ADD sh/ ${NIFI_BASE_DIR}/scripts/
-ADD $NIFI_BINARY $NIFI_BASE_DIR
+COPY $NIFI_BINARY $NIFI_BASE_DIR
+RUN unzip ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip -d ${NIFI_BASE_DIR} \
+ && rm ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.zip
-# Setup NiFi user and create necessary directories
-RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -f1` \
- && useradd --shell /bin/bash -u ${UID} -g ${GID} -m nifi \
- && mkdir -p ${NIFI_HOME}/conf \
+COPY $NIFI_TOOLKIT_BINARY $NIFI_BASE_DIR
+RUN unzip ${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip -d ${NIFI_BASE_DIR} \
+ && rm ${NIFI_BASE_DIR}/nifi-toolkit-${NIFI_VERSION}-bin.zip
+
+# Create necessary directories
+RUN mkdir -p ${NIFI_HOME}/conf \
&& mkdir -p ${NIFI_HOME}/database_repository \
&& mkdir -p ${NIFI_HOME}/flowfile_repository \
&& mkdir -p ${NIFI_HOME}/content_repository \
&& mkdir -p ${NIFI_HOME}/provenance_repository \
&& mkdir -p ${NIFI_HOME}/state \
- && mkdir -p ${NIFI_LOG_DIR} \
- && chown -R nifi:nifi ${NIFI_BASE_DIR} \
+ && mkdir -p ${NIFI_LOG_DIR}
+
+FROM openjdk:8-jre
+LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
+
+ARG UID=1000
+ARG GID=1000
+
+ARG NIFI_VERSION
+
+ENV NIFI_BASE_DIR /opt/nifi
+ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
+ENV NIFI_PID_DIR=${NIFI_HOME}/run
+ENV NIFI_LOG_DIR=${NIFI_HOME}/logs
+
+# Setup NiFi user and create necessary directories
+RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -f1` \
+ && useradd --shell /bin/bash -u ${UID} -g ${GID} -m nifi \
&& apt-get update \
&& apt-get install -y jq xmlstarlet procps
+COPY --chown=nifi:nifi --from=artifactbase $NIFI_BASE_DIR $NIFI_BASE_DIR
+
VOLUME ${NIFI_LOG_DIR} \
${NIFI_HOME}/conf \
${NIFI_HOME}/database_repository \
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/pom.xml b/nifi-docker/dockermaven/pom.xml
index bdfca53..2d14635 100644
--- a/nifi-docker/dockermaven/pom.xml
+++ b/nifi-docker/dockermaven/pom.xml
@@ -40,7 +40,8 @@
<UID>1000</UID>
<GID>1000</GID>
<NIFI_VERSION>${project.version}</NIFI_VERSION>
- <NIFI_BINARY>target/nifi-${nifi.version}-bin.tar.gz</NIFI_BINARY>
+ <NIFI_BINARY>target/nifi-${nifi.version}-bin.zip</NIFI_BINARY>
+ <NIFI_TOOLKIT_BINARY>target/nifi-toolkit-${nifi.version}-bin.zip</NIFI_TOOLKIT_BINARY>
</buildArgs>
<repository>apache/nifi</repository>
<tag>${project.version}-dockermaven</tag>
@@ -59,8 +60,24 @@
<configuration>
<target name="copy assembly to nifi-docker for image build">
<copy todir="${project.basedir}/target" overwrite="true" flatten="true">
- <fileset dir="${project.basedir}/../../nifi-assembly/target" includes="*.tar.gz">
- <include name="*.tar.gz" />
+ <fileset dir="${project.basedir}/../../nifi-assembly/target" includes="*.zip">
+ <include name="*.zip" />
+ </fileset>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>copy-toolkit-for-docker</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <target name="copy toolkit assembly to nifi-docker for image build">
+ <copy todir="${project.basedir}/target" overwrite="true" flatten="true">
+ <fileset dir="${project.basedir}/../../nifi-toolkit/nifi-toolkit-assembly/target" includes="*.zip">
+ <include name="*.zip" />
</fileset>
</copy>
</target>
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/sh/common.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/sh/common.sh b/nifi-docker/dockermaven/sh/common.sh
index a0a6550..88b3dbb 100755
--- a/nifi-docker/dockermaven/sh/common.sh
+++ b/nifi-docker/dockermaven/sh/common.sh
@@ -25,4 +25,5 @@ prop_replace () {
# NIFI_HOME is defined by an ENV command in the backing Dockerfile
export nifi_props_file=${NIFI_HOME}/conf/nifi.properties
+export nifi_toolkit_props_file=${HOME}/.nifi-cli.nifi.properties
export hostname=$(hostname)
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/sh/secure.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/sh/secure.sh b/nifi-docker/dockermaven/sh/secure.sh
index 5ff56e4..46fa098 100644
--- a/nifi-docker/dockermaven/sh/secure.sh
+++ b/nifi-docker/dockermaven/sh/secure.sh
@@ -41,10 +41,19 @@ fi
prop_replace 'nifi.security.keystore' "${KEYSTORE_PATH}"
prop_replace 'nifi.security.keystoreType' "${KEYSTORE_TYPE}"
prop_replace 'nifi.security.keystorePasswd' "${KEYSTORE_PASSWORD}"
+prop_replace 'nifi.security.keyPasswd' "${KEY_PASSWORD:-$KEYSTORE_PASSWORD}"
prop_replace 'nifi.security.truststore' "${TRUSTSTORE_PATH}"
prop_replace 'nifi.security.truststoreType' "${TRUSTSTORE_TYPE}"
prop_replace 'nifi.security.truststorePasswd' "${TRUSTSTORE_PASSWORD}"
+prop_replace 'keystore' "${KEYSTORE_PATH}" ${nifi_toolkit_props_file}
+prop_replace 'keystoreType' "${KEYSTORE_TYPE}" ${nifi_toolkit_props_file}
+prop_replace 'keystorePasswd' "${KEYSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+prop_replace 'keyPasswd' "${KEY_PASSWORD:-$KEYSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+prop_replace 'truststore' "${TRUSTSTORE_PATH}" ${nifi_toolkit_props_file}
+prop_replace 'truststoreType' "${TRUSTSTORE_TYPE}" ${nifi_toolkit_props_file}
+prop_replace 'truststorePasswd' "${TRUSTSTORE_PASSWORD}" ${nifi_toolkit_props_file}
+
# Disable HTTP and enable HTTPS
prop_replace 'nifi.web.http.port' ''
prop_replace 'nifi.web.http.host' ''
@@ -52,6 +61,9 @@ prop_replace 'nifi.web.https.port' "${NIFI_WEB_HTTPS_PORT:-8443}"
prop_replace 'nifi.web.https.host' "${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}"
prop_replace 'nifi.remote.input.secure' 'true'
+# Setup nifi-toolkit
+prop_replace 'baseUrl' "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}" ${nifi_toolkit_props_file}
+
# Check if the user has specified a nifi.web.proxy.host setting and handle appropriately
if [ -z "${NIFI_WEB_PROXY_HOST}" ]; then
echo 'NIFI_WEB_PROXY_HOST was not set but NiFi is configured to run in a secure mode. The NiFi UI may be inaccessible if using port mapping.'
@@ -62,3 +74,9 @@ fi
# Establish initial user and an associated admin identity
sed -i -e 's|<property name="Initial User Identity 1"></property>|<property name="Initial User Identity 1">'"${INITIAL_ADMIN_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
sed -i -e 's|<property name="Initial Admin Identity"></property>|<property name="Initial Admin Identity">'"${INITIAL_ADMIN_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
+
+if [ -n "${NODE_IDENTITY}" ]; then
+ sed -i -e 's|<property name="Node Identity 1"></property>|<property name="Node Identity 1">'"${NODE_IDENTITY}"'</property>|' ${NIFI_HOME}/conf/authorizers.xml
+fi
+
+prop_replace 'proxiedEntity' "${INITIAL_ADMIN_IDENTITY}" ${nifi_toolkit_props_file}
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/sh/start.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/sh/start.sh b/nifi-docker/dockermaven/sh/start.sh
index f65a43e..936d277 100755
--- a/nifi-docker/dockermaven/sh/start.sh
+++ b/nifi-docker/dockermaven/sh/start.sh
@@ -26,6 +26,10 @@ prop_replace 'nifi.remote.input.host' "${NIFI_REMOTE_INPUT_HOST:-$HOST
prop_replace 'nifi.remote.input.socket.port' "${NIFI_REMOTE_INPUT_SOCKET_PORT:-10000}"
prop_replace 'nifi.remote.input.secure' 'false'
+# Set nifi-toolkit properties files and baseUrl
+"${scripts_dir}/toolkit.sh"
+prop_replace 'baseUrl' "http://${NIFI_WEB_HTTP_HOST:-$HOSTNAME}:${NIFI_WEB_HTTP_PORT:-8080}" ${nifi_toolkit_props_file}
+
prop_replace 'nifi.variable.registry.properties' "${NIFI_VARIABLE_REGISTRY_PROPERTIES:-}"
prop_replace 'nifi.cluster.is.node' "${NIFI_CLUSTER_IS_NODE:-false}"
prop_replace 'nifi.cluster.node.address' "${NIFI_CLUSTER_ADDRESS:-$HOSTNAME}"
http://git-wip-us.apache.org/repos/asf/nifi/blob/b7fe0425/nifi-docker/dockermaven/sh/toolkit.sh
----------------------------------------------------------------------
diff --git a/nifi-docker/dockermaven/sh/toolkit.sh b/nifi-docker/dockermaven/sh/toolkit.sh
new file mode 100755
index 0000000..5262c91
--- /dev/null
+++ b/nifi-docker/dockermaven/sh/toolkit.sh
@@ -0,0 +1,32 @@
+#!/bin/sh -e
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cat <<EOT > ${nifi_toolkit_props_file}
+baseUrl=
+keystore=
+keystoreType=
+keystorePasswd=
+keyPasswd=
+truststore=
+truststoreType=
+truststorePasswd=
+proxiedEntity=
+EOT
+
+cat <<EOT > ${HOME}/.nifi-cli.config
+nifi.props=${nifi_toolkit_props_file}
+EOT
\ No newline at end of file