added sentry integration (#5)

* added sentry integration

* added environment parameter to sentry

* test error

* remove test func
This commit is contained in:
mloginov 2023-08-23 12:46:23 +01:00 committed by GitHub
parent 7bcc4948cb
commit 2c35bf6c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -10,10 +10,15 @@ replaceHtmlUrls () {
sed -i "s/$1/$2/" "./vnc.html"
}
replaceTagVersion () {
sed -i "s/TAG_VERSION/${tag}/" "./vnc.html"
}
prepareHtml () {
cdn="\/\/static-assets.codio.com\/${folder}\/${tag}"
replaceHtmlUrls "href=\"app\/" "href=\"${cdn}\/app\/"
replaceHtmlUrls "src=\"app\/" "src=\"${cdn}\/app\/"
replaceTagVersion
}
readarray -d '' files < <(find ./ -type f -print0)

View File

@ -43,13 +43,28 @@
<link rel="preload" as="image" href="app/images/info.svg">
<link rel="preload" as="image" href="app/images/error.svg">
<link rel="preload" as="image" href="app/images/warning.svg">
<script
src="https://js.sentry-cdn.com/d08e273c89d12afcde41b3ec30d37ace.min.js"
crossorigin="anonymous"
></script>
<script>
const prodRe = /https:\/\/.+\.codio\.io$/
const prodUkRe = /https:\/\/.+\.codio-box\.uk$/
const isProd = prodRe.test(location.origin) || prodUkRe.test(location.origin)
Sentry.onLoad(function() {
Sentry.init({
// No need to configure DSN here, it is already configured in the loader script
// You can add any additional configuration here
release: 'TAG_VERSION',
environment: isProd ? 'production' : 'development'
});
});
</script>
<script type="module" crossorigin="anonymous" src="app/error-handler.js"></script>
<script type="module" crossorigin="anonymous" src="app/ui.js"></script>
</head>
<body>
<div id="noVNC_fallback_error" class="noVNC_center">
<div>
<div>noVNC encountered an error:</div>