diff --git a/frontend/.env b/frontend/.env index 3d51b461..bb169a29 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1 +1,2 @@ API_BASE_URL=https://btrix.webrecorder.net/api +GLITCHTIP_DSN= \ No newline at end of file diff --git a/frontend/sample.env.local b/frontend/sample.env.local index dd96dd09..df81b01e 100644 --- a/frontend/sample.env.local +++ b/frontend/sample.env.local @@ -1 +1,2 @@ API_BASE_URL=https://btrix-dev.webrecorder.net/api +GLITCHTIP_DSN= \ No newline at end of file diff --git a/frontend/src/index.ejs b/frontend/src/index.ejs index 16972bff..a3395eac 100644 --- a/frontend/src/index.ejs +++ b/frontend/src/index.ejs @@ -9,8 +9,26 @@ Browsertrix Cloud + + + diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 67482541..62bc8fac 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -4,6 +4,7 @@ const ESLintPlugin = require("eslint-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); const Dotenv = require("dotenv-webpack"); +const childProcess = require("child_process"); const isDevServer = process.env.WEBPACK_SERVE; @@ -14,6 +15,16 @@ const dotEnvPath = path.resolve( process.cwd(), `.env${isDevServer ? `.local` : ""}` ); +// Get git info to use as Glitchtip release version + +const gitBranch = childProcess + .execSync("git rev-parse --abbrev-ref HEAD") + .toString() + .trim(); +const commitHash = childProcess + .execSync("git rev-parse --short HEAD") + .toString() + .trim(); require("dotenv").config({ path: dotEnvPath, @@ -107,6 +118,9 @@ module.exports = { template: "src/index.ejs", templateParameters: { rwp_base_url: RWP_BASE_URL, + glitchtip_dsn: process.env.GLITCHTIP_DSN || "", + environment: isDevServer ? "development" : "production", + commit_hash: `${gitBranch} (${commitHash})`, }, // Need to block during local development for HMR: inject: isDevServer ? "head" : true,