summaryrefslogtreecommitdiffstats
path: root/packaging
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
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')
-rw-r--r--packaging/docker/Dockerfile2
-rwxr-xr-xpackaging/docker/run.sh14
-rwxr-xr-xpackaging/installer/kickstart-static64.sh6
-rw-r--r--packaging/installer/methods/kickstart-64.md2
-rwxr-xr-xpackaging/makeself/install-or-update.sh4
-rw-r--r--packaging/makeself/makeself-help-header.txt4
6 files changed, 21 insertions, 11 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 "$@"
diff --git a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh
index eb34314d7c..7f032bbfbe 100755
--- a/packaging/installer/kickstart-static64.sh
+++ b/packaging/installer/kickstart-static64.sh
@@ -8,7 +8,7 @@
# --non-interactive do not wait for input
# --dont-start-it do not start netdata after install
# --stable-channel Use the stable release channel, rather than the nightly to fetch sources
-# --disable-telemetry Opt-out of anonymous telemetry program
+# --disable-telemetry Opt-out of anonymous telemetry program (DO_NOT_TRACK=1)
# --local-files Use a manually provided tarball for the installation
#
# ---------------------------------------------------------------------------------------------------------------------
@@ -231,6 +231,10 @@ while [ -n "${1}" ]; do
fi
done
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
+ NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }--disable-telemtry"
+fi
+
# ---------------------------------------------------------------------------------------------------------------------
TMPDIR=$(create_tmp_directory)
cd "${TMPDIR}" || exit 1
diff --git a/packaging/installer/methods/kickstart-64.md b/packaging/installer/methods/kickstart-64.md
index 14c8abc700..6660b43cfa 100644
--- a/packaging/installer/methods/kickstart-64.md
+++ b/packaging/installer/methods/kickstart-64.md
@@ -68,7 +68,7 @@ To use `md5sum` to verify the intregity of the `kickstart-static64.sh` script yo
command above, run the following:
```bash
-[ "dfa84c3b5e6fd8975555d68f46eccdde" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
+[ "788cfe179615158331877a577c140486" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
```
If the script is valid, this command will return `OK, VALID`.
diff --git a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh
index 4791ea2e92..4771f8ee25 100755
--- a/packaging/makeself/install-or-update.sh
+++ b/packaging/makeself/install-or-update.sh
@@ -57,6 +57,10 @@ while [ "${1}" ]; do
shift 1
done
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
+ REINSTALL_OPTIONS="${REINSTALL_OPTIONS} --disable-telemtry"
+fi
+
deleted_stock_configs=0
if [ ! -f "etc/netdata/.installer-cleanup-of-stock-configs-done" ]; then
diff --git a/packaging/makeself/makeself-help-header.txt b/packaging/makeself/makeself-help-header.txt
index d561f818f9..9a8a3ec336 100644
--- a/packaging/makeself/makeself-help-header.txt
+++ b/packaging/makeself/makeself-help-header.txt
@@ -44,4 +44,6 @@
https://github.com/netdata/netdata/blob/master/LICENSE.md
Anonymous stat collection and reporting to Google Analytics is enabled
- by default. To disable, pass --disable-telemetry option to the installer.
+ by default. To disable, pass --disable-telemetry option to the installer
+ or export the environment variable DO_NOT_TRACK to a non-zero or non-empty
+ value (e.g export DO_NOT_TRACK=1).