@@ -1143,6 +1143,16 @@ when required by your organization's security policy.`,
11431143Group :& deploymentGroupEmailTLS ,
11441144YAML :"certKeyFile" ,
11451145}
1146+ telemetryEnable := serpent.Option {
1147+ Name :"Telemetry Enable" ,
1148+ Description :"Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product." ,
1149+ Flag :"telemetry" ,
1150+ Env :"CODER_TELEMETRY_ENABLE" ,
1151+ Default :strconv .FormatBool (flag .Lookup ("test.v" )== nil || os .Getenv ("CODER_TEST_TELEMETRY_DEFAULT_ENABLE" )== "true" ),
1152+ Value :& c .Telemetry .Enable ,
1153+ Group :& deploymentGroupTelemetry ,
1154+ YAML :"enable" ,
1155+ }
11461156opts := serpent.OptionSet {
11471157{
11481158Name :"Access URL" ,
@@ -1903,15 +1913,19 @@ when required by your organization's security policy.`,
19031913YAML :"dangerousSkipIssuerChecks" ,
19041914},
19051915// Telemetry settings
1916+ telemetryEnable ,
19061917{
1907- Name :"Telemetry Enable" ,
1908- Description :"Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product." ,
1909- Flag :"telemetry" ,
1910- Env :"CODER_TELEMETRY_ENABLE" ,
1911- Default :strconv .FormatBool (flag .Lookup ("test.v" )== nil ),
1912- Value :& c .Telemetry .Enable ,
1913- Group :& deploymentGroupTelemetry ,
1914- YAML :"enable" ,
1918+ Hidden :true ,
1919+ Name :"Telemetry (backwards compatibility)" ,
1920+ // Note the flip-flop of flag and env to maintain backwards
1921+ // compatibility and consistency. Inconsistently, the env
1922+ // was renamed to CODER_TELEMETRY_ENABLE in the past, but
1923+ // the flag was not renamed -enable.
1924+ Flag :"telemetry-enable" ,
1925+ Env :"CODER_TELEMETRY" ,
1926+ Value :& c .Telemetry .Enable ,
1927+ Group :& deploymentGroupTelemetry ,
1928+ UseInstead : []serpent.Option {telemetryEnable },
19151929},
19161930{
19171931Name :"Telemetry URL" ,