Commit graph

89 commits

Author SHA1 Message Date
2e0c6cdba7 fix: replace storage.cfg parser with pvesm status for reliable pool discovery; add Custom... dropdown option 2026-07-27 08:52:34 +00:00
e53fcacaa6 fix: show all leftover sessions — resumable ones get Resume, stale ones get Clean Up 2026-07-27 07:52:48 +00:00
df6b8085ca feat: landing page with Download, SCP Pull, and Resume cards
- Hero header at top describing the app
- Two side-by-side cards: Download (URL) and SCP Pull
- Resume sessions section appears above cards when sessions exist
- Download card expands to inline form
- Resume asks for VM Name/ID only, skips URL field
- Clean separation of entry points
2026-07-27 07:48:14 +00:00
162110b4b1 fix: only show resumable sessions with archives or disk images; pass single first file name not joined list 2026-07-27 07:46:02 +00:00
a030a83207 fix: session scanner now walks in/ recursively — finds files inside extracted subdirectories 2026-07-27 07:41:10 +00:00
8eb1def62b feat: session resume — detect leftover staging dirs and offer to resume analysis
- GET /api/v1/sessions scans tmp/ for session dirs with staged files
- Index page shows resumable sessions with filenames and sizes
- Resume button skips download and starts analysis with stored session_id
- session_id carried through analysis → confirm → job for correct file paths
2026-07-27 07:38:00 +00:00
631f08fc31 fix: SCP polling page now shows reuse section + clone/copy/cleanup buttons work 2026-07-27 07:33:05 +00:00
9bab8e95a1 fix: storage.cfg parser was stripping indentation before checking line.startswith(' ') — property lines never parsed 2026-07-27 07:26:32 +00:00
dc023c8572 fix: show storage dropdown even when only one pool available 2026-07-27 07:24:56 +00:00
e3bc7929c6 fix: storage pool list now filters by content type — only pools with 'images' support are shown 2026-07-27 07:08:02 +00:00
7eb2d6bb45 feat: storage pool dropdown populated from /etc/pve/storage.cfg
- New GET /api/v1/storage/pools returns available lvmthin/zfspool/rbd/dir pools
- Analysis result template now shows dropdown when >1 pool available
- Falls back to text input with single pool or on discovery failure
2026-07-27 06:55:10 +00:00
878bc66da8 feat: add .ova support — OVA files are tar archives containing .vmdk disks 2026-07-26 07:42:06 +00:00
0c2b11f2d2 fix: guard against missing analysis_id and limit poll error retries 2026-07-26 07:03:41 +00:00
1ecaefe1d8 feat: async analysis with polling + nested archive extraction
- Backend /api/v1/analyze now returns 202 with analysis_id immediately
- New GET /api/v1/analyze/{id} for polling analysis status
- Background thread handles extraction, disk discovery, OS/EFI detection
- Nested archive extraction: handles chained zips and split zips (.z01-.zNN)
- Frontend polls /session/analyze/status/{id} every 2s until complete
- SCP page now has complete confirm form flow with job polling
2026-07-26 00:13:14 +00:00
1e14d96052 docs: update README with current directory layout, install script download link, SCP/clone features, and session isolation 2026-07-25 18:17:09 +00:00
f1978008bd fix: use relative paths for STAGING_ROOT and LOG_DIR so backend works on host regardless of install location 2026-07-25 17:50:13 +00:00
f7c6527d3d chore: add AGENTS.md, move install.sh to root, rename frontend install.sh → setup.sh 2026-07-25 17:40:59 +00:00
root
ef2d74a62b fix: remove qemu-utils from installer + configurable storage path
1. Removed qemu-utils from required packages — Proxmox ships its own
   qemu-img and installing Debian's version breaks VMs. Added preflight
   check: if qemu-img missing, exits with clear error message.

2. Installer now prompts for host storage path (default:
   /mnt/pve/hosted-thin). Uses it for the LXC bind mount mp0.
   The LXC always sees /mnt/converter internally — no symlinks needed.
2026-07-25 11:23:26 +00:00
b33ab1605e fix: auto-cleanup staging files to minimize disk usage
Deletes intermediate files as conversion progresses:
- Archive (.7z/.zip) after extraction
- Source VMDK after qemu-img convert
- Local QCOW2 after qm disk import

Reduces peak storage from zip+VMDK+QCOW2 to just the largest
single file — critical for the 94 GB rootfs with 87 GB images.
2026-07-24 10:06:12 +00:00
a7ab9243c0 feat: SCP probes remote file size via SSH before pull
Runs 'ssh stat -c%s' or 'ls -l' to get total bytes before starting
SCP transfer. Progress bar now shows real percentage and ETA
instead of indeterminate spinner.
2026-07-24 09:48:43 +00:00
cd5f31505a fix: capture SCP stderr for better error messages 2026-07-24 09:43:19 +00:00
6e161a6105 fix: STAGING → _staging() in SCP disk check 2026-07-24 09:17:54 +00:00
6d4066784d ux: show exact auto-shrink target + warning about complex layouts 2026-07-23 13:04:00 +00:00
cd8d86a98c fix: auto-shrink to 10% of virtual size, min 20 GB
Replaces flat 30 GB default with proportional sizing:
- 500 GB → 50 GB, 200 GB → 20 GB, 80 GB → 20 GB
- Less aggressive for large disks, safer for GRUB boot
- Update UI hint and README to reflect new rule
2026-07-23 12:45:32 +00:00
778e929985 refactor: remove browser file upload — download + SCP only
- Removed UploadFile handling, upload-raw endpoint, source type selector
- index.html: single URL input, 'Download & Analyse' button
- session_upload simplified to download-only (aria2c)
- Removed dead code: _check_disk_space, UPLOAD_PROGRESS_INTERVAL,
  MIN_FREE_DISK_GB, UploadFile/File imports
- SCP Pull remains as separate /scp page
2026-07-23 12:33:23 +00:00
2d347692db fix: indentation error from aria2c edit 2026-07-23 11:21:07 +00:00
9110eb41bd feat: use aria2c for parallel downloads (8 connections, resumable)
Replaces wget with aria2c -x8 -s8 for significantly faster
downloads, especially on high-latency connections. Falls back to
single-connection if the server doesn't support range requests.
2026-07-23 11:19:13 +00:00
d050b8e6ed fix: progress bar min 1% + spinner for first 5% 2026-07-23 11:11:47 +00:00
344b3b189f debug: console.log upload progress events 2026-07-23 11:01:49 +00:00
5f2cb3dc64 fix: show MB during upload for values <100MB, GiB after
0.00008 GiB rounded to 0.0 — looked like no progress. Now shows
'16 MB' → '128 MB' → '0.5 GiB' → '1.9 GiB' as upload progresses.
2026-07-23 10:59:24 +00:00
39cf91cbc4 fix: corrupted event listeners and undefined sessionId from overzealous string replace
The Python replacement script changed ALL 'error' strings to
'pve-alert pve-alert-error', including:
- addEventListener('error', ...) → broken event listener
- data.phase === 'error' → never matched
- sessionId variable definition was lost/doubled

Restored proper event names and phase comparisons.
2026-07-23 10:56:50 +00:00
6db69f434c fix: Clean Up now deletes entire session directory tmp/{guid}/
- Backend cleanup_staging accepts session_id, deletes whole
  STAGING_ROOT/{guid}/ dir when provided
- CleanupRequest model gets session_id field
- Frontend cleanup proxy passes session_id from body
- api_client passes session_id to backend
- reuseImage JS includes session_id in cleanup payload
2026-07-23 10:54:42 +00:00
90bf8e4842 fix: remove unused out_dir from submit_job + Copy flow uses legacy fallback
1. submit_job() was creating empty tmp/out/{vmid}/ dirs via the old
   flat STAGING_OUT path. Removed — _process_job handles this via
   _staging_out() in the session-aware path.

2. Copy (re-convert) flow was hardcoding boot_type=uefi. Now uses
   auto_detect_boot=true with boot_type=legacy as fallback, matching
   the behavior of the original analyze→convert flow.
2026-07-23 10:52:20 +00:00
6617aca341 fix: purge all old staging path references — full code review cleanup
Bugs found and fixed:
- converter.py: STAGING_IN.iterdir() → extract_base.iterdir()
  (checked wrong dir when source was in session subdir)
- vm-bench.service: TMPDIR=/mnt/converter/in → /mnt/converter/tmp
  (old path poisoned all temp file writes)
- backend/app.py: removed unused STAGING_IN constant
- converter.py: removed unused STAGING_OUT constant
- install.sh: removed creation of old /in and /out dirs
2026-07-23 10:36:03 +00:00
1b145adea7 fix: extraction uses file's parent dir as base, not hardcoded STAGING_IN
extract_if_needed now extracts relative to the source file's parent
directory instead of /mnt/converter/tmp/in/. This correctly handles
files in tmp/{guid}/in/ paths.
2026-07-23 10:19:43 +00:00
7a024ca166 fix: correct staging path resolution — tmp/{guid}/in not tmp/in/{guid}
Frontend now passes '{guid}/in/filename' to backend.
Backend extract_if_needed uses STAGING_ROOT (tmp/) as base.
Provisioner staging helpers build tmp/{guid}/in + tmp/{guid}/out.
2026-07-23 10:14:19 +00:00
9dcde5d022 fix: flatten nested single-child directories after extraction
Archives like Debian_13_VMG.7z contain nested single-child dirs:
  Debian_13_VMG_LinuxVMImages.COM/Debian_13_VMG_LinuxVMImages.COM/

_flatten_nested() collapses these chains until files sit directly
in the parent, eliminating the double-nesting issue.
2026-07-23 10:09:25 +00:00
a28e2af674 refactor: move staging to /mnt/converter/tmp/{guid}/in + out 2026-07-23 10:07:57 +00:00
fc380f7d08 fix: add session_id to copyVM payload (Copy flow was missing it) 2026-07-23 09:51:30 +00:00
bc20691390 fix: prepend session GUID to filename when calling backend analyze
When files are stored in /mnt/converter/in/{guid}/, the backend
needs the full relative path. The analyze endpoint now constructs
'{guid}/{filename}' before passing to the backend API.
2026-07-23 09:46:28 +00:00
e53d05f7dc fix: add missing _staging_in helper + STAGING_IN constant 2026-07-23 09:36:50 +00:00
63659e4f93 feat: session GUID isolation for multi-user support
Each browser gets a UUID stored in localStorage, set as a cookie,
and attached to every API call. Files go to session-specific dirs:

  /mnt/converter/in/{guid}/    — uploads, downloads, SCP pulls
  /mnt/converter/out/{guid}/   — converted QCOW2s

Changes:
- base.html: generates UUID via crypto.randomUUID(), stores in
  localStorage + cookie, exposes as window.VM_BENCH_SID
- Frontend: all endpoints accept session_id, _staging() helper
  creates session-aware paths on demand
- JavaScript: session_id appended to all FormData, set as
  X-Session-ID header on raw uploads
- Backend models: JobSubmissionRequest.session_id field added
- Provisioner: _staging_in/_staging_out helpers, source path
  resolution uses session-aware directory
- Converter: extract_if_needed skips re-extraction if dir exists
2026-07-23 09:32:16 +00:00
7ded831354 fix: skip re-extraction if source directory already exists
When reusing a source image (Copy flow), the archive was already
extracted in /mnt/converter/in/. The extraction step failed with
'Destination path already exists' from 7z.

Now extract_if_needed checks if the expected output directory already
contains disk images, and returns it directly without re-extracting.
2026-07-23 09:28:02 +00:00
111d0d1331 chore: remove debug console.log from toggleSourceInput 2026-07-23 09:22:06 +00:00
fd4f8744d2 style: light Proxmox VE theme — white panels, blue header, light badges
Rewrote to match actual Proxmox VE light interface:
- #f0f0f0 page background, white panels
- Dark blue header (#1b3a5c) with white text
- Light gray panel headers (#f8f8f8)
- Bootstrap-style alert colors (yellow/blue/green/red)
- Orange accent throughout
2026-07-23 09:21:07 +00:00
272feefd36 debug: add console.log to toggleSourceInput 2026-07-23 09:19:36 +00:00
b2dbfe81f9 fix: custom select dropdown arrow visible on dark background
Native browser select arrows don't adapt to dark backgrounds.
Added appearance:none with a light SVG chevron via background-image.
2026-07-23 09:17:42 +00:00
4bebbd9da9 fix: add cache-busting ?v=2 to CSS link (nginx was caching old stylesheet) 2026-07-23 09:11:28 +00:00
844d86c105 style: Proxmox VE-inspired dark theme — pve-* class naming
Rewrote proxmox.css with consistent pve- prefix matching the Proxmox
VE design language: panels with orange-accent headers, clean tables,
orange progress bars, green/red/orange badges, subtle shadows.

Updated all templates (base, index, _analysis, polling, scp)
to use pve-btn, pve-input, pve-select, pve-panel, pve-progress,
pve-badge, pve-alert, pve-spinner, pve-hidden, pve-dim, etc.
2026-07-23 09:09:29 +00:00
492924f346 fix: remove dangling } from regex cleanup of submitReuse 2026-07-23 09:05:11 +00:00