1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00
Commit graph

2259 commits

Author SHA1 Message Date
catborise
34048dce83 fix(instances): a disk form loaded before the disk changed changes nothing
The Edit, Detach and Delete forms of a VM's disk name it by its device:
the view acted on whatever disk had that device by then. A form loaded
before a disk move, an external snapshot or another tab's change wrote the
old path back over the new one (the VM then starts from an old or deleted
file), or detached and deleted the volume that replaced it.

The forms already send the path they show. The views now refuse a disk
whose path is not that one, and tell the user to reload the page. Turkish
and Chinese texts included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 12:55:34 +03:00
catborise
a53a3623d2 fix(instances): a VM's saved state keeps the disks it starts with
A VM with a saved state (managed save, as libvirt-guests leaves VMs when
its host shuts down) shows as shut off, and its start restores the
definition it was saved with. The panel let the VM's Delete remove a disk
of it, and the storage pool delete a volume detached since: the VM then
did not start ("Cannot access storage file"), and the panel has no way to
drop the saved state.

A VM's Delete now refuses a disk while the VM has a saved state, and a
volume in a domain's saved state is in use for every delete check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 12:55:34 +03:00
catborise
a4bfe77949 fix(instances): the Secure Boot machine type warning is in the user's language
A new VM with UEFI Secure Boot on a machine type other than q35 is made
on q35, and the create page says so. That warning was an English-only
string; it is now a translated message, with Turkish and Chinese texts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 10:30:54 +03:00
catborise
9fa898a856 fix(instances): a new VM cannot take the MAC address of another VM on its host
The create form and API took a MAC address for a new VM's NIC without
looking at the host's other VMs, so a VM could be defined with a MAC
another one has. Running on one network, neither NIC is reached reliably.
A clone already refused this among its own NICs.

The create now refuses a MAC a NIC of a VM on the host has, in any form
the field takes (case, colons), including a NIC added for a VM's next
boot only. The worker checks again before it defines the VM, since
another VM may take the address while the job is queued. Turkish and
Chinese texts included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 10:30:54 +03:00
catborise
590b8d956d fix(instances): a create whose definition answer was lost keeps the VM's disk
A definition can go through on the host while its answer is lost, as when
the connection drops right then. The create job took every failed
definition for none and deleted the new disk and seed, so the VM could be
left defined without them, and recovery then reported it created.

The job now asks the host for the VM's UUID first. Only when the host says
there is no such VM do the new volumes go; otherwise they stay and recovery
decides, recording the VM it finds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 10:30:54 +03:00
catborise
b7c5f98ba5 fix(instances): a volume already named as a new VM's disk refuses the create
A new disk or template copy whose name a volume of its pool already had
made the job fail on it; recovery then took that volume for the job's own,
ended the job uncertain and kept its claims, so no VM could be created on
that compute until an admin resolved it. Recovery also took a volume of the
same name in any other pool for the job's, and one in a stopped pool for
nothing left.

The form, the API and the worker now refuse a name a volume of the disk's
pool already has, as they did for a template copy's .img only. Recovery
looks in the job's own pools; one that is not running cannot be listed, so
recovery waits for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-11 10:30:54 +03:00
catborise
417be11616 fix(console): a VNC console whose access check fails is closed, not left unchecked
novncd checks every 10 seconds that an open VNC console's user may still
open it. An error in that check, such as a locked database, ended the
checking thread and left the session open for good, unchecked: a user
removed from the VM afterwards kept its console. The session now ends
with a warning in the log, as a serial console's worker does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 19:01:21 +03:00
catborise
16ad625cda fix(console): a console the server closes says Connection lost, not Disconnected
The VNC and serial pages showed "Disconnected", as if the user had ended
the session, when the VM stopped, was migrated or the console daemon
restarted: noVNC calls a close by the server clean, and the serial page
had a single text. "Disconnected" is now kept for the user's own
Disconnect; any other end of a working connection is "Connection lost"
(the serial terminal still prints the server's reason).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 19:01:21 +03:00
catborise
450ffbba30 fix(console): Reconnect after a migration opens the console on the VM's new compute
A console page's link names the compute the VM ran on. After a migration
moved the VM, the page's Reconnect asked for it there and got "User does
not have permission to access console or host/instance not exist". The
console page now sends the user to the VM's new compute when that is the
only VM with the UUID the user may open; others still get the same 403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 18:58:05 +03:00
catborise
1488baea7a fix(console): a serial console waits for its VM's start instead of closing
While a VM starts, libvirt shows it paused, reason "starting up", before
its devices are set up. The worker took that for a running VM, asked for
its console before the terminal existed ("PTY device is not yet assigned")
and closed, although it had just said that the console opens again when
the VM starts. A VM paused while starting up now counts as not running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 18:57:20 +03:00
catborise
65bd5da471 test(instances): the live create-from-template job names the template's pool
Since 8f09812b a new VM's template is taken from the pool the form names
(template_pool). That change updated the live view test but not the live
job test, which left template_pool out: the create job looked the
template up in a pool named '' and failed, on live runs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 16:39:42 +03:00
catborise
7a888bc32e docs(readme): a Docker update and rollback keep the TLS client certificates
Up to v4.3.0 the Docker image had no volume for /var/www/.pki, so TLS
client certificates put there lived in the container. The Docker update
recreates the container: following README "Updating" from v4.3.0 lost
them, and the TLS computes could not be reached. Checked with a v4.3.0
container holding a certificate and key.

The update now copies /var/www/.pki into the backup directory after the
old container stops (an empty one when an old container has none),
creates the new container without starting it, copies them in and
starts it; the start script gives them to www-data. The Docker rollback
puts them back the same way from the backup and gives them to www-data
itself: an image of v4.3.0 or older neither keeps them in a volume nor
fixes their owner at start.

Run from the README: update from v4.3.0 without .pki, with a certificate
and key, and master to master; then a rollback of the second to v4.3.0.
Each came up healthy, the key readable by www-data with mode 600.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 15:34:28 +03:00
catborise
5ab3644833 fix(instances): a disk move or migration leaves one check on a stuck host
Whether a moved disk's old file is used elsewhere is asked of every
compute in a thread the job waits on for at most 60 s. A host that did
not answer kept that thread, and each later disk move or migration left
one more. As the VM delete's check does, a compute that does not answer
is not asked again: the file counts as used, so it is kept.

Both checks marked a compute as not answering from the moment they
asked it. A check beside another one (two jobs at once) took a healthy
compute that the other was asking for a stuck one, and refused at once;
and two overlapping checks could both ask a stuck one, the first to end
clearing the mark of the other. Each call to a compute now records when
it started, and a compute counts as not answering only while a call to
it has run for 60 s, checked again just before each compute is asked.

And a VM delete's check whose thread had not yet reached the first
compute when the 60 s ran out found no failure and no compute it was at,
and answered that no file was used: the disks could have been deleted
unchecked. It now counts as not answered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:48:14 +03:00
catborise
d69d149d97 fix(operations): a housekeeping pass is not started while one runs
The worker started housekeeping every 10 minutes on its control threads
whether or not the last pass had ended. A pass stuck on a host (the
cleanup of an idle upload on a host that does not answer) took one more
thread each time, and after four passes no control thread was left for
cancels and recovery. The next pass now starts only after the last one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:48:14 +03:00
catborise
db1db4cb32 fix(logging): the web workers rotate the panel's log without losing lines
Every gunicorn worker had its own RotatingFileHandler on the panel's log.
Once one rotated it, the others went on writing into the renamed file and
rotated again in turn: the log then held the lines of one worker, and the
others' went into the old files and were deleted with them. The handler
is now concurrent-log-handler's, which rotates under a lock file and
reopens the log after another process rotated it.

That handler keeps no file open, so socketiod's copy of its stderr can be
fd 3, the number a serial console worker logs to: dup2 onto itself kept
it close-on-exec and the worker failed to start. It is made inheritable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:48:14 +03:00
catborise
30da02e25e fix(computes): a VM gone from its compute gives no copy its owners
When a VM left its compute and its UUID was listed on another, its owners
moved there: an out-of-band move. With the UUID on two other computes,
the first record found got them, which may be an independent copy, giving
its owners another VM and charging their quota for it. The owners now
move only when one other compute lists the UUID; otherwise they are kept
on the Removed VMs page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
b95f2a28d7 fix(instances): the VM page's DRBD state does not rewrite the VM's record
With VM DRBD Status on, the VM page saved the whole record it had read
after waiting up to its ssh timeout for the host. A migration or delete
that finished meanwhile was undone: the record moved back to the old
compute, or came back without its owners. Only the DRBD state is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
12e33f7964 fix(computes): a compute is not edited while a job on it is admitted
A job resolves its compute's connection when it runs. Changing the
compute's hostname meanwhile sent the job to another host, where a VM
with the same UUID (a copy) could be deleted or changed instead. An edit
now holds the compute as a delete does, and is refused while a job or VM
operation on it is admitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
a2f4d3fe06 fix(instances): an open VM page follows its VM's removal on the host
A VM undefined outside the panel (virsh, virt-manager) while its page was
open made the state and statistics polls answer 500 every 5 seconds, each
an error in the panel's log, and the page stayed as it was. A page read of
an object the host no longer has is now 404, and the VM page reloads on a
404 of its state: it then goes to the VM list with "no longer on its host",
or shows that the VM is not found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
373760f2c5 fix(instances): a VM name of any length libvirt takes is kept
libvirt names a VM by its <name>.xml file, so a name can have up to 251
bytes. The panel's VM, removed-VM and log records held 120 characters:
on PostgreSQL one longer name made the host's sync fail and the VM list
answer with an error. They now hold 255.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:11:22 +03:00
catborise
e83bdcbd44 fix: worker warnings and CPU windows do not depend on a wall clock
The job panel warned "Worker unavailable" when the worker's last
heartbeat was more than 60 s older than the browser's clock: a browser
set two minutes ahead warned about a worker that had just beaten, and
one behind hid a worker that had stopped. The server now says whether
the worker is gone (worker_gone in the job panel's answer), by the same
rule as the Jobs page.

A host's CPU graph measured its averaging window with time.time(): a
clock set back between two polls gave a negative window. It now uses
time.monotonic(), as a VM's usage already does; a sample from before
the server restarted is measured over a second again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 12:21:36 +03:00
catborise
25e49c2aa2 fix: backups and snapshots keep their order when the clock goes back
Backup retention kept the last --keep backups by name, and a name is the
panel's local time. Where the clock goes back an hour in autumn
(TIME_ZONE=Europe/Berlin), a backup at 02:10 CET forty minutes after one
at 02:50 CEST sorted first, and --keep 1 deleted the new one. Retention
now keeps the newest by when they were made (the directory's mtime);
the names stay as they were.

Snapshot times from libvirt (epoch seconds) became naive local times,
which the snapshot list sorts newest first: in the same hour the older
snapshot came first. They are now aware UTC times; the page still shows
them in the panel's time zone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 12:21:36 +03:00
catborise
0d20d07b29 fix(ui): host and VM charts give their points the panel's time
A host's charts and their "Updated at" line took their times from
timezone.now(), which is UTC, while a VM's charts took time.strftime(),
the panel's time zone. With TIME_ZONE=Europe/Istanbul the same moment
read 09:00 on the host page and 12:00 on the VM page. Both now give the
panel's time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:57:43 +03:00
catborise
a8f7c8aeaa fix(logs): the VM page's Logs tab shows times as the Logs page does
The Logs tab of a VM's Stats showed each row's time in UTC, formatted by
the process locale ("11/10/26 08:43:08" whatever the page's language),
while the Logs page shows the same row in the panel's time zone
("2026-11-10 11:43:08" with TIME_ZONE=Europe/Istanbul). The tab now
shows the panel's time in the Logs page's format, and its Date heading
names the zone as the Logs page's does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:52:54 +03:00
catborise
ae3496ac50 fix(console): a VNC session ends when its host drops off the network
novncd connects to a VM's VNC server directly when it listens on a
reachable address, with no timeout once connected: a console may stay
quiet for long. When the network to the host dropped without a word,
nothing noticed it; the browser kept a frozen console and novncd its
proxy process until the user closed the tab or the kernel gave up after
many minutes.

The socket now has TCP keepalive (30 s idle, then 3 probes 10 s apart)
and TCP_USER_TIMEOUT (60 s for data left unanswered). Measured against
compute1 with the port's packets dropped: quiet and busy sockets both
ended after 61 s; a socket without these options still waited after
200 s. SSH-tunnelled consoles already have SSH's keepalive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:21 +03:00
catborise
139e43e4c4 fix(instances): the VM page says when its host stops answering
The VM page polls the VM's state every 5 s and reloads when it changes.
When the host stopped answering, the poll failed and nothing changed on
the page: it kept showing the last state, figures and actions as if they
were current. A notice now says that the page could not be refreshed and
may be out of date while the poll fails (a host that does not answer, a
session that ended); it goes away with the next answer. Checked on
compute1 in headless Chromium with its libvirt port dropped and restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:21 +03:00
catborise
6cdda6d4f3 fix(instances): the VM list survives a host that stops answering mid-request
The VM list reads each reachable host's CPUs and memory while it renders,
after it has found the host reachable. When the network to a host
dropped during that request, libvirt's keepalive closed the connection
in between, and the read raised: the whole list became the 500 error
page after about 40 s. Only the next load showed the host as down.

The host's CPU, memory and memory-use reads now give None for a host
that stopped answering; the list leaves its numbers out and the New VM
dialog does not offer it. Checked on compute1 with its libvirt port
dropped mid-request: the list answers 200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:08 +03:00
catborise
b70bab2144 fix(vrtManager): reconnect after a host's storage or network daemon restarts
On a host with libvirt's modular daemons, a restart of virtstoraged or
virtnetworkd (a package update, for one) left the panel's connection to
virtproxyd open and alive, but every later storage or network call on it
failed with "internal error: client socket is closed". Nothing replaced
it: the storage and network pages showed the error and the VM page gave
500 until the panel was restarted, and a clone running then waited in
recovery for up to an hour, holding its VM.

libvirt reports that error as an RPC internal error and does not say on
which connection, so the error handler now has the process retire its
open connections at the next get_connection: each opens again when next
asked. A retired connection stays with the threads that use them, its
close callback unregistered so that it closes once they are done; a
connection that failed or is opening keeps its retry delay. On compute1 the
pages answered again from the second request on, and the clone's job
failed at its first recovery check, 30 s later, freeing its VM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:08 +03:00
catborise
aefe551450 feat(ui): the owner and VM lists of the ownership forms are searchable
The VM page's Add owner and a user's Add VM page listed every user and
every VM in a plain drop-down: with 800 users and 300 VMs one was found
by scrolling. They now have a search box (Tom Select, already used by the
create form), through searchable_select.js for a select with
data-searchable.

The box loses focus once an item is chosen: focused, it is a line taller,
and on a phone the tap on Save shrank it and moved the button away from
under the finger, so the first tap did nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:21:25 +03:00
catborise
0368d94f27 fix(ui): the Logs and Jobs page links fit a phone screen
The page links of Logs and Jobs showed eleven pages around the current
one: with many pages the bar was 674 px wide on a 375 px screen and the
page scrolled sideways. They now show five and wrap when even those do
not fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:05:01 +03:00
catborise
b91a9d6f28 fix(instances): a long VM name wraps on its page
The VM page's heading did not wrap a name without spaces: a 185-character
name made the page 2,600 px wide, even on a 1440 px screen, and pushed the
state badge off it. The heading now breaks the name and the badges wrap
below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:04:19 +03:00
catborise
8c87fe8d32 fix(admin): a block deletes the user's API tokens
A blocked user's tokens were refused while the block lasted, but an
unblock brought them back: blocking a taken-over account and opening it
again gave its tokens back to whoever had made them. Blocking, from the
user list or by unticking Active on the edit form, now deletes them, as
an administrator's password reset does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 08:10:56 +03:00
catborise
135839bd66 feat(accounts): an administrator can reset a user's OTP
A user's OTP secret could not be changed: "Lost OTP?" and the admin's
"Email OTP QR code" both send the same secret again, so a stolen phone
kept making valid codes. The user's profile page now has "Reset OTP",
which deletes the user's TOTP device; they sign in with the password
alone until a new QR code is mailed, which has a new secret.

The mailed link now names the device, not the user: a link mailed before
a reset shows nothing, not the next device's secret. A new signing salt
refuses the links that named a user, whose id may be another user's device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 08:10:48 +03:00
catborise
fa0f7f79ac fix(accounts): a failed OTP mail leaves the user without OTP
The admin's "Email OTP QR code" made the user's TOTP device and then sent
the mail. When the SMTP server refused it, the page said so, but the
device stayed: the user's next login asked for a code from a QR code they
never got. The device and the mail now share one transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 07:58:46 +03:00
catborise
cb4fd4185b test(operations): the stuck-host cancel test waits for both hosts' hooks
The worker starts the cancel hooks of the two hosts in no set order. The
test waited only for the healthy host's hook and then counted the stuck
host's, which on a slow runner had not started yet (seen on Python 3.14
in CI): it now waits for both before it counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:44:25 +03:00
catborise
e6155c855a fix(instances): a late cancel leaves a later job's migration or disk move alone
A cancel that comes before libvirt began a migration or disk move waits
for it. When the job ended meanwhile and another job of the VM started
its own migration or copy within the hook's second of sleep, the hook
took that for its own and aborted it. The hook now asks whether its job
is still active right before it aborts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:20 +03:00
catborise
c49ee24aae fix(operations): a cancel during recovery cannot hold up its job for good
After a worker restart, recovery watches a migration or disk move that
libvirt still runs and sends a cancel asked meanwhile to the job's hook.
It ran inline in the inspection. The hook waits until libvirt's job runs
or the panel's job ends; when libvirt finished just after the inspection
saw it run, only the next inspection could record the end, so the job
stayed cancelling for good and held its host's control slot. The hook
now runs in a thread of its own, and the next inspection ends the job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:20 +03:00
catborise
8197e645f9 fix(instances): a VM delete waits at most 60 s for another host's disk check
Deleting a VM with its disks first asks the other computes whether they
use its files. A host that is connected but does not answer (a hung NFS
mount under a pool) held the delete job for good, and with it a slot of
the worker: a few such deletes could fill the pool and stop the jobs of
healthy hosts. The check now waits USED_CHECK_WAIT, as the disk move and
migration checks do; a host that does not answer in time stops the
delete before anything changes, naming the host. Until it answers the
earlier check, a retried delete is refused at once instead of asking it
again, so the calls waiting on it do not pile up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:06 +03:00
catborise
f6c7f8c85e fix(i18n): chart series and the preset announcement in the page's language
The VM and host charts named their series in English (Usage, Usage (RSS),
Read, Write, Inbound, Outbound) and the new-VM form announced an applied
preset as "...new N GiB disk" in English on Turkish and Chinese pages.
The texts now come from the templates: the stats tab and host overview
give the series names (disk and NIC series reuse In, Out, Read, Write of
the readings line), and each preset button carries its own announcement.
"Usage" has the context "chart": zh translated it for secrets as "used by".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:48 +03:00
catborise
03dcb14e45 fix(storages): an ISO chunk answered with an HTML page is not counted as stored
When the host did not answer, the storage page redirected the chunk's
POST to the pools page; the upload took that HTML as a stored chunk, and
on the last one closed as finished without an error. The chunk request
now expects JSON, so such an answer shows the upload error and the
upload can be resumed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:48 +03:00
catborise
7625b327c4 fix(instances): the VM page waits to reload while it is in use
A power state change reloaded the VM page at once, losing what the user
was typing in a form or a dialog left open (only an unsaved XML edit was
kept). It now waits while pageInUse(), as the VM list's poll does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:43 +03:00
catborise
600c8d8566 fix(operations): the job panel shows the outcome when its resource is gone
An owner who deleted their VM stayed on its page with "Delete VM queued"
and a Cancel button for good: the delete takes the user's ownership, so
the resource's job list answers 404, and outcomes were asked for only
after a list answered. A 403 or 404 list now counts as an empty one, so
each job is asked for by its id: while it runs (a delete goes on with the
disks after the VM's record is gone) it stays shown with its Cancel
button, and once it ends its page (the VM list) opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:39 +03:00
catborise
f18287d3b8 fix(instances): the delete page names the host only where hosts are shown
The confirmation page put "on <host>" in its heading for every owner who
may delete the VM, while the VM list and page show the host only to
superusers and users with view_instances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 13:54:28 +03:00
catborise
0cee65805d fix(instances): a template's console settings cannot be changed by a POST
A template's page has no console settings form (it is cloned, not run),
but update_console still took a direct POST from a staff owner with
is_change and is_vnc, or from a superuser. can_manage_console now refuses
every template, so the page and the view use one rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 13:53:51 +03:00
catborise
d34b1eb2bf fix(accounts): the mailed OTP link keeps its token out of the access logs
The link to the OTP QR code carried its signed token in the path, so
gunicorn's access log (docker logs, the journal) and nginx's held it:
anyone reading them within the hour could open the code and take the
TOTP secret. The token is now the URL's fragment, which no request
carries; the page posts it (otp_qr.js) and the answer shows the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
9323d61743 fix(backup): the backup holds the secret key in use
The backup copied data/secret_key, which does not exist when SECRET_KEY
comes from the environment (Docker then makes none) and can differ from
the key in use: a restored panel signed everyone out and could not read
what it had signed. The backup now writes settings.SECRET_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
d0b08db654 fix(docker): the settings.py kept next to the compose file stays out of the image
The README has Docker users keep their own settings.py next to the compose
file and mount it. .dockerignore left out only webvirtcloud/settings.py,
so the next docker compose build copied that file, with its LDAP password
or SECRET_KEY, into an image layer. It is now ignored by Docker and git,
and CI plants it among the files that must not reach the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
7b405e0c6e docs(readme): environment variables go to /etc/default/webvirtcloud, not settings.py
The README offered "edit webvirtcloud/settings.py" as a place for the
environment variables, but settings.py reads them from the environment:
WEBVIRTCLOUD_HTTPS = 1 written there changes nothing. It now says so and
names the setting to change instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
bba4f7908e fix(install): migrate runs with /etc/default/webvirtcloud loaded
The services read their environment from /etc/default/webvirtcloud, but
a re-run of the installer and the README's update and rollback steps ran
manage.py migrate without it: with WEBVIRTCLOUD_DB_HOST set there, the
migrations went to the fallback sqlite file and PostgreSQL kept the old
schema. All three now load the file first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
0c028ef107 fix(settings): OTP mail is sent from the SMTP account, or DEFAULT_FROM_EMAIL
send_mail got no sender, so the OTP mail went out from Django's default
webmaster@localhost, which relays that take mail only from their account
refuse. DEFAULT_FROM_EMAIL is now read from the environment, defaulting to
EMAIL_HOST_USER.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00