root: replace django-silk with Spotlight (#7828)

* root: replace django-silk with Spotlight

https://spotlightjs.com/
Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* use containerized spotlight

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix lock

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* update spotlight version

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* remove platform

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix lint

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-01-11 12:33:31 +01:00
committed by GitHub
parent 7ea3830e56
commit 38e1ad5ade
12 changed files with 48 additions and 70 deletions

29
web/package-lock.json generated
View File

@ -62,6 +62,7 @@
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@spotlightjs/spotlight": "^1.2.6",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/api": "^7.6.7",
@ -4853,6 +4854,34 @@
"integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
"dev": true
},
"node_modules/@spotlightjs/overlay": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@spotlightjs/overlay/-/overlay-1.2.3.tgz",
"integrity": "sha512-JypKrZCXGYp7PbLRTi6phBeMXvHP3ulaZVC829rpg+69tcaUXoGmgkjXDNxgrCfFE+xvi73fZk+bbus45b3C/w==",
"dev": true
},
"node_modules/@spotlightjs/sidecar": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@spotlightjs/sidecar/-/sidecar-1.3.3.tgz",
"integrity": "sha512-bRxizHcAUQS8H2f2jD/qbCTZA9ftjkCC9mMRwG6YRIkAi/3VRxB6hnhYkP1LnkZK8BQC0YtHmnlr8N2GJfwLhA==",
"dev": true,
"bin": {
"spotlight-sidecar": "server.js"
}
},
"node_modules/@spotlightjs/spotlight": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@spotlightjs/spotlight/-/spotlight-1.2.6.tgz",
"integrity": "sha512-MjRnzRFk5IZOAUDlkR/ENiB9uAbDlLAgLt4lIrCX0/v8WHwuS1zHMf65G3PjSYWYgjJ14cT98gMJErFVpCWx4g==",
"dev": true,
"dependencies": {
"@spotlightjs/overlay": "1.2.3",
"@spotlightjs/sidecar": "1.3.3"
},
"bin": {
"spotlight-sidecar": "bin/run.js"
}
},
"node_modules/@storybook/addon-actions": {
"version": "7.6.7",
"resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-7.6.7.tgz",

View File

@ -87,13 +87,14 @@
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@spotlightjs/spotlight": "^1.2.6",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/api": "^7.6.7",
"@storybook/blocks": "^7.6.4",
"@storybook/manager-api": "^7.6.7",
"@storybook/web-components": "^7.6.7",
"@storybook/web-components-vite": "^7.6.7",
"@storybook/web-components": "^7.6.7",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/chart.js": "^2.9.41",
"@types/codemirror": "5.60.15",
@ -104,12 +105,12 @@
"babel-plugin-macros": "^3.1.0",
"babel-plugin-tsconfig-paths": "^1.0.3",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-lit": "^1.11.0",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint": "^8.56.0",
"lit-analyzer": "^2.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",

View File

@ -5,7 +5,7 @@ import { me } from "@goauthentik/common/users";
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
import { Config, ResponseError } from "@goauthentik/api";
import { CapabilitiesEnum, Config, ResponseError } from "@goauthentik/api";
export const TAG_SENTRY_COMPONENT = "authentik.component";
export const TAG_SENTRY_CAPABILITIES = "authentik.capabilities";
@ -60,6 +60,11 @@ export async function configureSentry(canDoPpi = false): Promise<Config> {
scope.setTransactionName(`authentik.web.if.${currentInterface()}`),
);
}
if (cfg.capabilities.includes(CapabilitiesEnum.CanDebug)) {
const Spotlight = await import("@spotlightjs/spotlight");
Spotlight.init({ injectImmediately: true });
}
if (cfg.errorReporting.sendPii && canDoPpi) {
me().then((user) => {
Sentry.setUser({ email: user.user.email });