mirror of
https://github.com/community-scripts/ProxmoxVE-Local.git
synced 2026-07-29 08:53:13 -04:00
7bbfa15a77ea694bfccdf2732fee61d0070cbc12
37 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d2954f126c | feat: enhance server resolution logic for SSH execution with redacted payloads | ||
|
|
44530afe24 | feat: enhance script downloading fallback logic and add support for additional script types | ||
|
|
62bcfe0012 |
feat: add JWT expiry validation and refactor magic numbers (#612)
* feat: add JWT expiry validation and refactor magic numbers - Decode JWT in WebSocket auth to reject expired tokens and log auth failures. - Introduce constants `OUTPUT_BUFFER_MAX_LENGTH`, `BACKUP_UPDATE_DELAY_MS`, and `JWT_EXP_MS_FACTOR`. - Replace hardcoded buffer length and delay values with the new constants. - Coerce `AUTH_ENABLED` and `AUTH_SETUP_COMPLETED` to boolean and add `AUTH_SESSION_DURATION_DAYS` env. * refactor: remove unused and confusing WEBSOCKET_PORT env variable --------- Co-authored-by: Vivelis <¨maceo.jalbert@gmail.com¨> |
||
|
|
001ff7b999 |
v1.1.2 Bump (Security, Alpine Fixes (#602)
* fix(security): protect servers api and redact secrets * feat: add authentication checks to various API routes - Implemented `requireApiAuth` in multiple settings routes to enforce authentication. - Added checks for setup completion in the authentication setup route. - Enhanced error handling and response messages for better clarity. - Ensured that sensitive information is only exposed to authenticated users. * fix: update auth module import from .ts to .js * fix: enhance error handling in auto-sync and normalize alpine CT slug * fix: remove unnecessary whitespace in script handling functions --------- Co-authored-by: ProxmoxVE Developer <dev@localhost> |
||
|
|
d2e8ac91d1 |
v1.0.0: Major UI/UX Overhaul, Performance & New Features (#566)
* Add GeneratorTab and UI refactor/styles
Introduce a full-featured GeneratorTab component for building and exporting script configuration (script selector, CPU/RAM/Disk sliders, advanced networking/features, generate/copy/export/import, and execute). Apply visual and structural UI refactors: new glass-card styles across ScriptCard, ScriptCardList, ScriptDetailModal, Terminal and Footer; update button variants and interaction classes; add Heart icon and extra footer links; update layout to use Manrope + JetBrains Mono fonts, sticky navbar, ambient backgrounds and metadata tweaks. Wire GeneratorTab into the main page and add related icon imports. Misc: small code-style/formatting adjustments and improved deriveScriptPath / handler signatures for clarity.
* Add script notes, server presets & APT proxy
Add persistent script notes and server presets, plus APT proxy settings and various UI/behavior improvements.
- DB: new migration adds script_notes and server_presets tables and indexes; Prisma schema updated with ScriptNote and ServerPreset models.
- Notes: new client component ScriptNotesPanel with CRUD using a new TRPC router (scriptNotes) and integration into ScriptDetailModal to show/manage private/shared notes.
- APT proxy: new Next.js API route /api/settings/apt-proxy that reads/writes .env vars; GeneralSettingsModal and ConfigurationModal load/save the proxy and pre-fill advanced install vars.
- UX/UI: add copyable install command, version badges on script cards/detail, container ID input in advanced configuration, and styling tweaks (glass-card-static).
- Server/script detection: installedScripts router now attempts to resolve the actual Proxmox node name via SSH and relaxes ID parsing to numeric-only.
- Notifications: appriseService extended to support Gotify endpoints and allow gotify:// scheme, and URL validation adjusted accordingly.
These changes enable user-maintained notes/presets, persistent APT-cacher defaults, improved install UX, better server detection, and additional notification backend support.
* Add server presets and silent batch updates
Introduce server presets and silent batch update support across API, server, and UI. Added a new serverPresets TRPC router and wired it into the API root. ConfigurationModal now lets users save/load/delete presets tied to a server. InstalledScriptsTab adds a "Silent update" option, a sequential "Update All Containers" batch flow that runs updates with PHS_SILENT=1, and passes envVars into update executions. ScriptExecutionHandler (server.js) now accepts envVars for updates and injects export commands into both local and SSH update flows so environment flags (e.g. PHS_SILENT) are honored. Also added "updated" sort handling in ScriptsGrid, DownloadedScriptsTab and FilterBar, and small typing fixes in appriseService.
* Use per-router Prisma client with Better SQLite3
Replace usage of the shared prisma import with per-router PrismaClient instances configured with @prisma/adapter-better-sqlite3. Add getNotesDb/getPresetsDb helpers (with DATABASE_URL fallback) and update scriptNotes and serverPresets to use the new client. Also add error handling in read endpoints to return empty arrays on DB failures and ensure create/update/delete use the new client.
* Icon-only action buttons; use presets DB
Convert HelpButton, ResyncButton, ServerSettingsButton and SettingsButton from labeled outline controls to compact ghost icon-only buttons with aria-labels and smaller icons/spinners for a more compact header UI. Simplify ResyncButton markup (smaller spinner/SVG, removed extra contextual text/lastSync layout) and tweak sync message styling. Add Server icon import in ServerSettingsButton. In serverPresets router, replace direct prisma calls with getPresetsDb() and use the returned db instance for all queries and mutations to support the presets DB connection.
* Add quick filters, Dev/ARM badges, and CSS tweaks
Introduce quick filter support and visual indicators for developer/ARM scripts. Added QuickFilter type and quickFilter to FilterState (getDefaultFilters/mergeFiltersWithDefaults) and a quick-filter UI in FilterBar (All, New, Updated, In Dev, ARM). Implemented filtering logic in ScriptsGrid and added category dev counts to surface per-category "dev" counts in CategorySidebar. Added DevBadge and ArmBadge components, used in ScriptCard and ScriptDetailModal; ScriptCard also gets a subtle violet highlight when script.is_dev is true. Fixed script path generation in GeneratorTab to include a `scripts/` prefix. Minor dark-theme adjustments to .glass-card/.glass-card-static background and border-color for improved contrast.
* Add appearance settings and persist UI prefs
Introduce an Appearance tab in the Settings modal to control theme, text size and layout width (default vs wide). Preferences are saved to localStorage and applied immediately via helper functions (applyTextSize/applyLayoutWidth) and a small inline script injected into <head> to apply saved settings on first paint. Add CSS utility classes for text-size variants and wire up theme buttons (using lucide icons). Also include minor cleanup: optional chaining fix in CategorySidebar and removal of an unused import in ResyncButton.
* Normalize quotes and format components
Apply consistent formatting across several components: convert single quotes to double quotes, reformat the QuickFilter union type and quick-filters array in FilterBar, adjust JSX prop and className string formatting in HelpButton, ScriptCard, ServerSettingsButton, and SettingsButton. These are cosmetic/formatting changes only and do not alter runtime behavior.
* Refactor Badge & CategorySidebar types/styles
Normalize formatting and strengthen typings for Badge; convert single quotes to double, expand variant/type unions, and tidy JSX/props and helper badge components. Rework CategorySidebar: refactor CategoryIcon SVGs for readability, standardize className usage, improve collapsed-state layout and buttons, and ensure categories are filtered/sorted by count with correct icon mapping and counts display. Overall cleanup improves consistency, readability, and type safety across these components.
* Add modal stacking and portal support
Introduce a modal stacking system and portal to ensure modals escape parent stacking contexts. ModalStackProvider now computes a zIndex for each registered modal and returns an unregister handle; useRegisterModal returns the zIndex. A ModalPortal component (createPortal to document.body) was added and all modal components were updated to: capture the returned zIndex, wrap their markup in <ModalPortal>, and apply the dynamic zIndex instead of a hardcoded z-50 class. This improves correct layering of multiple modals and avoids backdrop-filter / transform stacking issues.
* Wrap modals in portal and use zIndex
Use ModalPortal and zIndex values from useRegisterModal across modal components to avoid hardcoded z-50 stacking. Updated ExecutionModeModal, LXCSettingsModal, PublicKeyModal, ReleaseNotesModal, SetupModal, StorageSelectionModal, and TextViewer to import ModalPortal, capture the zIndex returned by useRegisterModal, wrap modal markup in <ModalPortal>, and apply style={{ zIndex }} to backdrops; LXC result overlay uses zIndex + 10 for proper stacking. Also changed LoadingOverlay in VersionDisplay to render with createPortal(document.body) and added the import. These changes centralize stacking behavior and prevent z-index conflicts when multiple modals/overlays are present.
* Use categoryIconColorMap for sidebar icons
Update CategorySidebar.tsx to derive non-selected icon color classes from categoryIconColorMap for both the "template" and per-category icons. Selected icons still use text-primary; fallbacks preserve previous muted and group-hover classes to retain existing styling when a mapping is absent.
* Standardize modal layout and form styles
Refactor modal markup across many components to use a consistent wrapper structure and unified Tailwind utility ordering (moved zIndex to outer container, standardized backdrop and centering). Clean up form layouts: align icons, labels and inputs, normalize spacing, error styling, and button variants (including icon/ghost adjustments). Improve AuthModal and CloneCountInputModal UX (loading/error states, closer placement, validation), and normalize BackupWarningModal and other modal presentations. Update ConfigurationModal advanced UI: reorganize network fields and add/handle extra options (IPv6 static, gateway, MTU, MAC, VLAN, DNS), refine presets save/cancel flow, and apply general formatting/whitespace cleanups.
* 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.
* Add favicon set and logo; remove old favicon
Replace legacy root favicon.png with a full favicon set under public/favicon (android-chrome 192/512, apple-touch-icon, favicon-16x16, favicon-32x32, favicon.ico, favicon.png) and add site.webmanifest. Also add public/logo.png. This organizes favicon assets for multiple platforms and adds a webmanifest for PWA/icon declarations.
* Portalize script dropdown and add outside click
Render the script selector dropdown into document.body via createPortal to escape stacking/overflow contexts. Add triggerRef/dropdownRef, compute fixed position from the trigger on open, and attach an outside-click handler to close the dropdown. Also import useRef/useEffect and createPortal; preserve existing search, selection, and reset behaviors while adjusting z-index/positioning.
* Update favicon and logo assets
Replace favicon and logo image files with updated versions to refresh branding. Updated files: public/favicon/android-chrome-192x192.png, public/favicon/android-chrome-512x512.png, public/favicon/apple-touch-icon.png, public/favicon/favicon-16x16.png, public/favicon/favicon-32x32.png, public/favicon/favicon.ico, public/logo.png.
* Add appearance modal & improve script detail UI
Add an AppearanceModal and AppearanceButton to let users change theme, text size and layout width (persisted in localStorage). Enhance FilterBar with category filtering (selectedCategory, dropdown UI, counts, and outside-click handling). Heavily refactor ScriptDetailModal: layout and visual refresh, new icons, better loading/update/delete/install flows, memoized install command, improved copy behavior, keyboard navigation between scripts (using orderedSlugs + onSelectSlug), clearer status/messages, and various performance/UX tweaks. Wire DownloadedScriptsTab to pass orderedSlugs and onSelectSlug into the ScriptDetailModal. Overall small UI/UX and state-management improvements across components.
* Optimize rendering, lazy-load tabs, add sync modal
Performance and UX improvements: memoize computed values in InstalledScriptsTab (scriptsWithStatus, filteredScripts, uniqueServers) and use useCallback/useMemo in ScriptsGrid to avoid unnecessary re-renders. Memoize ScriptCard and ScriptCardList components and tighten their ScriptCard type alias. Introduce a new SyncModal (ResyncButton) component to run/resync scripts with a progress UI and retry/close behavior, and replace the previous ResyncButton import in page.tsx. Lazy-load heavy tab components (Downloaded, Installed, Backups, Generator) with next/dynamic and add a TabSkeleton loader; consolidate tab definitions into a memoized tabs array. Misc: small prop/prop-name fixes and minor JSX formatting adjustments.
* Add Arcane script, status UI, validation & cache
Multiple changes improving UX, reliability, and CI permissions:
- Add scripts/tools/addon/arcane.sh: installer/update/uninstall helper for Arcane (Docker Compose), creates update helper and generates secrets.
- Add ServerStatusIndicator component and integrate into header (src/app/_components/ServerStatusIndicator.tsx, src/app/page.tsx); adjust hero/layout to accommodate inline version + status.
- Enhance GeneratorTab (src/app/_components/GeneratorTab.tsx): fetch full script details by slug, derive and apply default resource values from install_methods, and show an App Defaults info panel.
- Harden repo provider detection (src/server/lib/repositoryUrlValidation.js/.ts): use URL parsing for hostname matching with safe fallback to 'custom'.
- Tune client caching (src/trpc/query-client.ts): increase staleTime to 30min, set gcTime to 1h, and disable automatic refetches on mount/window focus/reconnect.
- Update GitHub Actions permissions: node.js.yml grants contents: read; release-drafter.yml grants contents: write and pull-requests: read.
These changes aim to provide better default resource handling for scripts, visible server reachability, more robust URL parsing, improved client-side cache behavior, and explicit workflow permissions.
* Add suppressHydrationWarning to <html>
Add the React prop suppressHydrationWarning to the <html> element in RootLayout (src/app/layout.tsx) to suppress hydration mismatch warnings. This helps avoid noisy console warnings when server-rendered markup and client rendering differ (e.g., due to dynamic font class injection or other runtime-only differences).
* Refactor GeneratorTab layout and add SSH imports
Rework GeneratorTab rendering and small UI/format fixes: tidy the scriptDetail useMemo formatting and restructure the Script Defaults block so defaults (CPU, RAM, HDD) are always shown and OS/version/variant badges render correctly. Minor formatting change to ServerStatusIndicator's fetch call and a small spacing fix on the home page title. Also add imports for getSSHService and the Server type to servers router in preparation for SSH-related functionality.
* Add explicit typing for servers in indicator
Annotate the `servers` variable with an explicit array type (id, name, ip, online) and cast `data?.servers` to that type, defaulting to an empty array. This clarifies TypeScript inference and prevents `servers` from being undefined for downstream logic without changing runtime behavior.
* perf/cleanup: audit fixes - hoist iconMap, pin Next.js, strip console.log, lighten glass-card, fix dev badge
* Refactor icons, remove debug logs, pin Next
Replace the large inline SVG icon map with a compact iconPaths mapping and fallback path, simplifying CategoryIcon rendering. Tighten the dev-count badge markup/styles for better layout. Remove leftover console.debug/log statements from InstalledScriptsTab and LXCSettingsModal. Pin Next.js version to 16.2.1 in package.json (deps and devDeps). Slightly adjust dark glass-card background opacity/hover values in globals.css.
* refactor: migrate server TS files to structured logger, accessibility improvements
* perf: fix 14s page load - remove SSH from initial query, defer tab-specific data
- getAllInstalledScripts: removed SSH batchDetectContainerTypes, use DB-only
heuristic (lxc_config presence) for VM/LXC detection
- Defer installedScripts + backups queries until their tab is activated
- Initial batch now only fires 3 fast DB queries instead of 7 (incl. SSH)
* perf: split SSH queries from tRPC batch, skip save-on-mount
- Use splitLink to route servers.checkServersStatus through a separate
non-batched httpLink. SSH queries no longer block fast DB queries from
returning (was causing 14s+ batch response holding all data hostage).
- Add initialization refs in ScriptsGrid and DownloadedScriptsTab so
save-filter/view-mode POST effects skip their first fire after load,
eliminating 2-4 unnecessary network requests per tab mount.
* refactor: restore SSH detection for installed scripts, cache badge counts
- Restore batchDetectContainerTypes SSH calls in getAllInstalledScripts
(shows real VM/LXC state, not just DB heuristic)
- Route getAllInstalledScripts through splitLink (non-batched) so SSH
never blocks fast DB queries
- Cache installed/backups badge counts in localStorage so tabs show
last-known counts instantly, updated when fresh data arrives
- Query still deferred until tab is visited (no eager SSH on page load)
* Refactor init checks, footer, and parallel fetch
Make several small refactors and updates across the app:
- Expand single-line early-return checks into multi-line blocks in DownloadedScriptsTab and ScriptsGrid for clarity when skipping initial effect triggers.
- Update Footer links: add separate GitHub (ProxmoxVE-Local) and GitHub (ProxmoxVE) buttons and change the site link to community-scripts.org.
- Minor formatting tweaks in page.tsx (useState initializer and backups ternary) for readability.
- In the scripts API router, fetch script cards and metadata in parallel via Promise.all to reduce latency and return both together.
These changes improve readability and slightly optimize the scripts fetch path.
* Add in-memory PB cache and invalidate on resync
Introduce a simple server-side in-memory cache for PocketBase data with a 10-minute TTL to reduce PB requests for rarely-changing data. Adds getCached/setCache helpers and a shared _cache store, and exports invalidatePbCache() to clear cached entries. Apply caching to getScriptCards, getCategories, and getScriptTypes, and call invalidatePbCache() in the resyncScripts mutation so fresh data is fetched after a resync.
* Update react.tsx
* Show script download flow & per-node server status
GeneratorTab: add detection of locally downloaded scripts (query + mutation), compute a slug set for O(1) lookup, and gate selection/execution on download state. Update script list UI to indicate downloadable items, grayscale/opacity non-downloaded entries, and show a download confirmation modal that triggers loadScript mutation and invalidates cache. Add Loader2 and AlertTriangle icons and disable Execute when the selected script isn't downloaded.
ServerStatusIndicator: change from a single aggregate dot to per-node indicators showing each host name and status (green online with ping animation, red offline). Improve handling of loading vs no-configured-servers states and update tooltip/title text for clarity.
* Improve updater script and minor UI tweaks
Refactor update.sh to make the updater more robust and flexible: add support for specifying a target release (get_release), include tar in dependency checks, strengthen download/extract logic and error logging, improve source-dir detection, and tighten backup/restore, install/build and service start/rollback flows. Also normalize indentation and logging output and add clearer diagnostic messages on failures. Minor UI cleanups in TSX: simplify GeneratorTab conditional formatting and adjust ServerStatusIndicator class ordering.
* Bump deps and add VSCode Next.js prompt setting
Update multiple dependencies to newer patch/minor versions (Prisma, @tanstack/react-query, axios, better-sqlite3, dotenv, lucide-react, next, react, react-dom, vite, vitest tooling, eslint, jsdom, postcss, prettier, prisma, etc.). Replace legacy typescript-eslint package with @typescript-eslint/eslint-plugin and @typescript-eslint/parser. Add .vscode/settings.json to mark WillLuke.nextjs.hasPrompted as true to suppress the Next.js prompt in VS Code.
* Normalize indentation in core scripts
Reformat scripts/core/alpine-install.func and scripts/core/api.func for consistent indentation and whitespace. Changes are formatting-only (no logic changes): converted leading tabs to spaces, aligned multiline blocks, and adjusted a comment reference (error-handler → error_handler) for consistency. Improves readability and maintainability without affecting behavior.
* Show/hide install command UI and service fixes
UI: Add a Terminal icon, show/hide toggle, and display block for the install command in ScriptDetailModal (new showCommand state and button).
Server: installedScripts - default unknown container types to LXC (safe default) and simplify VM/LXC detection comments.
AppriseService: support gotifys:// (HTTPS) and gotify:// formats, select protocol correctly, and update URL regex.
BackupService: include PBS namespace (--ns) when storage.namespace is configured so proxmox-backup-client commands include the namespace.
ScriptDownloader: add fallback to attempt downloading a ct/<slug>.sh when install_methods is empty for CT/LXC scripts, improve returned success/message semantics, better 404-aware error messaging, and check for fallback CT script presence when scanning downloaded files.
Other: add /examples to .gitignore and remove restore.log.
These changes improve robustness for missing install metadata, add HTTPS Gotify support, ensure PBS namespace usage, and improve UX for viewing install commands.
* Prefer local install scripts; add envVars & token
Allow using local copies of helper/install scripts during development and forward environment variables and a GitHub token through the UI and websocket layer.
Changes:
- scripts/core/alpine-install.func & scripts/core/install.func: try to load misc/tools.func from the local scripts directory before falling back to downloading from GitHub; improved error messaging on failure.
- scripts/core/build.func: resolve SCRIPT_DIR, prefer local alpine/install function files and export their contents to FUNCTIONS_FILE_PATH; fall back to remote download if local files are missing; use local install scripts for lxc-attach when available (fallback to remote). Adjusted dev MOTD path to source from /tmp.
- src/app/_components/ConfigurationModal.tsx: added a password input for var_github_token (passed as GITHUB_TOKEN to mitigate API rate limits).
- src/server/api/websocket/handler.ts: websocket handler now accepts an envVars object and forwards it into startScriptExecution so environment variables from the client can be supplied to script runs.
Overall this improves local development workflows and enables passing custom env vars and a GitHub token to scripts.
* Replace *_json with install_methods/notes
Adapt code to the updated PocketBase schema by renaming install_methods_json and notes_json to install_methods and notes across services and routers. Update parsing in pbScripts.ts, mappings in scripts.ts, autoSyncService.js, and localScripts.ts, and adjust scriptDownloader fallback comment/logic to reference the new field. Also add new PBScript metadata fields (github_data, deleted_message, disable_message, last_update_commit) so the PBScript type reflects the extended record shape.
* Add InstallCommandBlock and integrate installer UI
Introduce a full InstallCommandBlock React component (new file) that builds, previews, and copies install commands with support for GitHub/Gitea, Alpine/Advanced modes, ARM flag, resource presets, and dev gating. Integrate it into ScriptDetailModal: compute hasAlpine and installDefaults from script.install_methods, remove the old simple install command UI/handlers, and embed the new component for non-misc scripts. Update ScriptsGrid to allow aborting batch downloads, invalidate downloaded-scripts cache after downloads, and adjust orderedSlugs passed to the modal (prefer newest when no active filters). On the server, make ScriptDownloaderService resolve dev scripts to the ProxmoxVED repository (dev-specific repo path) while preserving explicit repository_url and default repo behavior.
* Fix envStr possibly undefined in InstallCommandBlock
* Redesign Install section: inline node picker, remove old modals, drop My Notes
* Remove bash command display, pass envVars to SSH, inline Terminal below Install
* Fix envVars: always pass mode to skip whiptail dialog; fix terminal clipping
* Remove dangerous source envVar, fix View button gating, clean dead onInstallScript prop chains
* Tidy JSX formatting and remove extra whitespace
Clean up minor JSX formatting and stray blank lines across components. Removed extra blank lines in DownloadedScriptsTab and ScriptsGrid modal props, reformatted the terminal container div in InstallCommandBlock for clearer attribute layout, and simplified conditional JSX in page.tsx to single-line renders. No functional changes intended—only stylistic/formatting adjustments to improve readability.
* refactor: comprehensive code quality improvements
- Move Terminal component into GeneratorTab (self-contained)
- Replace all alert()/confirm() with modal dialogs
- Type server prop as Server instead of any
- Fix deprecated onKeyPress -> onKeyDown
- Memoize stat counters + fix O(n^2) scriptCounts with Set lookups
- Remove dead hasActions function (always returned true)
- Decompose InstalledScriptsTab: extract Stats, Filters, StatusMessage
- Add buildServerFromScript helper (deduplicates 5 identical blocks)
- Fix eslint-disable blanket: targeted disables + void floating promises
* fix: resolve LXCSettingsModal rootfs_size TS error blocking build
- Type configData as Record<string,unknown> so TS union includes rootfs_size
- Include formatter fixes for extracted sub-components
* feat: bootstrap updater - self-updating update engine
Split update system into two files:
- update.sh: Thin bootstrap (~100 lines) that fetches the latest
update-engine.sh from main branch before executing it
- update-engine.sh: Full update logic (moved from old update.sh)
- UPDATER_VERSION: Version tracker for the engine
How it works:
1. User runs 'bash update.sh' (unchanged workflow)
2. Bootstrap checks UPDATER_VERSION on main vs local
3. If different, downloads latest update-engine.sh from main
4. Hands off to update-engine.sh with all arguments
This ensures bugfixes to the update logic reach users automatically,
without requiring a manual intervention or a new app release.
* fix: widen terminal - collapse sidebar to single column when terminal active
- Add onTerminalChange callback to InstallCommandBlock
- ScriptDetailModal switches from 2-col grid to single column when terminal runs
- Sidebar (ACCESS/DETAILS/INSTALL PROFILES) moves below terminal
- Remove max-w-4xl cap from Terminal.tsx so it fills full container width
- Reset terminalActive state when navigating between scripts
* Release prep: bump to 1.0.0-pre1 + add updater
Update project to pre-release 1.0.0-pre1 and add an interactive updater.
- Bump VERSION and package.json version to 1.0.0-pre1.
- Add pre-release-updater.sh: interactive script to list GitHub prereleases, backup current install, download/extract a selected prerelease, install deps, run migrations, build, and restart the service.
- Minor JSX formatting cleanup in ScriptDetailModal.tsx (split long className into multiple lines for readability; no functional change).
* fix: correct INSTALL_DIR to /opt/ProxmoxVE-Local
* fix(modal): resolve z-index race in ModalStackProvider; refactor(installed-scripts): UI overhaul - stats cards, filters, toolbar, table
* feat(installed-scripts): add Restart/Reboot action; fix orphaned cleanup for missing-server records
* fix(cleanup): delete SSH records with server but no container_id (Pass 1.5); feat(backups): add Create Backup via vzdump in BackupsTab
* fix(generator): await refetch after download; add server selection for SSH execution
- Fix download race condition: await getAllDownloadedScripts.refetch() before
closing dialog and selecting script so isScriptDownloaded returns true
- Add Server type import + state + useEffect to fetch /api/servers on mount
- Add server selection pill buttons above Execute (auto-selects single server)
- Execute button label changes to 'Execute on <name>' or 'Execute Locally'
- Pass mode + server to Terminal for correct local vs SSH execution
- Add selectedServer to handleExecute useCallback dependencies
* fix(generator): restore missing setTimeout body (syntax error)
* style: auto-format BackupsTab and GeneratorTab
* feat(pre2): ProxmoxVED toggle, floating shell dialog, settings UI polish
- Settings: remove Theme block (use AppearanceButton instead), restyle tabs
to match main nav pill style
- Settings: add ProxmoxVED / Dev Scripts toggle (default: off); persisted in
localStorage; StorageEvent keeps ScriptsGrid in sync without context
- ScriptsGrid: filter is_dev scripts from Newest carousel and full grid when
ProxmoxVED is disabled; add showDevScripts -> FilterBar prop
- FilterBar: hide 'In Dev' quick-filter pill when ProxmoxVED is disabled
- ShellContext: new React context (open/minimize/restore/close) for shell sessions
- FloatingShell: new floating dialog with minimize-to-pill, maximize, close;
persists across tab switches; renders via createPortal
- InstalledScriptsTab: delegate shell open to useShell() context instead of
local inline terminal; remove inline shell JSX
- page.tsx: wrap Home in ShellProvider, render FloatingShell at page level
* feat: implement execute_in container picker for addon scripts
- Add execute_in?: string[] | null to Script type
- Forward execute_in from PocketBase via pbToScript() mapper
- Add listContainersOnServer tRPC query (pct list + qm list via SSH)
- GeneratorTab: show container/VM picker when script has execute_in flags
- lxc, pbs, pmg -> show LXC picker (pbs/pmg pin matching containers)
- vm -> show VM picker
- Passes CTID env var to the script on execution
- Picker resets on server or script change
* fix(generator): move container-reset useEffect after selectedSlug declaration
* feat: add prerelease update channel toggle + bump version to 1.0.0-pre2
- Add ALLOW_PRERELEASE env var to env.js
- Add /api/settings/prerelease GET/POST route (persists to .env)
- version.ts: getVersionStatus + getLatestRelease use /releases (all) when
ALLOW_PRERELEASE=true, otherwise /releases/latest (stable only)
- GitHubRelease interface: add prerelease boolean field
- GeneralSettingsModal: add Update Channel toggle in General tab
- VERSION: bump to 1.0.0-pre2
- page.tsx: destructure isAuthenticated from useAuth()
- GeneratorTab.tsx: move container-reset useEffect after selectedSlug decl
* fix(page): destructure logout from useAuth
* feat: floating terminal for backup + New Backup dialog + fixes
- FloatingShell: support backup task mode (isBackup Terminal when
session.backupStorage is set); adds HardDrive icon, onComplete callback
- ShellContext: extend ShellSession with backupStorage, title, onComplete
- BackupsTab: replace blocking createBackupMutation with FloatingShell backup;
add 'New Backup' dialog (server -> container -> storage selection)
- InstalledScriptsTab: fix fetchStorages to not show blocking error modal
- VERSION: bump to 1.0.0-pre3, fixed UTF-8 BOM encoding
* fix: keep Terminal mounted on minimize, add drag-to-move support
- FloatingShell is now a single always-mounted window instead of
conditional branches — visibility:hidden on minimize keeps the
xterm.js WebSocket alive so 'starting shell session' no longer
appears on restore
- Header acts as drag handle: mouse-drag repositions the floating
window freely so the background remains usable
- Maximize still covers full viewport; restore returns to last
dragged position (or CSS-centered if never dragged)
* fix: Server.host -> Server.ip in BackupsTab new backup dialog
* fix: use lxc/vm fields from listContainersOnServer (no containers/vmid)
* fix: bundle core.func+error-handler.func into FUNCTIONS_FILE_PATH
* fix: typed container list in New Backup dialog (no unsafe any)
* feat: v1.0.0-pre4 - multi-session shell, multi-LXC backup, auto-discover after backup, local generator command, addon execute_in
* feat: add Refresh button to Downloaded Scripts tab
* fix: add executeInContainer to WebSocketMessage typedef
* fix: installationId typedef + verbose logo error logging
* fix: add JSDoc type annotations to implicit any callback params
* fix: guard against undefined results[j] in logo cache loop
* Refactor Backups modal and minor UI cleanups
Refactor the Backups create dialog for clarity and better state handling: reorganized JSX, normalized formatting, extract typed container lists, and ensure closing the dialog clears selected storage. Adjust server/container/storage selection flows and button behaviors to improve readability and UX. Also apply small readability/formatting fixes in DownloadedScriptsTab (expand onClick), FloatingShell (simplify Math.min expression), and GeneratorTab (wrap ternary for containerId). These are mostly non-functional cleanup and UI clarity changes across the mentioned components.
* feat: execute_in container routing + install UI overhaul
- GeneratorTab: remove && !!selectedServer from execInContainer so addon
scripts work in local mode (pct exec works without SSH)
- InstallCommandBlock: add executeIn prop + container picker via tRPC
listContainersOnServer; pass executeInContainer/containerId/containerType
to Terminal so addon scripts run inside the container, not on the host
- InstallCommandBlock: remove GitHub/Gitea source toggle; promote
My Defaults + App Defaults to top-level tabs alongside Default/Alpine/Advanced
- ScriptDetailModal: pass execute_in to InstallCommandBlock; add Runs In
badges to Details panel
* fix: GitHub PAT not applied at runtime + light mode contrast
- route.ts: also set process.env.GITHUB_TOKEN in memory after writing to
.env file - tokens saved via UI now take effect immediately without restart
- github.ts: read process.env.GITHUB_TOKEN directly instead of the frozen
t3-env snapshot (env.GITHUB_TOKEN is captured once at startup)
- github.ts: switch Authorization to 'Bearer' scheme (works for both classic
ghp_ and fine-grained github_pat_ tokens per GitHub docs)
- GeneralSettingsModal: fix text-success-foreground / text-error-foreground
-> text-success / text-error so messages are readable in light mode
(success-foreground is white, which is invisible on bg-success/10)
- GeneralSettingsModal: update PAT description to mention both token types
* fix: unblock pre-release updater TypeScript build + cut pre5
- InstallCommandBlock: fix trpc input type for listContainersOnServer
(serverId now numeric fallback instead of string)
- InstallCommandBlock: align container list mapping to API response shape
(use id/name instead of vmid)
- InstallCommandBlock: narrow running.containerType type to 'lxc' | 'vm'
- VERSION: bump to 1.0.0-pre5
- package.json: bump app version to 1.0.0-pre5 (installer/build logs)
This resolves the pre4 updater build failures reported in PR comments.
* feat: backup dialog UX + generator local-node workflow fixes
Backups:
- render create-backup dialog in portal with full-screen backdrop
- fix multi-select flow: explicit steps (server -> containers -> storage)
- keep container selection until user clicks Continue
- show storage free capacity (GB) from pvesm status
- show estimated max backup size from selected container disk templates
Generator:
- remove 'This machine (local)' execution option
- require node selection; execute over SSH only
- generated command now always uses local script path (scripts/...)
instead of remote curl command
- add install mode tabs: Default / My Defaults / App Defaults / Advanced
- apply mode to command/envVars (mode=default|mydefaults|appdefaults|generated)
- use selected container resources as template defaults (cpu/ram/disk)
API:
- getBackupStorages now enriches storages with available/used/total GB
- add getContainersResourceTemplates for per-container cpu/ram/disk templates
* Add advanced options to generator tab
Expose many new advanced/container, network and feature settings in GeneratorTab: password, tags, timezone, container/template storage, protection, IPv6 method/ip/gateway, search domain, nameserver, TUN, keyctl, mknod, verbose, APT cacher (with IP), mount filesystems and SSH authorized key. Wire these into command overrides, env-vars generation, export/import and reset logic. UI updated with grouped sections, IPv6 selector buttons, new inputs and toggles, and FieldInput now supports input type and hint. Also minor refactor to templateDefaults lookup formatting.
* Format JSX in BackupsTab and GeneralSettingsModal
Apply code style/formatting updates across BackupsTab.tsx and GeneralSettingsModal.tsx: reflow JSX props and elements, add consistent line breaks/commas and minor spacing adjustments (including a spacing fix in the GitHub token text). No logic or behavioral changes.
* feat: filter addon/pve types from sync, display, and script loading
- Add UNSUPPORTED_TYPES constant ['addon', 'pve'] in scripts router
- Filter these types from getScriptCards, getScriptCardsWithCategories
- Block loadScript and loadMultipleScripts for unsupported types
- Remove addon/pve filter options from FilterBar UI
- Remove unused Wrench/Server icon imports from FilterBar
* chore: bump version to 1.0.0-pre6
* fix: add pbs_username to hand-written PBSStorageCredential type
* chore: update dependencies and regenerate lockfile
* feat: hide dev count badge in category sidebar when dev mode is off
* feat: add DHCP/STATIC IPv4 mode pills to generator, show IP/gateway fields only when static
* Fix CategorySidebar JSX and format GeneratorTab
Close a mismatched <span> in CategorySidebar so the inner "dev" badge is properly nested and rendered. Also reformat several single-line conditionals and adjust className ordering/formatting in GeneratorTab for improved readability; these are stylistic changes with no functional behavior changes.
* fix: keep floating shell windows mounted when minimized to preserve session state
Instead of unmounting FloatingShellWindow (which destroyed xterm + WebSocket),
all session windows are now kept in the DOM and hidden via CSS (display: none)
when minimized. This preserves the terminal session, history, and WebSocket
connection across minimize/restore cycles.
* feat: add floating shell access to Scripts, Downloaded, and Detail modal
Shell buttons now appear everywhere an installed container is recognized:
- ScriptDetailModal sidebar: 'Containers' section shows each matching
installed container with a direct Shell button (covers Scripts +
Downloaded tabs via the modal)
- ScriptsGrid / ScriptCard: shell button appears on cards (card and list
view) for scripts that have an installed container
- DownloadedScriptsTab: same shell button on cards and list rows
- ScriptCardList: shell button in the header row alongside website link
Matching is done by normalizing the installed script_name against the
card slug (lowercase, strip extension, replace non-alphanumeric with dash).
Only containers with a valid container_id and non-failed status are shown.
* fix: restore downloaded addon/pve scripts visibility in Downloaded tab
The UNSUPPORTED_TYPES filter was applied at the router level in
getScriptCardsWithCategories and getScriptCards. Since DownloadedScriptsTab
builds its list by cross-referencing local files against the GitHub cards
from this endpoint, addon/pve scripts that were already downloaded locally
were invisibly dropped.
Fix: remove the filter from the router, apply it client-side in
ScriptsGrid's combinedScripts memo instead. This means:
- Scripts grid: still hides addon/pve (can't install them)
- Downloaded tab: shows ALL locally downloaded scripts regardless of type
- loadScript / loadMultipleScripts: still block new addon/pve downloads
* Format imports and object indentation
Reformat code in DownloadedScriptsTab.tsx and ScriptDetailModal.tsx for readability: split the React import across multiple lines, adjust placement/indentation of eslint-disable comments, and reflow object property lines in ScriptDetailModal. These are stylistic changes only and do not modify runtime behavior.
* feat: v1.0.0-pre7 - updater channel fix, configurable detection tag, static IP guard
Fixes:
- fix: updater no longer downgrades prerelease installs to stable
version.ts executeUpdate now uses the v1.0.0 branch when VERSION
contains 'pre', so prerelease users always get the prerelease update.sh
- fix: static IP guard in build.func - if NET is the literal word 'static'
(no CIDR entered), fall back to dhcp with a warning instead of creating
a container with ip=static
- fix: ConfigurationModal no longer sends var_net=static to the script
when no IP address was entered in the static IP field
Features:
- feat: configurable container detection tag (Settings > General)
Users can override 'community-script' with any tag (e.g. 'cs')
Stored in .env as CONTAINER_DETECTION_TAG, used by autoDetectLXCContainers
Version:
- bump VERSION + package.json to 1.0.0-pre7
* fix: preserve downloaded scripts across updates
- pre-release updater now backs up/restores scripts ct/tools/vm/vw
- prevent rsync from overwriting downloaded script directories
- include scripts/vw in update-engine backup/restore/rollback/excludes
This prevents downloaded scripts from disappearing after update and
explains why only bundled defaults (e.g. debian + arcane) remained.
* feat(ui): unify floating terminals and enable addon execution
* chore: bump version to 1.0.0-pre8
* fix(updater): skip engine self-update gracefully when UPDATER_VERSION not on main (pre-release)
* fix: SSH interactive input, suppress rsync output, 4-theme picker, sort containers by ID
* fix(ui): overhaul terminal themes with strong contrast and real preview cards
* feat(pre9): execute_in policy matrix, full type visibility, lxc-only generator
* fix(pre9): make VM/LXC status and type detection server-scoped
---------
Co-authored-by: MickLesk <mickey.leskowitz@levelbuild.com>
|
||
|
|
541fa9a266 |
Change hostname from '0.0.0.0' to '::' to enable dual stack support by default (#519)
0.0.0.0 only listens on legacy IP. changing to :: allows for use on any network - dual stacked, ipv6-only, or ipv4-only |
||
|
|
e1d270d52c |
fix: resolve server from DB for SSH when client sends no ssh_key_path (fixes #466)
- Add resolveServerForSSH() to load full server (including ssh_key_path) from DB when WebSocket server has id but key auth without valid ssh_key_path - Call resolver in handleMessage for all start flows (clone, backup, update, shell, script) so Shell and Update over SSH work with key auth - Extend ServerInfo typedef with auth_type, ssh_key_path for TypeScript |
||
|
|
6d2df9929c |
fix: use node-specific Proxmox config paths for VM vs LXC detection
- isVM(): check /etc/pve/nodes/<server.name>/qemu-server and lxc first, fallback to /etc/pve/qemu-server and lxc for single-node - checkConfigAndExtractInfo, config-existence checks, getContainerHostname, addClonedContainerToDatabase: use node-specific paths - syncLXCConfig/updateLXCConfig: use node-specific LXC config path - server.js clone flow: use node-specific config path Fixes #464 |
||
|
|
b5c6beafff |
Fix #362: auto-detect race, VM shell path, UI hints
- Defer resolve in autoDetectLXCContainers (pct/qm list) so stdout is complete - Pass containerType when opening shell; use qm terminal for VMs, pct enter for LXC - Add UI hint for VM shell (serial console, Ctrl+O, serial port requirement) - Rename auto-detect to Containers & VMs and update help text Fixes #362 |
||
|
|
c88040084a |
Improve server startup logging and update script fetching (#443)
Adds success and error logging to the Next.js app preparation process in server.js, including guidance for missing production builds. In versionRouter, always fetches the latest update.sh from GitHub before running updates, logging the outcome and falling back to the local script if fetching fails. |
||
|
|
7b8c1ebdf1 |
feat: Add default and advanced install method selection
- Add ConfigurationModal component for selecting default or advanced installation mode - Default mode: Uses predefined defaults with minimal user input (hostname from slug, vmbr0, dhcp, etc.) - Advanced mode: Full configuration modal with all environment variables customizable - Add support for IPv4 CIDR input when network mode is 'static' - Add support for IPv6 static address input when IPv6 method is 'static' - Implement password formatting as '-password <password>' for build.func compatibility - Auto-enable SSH when password or SSH keys are provided - Add storage selection dropdowns filtered by server node assignment - Pass environment variables through entire execution stack (frontend -> WebSocket -> SSH/local execution) - Add mode environment variable (always set to 'default' for script execution) - Update ExecutionModeModal to show 'Advanced (Beta)' option |
||
|
|
0ed13fcf0f | Fix linter errors: use Record type, remove unused function, fix floating promises and unsafe types | ||
|
|
dd17d2cbec |
feat: Add VM/LXC cloning functionality
- Add CloneCountInputModal component for specifying clone count - Implement clone handlers and state management in InstalledScriptsTab - Add clone menu item to ScriptInstallationCard - Extend StorageSelectionModal to support clone storage selection (rootdir only) - Add clone terminal support to Terminal component - Implement startSSHCloneExecution in server.js with sequential ID retrieval - Add clone-related API endpoints (getClusterNextId, getContainerType, getCloneStorages, generateCloneHostnames, executeClone, addClonedContainerToDatabase) - Integrate with VM/LXC detection from main branch - Fix storage fetching to use correct serverId parameter - Fix clone execution to pass storage parameter correctly - Remove unused eslint-disable comments |
||
|
|
5bc3933d11 | fix gh action runner | ||
|
|
1c6d1ac120 | fix gh action | ||
|
|
8e22568efb | Add detailed logging for autoSyncInit dynamic import and function checks | ||
|
|
6bb9ed5182 | Use dynamic import for autoSyncInit to avoid tsx caching issues | ||
|
|
74030b5806 |
Refactor lint comments and minor code improvements
Removed or updated unnecessary eslint-disable comments across several server and service files to improve code clarity. Fixed import paths and added TypeScript ignore comments where needed for compatibility. Minor formatting adjustments were made for readability. |
||
|
|
e3e4556f83 |
Add type annotations and improve script services
Enhanced type safety and documentation in several files, including adding explicit type annotations for script objects and function parameters. Improved error handling and code clarity in scriptDownloader.js, and updated autoSyncService.js to remove unnecessary cron job options. Refactored prisma.config.ts for schema configuration and updated server.js to support backup storage and improve parameter defaults. |
||
|
|
66f8a84260 |
Various small fixes (#349)
* Fix script viewer to support vm/ and tools/ scripts - Update ScriptDetailModal to extract scriptName from any path (ct/, vm/, tools/) - Refactor TextViewer to use actual script paths from install_methods - Remove hardcoded path assumptions and use dynamic script paths - Only show Install Script tab for ct/ scripts that have install scripts - Rename CT Script tab to Script for better clarity * Fix downloaded scripts count to include vm/ and tools/ scripts - Update matching logic to use same robust approach as DownloadedScriptsTab - Add normalized slug matching to handle filename-based slugs vs JSON slugs - Add multiple fallback matching strategies for better script detection - Fixes issue where scripts in vm/ and tools/ directories weren't being counted * Filter categories to only show those with scripts - Add filter to exclude categories with count 0 from category sidebar - Only categories with at least one script will be displayed - Reduces UI clutter by hiding empty categories * Fix intermittent page reloads from VersionDisplay reconnect logic - Add guards to prevent reload when not updating - Use refs to track isUpdating and isNetworkError state in interval callbacks - Add hasReloadedRef flag to prevent multiple reloads - Clear reconnect interval when update completes or component unmounts - Only start reconnect attempts when actually updating - Prevents false positive reloads when server responds normally * Fix Next.js HMR WebSocket and static asset handling - Add WebSocket upgrade detection to only intercept /ws/script-execution - Pass all other WebSocket upgrades (including HMR) to Next.js handler - Ensure _next routes and static assets are properly handled by Next.js - Fixes 400 errors for Next.js HMR WebSocket connections - Fixes 403 errors for static assets by ensuring proper routing * Fix WebSocket upgrade handling to properly route Next.js HMR - Create WebSocketServer with noServer: true to avoid auto-attaching - Manually handle upgrade events to route /ws/script-execution to our WebSocketServer - Route all other WebSocket upgrades (including Next.js HMR) to Next.js handler - This ensures Next.js HMR WebSocket connections are properly handled - Fixes 400 errors for /_next/webpack-hmr WebSocket connections * Revert WebSocket handling to simpler approach - Go back to attaching WebSocketServer directly with path option - Remove manual upgrade event handling that was causing errors - The path option should filter to only /ws/script-execution - Next.js should handle its own HMR WebSocket upgrades naturally * Fix WebSocket upgrade handling to preserve Next.js HMR handlers - Save existing upgrade listeners before adding our own - Call existing listeners for non-matching paths to allow Next.js HMR - Only handle /ws/script-execution ourselves - This ensures Next.js can handle its own WebSocket upgrades for HMR * Fix random page reloads during normal app usage - Memoize startReconnectAttempts with useCallback to prevent recreation on every render - Fix useEffect dependency arrays to include memoized function - Add stricter guards checking refs before starting reconnect attempts - Ensure reconnect logic only runs when actually updating (not during normal usage) - Add early return in fallback useEffect to prevent false triggers - Add ref guards in ResyncButton to prevent multiple simultaneous sync operations - Only reload after sync if it was user-initiated * Fix critical bug: prevent reloads from stale updateLogsData.isComplete - Add isUpdating guard before processing updateLogsData.isComplete - Reset shouldSubscribe when update completes or fails - Prevent stale isComplete data from triggering reloads during normal usage * Add update confirmation modal with changelog display - Add UpdateConfirmationModal component that shows changelog before update - Modify getVersionStatus to include release body (changelog) in response - Update VersionDisplay to show confirmation modal instead of starting update directly - Users must review changelog and click 'Proceed with Update' to start update - Ensures users see potential breaking changes before updating |
||
|
|
5d48c7b61c | Merge branch 'main' into feat/lxc_backups | ||
|
|
d50ea55e6d |
Add LXC container backup functionality
- Add backup capability before updates or as standalone action - Implement storage service to fetch and parse backup-capable storages from PVE nodes - Add backup storage selection modal for user choice - Support backup+update flow with sequential execution - Add standalone backup option in Actions menu - Add storage viewer in server section to show available storages - Parse /etc/pve/storage.cfg to identify backup-capable storages - Cache storage data for performance - Handle backup failures gracefully (warn but allow update to proceed) |
||
|
|
4ea49be97d | Initial for Backup function | ||
|
|
72ffc5597f |
feat: Add multi-repository support for script synchronization
- Add Repository model to Prisma schema with migration - Create repositoryService for managing repositories - Add repositories API router with CRUD operations - Update GitHubJsonService to support multiple repositories - Update ScriptDownloaderService to use repository URL from scripts - Add repository_url field to Script and ScriptCard types - Add repository management UI tab to GeneralSettingsModal - Display repository source on script cards and detail modal - Implement repository deletion with JSON file cleanup - Initialize default repositories (main and dev) on server startup |
||
|
|
e0bea6c6e0 |
feat: Add comprehensive auto-sync functionality
✨ New Features: - Auto-sync service with configurable intervals (15min, 30min, 1hour, 6hours, 12hours, 24hours, custom cron) - Automatic JSON file synchronization from GitHub repositories - Auto-download new scripts when JSON files are updated - Auto-update existing scripts when newer versions are available - Apprise notification service integration for sync status updates - Comprehensive error handling and logging 🔧 Technical Implementation: - AutoSyncService: Core scheduling and execution logic - GitHubJsonService: Handles JSON file synchronization from GitHub - AppriseService: Sends notifications via multiple channels (Discord, Telegram, Email, Slack, etc.) - ScriptDownloaderService: Manages automatic script downloads and updates - Settings API: RESTful endpoints for auto-sync configuration - UI Integration: Settings modal with auto-sync configuration options 📋 Configuration Options: - Enable/disable auto-sync functionality - Flexible scheduling (predefined intervals or custom cron expressions) - Selective script processing (new downloads, updates, or both) - Notification settings with multiple Apprise URL support - Environment-based configuration with .env file persistence 🎯 Benefits: - Keeps script repository automatically synchronized - Reduces manual maintenance overhead - Provides real-time notifications of sync status - Supports multiple notification channels - Configurable to match different deployment needs This feature significantly enhances the automation capabilities of PVE Scripts Local, making it a truly hands-off solution for script management. |
||
|
|
5a73a30a92 | fix(server): enforce numeric ssh_port end-to-end; harden UI input; coerce in API/DB; fix runtime handler import | ||
|
|
c33e4f004e | chore: commit via Cursor on 2025-10-20 | ||
|
|
b793c57000 |
refactor: migrate from better-sqlite3 to Prisma (#170)
* refactor: migrate from better-sqlite3 to Prisma - Install Prisma dependencies and initialize with SQLite - Create Prisma schema matching existing database structure - Replace database.js with Prisma-based database service - Update all API routes, tRPC routers, and WebSocket handler - Convert TypeScript types to match Prisma schema - Update build process to include Prisma migrations - Remove better-sqlite3 dependency All database operations now use Prisma while maintaining SQLite backend. * fix: flatten server data in installed scripts API responses - Transform Prisma nested server objects to flattened fields expected by frontend - Update getAllInstalledScripts, getInstalledScriptsByServer, and getInstalledScriptById - Server names should now display correctly in the installed scripts table - Use nullish coalescing operators for better null handling * fix: ensure DATABASE_URL is set in .env for Prisma during updates - Add ensure_database_url() function to update.sh - Function checks if .env exists and creates from .env.example if needed - Automatically adds DATABASE_URL if not present - Call function after restore_backup_files() in update flow - Fixes Prisma client generation error during updates |
||
|
|
ceef5c7bb9 |
feat: Add UI Access button and rearrange the Action Buttons in a Dropdown. (#146)
* feat: Add Web UI IP:Port tracking and access functionality - Add web_ui_ip and web_ui_port columns to installed_scripts table with migration - Update database CRUD methods to handle new Web UI fields - Add terminal output parsing to auto-detect Web UI URLs during installation - Create autoDetectWebUI mutation that runs hostname -I in containers via SSH - Add Web UI column to desktop table with editable IP and port fields - Add Open UI button that opens http://ip:port in new tab - Add Re-detect button for manual IP detection using script metadata - Update mobile card view with Web UI fields and buttons - Fix nested button hydration error in ContextualHelpIcon - Prioritize script metadata interface_port over existing database values - Use pct exec instead of pct enter for container command execution - Add comprehensive error handling and user feedback - Style auto-detect button with muted colors and Re-detect text Features: - Automatic Web UI detection during script installation - Manual IP detection with port lookup from script metadata - Editable IP and port fields in both desktop and mobile views - Clickable Web UI links that open in new tabs - Support for both local and SSH script executions - Proper port detection from script JSON metadata (e.g., actualbudget:5006) - Clean UI with subtle button styling and clear text labels * feat: Disable Open UI button when container is stopped - Add disabled state to Open UI button in desktop table when container is stopped - Update mobile card Open UI button to be disabled when container is stopped - Apply consistent styling with Shell and Update buttons - Prevent users from accessing Web UI when container is not running - Add cursor-not-allowed styling for disabled clickable IP links * feat: Align Re-detect buttons consistently in Web UI column - Change flex layout from space-x-2 to justify-between for consistent button alignment - Add flex-shrink-0 to prevent IP:port text and buttons from shrinking - Add ml-2 margin to Re-detect button for proper spacing - Apply changes to both desktop table and mobile card views - Buttons now align vertically regardless of IP:port text length * feat: Add actions dropdown menu with conditional Start/Stop colors and update help - Create dropdown-menu.tsx component using Radix UI primitives - Move all action buttons except Edit into dropdown menu - Keep Edit and Save/Cancel buttons always visible - Add conditional styling: Start (green), Stop (red) - Apply changes to both desktop table and mobile card views - Add smart visibility - dropdown only shows when actions available - Auto-close dropdown after clicking any action - Style dropdown to match existing button theme - Fix syntax error in dropdown-menu.tsx component - Update help section with Web UI Access and Actions Dropdown documentation - Add detailed explanations of auto-detection, IP/port tracking, and color coding * Fix TypeScript build error in server.js - Updated parseWebUIUrl JSDoc return type from Object|null to {ip: string, port: number}|null - This fixes the TypeScript error where 'ip' property was not recognized on type 'Object' - Build now completes successfully without errors |
||
|
|
546d7290ee |
feat: Add Shell button for interactive LXC container access (#144)
* feat: Add Shell button for interactive LXC container access - Add Shell button to ScriptInstallationCard for SSH scripts with container_id - Implement shell state management in InstalledScriptsTab - Add shell execution methods in server.js (local and SSH) - Add isShell prop to Terminal component - Implement smooth scrolling to terminal when opened - Add highlight effect for better UX - Shell sessions are interactive (no auto-commands like update) The Shell button provides direct interactive access to LXC containers without automatically sending update commands, allowing users to manually execute commands in the container shell. * fix: Include SSH authentication fields in installed scripts data - Add SSH key fields (auth_type, ssh_key, ssh_key_passphrase, ssh_port) to database query - Update InstalledScript interface to include SSH authentication fields - Fix server data construction in handleOpenShell and handleUpdateScript - Now properly supports SSH key authentication for shell and update operations This fixes the issue where SSH key authentication was not being used even when configured in server settings, as the installed scripts data was missing the SSH authentication fields. * fix: Resolve TypeScript and ESLint build errors - Replace logical OR (||) with nullish coalescing (??) operators - Remove unnecessary type assertion for container_id - Add missing dependencies to useEffect and useCallback hooks - Remove unused variable in SSHKeyInput component - Add isShell property to WebSocketMessage type definition - Fix ServerInfo type to allow null in shell execution methods All TypeScript and ESLint errors resolved, build now passes successfully. |
||
|
|
024ffcbf09 |
feat: Add script installation tracking and update functionality (#36)
* feat: Add script installation tracking with Container ID detection
- Add installed_scripts table to database schema
- Implement Container ID parsing from terminal output
- Add installation tracking for both local and SSH executions
- Create InstalledScriptsTab component with filtering and search
- Add tab navigation to main page (Scripts | Installed Scripts)
- Add tRPC endpoints for installed scripts CRUD operations
- Track installation status, server info, and output logs
- Support both local and SSH execution modes
* fix: Resolve SQL syntax error in database queries
- Change table alias from 'is' to 'inst' in SQL queries
- 'is' is a reserved keyword in SQLite causing syntax errors
- Fixes getAllInstalledScripts, getInstalledScriptById, and getInstalledScriptsByServer methods
* feat: Enhance Container ID detection and add manual editing
- Add comprehensive Container ID detection patterns for various script formats
- Add debug logging to help identify detection issues
- Add manual Container ID editing feature in the frontend
- Add updateInstalledScript tRPC mutation for updating records
- Improve Container ID column with inline editing UI
- Test and verify Container ID detection is working (detected 132 from 2fauth script)
* fix: Improve Container ID detection with ANSI code handling
- Add ANSI color code stripping before pattern matching
- Add primary pattern for exact format: 🆔 Container ID: 113
- Test patterns on both original and cleaned output
- Add better debug logging to show matched text
- This should fix Container ID detection for Proxmox scripts
* feat: Add script update functionality with terminal output
- Add Update button for each installed script (only shows when container_id exists)
- Add WebSocket support for update action (pct enter <ct-id> -- update)
- Add updateScript tRPC endpoint for initiating updates
- Add startScriptUpdate, startLocalScriptUpdate, startSSHScriptUpdate methods
- Modify Terminal component to handle update operations
- Display real-time terminal output for update commands
- Support both local and SSH execution modes for updates
- Show 'Update Container <ID>' in terminal title for update operations
* fix: Fix SSH update functionality
- Replace sshService.executeScript with direct sshpass command
- Use bash -c to execute SSH command: sshpass -p 'password' ssh -o StrictHostKeyChecking=no user@ip 'pct enter <ct-id> -- update'
- This fixes the 'Permission denied' and rsync errors
- SSH updates now work properly for remote containers
* fix: Fix WebSocket update action handling
- Add containerId to WebSocketMessage typedef
- Extract containerId from message in handleMessage function
- Remove debug logging from Terminal component
- This fixes the 'containerId is not defined' error
- Update action should now work properly without creating script records
* feat: Add Update functionality for installed scripts
- Add Update button to InstalledScriptsTab for scripts with Container ID
- Modify Terminal component to handle update operations with isUpdate and containerId props
- Add startUpdateExecution method to WebSocket handler
- Implement local update execution using 'pct enter <CT ID> -c update'
- Implement SSH update execution for remote servers
- Update WebSocket message parsing to handle update parameters
- Users can now update installed scripts by entering the LXC container and running update command
* fix: Fix SSH update execution by using direct command execution
- Add executeCommand method to SSH service for direct command execution
- Update startSSHUpdateExecution to use executeCommand instead of executeScript
- This fixes the rsync permission denied error when updating scripts via SSH
- Update functionality now works properly for both local and SSH installations
* fix: Add server credentials fetching for SSH updates
- Create servers router with getServerById endpoint
- Update handleUpdateScript to fetch full server details including credentials
- This fixes the permission denied error by providing user/password for SSH authentication
- SSH updates now have access to complete server configuration
* fix: Simplify server credentials fetching for SSH updates
- Add server_user and server_password to database query
- Update InstalledScript interface to include server credentials
- Simplify handleUpdateScript to use data already available
- Remove complex tRPC server fetching that was causing errors
- SSH updates now work with complete server authentication data
* fix: Correct pct enter command sequence for updates
- Change from 'pct enter <CT ID> -c "update"' to proper sequence
- First run 'pct enter <CT ID>' to enter container shell
- Then send 'update' command after entering the container
- Apply fix to both local and SSH update execution methods
- Add 1-second delay to ensure container shell is ready before sending update command
* fix: Increase delay to 4 seconds before sending update command
- Change delay from 1 second to 4 seconds for both local and SSH updates
- Ensures container shell is fully ready before sending update command
- Prevents premature command execution that could fail
* cleanup: Remove all debug console.log statements
- Remove debug logging from server.js WebSocket handlers
- Remove debug logging from Terminal component
- Remove debug logging from page.tsx
- Remove debug logging from ExecutionModeModal component
- Remove debug logging from githubJsonService.ts
- Keep only essential server startup messages and error logging
- Clean up codebase for production readiness
* fix: Resolve all build and linter errors
- Fix React Hook useEffect missing dependencies in Terminal.tsx
- Fix TypeScript unsafe argument error in installedScripts.ts by properly typing updateData
- Add missing isUpdate and containerId properties to WebSocketMessage type definition
- Add proper type annotations for callback parameters in server.js
- Fix TypeScript errors with execution.process by adding type assertions
- Remove duplicate updateInstalledScript method in installedScripts.ts
- Build now passes successfully with no errors or warnings
|
||
|
|
433d8121e8 |
Fix TypeScript and ESLint errors (#31)
- Add proper type annotations for WebSocketMessage and ServerInfo types - Fix type imports to use type-only imports where appropriate - Replace logical OR operators with nullish coalescing operators - Fix floating promises by adding void operator - Add proper type assertions for database results - Fix useEffect dependencies in Terminal component - Remove unused variables and fix unescaped entities - Add JSDoc type annotations for database methods - Fix singleton instance type annotations |
||
|
|
a053275d70 |
Remove debug console.log statements from WebSocket handler
- Removed verbose debug output from WebSocket connection logs - Removed script execution debug messages - Removed input handling debug logs - Kept important error logging and server startup messages - WebSocket functionality remains fully intact |
||
|
|
57293b9e59 |
Fix script execution issues and improve container creation
- Fixed syntax errors in build.func (duplicate export, unmatched quotes) - Fixed color variable initialization by calling load_functions in core.func - Replaced undefined function calls (post_to_api, post_update_to_api) with echo statements - Fixed install script execution by copying scripts into container first - Made create_lxc.sh executable - Improved error handling and script sourcing - Added missing core functions and tools - Enhanced script downloader and local script management |
||
|
|
c739196dc2 |
fix: Use resolved absolute path for script execution
- Fix script execution by using resolvedPath instead of scriptPath - This ensures the correct absolute path is used when spawning bash - Previously was looking for scripts/ct/script.sh inside scripts/ directory - Now correctly uses /root/Dev/PVESciptslocal/scripts/ct/script.sh |
||
|
|
030cd9ec9a | Got the terminal working | ||
|
|
6ee5c5c017 | PoC |