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>
James Mills committed
Jan 30, 2020 at 09:49 UTC
38ad89fc2bc6ec46e88a3428d81e29e0f46c4b18
10 files changed
+124
-111
daemon/anonymous-statistics.sh.in
+40
-40
@@ -7,8 +7,8 @@
7
# ACTION_DATA -- fmt, args passed to fatal
8
# - START - netdata started
9
# ACTION_DATA -- nan
10
-# - EXIT - installation action
11
-# ACTION_DATA -- ret value of
10
+# - EXIT - installation action
11
+# ACTION_DATA -- ret value of
12
13
ACTION="${1}"
14
ACTION_RESULT="${2}"
@@ -18,8 +18,8 @@ ACTION_DATA=$(echo "${ACTION_DATA}" | tr '"' "'")
18
# -------------------------------------------------------------------------------------------------
19
# check opt-out
20
21
-if [ -f "@configdir_POST@/.opt-out-from-anonymous-statistics" ]; then
22
- exit 0
21
+if [ -f "@configdir_POST@/.opt-out-from-anonymous-statistics" ] || [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
22
+ exit 0
23
fi
24
25
# Shorten version for easier reporting
@@ -29,43 +29,43 @@ NETDATA_VERSION=$(echo "${NETDATA_VERSION}" | sed 's/-.*//g' | tr -d 'v')
29
# send the anonymous statistics to GA
30
# https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
31
# The maximum index for a cd parameter is 20 so we have effectively run out.
32
-if [ -n "$(command -v curl 2>/dev/null)" ]; then
33
- curl -X POST -Ss --max-time 2 \
34
- --data "v=1" \
35
- --data "tid=UA-64295674-3" \
36
- --data "aip=1" \
37
- --data "ds=shell" \
38
- --data-urlencode "cid=${NETDATA_REGISTRY_UNIQUE_ID}" \
39
- --data-urlencode "cs=${NETDATA_REGISTRY_UNIQUE_ID}" \
40
- --data "t=event" \
41
- --data "ni=1" \
42
- --data "an=anonymous-statistics" \
43
- --data-urlencode "av=${NETDATA_VERSION}" \
44
- --data-urlencode "ec=${ACTION}" \
45
- --data-urlencode "ea=${ACTION_RESULT}" \
46
- --data-urlencode "el=${ACTION_DATA}" \
47
- --data-urlencode "cd1=${NETDATA_HOST_OS_NAME}" \
48
- --data-urlencode "cd2=${NETDATA_HOST_OS_ID}" \
49
- --data-urlencode "cd3=${NETDATA_HOST_OS_ID_LIKE}" \
50
- --data-urlencode "cd4=${NETDATA_HOST_OS_VERSION}" \
51
- --data-urlencode "cd5=${NETDATA_HOST_OS_VERSION_ID}" \
52
- --data-urlencode "cd6=${NETDATA_HOST_OS_DETECTION}" \
53
- --data-urlencode "cd7=${NETDATA_SYSTEM_KERNEL_NAME}" \
54
- --data-urlencode "cd8=${NETDATA_SYSTEM_KERNEL_VERSION}" \
55
- --data-urlencode "cd9=${NETDATA_SYSTEM_ARCHITECTURE}" \
56
- --data-urlencode "cd10=${NETDATA_SYSTEM_VIRTUALIZATION}" \
57
- --data-urlencode "cd11=${NETDATA_SYSTEM_VIRT_DETECTION}" \
58
- --data-urlencode "cd12=${NETDATA_SYSTEM_CONTAINER}" \
59
- --data-urlencode "cd13=${NETDATA_SYSTEM_CONTAINER_DETECTION}" \
60
- --data-urlencode "cd14=${NETDATA_CONTAINER_OS_NAME}" \
61
- --data-urlencode "cd15=${NETDATA_CONTAINER_OS_ID}" \
62
- --data-urlencode "cd16=${NETDATA_CONTAINER_OS_ID_LIKE}" \
63
- --data-urlencode "cd17=${NETDATA_CONTAINER_OS_VERSION}" \
64
- --data-urlencode "cd18=${NETDATA_CONTAINER_OS_VERSION_ID}" \
65
- --data-urlencode "cd19=${NETDATA_CONTAINER_OS_DETECTION}" \
66
- "https://www.google-analytics.com/collect" >/dev/null 2>&1
32
+if [ -n "$(command -v curl 2> /dev/null)" ]; then
33
+ curl -X POST -Ss --max-time 2 \
34
+ --data "v=1" \
35
+ --data "tid=UA-64295674-3" \
36
+ --data "aip=1" \
37
+ --data "ds=shell" \
38
+ --data-urlencode "cid=${NETDATA_REGISTRY_UNIQUE_ID}" \
39
+ --data-urlencode "cs=${NETDATA_REGISTRY_UNIQUE_ID}" \
40
+ --data "t=event" \
41
+ --data "ni=1" \
42
+ --data "an=anonymous-statistics" \
43
+ --data-urlencode "av=${NETDATA_VERSION}" \
44
+ --data-urlencode "ec=${ACTION}" \
45
+ --data-urlencode "ea=${ACTION_RESULT}" \
46
+ --data-urlencode "el=${ACTION_DATA}" \
47
+ --data-urlencode "cd1=${NETDATA_HOST_OS_NAME}" \
48
+ --data-urlencode "cd2=${NETDATA_HOST_OS_ID}" \
49
+ --data-urlencode "cd3=${NETDATA_HOST_OS_ID_LIKE}" \
50
+ --data-urlencode "cd4=${NETDATA_HOST_OS_VERSION}" \
51
+ --data-urlencode "cd5=${NETDATA_HOST_OS_VERSION_ID}" \
52
+ --data-urlencode "cd6=${NETDATA_HOST_OS_DETECTION}" \
53
+ --data-urlencode "cd7=${NETDATA_SYSTEM_KERNEL_NAME}" \
54
+ --data-urlencode "cd8=${NETDATA_SYSTEM_KERNEL_VERSION}" \
55
+ --data-urlencode "cd9=${NETDATA_SYSTEM_ARCHITECTURE}" \
56
+ --data-urlencode "cd10=${NETDATA_SYSTEM_VIRTUALIZATION}" \
57
+ --data-urlencode "cd11=${NETDATA_SYSTEM_VIRT_DETECTION}" \
58
+ --data-urlencode "cd12=${NETDATA_SYSTEM_CONTAINER}" \
59
+ --data-urlencode "cd13=${NETDATA_SYSTEM_CONTAINER_DETECTION}" \
60
+ --data-urlencode "cd14=${NETDATA_CONTAINER_OS_NAME}" \
61
+ --data-urlencode "cd15=${NETDATA_CONTAINER_OS_ID}" \
62
+ --data-urlencode "cd16=${NETDATA_CONTAINER_OS_ID_LIKE}" \
63
+ --data-urlencode "cd17=${NETDATA_CONTAINER_OS_VERSION}" \
64
+ --data-urlencode "cd18=${NETDATA_CONTAINER_OS_VERSION_ID}" \
65
+ --data-urlencode "cd19=${NETDATA_CONTAINER_OS_DETECTION}" \
66
+ "https://www.google-analytics.com/collect" > /dev/null 2>&1
67
else
68
- wget -q -O - --timeout=1 "https://www.google-analytics.com/collect?\
68
+ wget -q -O - --timeout=1 "https://www.google-analytics.com/collect?\
69
&v=1\
70
&tid=UA-64295674-3\
71
&aip=1\
docs/anonymous-statistics.md
+2
-1
@@ -78,7 +78,8 @@ installation, including manual, offline, and macOS installations. Create the fil
78
79
**Pass the option `--disable-telemetry` to any of the installer scripts in the [installation
80
docs](../packaging/installer/README.md).** You can append this option during the initial installation or a manual
81
-update.
81
+update. You can also export the environment variable `DO_NOT_TRACK` with a non-zero or non-empty value
82
+(e.g: `export DO_NOT_TRACK=1`).
83
84
When using Docker, **set your `DO_NOT_TRACK` environment variable to `1`.** You can set this variable with the following
85
command: `export DO_NOT_TRACK=1`. When creating a container using Netdata's [Docker
netdata-installer.sh
+8
-2
@@ -179,7 +179,7 @@ USAGE: ${PROGRAM} [options]
179
--zlib-is-really-here or
180
--libs-are-really-here If you get errors about missing zlib or libuuid but you know it is available, you might
181
have a broken pkg-config. Use this option to proceed without checking pkg-config.
182
- --disable-telemetry Use this flag to opt-out from our anonymous telemetry progam.
182
+ --disable-telemetry Use this flag to opt-out from our anonymous telemetry progam. (DO_NOT_TRACK=1)
183
184
Netdata will by default be compiled with gcc optimization -O2
185
If you need to pass different CFLAGS, use something like this:
@@ -304,7 +304,9 @@ if [ -z "$NETDATA_DISABLE_TELEMETRY" ]; then
304
305
${TPUT_YELLOW}${TPUT_BOLD}NOTE${TPUT_RESET}:
306
Anonymous usage stats will be collected and sent to Google Analytics.
307
- To opt-out, pass --disable-telemetry option to the installer.
307
+ To opt-out, pass --disable-telemetry option to the installer or export
308
+ the enviornment variable DO_NOT_TRACK to a non-zero or non-empty value
309
+ (e.g: export DO_NOT_TRACK=1).
310
311
BANNER4
312
fi
@@ -885,6 +887,10 @@ install_go
887
# -----------------------------------------------------------------------------
888
progress "Telemetry configuration"
889
890
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
891
+ NETDATA_DISABLE_TELEMETRY=1
892
+fi
893
+
894
# Opt-out from telemetry program
895
if [ -n "${NETDATA_DISABLE_TELEMETRY+x}" ]; then
896
run touch "${NETDATA_USER_CONFIG_DIR}/.opt-out-from-anonymous-statistics"
packaging/docker/Dockerfile
+1
-1
@@ -68,7 +68,7 @@ ARG NETDATA_GID=201
68
ENV DOCKER_GRP netdata
69
ENV DOCKER_USR netdata
70
# If DO_NOT_TRACK is set, it will disable anonymous stats collection and reporting
71
-#ENV DO_NOT_TRACK
71
+#ENV DO_NOT_TRACK=1
72
RUN \
73
# fping from alpine apk is on a different location. Moving it.
74
mv /usr/sbin/fping /usr/local/bin/fping && \
packaging/docker/run.sh
+7
-7
@@ -7,21 +7,21 @@
7
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
8
set -e
9
10
-if [ -n "${DO_NOT_TRACK+x}" ]; then
10
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; 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"
17
- apk upgrade --update-cache --available
16
+ echo "Reinstalling all packages to get the latest Polymorphic Linux scramble"
17
+ apk upgrade --update-cache --available
18
fi
19
20
if [ -n "${PGID}" ]; then
21
- echo "Creating docker group ${PGID}"
22
- addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"
23
- echo "Assign netdata user to docker group ${PGID}"
24
- usermod -a -G ${PGID} ${DOCKER_USR} || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
21
+ echo "Creating docker group ${PGID}"
22
+ addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"
23
+ echo "Assign netdata user to docker group ${PGID}"
24
+ usermod -a -G "${PGID}" "${DOCKER_USR}" || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
25
fi
26
27
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 "$@"
packaging/installer/kickstart-static64.sh
+5
-1
@@ -8,7 +8,7 @@
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
-# --disable-telemetry Opt-out of anonymous telemetry program
11
+# --disable-telemetry Opt-out of anonymous telemetry program (DO_NOT_TRACK=1)
12
# --local-files Use a manually provided tarball for the installation
13
#
14
# ---------------------------------------------------------------------------------------------------------------------
@@ -231,6 +231,10 @@ while [ -n "${1}" ]; do
231
fi
232
done
233
234
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
235
+ NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }--disable-telemtry"
236
+fi
237
+
238
# ---------------------------------------------------------------------------------------------------------------------
239
TMPDIR=$(create_tmp_directory)
240
cd "${TMPDIR}" || exit 1
packaging/installer/methods/kickstart-64.md
+1
-1
@@ -68,7 +68,7 @@ To use `md5sum` to verify the intregity of the `kickstart-static64.sh` script yo
68
command above, run the following:
69
70
```bash
71
-[ "dfa84c3b5e6fd8975555d68f46eccdde" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
71
+[ "788cfe179615158331877a577c140486" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
72
```
73
74
If the script is valid, this command will return `OK, VALID`.
packaging/makeself/install-or-update.sh
+4
@@ -57,6 +57,10 @@ while [ "${1}" ]; do
57
shift 1
58
done
59
60
+if [ ! "$DO_NOT_TRACK" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
61
+ REINSTALL_OPTIONS="${REINSTALL_OPTIONS} --disable-telemtry"
62
+fi
63
+
64
deleted_stock_configs=0
65
if [ ! -f "etc/netdata/.installer-cleanup-of-stock-configs-done" ]; then
66
packaging/makeself/makeself-help-header.txt
+3
-1
@@ -44,4 +44,6 @@
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.
47
+ by default. To disable, pass --disable-telemetry option to the installer
48
+ or export the environment variable DO_NOT_TRACK to a non-zero or non-empty
49
+ value (e.g export DO_NOT_TRACK=1).
web/server/web_client.h
+53
-57
@@ -6,24 +6,22 @@
6
#include "libnetdata/libnetdata.h"
7
8
#ifdef NETDATA_WITH_ZLIB
9
-extern int web_enable_gzip,
10
- web_gzip_level,
11
- web_gzip_strategy;
9
+extern int web_enable_gzip, web_gzip_level, web_gzip_strategy;
10
#endif /* NETDATA_WITH_ZLIB */
11
12
// HTTP_CODES 2XX Success
15
-#define HTTP_RESP_OK 200
13
+#define HTTP_RESP_OK 200
14
15
// HTTP_CODES 3XX Redirections
18
-#define HTTP_RESP_MOVED_PERM 301
19
-#define HTTP_RESP_REDIR_TEMP 307
20
-#define HTTP_RESP_REDIR_PERM 308
16
+#define HTTP_RESP_MOVED_PERM 301
17
+#define HTTP_RESP_REDIR_TEMP 307
18
+#define HTTP_RESP_REDIR_PERM 308
19
20
// HTTP_CODES 4XX Client Errors
23
-#define HTTP_RESP_BAD_REQUEST 400
24
-#define HTTP_RESP_FORBIDDEN 403
25
-#define HTTP_RESP_NOT_FOUND 404
26
-#define HTTP_RESP_PRECOND_FAIL 412
21
+#define HTTP_RESP_BAD_REQUEST 400
22
+#define HTTP_RESP_FORBIDDEN 403
23
+#define HTTP_RESP_NOT_FOUND 404
24
+#define HTTP_RESP_PRECOND_FAIL 412
25
26
// HTTP_CODES 5XX Server Errors
27
#define HTTP_RESP_INTERNAL_SERVER_ERROR 500
@@ -33,10 +31,10 @@ extern int respect_web_browser_do_not_track_policy;
31
extern char *web_x_frame_options;
32
33
typedef enum web_client_mode {
36
- WEB_CLIENT_MODE_NORMAL = 0,
37
- WEB_CLIENT_MODE_FILECOPY = 1,
38
- WEB_CLIENT_MODE_OPTIONS = 2,
39
- WEB_CLIENT_MODE_STREAM = 3
34
+ WEB_CLIENT_MODE_NORMAL = 0,
35
+ WEB_CLIENT_MODE_FILECOPY = 1,
36
+ WEB_CLIENT_MODE_OPTIONS = 2,
37
+ WEB_CLIENT_MODE_STREAM = 3
38
} WEB_CLIENT_MODE;
39
40
typedef enum {
@@ -52,20 +50,20 @@ typedef enum {
50
} HTTP_VALIDATION;
51
52
typedef enum web_client_flags {
55
- WEB_CLIENT_FLAG_DEAD = 1 << 1, // if set, this client is dead
53
+ WEB_CLIENT_FLAG_DEAD = 1 << 1, // if set, this client is dead
54
57
- WEB_CLIENT_FLAG_KEEPALIVE = 1 << 2, // if set, the web client will be re-used
55
+ WEB_CLIENT_FLAG_KEEPALIVE = 1 << 2, // if set, the web client will be re-used
56
59
- WEB_CLIENT_FLAG_WAIT_RECEIVE = 1 << 3, // if set, we are waiting more input data
60
- WEB_CLIENT_FLAG_WAIT_SEND = 1 << 4, // if set, we have data to send to the client
57
+ WEB_CLIENT_FLAG_WAIT_RECEIVE = 1 << 3, // if set, we are waiting more input data
58
+ WEB_CLIENT_FLAG_WAIT_SEND = 1 << 4, // if set, we have data to send to the client
59
62
- WEB_CLIENT_FLAG_DO_NOT_TRACK = 1 << 5, // if set, we should not set cookies on this client
60
+ WEB_CLIENT_FLAG_DO_NOT_TRACK = 1 << 5, // if set, we should not set cookies on this client
61
WEB_CLIENT_FLAG_TRACKING_REQUIRED = 1 << 6, // if set, we need to send cookies
62
65
- WEB_CLIENT_FLAG_TCP_CLIENT = 1 << 7, // if set, the client is using a TCP socket
66
- WEB_CLIENT_FLAG_UNIX_CLIENT = 1 << 8, // if set, the client is using a UNIX socket
63
+ WEB_CLIENT_FLAG_TCP_CLIENT = 1 << 7, // if set, the client is using a TCP socket
64
+ WEB_CLIENT_FLAG_UNIX_CLIENT = 1 << 8, // if set, the client is using a UNIX socket
65
68
- WEB_CLIENT_FLAG_DONT_CLOSE_SOCKET = 1 << 9, // don't close the socket when cleaning up (static-threaded web server)
66
+ WEB_CLIENT_FLAG_DONT_CLOSE_SOCKET = 1 << 9, // don't close the socket when cleaning up (static-threaded web server)
67
} WEB_CLIENT_FLAGS;
68
69
//#ifdef HAVE_C___ATOMIC
@@ -74,7 +72,7 @@ typedef enum web_client_flags {
72
//#define web_client_flag_clear(w, flag) __atomic_and_fetch(&((w)->flags), ~flag, __ATOMIC_SEQ_CST)
73
//#else
74
#define web_client_flag_check(w, flag) ((w)->flags & (flag))
77
-#define web_client_flag_set(w, flag) (w)->flags |= flag
75
+#define web_client_flag_set(w, flag) (w)->flags |= flag
76
#define web_client_flag_clear(w, flag) (w)->flags &= ~flag
77
//#endif
78
@@ -118,59 +116,58 @@ typedef enum web_client_flags {
116
#define NETDATA_WEB_REQUEST_MAX_SIZE 16384
117
118
struct response {
121
- BUFFER *header; // our response header
122
- BUFFER *header_output; // internal use
123
- BUFFER *data; // our response data buffer
119
+ BUFFER *header; // our response header
120
+ BUFFER *header_output; // internal use
121
+ BUFFER *data; // our response data buffer
122
125
- int code; // the HTTP response code
123
+ int code; // the HTTP response code
124
127
- size_t rlen; // if non-zero, the excepted size of ifd (input of firecopy)
128
- size_t sent; // current data length sent to output
125
+ size_t rlen; // if non-zero, the excepted size of ifd (input of firecopy)
126
+ size_t sent; // current data length sent to output
127
130
- int zoutput; // if set to 1, web_client_send() will send compressed data
128
+ int zoutput; // if set to 1, web_client_send() will send compressed data
129
#ifdef NETDATA_WITH_ZLIB
132
- z_stream zstream; // zlib stream for sending compressed output to client
130
+ z_stream zstream; // zlib stream for sending compressed output to client
131
Bytef zbuffer[NETDATA_WEB_RESPONSE_ZLIB_CHUNK_SIZE]; // temporary buffer for storing compressed output
134
- size_t zsent; // the compressed bytes we have sent to the client
135
- size_t zhave; // the compressed bytes that we have received from zlib
136
- unsigned int zinitialized:1;
132
+ size_t zsent; // the compressed bytes we have sent to the client
133
+ size_t zhave; // the compressed bytes that we have received from zlib
134
+ unsigned int zinitialized : 1;
135
#endif /* NETDATA_WITH_ZLIB */
138
-
136
};
137
138
struct web_client {
139
unsigned long long id;
140
144
- WEB_CLIENT_FLAGS flags; // status flags for the client
145
- WEB_CLIENT_MODE mode; // the operational mode of the client
146
- WEB_CLIENT_ACL acl; // the access list of the client
147
- int port_acl; // the operations permitted on the port the client connected to
148
- char *auth_bearer_token; // the Bearer auth token (if sent)
141
+ WEB_CLIENT_FLAGS flags; // status flags for the client
142
+ WEB_CLIENT_MODE mode; // the operational mode of the client
143
+ WEB_CLIENT_ACL acl; // the access list of the client
144
+ int port_acl; // the operations permitted on the port the client connected to
145
+ char *auth_bearer_token; // the Bearer auth token (if sent)
146
size_t header_parse_tries;
147
size_t header_parse_last_size;
148
152
- int tcp_cork; // 1 = we have a cork on the socket
149
+ int tcp_cork; // 1 = we have a cork on the socket
150
151
int ifd;
152
int ofd;
153
157
- char client_ip[INET6_ADDRSTRLEN]; // Defined buffer sizes include null-terminators
154
+ char client_ip[INET6_ADDRSTRLEN]; // Defined buffer sizes include null-terminators
155
char client_port[NI_MAXSERV];
156
char server_host[NI_MAXHOST];
157
char client_host[NI_MAXHOST];
158
162
- char decoded_url[NETDATA_WEB_REQUEST_URL_SIZE + 1]; // we decode the URL in this buffer
163
- char decoded_query_string[NETDATA_WEB_REQUEST_URL_SIZE + 1]; // we decode the Query String in this buffer
164
- char last_url[NETDATA_WEB_REQUEST_URL_SIZE+1]; // we keep a copy of the decoded URL here
159
+ char decoded_url[NETDATA_WEB_REQUEST_URL_SIZE + 1]; // we decode the URL in this buffer
160
+ char decoded_query_string[NETDATA_WEB_REQUEST_URL_SIZE + 1]; // we decode the Query String in this buffer
161
+ char last_url[NETDATA_WEB_REQUEST_URL_SIZE + 1]; // we keep a copy of the decoded URL here
162
size_t url_path_length;
166
- char separator; // This value can be either '?' or 'f'
163
+ char separator; // This value can be either '?' or 'f'
164
char *url_search_path; //A pointer to the search path sent by the client
165
166
struct timeval tv_in, tv_ready;
167
171
- char cookie1[NETDATA_WEB_REQUEST_COOKIE_SIZE+1];
172
- char cookie2[NETDATA_WEB_REQUEST_COOKIE_SIZE+1];
173
- char origin[NETDATA_WEB_REQUEST_ORIGIN_HEADER_SIZE+1];
168
+ char cookie1[NETDATA_WEB_REQUEST_COOKIE_SIZE + 1];
169
+ char cookie2[NETDATA_WEB_REQUEST_COOKIE_SIZE + 1];
170
+ char origin[NETDATA_WEB_REQUEST_ORIGIN_HEADER_SIZE + 1];
171
char *user_agent;
172
173
struct response response;
@@ -179,22 +176,21 @@ struct web_client {
176
size_t stats_sent_bytes;
177
178
// cache of web_client allocations
182
- struct web_client *prev; // maintain a linked list of web clients
183
- struct web_client *next; // for the web servers that need it
179
+ struct web_client *prev; // maintain a linked list of web clients
180
+ struct web_client *next; // for the web servers that need it
181
182
// MULTI-THREADED WEB SERVER MEMBERS
186
- netdata_thread_t thread; // the thread servicing this client
187
- volatile int running; // 1 when the thread runs, 0 otherwise
183
+ netdata_thread_t thread; // the thread servicing this client
184
+ volatile int running; // 1 when the thread runs, 0 otherwise
185
186
// STATIC-THREADED WEB SERVER MEMBERS
190
- size_t pollinfo_slot; // POLLINFO slot of the web client
191
- size_t pollinfo_filecopy_slot; // POLLINFO slot of the file read
187
+ size_t pollinfo_slot; // POLLINFO slot of the web client
188
+ size_t pollinfo_filecopy_slot; // POLLINFO slot of the file read
189
#ifdef ENABLE_HTTPS
190
struct netdata_ssl ssl;
191
#endif
192
};
193
197
-
194
extern uid_t web_files_uid(void);
195
extern uid_t web_files_gid(void);
196