Skip to content

Commit ab7e46c

Browse files
fix: resolve npm audit vulnerabilities in prismjs dependency (#37)
* Cleanup: Remove unused components and update configuration - Remove RepoStatusButton component (unused) - Remove git.ts library file (unused) - Update ExecutionModeModal with improvements - Update page.tsx with enhancements - Update env.js configuration - Update scripts router with improvements - Update .env.example with new variables * fix: resolve npm audit vulnerabilities in prismjs dependency - Add overrides to force prismjs@^1.30.0 across all dependencies - Update refractor to latest version (5.0.0) - Resolves 3 moderate severity vulnerabilities in prismjs DOM Clobbering - All npm audit vulnerabilities now resolved (0 vulnerabilities found)
1 parent a2f830a commit ab7e46c

File tree

9 files changed

+304
-649
lines changed

9 files changed

+304
-649
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# When adding additional environment variables, the schema in "/src/env.js"
22
# should be updated accordingly.
33

4-
ORIGINAL_REPO_URL="https://github.com/michelroegl-brunner/PVEScriptslocal"
54
REPO_URL="https://github.com/community-scripts/ProxmoxVE"
65
REPO_BRANCH="main"
76
SCRIPTS_DIRECTORY="scripts"

package-lock.json

Lines changed: 280 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,29 @@
2929
"@trpc/server": "^11.0.0",
3030
"@types/react-syntax-highlighter": "^15.5.13",
3131
"@types/ws": "^8.18.1",
32-
"@xterm/addon-attach": "^0.11.0",
3332
"@xterm/addon-fit": "^0.10.0",
3433
"@xterm/addon-web-links": "^0.11.0",
3534
"@xterm/xterm": "^5.5.0",
35+
"better-sqlite3": "^9.6.0",
3636
"next": "^15.5.3",
3737
"node-pty": "^1.0.0",
3838
"react": "^19.0.0",
3939
"react-dom": "^19.0.0",
4040
"react-syntax-highlighter": "^15.6.6",
41+
"refractor": "^5.0.0",
4142
"server-only": "^0.0.1",
42-
"simple-git": "^3.28.0",
4343
"strip-ansi": "^7.1.2",
4444
"superjson": "^2.2.1",
4545
"ws": "^8.18.3",
46-
"xterm": "^5.3.0",
47-
"zod": "^3.24.2",
48-
"better-sqlite3": "^9.6.0"
46+
"zod": "^3.24.2"
4947
},
5048
"devDependencies": {
5149
"@eslint/eslintrc": "^3.3.1",
5250
"@tailwindcss/postcss": "^4.0.15",
5351
"@testing-library/jest-dom": "^6.8.0",
5452
"@testing-library/react": "^16.3.0",
5553
"@testing-library/user-event": "^14.6.1",
54+
"@types/better-sqlite3": "^7.6.8",
5655
"@types/node": "^24.3.1",
5756
"@types/react": "^19.0.0",
5857
"@types/react-dom": "^19.0.0",
@@ -68,11 +67,13 @@
6867
"tailwindcss": "^4.0.15",
6968
"typescript": "^5.8.2",
7069
"typescript-eslint": "^8.27.0",
71-
"vitest": "^3.2.4",
72-
"@types/better-sqlite3": "^7.6.8"
70+
"vitest": "^3.2.4"
7371
},
7472
"ct3aMetadata": {
7573
"initVersion": "7.39.3"
7674
},
77-
"packageManager": "[email protected]"
75+
"packageManager": "[email protected]",
76+
"overrides": {
77+
"prismjs": "^1.30.0"
78+
}
7879
}

src/app/_components/ExecutionModeModal.tsx

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@ export function ExecutionModeModal({ isOpen, onClose, onExecute, scriptName }: E
7979
<div className="p-6">
8080
<div className="mb-6">
8181
<h3 className="text-lg font-medium text-gray-900 mb-2">
82-
How would you like to execute &quot;{scriptName}&quot;?
82+
Where would you like to execute &quot;{scriptName}&quot;?
8383
</h3>
84-
<p className="text-gray-600 text-sm">
85-
Choose between local execution or running the script on a remote server via SSH.
86-
</p>
84+
8785
</div>
8886

8987
{error && (
@@ -103,42 +101,7 @@ export function ExecutionModeModal({ isOpen, onClose, onExecute, scriptName }: E
103101

104102
{/* Execution Mode Selection */}
105103
<div className="space-y-4 mb-6">
106-
{/* Local Execution */}
107-
<div
108-
className={`border rounded-lg p-4 cursor-pointer transition-colors ${
109-
selectedMode === 'local'
110-
? 'border-blue-500 bg-blue-50'
111-
: 'border-gray-200 hover:border-gray-300'
112-
}`}
113-
onClick={() => handleModeChange('local')}
114-
>
115-
<div className="flex items-center">
116-
<input
117-
type="radio"
118-
id="local"
119-
name="executionMode"
120-
value="local"
121-
checked={selectedMode === 'local'}
122-
onChange={() => handleModeChange('local')}
123-
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300"
124-
/>
125-
<label htmlFor="local" className="ml-3 flex-1 cursor-pointer">
126-
<div className="flex items-center">
127-
<div className="flex-shrink-0">
128-
<div className="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center">
129-
<svg className="w-6 h-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
130-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
131-
</svg>
132-
</div>
133-
</div>
134-
<div className="ml-3">
135-
<h4 className="text-sm font-medium text-gray-900">Local Execution</h4>
136-
<p className="text-sm text-gray-500">Run the script on this server</p>
137-
</div>
138-
</div>
139-
</label>
140-
</div>
141-
</div>
104+
142105

143106
{/* SSH Execution */}
144107
<div

src/app/_components/RepoStatusButton.tsx

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/app/page.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export default function Home() {
3333
</p>
3434
</div>
3535

36+
{/* Controls */}
37+
<div className="mb-8">
38+
<div className="flex items-left pr-4 mb-6">
39+
<SettingsButton />
40+
<ResyncButton />
41+
</div>
42+
</div>
43+
3644
{/* Tab Navigation */}
3745
<div className="mb-8">
3846
<div className="border-b border-gray-200">
@@ -61,13 +69,7 @@ export default function Home() {
6169
</div>
6270
</div>
6371

64-
{/* Controls */}
65-
<div className="mb-8">
66-
<div className="flex items-center justify-between mb-6">
67-
<SettingsButton />
68-
<ResyncButton />
69-
</div>
70-
</div>
72+
7173

7274
{/* Running Script Terminal */}
7375
{runningScript && (

src/env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const env = createEnv({
1313
.default("development"),
1414
// Repository Configuration
1515
REPO_URL: z.string().url().optional(),
16-
ORIGINAL_REPO_URL: z.string().url().optional(),
16+
1717
REPO_BRANCH: z.string().default("main"),
1818
SCRIPTS_DIRECTORY: z.string().default("scripts"),
1919
JSON_FOLDER: z.string().default("json"),
@@ -42,7 +42,7 @@ export const env = createEnv({
4242
NODE_ENV: process.env.NODE_ENV,
4343
// Repository Configuration
4444
REPO_URL: process.env.REPO_URL,
45-
ORIGINAL_REPO_URL: process.env.ORIGINAL_REPO_URL,
45+
4646
REPO_BRANCH: process.env.REPO_BRANCH,
4747
SCRIPTS_DIRECTORY: process.env.SCRIPTS_DIRECTORY,
4848
JSON_FOLDER: process.env.JSON_FOLDER,

src/server/api/routers/scripts.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from "zod";
22
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
33
import { scriptManager } from "~/server/lib/scripts";
4-
import { gitManager } from "~/server/lib/git";
54
import { githubJsonService } from "~/server/services/githubJsonService";
65
import { localScriptsService } from "~/server/services/localScripts";
76
import { scriptDownloaderService } from "~/server/services/scriptDownloader";
@@ -27,27 +26,7 @@ export const scriptsRouter = createTRPCRouter({
2726
};
2827
}),
2928

30-
// Get repository status
31-
getRepoStatus: publicProcedure
32-
.query(async () => {
33-
const status = await gitManager.getStatus();
34-
return status;
35-
}),
36-
37-
// Update repository
38-
updateRepo: publicProcedure
39-
.mutation(async () => {
40-
const result = await gitManager.pullUpdates();
41-
return result;
42-
}),
43-
44-
// Full update repository (git pull, npm install, build)
45-
fullUpdateRepo: publicProcedure
46-
.mutation(async () => {
47-
const result = await gitManager.fullUpdate();
48-
return result;
49-
}),
50-
29+
5130
// Get script content for viewing
5231
getScriptContent: publicProcedure
5332
.input(z.object({ path: z.string() }))

0 commit comments

Comments
 (0)