summaryrefslogtreecommitdiffstats
path: root/packaging/docker
diff options
context:
space:
mode:
authorJames Mills <1290234+prologic@users.noreply.github.com>2020-01-30 09:49:23 +1000
committerGitHub <noreply@github.com>2020-01-30 09:49:23 +1000
commit38ad89fc2bc6ec46e88a3428d81e29e0f46c4b18 (patch)
tree1c8a04a7576982cb8a724a711ddb0bd226143f2a /packaging/docker
parent2979efe03161499e9a53f76d843c2fd7e5006a92 (diff)
Adds support for opting out of telemetry via the DO_NOT_TRACK envirnment variable (#7846)
* Added support for opting out of telemtry via the DO_NOT_TRACK environment variable * Added support for DO_NOT_TRACK=1 in anonymous-statistics.sh and minor cleanup in Dockerfile and run.sh entrypoint * Allow DO_NOT_TRACK to be either non-zero or non-empty * Update md5sum of kickstart-static64.sh in docs * Fixed a bug in netdata-installer.sh * Revert changes to daemon/main.c (testing onyl) * Update docs/anonymous-statistics.md Co-Authored-By: Mansour Behabadi <57921115+ncmans@users.noreply.github.com> Co-authored-by: Mansour Behabadi <57921115+ncmans@users.noreply.github.com>
Diffstat (limited to 'packaging/docker')
-rw-r--r--packaging/docker/Dockerfile2
-rwxr-xr-xpackaging/docker/run.sh14
2 files changed, 8 insertions, 8 deletions
diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile
index e8d36c159a..5c61c08d2f 100644
--- a/packaging/docker/Dockerfile
+++ b/packaging/docker/Dockerfile
@@ -68,7 +68,7 @@ ARG NETDATA_GID=201
ENV DOCKER_GRP netdata
ENV DOCKER_USR netdata
# If DO_NOT_TRACK is set, it will disable anonymous stats collection and reporting
-#ENV DO_NOT_TRACK
+#ENV DO_NOT_TRACK=1
RUN \
# fping from alpine apk is on a different location. Moving it.
mv /usr/sbin/fping /usr/local/bin/fping && \
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh
index de317927b8..70952b10b7 100755
--- a/packaging/docker/run.sh
+++ b/packaging/docker/run.sh
@@ -7,21 +7,21 @@
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
set -e
-if [ -n "${DO_NOT_TRACK+x}" ]; then
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
touch /etc/netdata/.opt-out-from-anonymous-statistics
fi
echo "Netdata entrypoint script starting"
if [ ${RESCRAMBLE+x} ]; then
- echo "Reinstalling all packages to get the latest Polymorphic Linux scramble"
- apk upgrade --update-cache --available
+ echo "Reinstalling all packages to get the latest Polymorphic Linux scramble"
+ apk upgrade --update-cache --available
fi
if [ -n "${PGID}" ]; then
- echo "Creating docker group ${PGID}"
- addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"
- echo "Assign netdata user to docker group ${PGID}"
- usermod -a -G ${PGID} ${DOCKER_USR} || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
+ echo "Creating docker group ${PGID}"
+ addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"
+ echo "Assign netdata user to docker group ${PGID}"
+ usermod -a -G "${PGID}" "${DOCKER_USR}" || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
fi
exec /usr/sbin/netdata -u "${DOCKER_USR}" -D -s /host -p "${NETDATA_PORT}" -W set web "web files group" root -W set web "web files owner" root "$@"