kolibri-sentry-plugin 0.0.1__tar.gz → 0.2.0__tar.gz

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.
Files changed (32) hide show
  1. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/MANIFEST.in +0 -1
  2. kolibri_sentry_plugin-0.2.0/PKG-INFO +30 -0
  3. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/README.rst +2 -3
  4. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin/__init__.py +1 -0
  5. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin/build/kolibri_sentry_plugin.main_stats.json +25 -0
  6. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin/kolibri_plugin.py +28 -0
  7. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin/options.py +5 -0
  8. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin/settings.py +7 -4
  9. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin/static/kolibri_sentry_plugin.main/kolibri_sentry_plugin.main-0.2.0.js +2 -0
  10. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin/static/kolibri_sentry_plugin.main/kolibri_sentry_plugin.main-0.2.0.js.map +1 -0
  11. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin.egg-info/PKG-INFO +30 -0
  12. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin.egg-info/SOURCES.txt +5 -3
  13. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin.egg-info/entry_points.txt +3 -0
  14. kolibri_sentry_plugin-0.2.0/kolibri_sentry_plugin.egg-info/requires.txt +4 -0
  15. kolibri_sentry_plugin-0.2.0/setup.cfg +9 -0
  16. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/setup.py +16 -8
  17. kolibri_sentry_plugin-0.0.1/PKG-INFO +0 -25
  18. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin/__init__.py +0 -1
  19. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin/build/kolibri_sentry_plugin_module_stats.json +0 -1
  20. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin/kolibri_plugin.py +0 -26
  21. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin/static/kolibri_sentry_plugin_module/kolibri_sentry_plugin_module-0.0.1.js +0 -2
  22. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin/static/kolibri_sentry_plugin_module/kolibri_sentry_plugin_module-0.0.1.js.map +0 -1
  23. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin.egg-info/PKG-INFO +0 -25
  24. kolibri_sentry_plugin-0.0.1/kolibri_sentry_plugin.egg-info/requires.txt +0 -1
  25. kolibri_sentry_plugin-0.0.1/setup.cfg +0 -4
  26. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/AUTHORS.rst +0 -0
  27. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/CHANGELOG.rst +0 -0
  28. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/CONTRIBUTING.rst +0 -0
  29. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/LICENSE +0 -0
  30. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin.egg-info/dependency_links.txt +0 -0
  31. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin.egg-info/not-zip-safe +0 -0
  32. {kolibri_sentry_plugin-0.0.1 → kolibri_sentry_plugin-0.2.0}/kolibri_sentry_plugin.egg-info/top_level.txt +0 -0
@@ -9,4 +9,3 @@ recursive-include kolibri_sentry_plugin/static *.*
9
9
 
10
10
  recursive-include kolibri_sentry_plugin/build *.json
11
11
  recursive-exclude kolibri_sentry_plugin/assets *
12
-
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.1
2
+ Name: kolibri_sentry_plugin
3
+ Version: 0.2.0
4
+ Summary: A plugin to provide sentry integration for Kolibri
5
+ Home-page: https://github.com/learningequality/kolibri-sentry-plugin
6
+ Author: Learning Equality
7
+ Author-email: info@learningequality.org
8
+ License: MIT
9
+ Keywords: kolibri
10
+ Platform: UNKNOWN
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
22
+ Provides-Extra: dev
23
+ License-File: LICENSE
24
+ License-File: AUTHORS.rst
25
+
26
+
27
+ A plugin that provides Sentry SDK integration for the frontend and backend
28
+ of Kolibri. See the `Github repo <https://github.com/learningequality/kolibri-sentry-plugin>`_ for more details.
29
+
30
+
@@ -11,7 +11,7 @@ How can I install this plugin?
11
11
 
12
12
  2. Activate the plugin:
13
13
 
14
- ``kolibri plugin kolibri_sentry_plugin enable``
14
+ ``kolibri plugin enable kolibri_sentry_plugin``
15
15
 
16
16
  3. Restart Kolibri.
17
17
 
@@ -26,7 +26,7 @@ How can I install this plugin for development?
26
26
 
27
27
  ``pip install -e <LOCAL-PATH-TO-REPO>``
28
28
 
29
- ``kolibri plugin kolibri_sentry_plugin enable``
29
+ ``kolibri plugin enable kolibri_sentry_plugin``
30
30
 
31
31
 
32
32
  4. Then run the commands to install frontend packages in Kolibri, this plugin will have its dependencies recursively installed.
@@ -46,4 +46,3 @@ How to publish to PyPi?
46
46
  4. In the terminal move to the root level of repo dir and run the following command to publish to PyPi:
47
47
 
48
48
  ``make release``
49
-
@@ -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
+ }
@@ -0,0 +1,28 @@
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
5
+ from kolibri.utils import conf
6
+
7
+
8
+ class SentryPlugin(KolibriPluginBase):
9
+ django_settings = "settings"
10
+ kolibri_options = "options"
11
+
12
+
13
+ @register_hook
14
+ class SentryPluginAsset(WebpackBundleHook):
15
+ bundle_id = "main"
16
+
17
+ @property
18
+ def plugin_data(self):
19
+ return {
20
+ "sentryDSN": conf.OPTIONS["Debug"]["SENTRY_FRONTEND_DSN"],
21
+ "sentryEnv": conf.OPTIONS["Debug"]["SENTRY_ENVIRONMENT"],
22
+ "sentryReplayEnabled": conf.OPTIONS["Debug"]["SENTRY_REPLAY_ENABLED"],
23
+ }
24
+
25
+
26
+ @register_hook
27
+ class SentryPluginInclusionHook(FrontEndBaseSyncHook):
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
+ )