From de4641ca66568b886decfd4af22e5f0870b9c7ce Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:26:31 +0200 Subject: [PATCH] Escape env var values; update favicons & logo Fix shell escaping when building env export commands by escaping backslashes and quotes (prevents broken exported values) in ScriptExecutionHandler (two locations). Update app metadata to point to favicon files under /favicon, add site manifest, and replace the header Package icon with a next/image using the android-chrome PNG (import Image and adjust markup) for consistent asset handling. --- server.js | 14 ++++++++++++-- src/app/layout.tsx | 7 ++++--- src/app/page.tsx | 12 ++++++++++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/server.js b/server.js index 095f561..4999089 100644 --- a/server.js +++ b/server.js @@ -1414,7 +1414,12 @@ class ScriptExecutionHandler { // Build env export commands (e.g. for PHS_SILENT=1) const envExports = Object.entries(envVars) .filter(([key]) => key.startsWith('PHS_') || key.startsWith('var_')) - .map(([key, value]) => `export ${key}="${String(value).replace(/"/g, '\\"')}"`) + .map(([key, value]) => { + const safeValue = String(value) + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"'); + return `export ${key}="${safeValue}"`; + }) .join('; '); // Send the update command after a delay to ensure we're in the container @@ -1489,7 +1494,12 @@ class ScriptExecutionHandler { // Build env export commands (e.g. for PHS_SILENT=1) const envExports = Object.entries(envVars) .filter(([key]) => key.startsWith('PHS_') || key.startsWith('var_')) - .map(([key, value]) => `export ${key}="${String(value).replace(/"/g, '\\"')}"`) + .map(([key, value]) => { + const safeValue = String(value) + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"'); + return `export ${key}="${safeValue}"`; + }) .join('; '); // Send the update command after a delay to ensure we're in the container diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9f09e0f..551522e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -14,10 +14,11 @@ export const metadata: Metadata = { description: "Manage and execute Proxmox helper scripts locally with live output streaming", icons: [ - { rel: "icon", url: "/favicon.png", type: "image/png" }, - { rel: "icon", url: "/favicon.ico", sizes: "any" }, - { rel: "apple-touch-icon", url: "/favicon.png" }, + { rel: "icon", url: "/favicon/favicon.png", type: "image/png" }, + { rel: "icon", url: "/favicon/favicon.ico", sizes: "any" }, + { rel: "apple-touch-icon", url: "/favicon/apple-touch-icon.png" }, ], + manifest: "/favicon/site.webmanifest", }; export const viewport: Viewport = { diff --git a/src/app/page.tsx b/src/app/page.tsx index abbc9ce..b6076aa 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,7 @@ "use client"; import { useState, useRef, useEffect } from "react"; +import Image from "next/image"; import { ScriptsGrid } from "./_components/ScriptsGrid"; import { DownloadedScriptsTab } from "./_components/DownloadedScriptsTab"; import { InstalledScriptsTab } from "./_components/InstalledScriptsTab"; @@ -243,8 +244,15 @@ export default function Home() {
{/* Left: Logo/Brand */}
-
- +
+ PVE Scripts Local