Skip to content

Commit

Permalink
Parse telemetry ini config as boolean and make telemetry opt-in. (#553)
Browse files Browse the repository at this point in the history
In issue #504, it was brought to attention that while the command line
arg for enabling telemetry was boolean, the ini config in et.cfg needed
to be an int to change the value.  SimpleIni has a GetBoolValue function
that treats the strings "0", "off", "no", "false" as boolean false and
"1", "on", "true" as boolean true.

Also, this will make telemetry opt-in as opposed to opt-out as has been
requested by multiple users.  The supplied et.cfg file will still have
telemetry on.
  • Loading branch information
jshort committed Jan 5, 2023
1 parent c31f3b9 commit 7289e04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/et.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ port = 2022
verbose = 0
silent = 0
logsize = 20971520
telemetry = 1
telemetry = true
4 changes: 2 additions & 2 deletions src/terminal/TerminalServerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main(int argc, char **argv) {

int port = 0;
string bindIp = "";
bool telemetry = true;
bool telemetry = false;
if (result.count("cfgfile")) {
// Load the config file
CSimpleIniA ini(true, false, false);
Expand All @@ -106,7 +106,7 @@ int main(int argc, char **argv) {
}
}

telemetry = bool(stoi(ini.GetValue("Debug", "Telemetry", "1")));
telemetry = ini.GetBoolValue("Debug", "telemetry", false);
// read verbose level (prioritize command line option over cfgfile)
const char *vlevel = ini.GetValue("Debug", "verbose", NULL);
if (result.count("verbose")) {
Expand Down

0 comments on commit 7289e04

Please sign in to comment.