kolibri-sentry-plugin 0.0.1__py2.py3-none-any.whl → 0.2.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- __version__ = "0.0.1"
1
+ __version__ = "0.2.0"
@@ -0,0 +1,25 @@
1
+ {
2
+ "status": "done",
3
+ "assets": {
4
+ "kolibri_sentry_plugin.main-0.2.0.js": {
5
+ "name": "kolibri_sentry_plugin.main-0.2.0.js",
6
+ "path": "/home/runner/work/kolibri-sentry-plugin/kolibri-sentry-plugin/kolibri_sentry_plugin/static/kolibri_sentry_plugin.main/kolibri_sentry_plugin.main-0.2.0.js",
7
+ "publicPath": "autokolibri_sentry_plugin.main-0.2.0.js"
8
+ },
9
+ "kolibri_sentry_plugin.main-0.2.0.js.map": {
10
+ "name": "kolibri_sentry_plugin.main-0.2.0.js.map",
11
+ "path": "/home/runner/work/kolibri-sentry-plugin/kolibri-sentry-plugin/kolibri_sentry_plugin/static/kolibri_sentry_plugin.main/kolibri_sentry_plugin.main-0.2.0.js.map",
12
+ "publicPath": "autokolibri_sentry_plugin.main-0.2.0.js.map"
13
+ }
14
+ },
15
+ "chunks": {
16
+ "kolibri_sentry_plugin.main": [
17
+ {
18
+ "name": "kolibri_sentry_plugin.main-0.2.0.js",
19
+ "path": "/home/runner/work/kolibri-sentry-plugin/kolibri-sentry-plugin/kolibri_sentry_plugin/static/kolibri_sentry_plugin.main/kolibri_sentry_plugin.main-0.2.0.js",
20
+ "publicPath": "autokolibri_sentry_plugin.main-0.2.0.js"
21
+ }
22
+ ]
23
+ },
24
+ "publicPath": "auto"
25
+ }
@@ -1,8 +1,7 @@
1
- from __future__ import absolute_import, print_function, unicode_literals
2
-
3
-
4
- from kolibri.core.webpack import hooks as webpack_hooks
5
- from kolibri.plugins.base import KolibriPluginBase
1
+ from kolibri.core.hooks import FrontEndBaseSyncHook
2
+ from kolibri.core.webpack.hooks import WebpackBundleHook
3
+ from kolibri.plugins import KolibriPluginBase
4
+ from kolibri.plugins.hooks import register_hook
6
5
  from kolibri.utils import conf
7
6
 
8
7
 
@@ -11,16 +10,19 @@ class SentryPlugin(KolibriPluginBase):
11
10
  kolibri_options = "options"
12
11
 
13
12
 
14
- class SentryPluginAsset(webpack_hooks.WebpackBundleHook):
15
- bundle_id = "kolibri_sentry_plugin_module"
13
+ @register_hook
14
+ class SentryPluginAsset(WebpackBundleHook):
15
+ bundle_id = "main"
16
16
 
17
17
  @property
18
18
  def plugin_data(self):
19
19
  return {
20
20
  "sentryDSN": conf.OPTIONS["Debug"]["SENTRY_FRONTEND_DSN"],
21
21
  "sentryEnv": conf.OPTIONS["Debug"]["SENTRY_ENVIRONMENT"],
22
+ "sentryReplayEnabled": conf.OPTIONS["Debug"]["SENTRY_REPLAY_ENABLED"],
22
23
  }
23
24
 
24
25
 
25
- class SentryPluginInclusionHook(webpack_hooks.FrontEndBaseSyncHook):
26
+ @register_hook
27
+ class SentryPluginInclusionHook(FrontEndBaseSyncHook):
26
28
  bundle_class = SentryPluginAsset
@@ -12,5 +12,10 @@ option_spec = {
12
12
  "type": "string",
13
13
  "envvars": ("KOLIBRI_DEBUG_SENTRY_ENVIRONMENT",),
14
14
  },
15
+ "SENTRY_REPLAY_ENABLED": {
16
+ "type": "boolean",
17
+ "default": False,
18
+ "envvars": ("KOLIBRI_DEBUG_SENTRY_REPLAY_ENABLED",),
19
+ },
15
20
  },
16
21
  }
@@ -1,9 +1,8 @@
1
- import sentry_sdk
2
1
  import kolibri
3
-
4
- from sentry_sdk.integrations.django import DjangoIntegration
2
+ import sentry_sdk
5
3
  from kolibri.utils import conf
6
4
  from kolibri.utils.server import installation_type
5
+ from sentry_sdk.integrations.django import DjangoIntegration
7
6
 
8
7
 
9
8
  sentry_sdk.init(
@@ -17,4 +16,8 @@ with sentry_sdk.configure_scope() as scope:
17
16
  scope.set_tag("mode", conf.OPTIONS["Deployment"]["RUN_MODE"])
18
17
  scope.set_tag("installer", installation_type())
19
18
 
20
- print("Sentry backend error logging is enabled")
19
+
20
+ # Copy of the Kolibri default src directive plus sentry.io for sending error reports.
21
+ CSP_CONNECT_SRC = ("'self'", "data:", "blob:", "*.sentry.io") + tuple(
22
+ conf.OPTIONS["Deployment"]["CSP_HOST_SOURCES"]
23
+ )