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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Docker builds settings.py from the template, whose TIME_ZONE was fixed to
UTC: TZ in docker-compose moved the container's clock and its backup time
but not the panel's dates, and Django then reset the process's TZ to UTC.
TIME_ZONE is now TZ, or UTC; the installer still writes the server's
zone into settings.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
WEBVIRTCLOUD_LOG_FILE=panel.log made os.makedirs("") raise while the
settings loaded: the panel did not start. A relative path is now taken
from the panel's directory, like the default data/webvirtcloud.log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Django matches the request's host with each ALLOWED_HOSTS entry as a name:
192.0.2.0/24 was accepted and matched nothing, so requests to the
addresses in it got 400 with no sign why. Such an entry now raises
ImproperlyConfigured, naming it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
WEBVIRTCLOUD_DEBUG, WEBVIRTCLOUD_HTTPS, WEBVIRTCLOUD_SERIAL_CONSOLE and
EMAIL_USE_TLS compared their value with "1": EMAIL_USE_TLS=true turned
STARTTLS off, and WEBVIRTCLOUD_HTTPS=true left the cookies insecure,
without a word. env_flag takes 1 or 0 (unset is the default, empty is 0
as before) and raises
ImproperlyConfigured, naming the variable, on anything else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
CONNECT_TIMEOUT bounds both the wait for a host's request slot, which
these tests time out on purpose, and the wait for the open's thread,
which they expect to finish. 0.2 s was missed once on a CI runner
("h did not answer within 0.2 s" in test_an_ended_request_lets_the_next_one_in).
The four refusal tests now wait 1 s each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
DEBUG was fixed to False in the template, and Docker builds settings.py
from it in each container: debug mode could only be had by editing the
file inside a running container. It is now read from the environment like
the other options; off unless the variable is 1.
The toolbar's URLs follow settings-dev, which installs the toolbar, not
DEBUG: with the dev packages present, DEBUG alone imported them without
the app and every URL lookup failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
nginx answers /static/ from staticfiles/ before a request reaches gunicorn,
so WhiteNoise never served a file in an installed panel. It only answered
under runserver with DEBUG off, from staticfiles/ as the last collectstatic
left it: a stale copy without the themes broke the page. The dev server
serves the sources itself with DEBUG on, or with --insecure, which the
README now says.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
ConnectionThreadsTestCase, like BoundedOpenTestCase, released its blocked
opens when a test ended without waiting for them, so an open could still
end during the next test. Its cleanup joins the threads the test started.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Tests of eight files patched a host's status but not what the page also read, its
connection, connection_error or proxy, and so connected for real: over
ssh to 10.0.0.9 or over TCP to unroutable addresses (5 to 10 s each until
the connect timeout), and to the machine's own libvirt (qemu:///system).
A failed host is not tried again for a while, so only the first such test
of a process connected, and which one depended on the order. They now
patch the connection itself, or what the page reads, and use RFC 5737
addresses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
BoundedOpenTestCase released its blocked opens when a test ended but did
not wait for them: an open that ended during the next test logged
"h: connected" into that test's assertLogs, and the log test failed in
two of three runs of the vrtManager tests in reverse order. The cleanup
now joins the threads the test started.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
test_ssh_keys repeated test_utils' cases of a key with and without a
comment and of an invalid key; test_utils keeps them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The worker checks again, before it migrates, that the job's user is
still an active superuser; no test removed either while the job was
queued, so the check could go unnoticed, as it is tested for clones and
new VMs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The test checked only that the copy had a table, and it copied the test
run's own database file, which a run of this module alone does not
create. Each test now backs up a database of its own whose last change
is still only in its WAL file, and checks that the copy has it: a copy of
the main file alone would lose it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The test checked only wvc_ensure_settings' exit status and then wrote
the settings file itself: a function that copied nothing passed. It now
checks the file's contents after the copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The test asserted only that one resize ran: a request that failed for any
other reason in its thread, unseen, passed it as well. It now collects
each request's messages, or its exception, and asserts that one resized
and the other was refused by the user's quota lock or by the quota.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The test fired the close callback at the 1st, 2nd or 3rd isAlive call of
a lookup, but a lookup calls isAlive once: two of its three cases closed
nothing. It also took a libvirtError for a result, as it only asserted
that the result was not None. It now runs the one interleaving there is
and asserts that the lookup returns the connection it checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
_snapshotCreateXML only forwarded to the domain's snapshotCreateXML, and
every snapshot test replaced it with a mock: a wrapper that called nothing
passed all of them. The wrapper is gone and the tests assert on the
domain's call, which the code makes directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
session_user_id read the user id out of the session row as it was, so a
session cookie that Django no longer accepts (the user's password changed,
or the user was deactivated) still matched a console token of its user in
novncd and socketiod. It now asks django.contrib.auth.get_user, which checks
the session's password hash and that the user may sign in.
The serial console tests built sessions by hand with only the user id;
they now sign in with force_login, as the panel does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
socketiod refused a request without a signed-in session, but took a
token from anyone's session: a token read from a log or a URL opened
another user's serial console for 120 s. As novncd does, the session
must be the token's user's; the refusal is the page's "not allowed".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Creating, cloning, migrating and deleting VMs are jobs: with the dev
server alone they stay queued. The step starts run_worker with the dev
settings in another terminal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The datasource names the VM by the reverse DNS name of the request's
address and sends keys only when its first label is one VM's name. On
the console settings, the listen address and removing the password of
a console listening beyond localhost are a superuser's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
An API request with invalid fields answers DRF's field errors, not
{"detail": ...}. The new VM's machine is chosen on a page before the
details form. The Logs page records 401 and 403 answers; a VM hidden
from a user answers 404 and is not logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
webvirt-backup.timer has RandomizedDelaySec=10min and Persistent=true:
it runs up to 10 minutes after 03:15, and at the next boot when the
server was off then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea