Ensure Go's telemetry is off

This commit is contained in:
Hoang Nguyen 2023-12-03 00:00:00 +07:00
parent 5552326eec
commit c3ef0b604f
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
5 changed files with 51 additions and 1 deletions

View File

@ -107,4 +107,28 @@ std.manifestYamlDoc([
},
tags: 'xdg-user-dirs',
},
{
name: 'golang | Set telemetry to off',
block: [
{
name: 'golang | Create Go config directory',
file: {
path: '{{ xdg_dir.config_home }}/go/telemetry',
mode: '755',
state: 'directory',
},
},
{
name: 'golang | Set mode file to off with current date',
copy: {
content: |||
off {{ '%Y-%m-%d' | strftime }}
|||,
dest: '{{ xdg_dir.config_home }}/go/telemetry/mode',
mode: '644',
},
},
],
tags: ['gotelemetry', 'golang'],
},
] + [task(x) for x in modules])

View File

@ -30,6 +30,22 @@
src: user-dirs.dirs
name: xdg-user-dirs | Configure XDG_USER_DIRS definitions
tags: xdg-user-dirs
- block:
- file:
mode: "755"
path: '{{ xdg_dir.config_home }}/go/telemetry'
state: directory
name: golang | Create Go config directory
- copy:
content: |
off {{ '%Y-%m-%d' | strftime }}
dest: '{{ xdg_dir.config_home }}/go/telemetry/mode'
mode: "644"
name: golang | Set mode file to off with current date
name: golang | Set telemetry to off
tags:
- gotelemetry
- golang
- import_tasks: aerc.yml
name: Configure aerc
tags: aerc

View File

@ -53,6 +53,7 @@ set -gx CDKTF_HOME $XDG_DATA_HOME/terraform-cdk
set -gx TF_PLUGIN_CACHE_DIR $XDG_CACHE_HOME/terraform/plugin-cache
set -gx APPTAINER_CACHEDIR $XDG_CACHE_HOME/apptainer
set -gx MAGEFILE_CACHE $XDG_CACHE_HOME/magefile
set -gx LINUXKIT_CACHE $XDG_CACHE_HOME/linuxkit
set -gx ANSIBLE_HOME $XDG_DATA_HOME/ansible
set -gx MIX_XDG true
# set -gx MANPATH :$XDG_DATA_HOME/man
@ -78,7 +79,6 @@ set -gx CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
set -gx GOPROXY direct
set -gx GOSUMDB off
set -gx GOTOOLCHAIN local
#set -gx GOTELEMETRY off
# Update check + telemetry
## .NET
@ -119,6 +119,8 @@ set -gx VAGRANT_DISABLE_RESOLV_REPLACE true
set -gx VAGRANT_PREFER_SYSTEM_BIN true
## OPA
set -gx OPA_TELEMETRY_SERVICE_URL ""
## Kics
set -gx DISABLE_CRASH_REPORT false
# gopass settings not covered by the config file
set -gx GOPASS_CONFIG_NOSYSTEM true

View File

@ -96,6 +96,9 @@ local packages =
// Meh BSL license
{ name: 'packer', url: 'github.com/hashicorp/packer' },
// I might be generous enough to turn it on at some point (or maybe never, Google!)
{ name: 'gotelemetry', url: 'golang.org/x/telemetry/cmd/gotelemetry' },
]
;

View File

@ -406,3 +406,8 @@
removes: /usr/bin/go
name: packages | Install packer
tags: packer
- command:
cmd: /usr/bin/go install -ldflags "-s -w" golang.org/x/telemetry/cmd/gotelemetry@latest
removes: /usr/bin/go
name: packages | Install gotelemetry
tags: gotelemetry