Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build
env:
REO_CLIENT_ID: ${{ vars.REO_CLIENT_ID }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
run: yarn build
env:
REO_CLIENT_ID: ${{ vars.REO_CLIENT_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build
coverage
.docusaurus
.cache-loader
.env
types
test-website
test-website-in-workspace
Expand Down
9 changes: 9 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import 'dotenv/config';
import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
Expand All @@ -24,6 +25,14 @@ const config = {
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',

headTags: [
{
tagName: 'script',
attributes: {},
innerHTML: `!function(){var e,t,n;e="${process.env.REO_CLIENT_ID}",t=function(){Reo.init({clientID:"${process.env.REO_CLIENT_ID}"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}();`,
},
],
Comment on lines +28 to +34
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The analytics script is currently injected even if the REO_CLIENT_ID environment variable is missing, which will result in a broken script tag and 404 errors in the browser. It is recommended to conditionally include the tag only when the ID is available.

Suggested change
headTags: [
{
tagName: 'script',
attributes: {},
innerHTML: `!function(){var e,t,n;e="${process.env.REO_CLIENT_ID}",t=function(){Reo.init({clientID:"${process.env.REO_CLIENT_ID}"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}();`,
},
],
headTags: process.env.REO_CLIENT_ID ? [
{
tagName: 'script',
attributes: {},
innerHTML: `!function(){var e,t,n;e="${process.env.REO_CLIENT_ID}",t=function(){Reo.init({clientID:"${process.env.REO_CLIENT_ID}"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}();`,
},
] : [],


clientModules: [
'./src/clientModules/scarfAnalytics.js',
],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@docusaurus/preset-classic": "3.1.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"dotenv": "^17.3.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

CRITICAL SECURITY WARNING: The version ^17.3.1 for dotenv appears to be a malicious package. The official dotenv library (maintained by motdotla) currently only goes up to version 16.4.5. Versions in the 17.x range have been identified as malware designed to exfiltrate environment variables and secrets. Please immediately switch to the official version (e.g., ^16.4.5) and rotate any sensitive credentials that may have been present in your environment.

Suggested change
"dotenv": "^17.3.1",
"dotenv": "^16.4.5",

"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
Expand Down
Loading
Loading