Skip to content

Commit 90d5a93

Browse files
authored
feat(posthog): Inject Posthog credentials (#814)
Signed-off-by: Javier Rodriguez <[email protected]>
1 parent cd1068c commit 90d5a93

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.goreleaser.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ builds:
2828
ldflags:
2929
- "{{ .Env.COMMON_LDFLAGS }}"
3030
- -X github.com/chainloop-dev/chainloop/app/cli/cmd.Version={{ .Version }}
31-
- -X github.com/chainloop-dev/chainloop/app/cli/cmd.posthogAPIKey={{ .Env.POSTHOG_API_KEY }}
32-
- -X github.com/chainloop-dev/chainloop/app/cli/cmd.posthogEndpoint={{ .Env.POSTHOG_ENDPOINT }}
3331
targets:
3432
- darwin_amd64
3533
- darwin_arm64

app/cli/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ VERSION=$(shell git describe --tags --always)
44
# build
55
build:
66
mkdir -p bin/ && go build -ldflags \
7-
"-X github.com/chainloop-dev/chainloop/app/cli/cmd.Version=$(VERSION) \
8-
-X github.com/chainloop-dev/chainloop/app/cli/cmd.posthogAPIKey=${POSTHOG_API_KEY} \
9-
-X github.com/chainloop-dev/chainloop/app/cli/cmd.posthogEndpoint=${POSTHOG_ENDPOINT}" \
7+
"-X github.com/chainloop-dev/chainloop/app/cli/cmd.Version=$(VERSION)" \
108
-o ./bin/chainloop ./main.go
119

1210
.PHONY: test

app/cli/cmd/root.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,12 @@ func parseToken(token string) (*parsedToken, error) {
338338
}
339339

340340
var (
341-
// Posthog API key and endpoint to be injected in the build process
342-
posthogAPIKey = ""
343-
posthogEndpoint = ""
341+
// Posthog API key and endpoint are not sensitive information it represents Chainloop's Posthog instance.
342+
// It can be overridden by the user if they want to use their own instance of Posthog or deactivated by setting
343+
// DO_NOT_TRACK=1 more information that can be found at: https://github.com/chainloop-dev/chainloop/blob/main/docs/docs/reference/operator/cli-telemetry.mdx
344+
// nolint:gosec
345+
posthogAPIKey = "phc_TWWW19kEiD6sEejlHKWcICQ5Vc06vZUTYia8WdPB0A0"
346+
posthogEndpoint = "https://crb.chainloop.dev"
344347
)
345348

346349
// recordCommand sends the command to the telemetry service

0 commit comments

Comments
 (0)