root: don't set signal on start when running in ci or dev
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
9ac3b29418
commit
8d766efecb
|
@ -432,19 +432,21 @@ if _ERROR_REPORTING:
|
||||||
env=CONFIG.y("error_reporting.environment", "customer"),
|
env=CONFIG.y("error_reporting.environment", "customer"),
|
||||||
)
|
)
|
||||||
if not CONFIG.y_bool("disable_startup_analytics", False):
|
if not CONFIG.y_bool("disable_startup_analytics", False):
|
||||||
get_http_session().post(
|
should_send = env not in ["dev", "ci"]
|
||||||
"https://goauthentik.io/api/event",
|
if should_send:
|
||||||
json={
|
get_http_session().post(
|
||||||
"domain": "authentik",
|
"https://goauthentik.io/api/event",
|
||||||
"name": "pageview",
|
json={
|
||||||
"url": f"http://localhost/{env}",
|
"domain": "authentik",
|
||||||
"referrer": f"{__version__} ({build_hash})",
|
"name": "pageview",
|
||||||
},
|
"url": f"http://localhost/{env}",
|
||||||
headers={
|
"referrer": f"{__version__} ({build_hash})",
|
||||||
"User-Agent": sha512(SECRET_KEY.encode("ascii")).hexdigest()[:16],
|
},
|
||||||
"Content-Type": "text/plain",
|
headers={
|
||||||
},
|
"User-Agent": sha512(SECRET_KEY.encode("ascii")).hexdigest()[:16],
|
||||||
)
|
"Content-Type": "text/plain",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
||||||
|
|
|
@ -44,6 +44,10 @@ func analytics(akURL url.URL, on string) {
|
||||||
if _, s := os.LookupEnv("AUTHENTIK_DISABLE_ANALYTICS"); s {
|
if _, s := os.LookupEnv("AUTHENTIK_DISABLE_ANALYTICS"); s {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
e := getEnv()
|
||||||
|
if e == "ci" {
|
||||||
|
return
|
||||||
|
}
|
||||||
body := struct {
|
body := struct {
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
@ -52,7 +56,7 @@ func analytics(akURL url.URL, on string) {
|
||||||
}{
|
}{
|
||||||
Domain: "authentik",
|
Domain: "authentik",
|
||||||
Name: "pageview",
|
Name: "pageview",
|
||||||
URL: fmt.Sprintf("http://localhost/outpost/%s", getEnv()),
|
URL: fmt.Sprintf("http://localhost/outpost/%s", e),
|
||||||
Referrer: fmt.Sprintf("%s (%s)", constants.VERSION, constants.BUILD()),
|
Referrer: fmt.Sprintf("%s (%s)", constants.VERSION, constants.BUILD()),
|
||||||
}
|
}
|
||||||
b, err := json.Marshal(body)
|
b, err := json.Marshal(body)
|
||||||
|
|
Reference in a new issue