mirror of
https://github.com/netdata/netdata.git
synced 2025-05-07 10:31:02 +00:00
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>
This commit is contained in:
parent
2979efe031
commit
38ad89fc2b
10 changed files with 124 additions and 111 deletions
|
@ -18,7 +18,7 @@ ACTION_DATA=$(echo "${ACTION_DATA}" | tr '"' "'")
|
|||
# -------------------------------------------------------------------------------------------------
|
||||
# check opt-out
|
||||
|
||||
if [ -f "@configdir_POST@/.opt-out-from-anonymous-statistics" ]; then
|
||||
if [ -f "@configdir_POST@/.opt-out-from-anonymous-statistics" ] || [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
@ -78,7 +78,8 @@ installation, including manual, offline, and macOS installations. Create the fil
|
|||
|
||||
**Pass the option `--disable-telemetry` to any of the installer scripts in the [installation
|
||||
docs](../packaging/installer/README.md).** You can append this option during the initial installation or a manual
|
||||
update.
|
||||
update. You can also export the environment variable `DO_NOT_TRACK` with a non-zero or non-empty value
|
||||
(e.g: `export DO_NOT_TRACK=1`).
|
||||
|
||||
When using Docker, **set your `DO_NOT_TRACK` environment variable to `1`.** You can set this variable with the following
|
||||
command: `export DO_NOT_TRACK=1`. When creating a container using Netdata's [Docker
|
||||
|
|
|
@ -179,7 +179,7 @@ USAGE: ${PROGRAM} [options]
|
|||
--zlib-is-really-here or
|
||||
--libs-are-really-here If you get errors about missing zlib or libuuid but you know it is available, you might
|
||||
have a broken pkg-config. Use this option to proceed without checking pkg-config.
|
||||
--disable-telemetry Use this flag to opt-out from our anonymous telemetry progam.
|
||||
--disable-telemetry Use this flag to opt-out from our anonymous telemetry progam. (DO_NOT_TRACK=1)
|
||||
|
||||
Netdata will by default be compiled with gcc optimization -O2
|
||||
If you need to pass different CFLAGS, use something like this:
|
||||
|
@ -304,7 +304,9 @@ if [ -z "$NETDATA_DISABLE_TELEMETRY" ]; then
|
|||
|
||||
${TPUT_YELLOW}${TPUT_BOLD}NOTE${TPUT_RESET}:
|
||||
Anonymous usage stats will be collected and sent to Google Analytics.
|
||||
To opt-out, pass --disable-telemetry option to the installer.
|
||||
To opt-out, pass --disable-telemetry option to the installer or export
|
||||
the enviornment variable DO_NOT_TRACK to a non-zero or non-empty value
|
||||
(e.g: export DO_NOT_TRACK=1).
|
||||
|
||||
BANNER4
|
||||
fi
|
||||
|
@ -885,6 +887,10 @@ install_go
|
|||
# -----------------------------------------------------------------------------
|
||||
progress "Telemetry configuration"
|
||||
|
||||
if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
|
||||
NETDATA_DISABLE_TELEMETRY=1
|
||||
fi
|
||||
|
||||
# Opt-out from telemetry program
|
||||
if [ -n "${NETDATA_DISABLE_TELEMETRY+x}" ]; then
|
||||
run touch "${NETDATA_USER_CONFIG_DIR}/.opt-out-from-anonymous-statistics"
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# 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
|
||||
|
||||
|
@ -21,7 +21,7 @@ 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}"
|
||||
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 "$@"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
#include "libnetdata/libnetdata.h"
|
||||
|
||||
#ifdef NETDATA_WITH_ZLIB
|
||||
extern int web_enable_gzip,
|
||||
web_gzip_level,
|
||||
web_gzip_strategy;
|
||||
extern int web_enable_gzip, web_gzip_level, web_gzip_strategy;
|
||||
#endif /* NETDATA_WITH_ZLIB */
|
||||
|
||||
// HTTP_CODES 2XX Success
|
||||
|
@ -135,7 +133,6 @@ struct response {
|
|||
size_t zhave; // the compressed bytes that we have received from zlib
|
||||
unsigned int zinitialized : 1;
|
||||
#endif /* NETDATA_WITH_ZLIB */
|
||||
|
||||
};
|
||||
|
||||
struct web_client {
|
||||
|
@ -194,7 +191,6 @@ struct web_client {
|
|||
#endif
|
||||
};
|
||||
|
||||
|
||||
extern uid_t web_files_uid(void);
|
||||
extern uid_t web_files_gid(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue