Skip to content

Commit

Permalink
remove support for axiom and pirsch
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Jun 25, 2024
1 parent 459d021 commit 1cee67b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Browser",
"url": "http://127.0.0.1:9301/wc/",
"url": "http://127.0.0.1:9301/",
"webRoot": "${workspaceFolder}/frontend/src"
},
{
Expand Down
95 changes: 0 additions & 95 deletions server/axiom.go

This file was deleted.

2 changes: 1 addition & 1 deletion server/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
domain = "tools.arslexis.io"
httpPort = 9301
frontEndBuildDir = filepath.Join("server", "dist")
wantedProdSecrets = []string{"AXIOM_TOKEN", "PIRSCH_SECRET", "GITHUB_SECRET_TOOLS_ARSLEXIS", "GITHUB_SECRET_LOCAL", "MAILGUN_DOMAIN", "MAILGUN_API_KEY"}
wantedProdSecrets = []string{"GITHUB_SECRET_TOOLS_ARSLEXIS", "GITHUB_SECRET_LOCAL", "MAILGUN_DOMAIN", "MAILGUN_API_KEY"}
)

// stuff that is derived from the above
Expand Down
9 changes: 0 additions & 9 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ var (
const secretsDev = `# secrets for dev mode
# COOKIE_AUTH_KEY=baa18ad1db89a7e9fbb50638815be63150a4494ac465779ee2f30bc980f1a55e
# COOKIE_ENCR_KEY=2780ffc17eec2d85960473c407ee37c0249db93e4586ec52e3ef9e153ba61e72
AXIOM_TOKEN=
PIRSCH_SECRET=
GITHUB_SECRET_TOOLS_ARSLEXIS=
GITHUB_SECRET_LOCAL=
MAILGUN_DOMAIN=
Expand Down Expand Up @@ -80,19 +78,12 @@ func loadSecrets() {

// those are only required in prod
must = flgRunProd
getEnv("AXIOM_TOKEN", &axiomApiToken, 40, must)
getEnv("PIRSCH_SECRET", &pirschClientSecret, 64, must)
getEnv("GITHUB_SECRET_TOOLS_ARSLEXIS", &secretGitHubToolsArslexis, 40, must)
getEnv("GITHUB_SECRET_LOCAL", &secretGitHubLocal, 40, must)
getEnv("MAILGUN_DOMAIN", &mailgunDomain, 4, must)
getEnv("MAILGUN_API_KEY", &mailgunAPIKey, 32, must)
getEnv("LOGTASTIC_API_KEY", &logtastic.ApiKey, 30, must)

// when running locally we shouldn't send axiom / pirsch
if isDev() || flgRunProdLocal {
axiomApiToken = ""
pirschClientSecret = ""
}
}

func getDataDirMust() string {
Expand Down
71 changes: 0 additions & 71 deletions server/pirsch.go

This file was deleted.

10 changes: 4 additions & 6 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ func logLogin(ctx context.Context, r *http.Request, token *oauth2.Token) {
return
}
logf("logged in as GitHub user: %s\n", *user.Login)
m := map[string]string{}
m := map[string]any{
"name": "github_login",
}
if user.Login != nil {
m["user"] = *user.Login
}
Expand All @@ -95,7 +97,7 @@ func logLogin(ctx context.Context, r *http.Request, token *oauth2.Token) {
if user.Name != nil {
m["name"] = *user.Name
}
pirschSendEvent(r, "github_login", 0, m)
logtastic.LogEvent(r, m)
}

// /auth/ghlogin
Expand Down Expand Up @@ -226,10 +228,6 @@ func makeHTTPServer(serveOpts *hutil.ServeFileOptions, proxyHandler *httputil.Re
}
logtastic.LogHit(r, m.Code, m.Written, m.Duration)
logHTTPReq(r, m.Code, m.Written, m.Duration)
if m.Code == 200 {
pirschSendHit(r)
}
axiomLogHTTPReq(ctx(), r, m.Code, int(m.Written), m.Duration)
}()
})

Expand Down

0 comments on commit 1cee67b

Please sign in to comment.