Add anon tracking notice for installers (#7437)
* Show notice of anonymous data collection * Add DO_NOT_TRACK env var to docker run script * Add disable-telemetry option to kickstart-static64 * Check if DO_NOT_TRACK is set
Mansour Behabadi committed
Dec 20, 2019 at 07:06 UTC
4edc7e907e3285aa9801e8caf651450e4fd8d2be
7 files changed
+35
-2
netdata-installer.sh
+10
@@ -289,6 +289,16 @@ cat <<BANNER3
289
290
BANNER3
291
292
+if [ -z "$NETDATA_DISABLE_TELEMETRY" ]; then
293
+ cat <<BANNER4
294
+
295
+ ${TPUT_YELLOW}${TPUT_BOLD}NOTE${TPUT_RESET}:
296
+ Anonymous usage stats will be collected and sent to Google Analytics.
297
+ To opt-out, pass --disable-telemetry option to the installer.
298
+
299
+BANNER4
300
+fi
301
+
302
have_autotools=
303
if [ "$(type autoreconf 2>/dev/null)" ]; then
304
autoconf_maj_min() {
packaging/docker/Dockerfile
+2
@@ -60,6 +60,8 @@ ARG NETDATA_UID=201
60
ARG NETDATA_GID=201
61
ENV DOCKER_GRP netdata
62
ENV DOCKER_USR netdata
63
+# If DO_NOT_TRACK is set, it will disable anonymous stats collection and reporting
64
+#ENV DO_NOT_TRACK
65
RUN \
66
# provide judy installation to base image
67
apk add make alpine-sdk shadow && \
packaging/docker/run.sh
+4
@@ -7,6 +7,10 @@
7
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
8
set -e
9
10
+if [ -n "${DO_NOT_TRACK+x}" ]; then
11
+ touch /etc/netdata/.opt-out-from-anonymous-statistics
12
+fi
13
+
14
echo "Netdata entrypoint script starting"
15
if [ ${RESCRAMBLE+x} ]; then
16
echo "Reinstalling all packages to get the latest Polymorphic Linux scramble"
packaging/installer/README.md
+1
-1
@@ -106,7 +106,7 @@ This script installs Netdata at `/opt/netdata`.
106
Verify the integrity of the script with this:
107
108
```bash
109
-[ "8ad43ff960bf6f2487233682909f7a87" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
109
+[ "23e0f38dfb9d517be16393c3ed1f88bd" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
110
```
111
112
*It should print `OK, VALID` if the script is the one we ship.*
packaging/installer/kickstart-static64.sh
+5
-1
@@ -8,7 +8,8 @@
8
# --non-interactive do not wait for input
9
# --dont-start-it do not start netdata after install
10
# --stable-channel Use the stable release channel, rather than the nightly to fetch sources
11
-# --local-files Use a manually provided tarball for the installation
11
+# --disable-telemetry Opt-out of anonymous telemetry program
12
+# --local-files Use a manually provided tarball for the installation
13
#
14
# ---------------------------------------------------------------------------------------------------------------------
15
# library functions copied from packaging/installer/functions.sh
@@ -200,6 +201,9 @@ while [ -n "${1}" ]; do
201
RELEASE_CHANNEL="stable"
202
NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
203
shift 1
204
+ elif [ "${1}" = "--disable-telemetry" ]; then
205
+ NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
206
+ shift 1
207
elif [ "${1}" = "--local-files" ]; then
208
shift 1
209
if [ -z "${1}" ]; then
packaging/makeself/install-or-update.sh
+10
@@ -32,6 +32,7 @@ while [ "${1}" ]; do
32
"--dont-start-it") STARTIT=0;;
33
"--auto-update"|"-u") AUTOUPDATE=1;;
34
"--stable-channel") RELEASE_CHANNEL="stable";;
35
+ "--disable-telemetry") DISABLE_TELEMETRY=1;;
36
*) echo >&2 "Unknown option '${1}'. Ignoring it.";;
37
esac
38
shift 1
@@ -134,6 +135,15 @@ progress "Install logrotate configuration for netdata"
135
136
install_netdata_logrotate || run_failed "Cannot install logrotate file for netdata."
137
138
+# -----------------------------------------------------------------------------
139
+progress "Telemetry configuration"
140
+
141
+# Opt-out from telemetry program
142
+if [ -n "${NETDATA_DISABLE_TELEMETRY+x}" ]; then
143
+ run touch "${NETDATA_USER_CONFIG_DIR}/.opt-out-from-anonymous-statistics"
144
+else
145
+ printf "You can opt out from anonymous statistics via the --disable-telemetry option, or by creating an empty file ${NETDATA_USER_CONFIG_DIR}/.opt-out-from-anonymous-statistics \n\n"
146
+fi
147
148
# -----------------------------------------------------------------------------
149
progress "Install netdata at system init"
packaging/makeself/makeself-help-header.txt
+3
@@ -42,3 +42,6 @@
42
netdata re-distributes a lot of open source software components.
43
Check its full license at:
44
https://github.com/netdata/netdata/blob/master/LICENSE.md
45
+
46
+ Anonymous stat collection and reporting to Google Analytics is enabled
47
+ by default. To disable, pass --disable-telemetry option to the installer.