Commit Graph

13 Commits

Author SHA1 Message Date
js d2791d3db7 improve: stream distrobuilder output to build logs in real-time
Added on_output callback to _run_doas_command so build logs update
live during the distrobuilder process instead of only after completion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:28:43 +00:00
js 9a0a6b501a fix: move build_image to background job to prevent gunicorn timeout
The build_image process (distrobuilder + image upload) takes 10+ minutes,
exceeding gunicorn worker timeout. Now uses frappe.enqueue() with Redis
cache for real-time progress tracking and frontend polling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:08:28 +00:00
js da71d91294 improve: graceful rebuild process with service readiness checks
Backend (sites.py):
- Graceful stop with fallback to force stop on timeout
- Verify container actually stopped/started before proceeding
- Wait for database readiness before running bench migrate
- Better log formatting: ✓/✗/⚠/→ prefixes, step numbers [1/5]-[5/5]
- Show manual command hint when migrate output is empty
- Separate migrate success tracking from overall rebuild success

Frontend (SiteDetail.vue):
- Step-by-step progress indicators during rebuild (5 steps)
- Elapsed time counter for both rebuild and migrate
- Terminal-style log viewer (dark background, colored output)
- Empty lines preserved for readability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 12:12:06 +00:00
js 430a8c521f fix: use uvx for bench migrate in containers, add migrate progress bar
- Fix bench migrate command to use `su frappe -c 'uvx --from frappe-bench bench migrate'`
  instead of bare `bench migrate` which fails with exit code 127
- Apply fix to both run_bench_migrate and rebuild_container functions
- Increase migrate timeout from 300s to 600s
- Add animated progress bar with elapsed time counter to migrate modal
- Separate migrate progress UI from rebuild progress UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:32:17 +00:00
js 69b889c07a feat: add bench migrate button and auto-migrate after rebuild
Add standalone Migrate button in site detail and checkbox to run
bench migrate automatically after container rebuild. Includes new
_exec_in_container helper for running commands inside containers
via Incus exec API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:39:55 +00:00
js 771053b8f1 feat: add doas password to build image process
- Build Image modal now requires doas password field
- Backend build_image() uses pty.fork()-based _run_doas_command from
  servers.py instead of doas -n (which required nopass config)
- Build runs distrobuilder via sh -c with cd to build directory
- Cleanup also uses doas with password via PTY
- Start Build button disabled until password is entered

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:15:47 +00:00
js a86fecaf2a fix: restore colored icons, move distrobuilder to Apps, fix doas pty.fork
- Restored colored icon circles (green shield, orange alert) for certificate
  section in Servers while keeping semantic tokens for backgrounds
- Moved distrobuilder setup section from Servers to Apps tab where it
  logically belongs
- Fixed doas TTY error by using pty.fork() instead of pty.openpty() —
  pty.fork() properly sets up a controlling terminal that doas requires

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:07:36 +00:00
js 4f6c07b14b fix: semantic dark mode for Servers, doas PTY for install, container-not-found detection
- Servers page now uses frappe-ui semantic tokens (bg-surface-gray-*, text-ink-gray-*)
  matching Dashboard style instead of explicit bg-green-50/dark:bg-green-950 etc.
- doas install uses Python pty module to create a real pseudo-terminal,
  fixing "doas: a tty is required" error
- SiteDetail detects externally deleted containers and shows "Container Not Found"
  screen with Retry/Back buttons instead of silently failing
- Action errors (start/stop/restart/delete) now show dismissible error banner

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:22:44 +00:00
js f324f04ee9 feat: password-based doas install, proper dark colors, delete container
- Distrobuilder install now prompts for doas password instead of
  requiring nopass config. Password is piped to doas via stdin.
  Manual install hint shown instead of doas.conf rules.
- Restore original colored backgrounds (green/yellow/blue/red) for
  light mode and add proper dark: variants (dark:bg-*-950/30) so
  both themes look good
- Add delete container button with confirmation dialog that requires
  typing the container name to confirm
- Fix snapshot default name to include seconds to avoid duplicates
- Fix certificate modal textarea to use theme-aware colors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:04:44 +00:00
js c42b978df9 fix: dark mode colors, install button alignment, doas tty error
- Use doas -n (non-interactive) flag to avoid "a tty is required" error
  in distrobuilder install and image build commands
- Replace hardcoded light-only colors (bg-green-50, bg-yellow-50, bg-blue-50)
  with semantic tokens (bg-surface-gray-2/3, text-ink-gray-*) for proper
  dark mode support in Panel Certificate and Software Setup sections
- Fix install button alignment in modal with proper flex wrapper
- Update doas.conf example to show all needed rules (apk, distrobuilder, rm)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:51:24 +00:00
js 9dfce44d99 fix: real-time dark theme toggle, rebuild container error, and UI improvements
- Fix dark theme: use data-theme attribute (frappe-ui standard) instead of .dark class
  so theme switches instantly without page reload
- Fix rebuild_container ValidationError: pass target_server param from frontend
- Also pass target_server to snapshot create/restore/delete calls
- Improve distrobuilder status UI: show version, better icons and colors
- Fix install button alignment in distrobuilder modal
- Add inline theme script in index.html to prevent flash on load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:33:17 +00:00
js d6b2b6da23 feat: Admin Panel for Incus container management 2026-02-05 22:17:42 +00:00
frappe fc64cd4a1f feat: Initialize App 2026-01-26 17:50:49 +00:00